OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Implements the Demuxer interface using FFmpeg's libavformat. At this time | 5 // Implements the Demuxer interface using FFmpeg's libavformat. At this time |
6 // will support demuxing any audio/video format thrown at it. The streams | 6 // will support demuxing any audio/video format thrown at it. The streams |
7 // output mime types audio/x-ffmpeg and video/x-ffmpeg and include an integer | 7 // output mime types audio/x-ffmpeg and video/x-ffmpeg and include an integer |
8 // key FFmpegCodecID which contains the CodecID enumeration value. The CodecIDs | 8 // key FFmpegCodecID which contains the CodecID enumeration value. The CodecIDs |
9 // can be used to create and initialize the corresponding FFmpeg decoder. | 9 // can be used to create and initialize the corresponding FFmpeg decoder. |
10 // | 10 // |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 class FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol { | 128 class FFmpegDemuxer : public Demuxer, public FFmpegURLProtocol { |
129 public: | 129 public: |
130 explicit FFmpegDemuxer(MessageLoop* message_loop); | 130 explicit FFmpegDemuxer(MessageLoop* message_loop); |
131 virtual ~FFmpegDemuxer(); | 131 virtual ~FFmpegDemuxer(); |
132 | 132 |
133 // Posts a task to perform additional demuxing. | 133 // Posts a task to perform additional demuxing. |
134 virtual void PostDemuxTask(); | 134 virtual void PostDemuxTask(); |
135 | 135 |
136 void Initialize( | 136 void Initialize( |
137 DataSource* data_source, PipelineStatusCallback* callback); | 137 DataSource* data_source, const PipelineStatusCB& callback); |
138 | 138 |
139 // Filter implementation. | 139 // Filter implementation. |
140 virtual void Stop(FilterCallback* callback); | 140 virtual void Stop(FilterCallback* callback); |
141 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb); | 141 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb); |
142 virtual void OnAudioRendererDisabled(); | 142 virtual void OnAudioRendererDisabled(); |
143 virtual void set_host(FilterHost* filter_host); | 143 virtual void set_host(FilterHost* filter_host); |
144 virtual void SetPlaybackRate(float playback_rate); | 144 virtual void SetPlaybackRate(float playback_rate); |
145 virtual void SetPreload(Preload preload); | 145 virtual void SetPreload(Preload preload); |
146 | 146 |
147 // Demuxer implementation. | 147 // Demuxer implementation. |
(...skipping 13 matching lines...) Expand all Loading... |
161 // For testing purposes. | 161 // For testing purposes. |
162 void disable_first_seek_hack_for_testing() { first_seek_hack_ = false; } | 162 void disable_first_seek_hack_for_testing() { first_seek_hack_ = false; } |
163 | 163 |
164 private: | 164 private: |
165 // Only allow a factory to create this class. | 165 // Only allow a factory to create this class. |
166 friend class MockFFmpegDemuxer; | 166 friend class MockFFmpegDemuxer; |
167 FRIEND_TEST_ALL_PREFIXES(FFmpegDemuxerTest, ProtocolRead); | 167 FRIEND_TEST_ALL_PREFIXES(FFmpegDemuxerTest, ProtocolRead); |
168 | 168 |
169 // Carries out initialization on the demuxer thread. | 169 // Carries out initialization on the demuxer thread. |
170 void InitializeTask( | 170 void InitializeTask( |
171 DataSource* data_source, PipelineStatusCallback* callback); | 171 DataSource* data_source, const PipelineStatusCB& callback); |
172 | 172 |
173 // Carries out a seek on the demuxer thread. | 173 // Carries out a seek on the demuxer thread. |
174 void SeekTask(base::TimeDelta time, const FilterStatusCB& cb); | 174 void SeekTask(base::TimeDelta time, const FilterStatusCB& cb); |
175 | 175 |
176 // Carries out demuxing and satisfying stream reads on the demuxer thread. | 176 // Carries out demuxing and satisfying stream reads on the demuxer thread. |
177 void DemuxTask(); | 177 void DemuxTask(); |
178 | 178 |
179 // Carries out stopping the demuxer streams on the demuxer thread. | 179 // Carries out stopping the demuxer streams on the demuxer thread. |
180 void StopTask(FilterCallback* callback); | 180 void StopTask(FilterCallback* callback); |
181 | 181 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // starting clock value to match the timestamps in the media file. Default | 254 // starting clock value to match the timestamps in the media file. Default |
255 // is 0. | 255 // is 0. |
256 base::TimeDelta start_time_; | 256 base::TimeDelta start_time_; |
257 | 257 |
258 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 258 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
259 }; | 259 }; |
260 | 260 |
261 } // namespace media | 261 } // namespace media |
262 | 262 |
263 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 263 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |