Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: media/filters/ffmpeg_demuxer.h

Issue 2050043002: Generate and assign media track ids in demuxers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-streamparser-trackid
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 20 matching lines...) Expand all
31 #include <vector> 31 #include <vector>
32 32
33 #include "base/callback.h" 33 #include "base/callback.h"
34 #include "base/macros.h" 34 #include "base/macros.h"
35 #include "base/memory/scoped_vector.h" 35 #include "base/memory/scoped_vector.h"
36 #include "base/threading/thread.h" 36 #include "base/threading/thread.h"
37 #include "media/base/audio_decoder_config.h" 37 #include "media/base/audio_decoder_config.h"
38 #include "media/base/decoder_buffer.h" 38 #include "media/base/decoder_buffer.h"
39 #include "media/base/decoder_buffer_queue.h" 39 #include "media/base/decoder_buffer_queue.h"
40 #include "media/base/demuxer.h" 40 #include "media/base/demuxer.h"
41 #include "media/base/media_tracks.h"
41 #include "media/base/pipeline_status.h" 42 #include "media/base/pipeline_status.h"
42 #include "media/base/text_track_config.h" 43 #include "media/base/text_track_config.h"
43 #include "media/base/video_decoder_config.h" 44 #include "media/base/video_decoder_config.h"
44 #include "media/ffmpeg/ffmpeg_deleters.h" 45 #include "media/ffmpeg/ffmpeg_deleters.h"
45 #include "media/filters/blocking_url_protocol.h" 46 #include "media/filters/blocking_url_protocol.h"
46 47
47 // FFmpeg forward declarations. 48 // FFmpeg forward declarations.
48 struct AVPacket; 49 struct AVPacket;
49 struct AVRational; 50 struct AVRational;
50 struct AVStream; 51 struct AVStream;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 base::Time GetTimelineOffset() const override; 207 base::Time GetTimelineOffset() const override;
207 DemuxerStream* GetStream(DemuxerStream::Type type) override; 208 DemuxerStream* GetStream(DemuxerStream::Type type) override;
208 base::TimeDelta GetStartTime() const override; 209 base::TimeDelta GetStartTime() const override;
209 int64_t GetMemoryUsage() const override; 210 int64_t GetMemoryUsage() const override;
210 211
211 // Calls |encrypted_media_init_data_cb_| with the initialization data 212 // Calls |encrypted_media_init_data_cb_| with the initialization data
212 // encountered in the file. 213 // encountered in the file.
213 void OnEncryptedMediaInitData(EmeInitDataType init_data_type, 214 void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
214 const std::string& encryption_key_id); 215 const std::string& encryption_key_id);
215 216
217 const DemuxerStream* GetDemuxerStreamByTrackId(
218 MediaTrack::TrackId track_id) const override;
219
216 // Allow FFmpegDemuxerStream to notify us when there is updated information 220 // Allow FFmpegDemuxerStream to notify us when there is updated information
217 // about capacity and what buffered data is available. 221 // about capacity and what buffered data is available.
218 void NotifyCapacityAvailable(); 222 void NotifyCapacityAvailable();
219 void NotifyBufferingChanged(); 223 void NotifyBufferingChanged();
220 224
221 // The lowest demuxed timestamp. If negative, DemuxerStreams must use this to 225 // The lowest demuxed timestamp. If negative, DemuxerStreams must use this to
222 // adjust packet timestamps such that external clients see a zero-based 226 // adjust packet timestamps such that external clients see a zero-based
223 // timeline. 227 // timeline.
224 base::TimeDelta start_time() const { return start_time_; } 228 base::TimeDelta start_time() const { return start_time_; }
225 229
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 bool duration_known_; 331 bool duration_known_;
328 332
329 // FFmpegURLProtocol implementation and corresponding glue bits. 333 // FFmpegURLProtocol implementation and corresponding glue bits.
330 std::unique_ptr<BlockingUrlProtocol> url_protocol_; 334 std::unique_ptr<BlockingUrlProtocol> url_protocol_;
331 std::unique_ptr<FFmpegGlue> glue_; 335 std::unique_ptr<FFmpegGlue> glue_;
332 336
333 const EncryptedMediaInitDataCB encrypted_media_init_data_cb_; 337 const EncryptedMediaInitDataCB encrypted_media_init_data_cb_;
334 338
335 const MediaTracksUpdatedCB media_tracks_updated_cb_; 339 const MediaTracksUpdatedCB media_tracks_updated_cb_;
336 340
341 std::map<MediaTrack::TrackId, const DemuxerStream*>
342 track_id_to_demux_stream_map_;
343
337 // NOTE: Weak pointers must be invalidated before all other member variables. 344 // NOTE: Weak pointers must be invalidated before all other member variables.
338 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; 345 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_;
339 346
340 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); 347 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer);
341 }; 348 };
342 349
343 } // namespace media 350 } // namespace media
344 351
345 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ 352 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698