Index: media/capture/webm_muxer.h |
diff --git a/media/capture/webm_muxer.h b/media/capture/webm_muxer.h |
index 3fec647fa9cc3e8aecb5a53220392e4541eb5376..bdd1892c2192a87e450e0c44c1ac4a2e8363cc25 100644 |
--- a/media/capture/webm_muxer.h |
+++ b/media/capture/webm_muxer.h |
@@ -46,19 +46,30 @@ class MEDIA_EXPORT WebmMuxer : public NON_EXPORTED_BASE(mkvmuxer::IMkvWriter) { |
// Adds a |video_frame| with |encoded_data.data()| to WebM Segment. |
// TODO(mcasas): Revisit how |encoded_data| is passed once the whole recording |
// chain is setup (http://crbug.com/262211). |
- void OnEncodedVideo(const scoped_refptr<VideoFrame>& video_frame, |
+ void OnEncodedVideo(int track_index, |
+ const scoped_refptr<VideoFrame>& video_frame, |
const base::StringPiece& encoded_data, |
base::TimeTicks timestamp, |
bool is_key_frame); |
+ int GetNextTrackIndex(); |
+ |
private: |
friend class WebmMuxerTest; |
+ struct MuxerArg { |
ajose
2015/09/18 18:28:58
Change to VideoMuxerArg or similar? These tests wi
msu.koo
2015/09/21 04:28:37
Done.
|
+ MuxerArg(const base::TimeTicks& first_frame_timestamp, uint64 track_number) |
+ : first_frame_timestamp(first_frame_timestamp), |
+ track_number(track_number) {} |
+ |
+ base::TimeTicks first_frame_timestamp; |
+ uint64 track_number; |
+ }; |
// Creates and adds a new video track. Called upon receiving the first |
// frame of a given Track, adds |frame_size| and |frame_rate| to the Segment |
// info, although individual frames passed to OnEncodedVideo() can have any |
// frame size. |
- void AddVideoTrack(const gfx::Size& frame_size, double frame_rate); |
+ uint64 AddVideoTrack(const gfx::Size& frame_size, double frame_rate); |
// IMkvWriter interface. |
mkvmuxer::int32 Write(const void* buf, mkvmuxer::uint32 len) override; |
@@ -71,12 +82,8 @@ class MEDIA_EXPORT WebmMuxer : public NON_EXPORTED_BASE(mkvmuxer::IMkvWriter) { |
// Used to DCHECK that we are called on the correct thread (usually IO) |
base::ThreadChecker thread_checker_; |
- // A caller-side identifier to interact with |segment_|, initialised upon |
- // first frame arrival by AddVideoTrack(). |
- uint64_t track_index_; |
- |
- // Origin of times for frame timestamps. |
- base::TimeTicks first_frame_timestamp_; |
+ // Arguments for each tracks to mkvmuxer. |
+ std::vector<MuxerArg> muxer_args; |
ajose
2015/09/18 18:28:58
muxer_args_ (or muxer_args_for_video_ or something
msu.koo
2015/09/21 04:28:37
Done.
|
// Callback to dump written data as being called by libwebm. |
const WriteDataCB write_data_callback_; |