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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Carries out demuxing and satisfying stream reads on the demuxer thread. | 135 // Carries out demuxing and satisfying stream reads on the demuxer thread. |
136 void DemuxTask(); | 136 void DemuxTask(); |
137 | 137 |
138 // Returns true if any of the streams have pending reads. Since we lazily | 138 // Returns true if any of the streams have pending reads. Since we lazily |
139 // post a DemuxTask() for every read, we use this method to quickly terminate | 139 // post a DemuxTask() for every read, we use this method to quickly terminate |
140 // the tasks if there is no work to do. | 140 // the tasks if there is no work to do. |
141 // | 141 // |
142 // Safe to call on any thread. | 142 // Safe to call on any thread. |
143 bool StreamsHavePendingReads(); | 143 bool StreamsHavePendingReads(); |
144 | 144 |
| 145 // Signal all FFmpegDemuxerStream that the stream has ended. |
| 146 void StreamHasEnded(); |
| 147 |
145 // Helper function to deep copy an AVPacket's data, size and timestamps. | 148 // Helper function to deep copy an AVPacket's data, size and timestamps. |
146 // Returns NULL if a packet could not be cloned (i.e., out of memory). | 149 // Returns NULL if a packet could not be cloned (i.e., out of memory). |
147 AVPacket* ClonePacket(AVPacket* packet); | 150 AVPacket* ClonePacket(AVPacket* packet); |
148 | 151 |
149 // FFmpeg context handle. | 152 // FFmpeg context handle. |
150 scoped_ptr_malloc<AVFormatContext, ScopedPtrAVFree> format_context_; | 153 scoped_ptr_malloc<AVFormatContext, ScopedPtrAVFree> format_context_; |
151 | 154 |
152 // Latest timestamp read on the demuxer thread. | 155 // Latest timestamp read on the demuxer thread. |
153 base::TimeDelta current_timestamp_; | 156 base::TimeDelta current_timestamp_; |
154 | 157 |
(...skipping 11 matching lines...) Expand all Loading... |
166 | 169 |
167 // Thread handle. | 170 // Thread handle. |
168 base::Thread thread_; | 171 base::Thread thread_; |
169 | 172 |
170 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 173 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
171 }; | 174 }; |
172 | 175 |
173 } // namespace media | 176 } // namespace media |
174 | 177 |
175 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 178 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |