summaryrefslogtreecommitdiffstats
path: root/media/base/filters.cc
blob: 4c9ab4ff9aa32eeb2b14f5e9d941c5447c165483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/base/filters.h"

#include "base/logging.h"
#include "base/message_loop.h"

namespace media {

MediaFilter::MediaFilter() : host_(NULL), message_loop_(NULL) {}

const char* MediaFilter::major_mime_type() const {
  return "";
}

void MediaFilter::set_host(FilterHost* host) {
  DCHECK(host);
  DCHECK(!host_);
  host_ = host;
}

FilterHost* MediaFilter::host() {
  return host_;
}

void MediaFilter::set_message_loop(MessageLoop* message_loop) {
  DCHECK(message_loop);
  DCHECK(!message_loop_);
  message_loop_ = message_loop;
}

MessageLoop* MediaFilter::message_loop() {
  return message_loop_;
}

void MediaFilter::Play(FilterCallback* callback) {
  DCHECK(callback);
  if (callback) {
    callback->Run();
    delete callback;
  }
}

void MediaFilter::Pause(FilterCallback* callback) {
  DCHECK(callback);
  if (callback) {
    callback->Run();
    delete callback;
  }
}

void MediaFilter::Flush(FilterCallback* callback) {
  DCHECK(callback);
  if (callback) {
    callback->Run();
    delete callback;
  }
}

void MediaFilter::Stop(FilterCallback* callback) {
  DCHECK(callback);
  if (callback) {
    callback->Run();
    delete callback;
  }
}

void MediaFilter::SetPlaybackRate(float playback_rate) {}

void MediaFilter::Seek(base::TimeDelta time, FilterCallback* callback) {
  scoped_ptr<FilterCallback> seek_callback(callback);
  if (seek_callback.get()) {
    seek_callback->Run();
  }
}

void MediaFilter::OnAudioRendererDisabled() {
}

MediaFilter::~MediaFilter() {}

bool DataSource::IsUrlSupported(const std::string& url) {
  return true;
}

FilterType DataSource::filter_type() const {
  return FILTER_DATA_SOURCE;
}

FilterType Demuxer::filter_type() const {
  return FILTER_DEMUXER;
}

FilterType AudioDecoder::filter_type() const {
  return FILTER_AUDIO_DECODER;
}

const char* AudioDecoder::major_mime_type() const {
  return mime_type::kMajorTypeAudio;
}

FilterType AudioRenderer::filter_type() const {
  return FILTER_AUDIO_RENDERER;
}

const char* AudioRenderer::major_mime_type() const {
  return mime_type::kMajorTypeAudio;
}

FilterType VideoDecoder::filter_type() const {
  return FILTER_VIDEO_DECODER;
}

const char* VideoDecoder::major_mime_type() const {
  return mime_type::kMajorTypeVideo;
}

FilterType VideoRenderer::filter_type() const {
  return FILTER_VIDEO_RENDERER;
}

const char* VideoRenderer::major_mime_type() const {
  return mime_type::kMajorTypeVideo;
}

DemuxerStream::~DemuxerStream() {}

VideoDecoder::VideoDecoder() {}

VideoDecoder::~VideoDecoder() {}

AudioDecoder::AudioDecoder() {}

AudioDecoder::~AudioDecoder() {}

}  // namespace media