| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 VideoRotation video_rotation() override; | 116 VideoRotation video_rotation() override; |
| 117 bool enabled() const override; | 117 bool enabled() const override; |
| 118 void set_enabled(bool enabled, base::TimeDelta timestamp) override; | 118 void set_enabled(bool enabled, base::TimeDelta timestamp) override; |
| 119 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) override; | 119 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) override; |
| 120 | 120 |
| 121 void SetLiveness(Liveness liveness); | 121 void SetLiveness(Liveness liveness); |
| 122 | 122 |
| 123 // Returns the range of buffered data in this stream. | 123 // Returns the range of buffered data in this stream. |
| 124 Ranges<base::TimeDelta> GetBufferedRanges() const; | 124 Ranges<base::TimeDelta> GetBufferedRanges() const; |
| 125 | 125 |
| 126 // Returns elapsed time based on the already queued packets. | |
| 127 // Used to determine stream duration when it's not known ahead of time. | |
| 128 base::TimeDelta GetElapsedTime() const; | |
| 129 | |
| 130 // Returns true if this stream has capacity for additional data. | 126 // Returns true if this stream has capacity for additional data. |
| 131 bool HasAvailableCapacity(); | 127 bool HasAvailableCapacity(); |
| 132 | 128 |
| 133 // Returns the total buffer size FFMpegDemuxerStream is holding onto. | 129 // Returns the total buffer size FFMpegDemuxerStream is holding onto. |
| 134 size_t MemoryUsage() const; | 130 size_t MemoryUsage() const; |
| 135 | 131 |
| 136 TextKind GetTextKind() const; | 132 TextKind GetTextKind() const; |
| 137 | 133 |
| 138 // Returns the value associated with |key| in the metadata for the avstream. | 134 // Returns the value associated with |key| in the metadata for the avstream. |
| 139 // Returns an empty string if the key is not present. | 135 // Returns an empty string if the key is not present. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 // The Time associated with timestamp 0. Set to a null | 343 // The Time associated with timestamp 0. Set to a null |
| 348 // time if the file doesn't have an association to Time. | 344 // time if the file doesn't have an association to Time. |
| 349 base::Time timeline_offset_; | 345 base::Time timeline_offset_; |
| 350 | 346 |
| 351 // Whether text streams have been enabled for this demuxer. | 347 // Whether text streams have been enabled for this demuxer. |
| 352 bool text_enabled_; | 348 bool text_enabled_; |
| 353 | 349 |
| 354 // Set if we know duration of the audio stream. Used when processing end of | 350 // Set if we know duration of the audio stream. Used when processing end of |
| 355 // stream -- at this moment we definitely know duration. | 351 // stream -- at this moment we definitely know duration. |
| 356 bool duration_known_; | 352 bool duration_known_; |
| 353 base::TimeDelta duration_; |
| 357 | 354 |
| 358 // FFmpegURLProtocol implementation and corresponding glue bits. | 355 // FFmpegURLProtocol implementation and corresponding glue bits. |
| 359 std::unique_ptr<BlockingUrlProtocol> url_protocol_; | 356 std::unique_ptr<BlockingUrlProtocol> url_protocol_; |
| 360 std::unique_ptr<FFmpegGlue> glue_; | 357 std::unique_ptr<FFmpegGlue> glue_; |
| 361 | 358 |
| 362 const EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 359 const EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
| 363 | 360 |
| 364 const MediaTracksUpdatedCB media_tracks_updated_cb_; | 361 const MediaTracksUpdatedCB media_tracks_updated_cb_; |
| 365 | 362 |
| 366 std::map<MediaTrack::Id, DemuxerStream*> track_id_to_demux_stream_map_; | 363 std::map<MediaTrack::Id, DemuxerStream*> track_id_to_demux_stream_map_; |
| 367 | 364 |
| 368 // NOTE: Weak pointers must be invalidated before all other member variables. | 365 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 369 base::WeakPtr<FFmpegDemuxer> weak_this_; | 366 base::WeakPtr<FFmpegDemuxer> weak_this_; |
| 370 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; | 367 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; |
| 371 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 368 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
| 372 | 369 |
| 373 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 370 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
| 374 }; | 371 }; |
| 375 | 372 |
| 376 } // namespace media | 373 } // namespace media |
| 377 | 374 |
| 378 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 375 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
| OLD | NEW |