| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // MediaFilter implementation. | 121 // MediaFilter implementation. |
| 122 virtual void Stop(); | 122 virtual void Stop(); |
| 123 virtual void Seek(base::TimeDelta time); | 123 virtual void Seek(base::TimeDelta time); |
| 124 | 124 |
| 125 // Demuxer implementation. | 125 // Demuxer implementation. |
| 126 virtual bool Initialize(DataSource* data_source); | 126 virtual bool Initialize(DataSource* data_source); |
| 127 virtual size_t GetNumberOfStreams(); | 127 virtual size_t GetNumberOfStreams(); |
| 128 virtual scoped_refptr<DemuxerStream> GetStream(int stream_id); | 128 virtual scoped_refptr<DemuxerStream> GetStream(int stream_id); |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 // Allow FFmpegDemuxerStream to post tasks to our message loop. | |
| 132 friend class FFmpegDemuxerStream; | |
| 133 | |
| 134 // Only allow a factory to create this class. | 131 // Only allow a factory to create this class. |
| 135 friend class FilterFactoryImpl0<FFmpegDemuxer>; | 132 friend class FilterFactoryImpl0<FFmpegDemuxer>; |
| 136 FFmpegDemuxer(); | 133 FFmpegDemuxer(); |
| 137 virtual ~FFmpegDemuxer(); | 134 virtual ~FFmpegDemuxer(); |
| 138 | 135 |
| 139 // Carries out initialization on the demuxer thread. | 136 // Carries out initialization on the demuxer thread. |
| 140 void InititalizeTask(DataSource* data_source); | 137 void InititalizeTask(DataSource* data_source); |
| 141 | 138 |
| 142 // Carries out a seek on the demuxer thread. | 139 // Carries out a seek on the demuxer thread. |
| 143 void SeekTask(base::TimeDelta time); | 140 void SeekTask(base::TimeDelta time); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 174 // representing unsupported streams where we throw away the data. | 171 // representing unsupported streams where we throw away the data. |
| 175 // | 172 // |
| 176 // Ownership is handled via reference counting. | 173 // Ownership is handled via reference counting. |
| 177 // | 174 // |
| 178 // Once initialized, operations on FFmpegDemuxerStreams should be carried out | 175 // Once initialized, operations on FFmpegDemuxerStreams should be carried out |
| 179 // on the demuxer thread. | 176 // on the demuxer thread. |
| 180 typedef std::vector< scoped_refptr<FFmpegDemuxerStream> > StreamVector; | 177 typedef std::vector< scoped_refptr<FFmpegDemuxerStream> > StreamVector; |
| 181 StreamVector streams_; | 178 StreamVector streams_; |
| 182 StreamVector packet_streams_; | 179 StreamVector packet_streams_; |
| 183 | 180 |
| 184 // Used for debugging. | |
| 185 PlatformThreadId thread_id_; | |
| 186 | |
| 187 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 181 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
| 188 }; | 182 }; |
| 189 | 183 |
| 190 } // namespace media | 184 } // namespace media |
| 191 | 185 |
| 192 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 186 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
| OLD | NEW |