Chromium Code Reviews| Index: media/capture/webm_muxer.h |
| diff --git a/media/capture/webm_muxer.h b/media/capture/webm_muxer.h |
| index 2d25c46a66a40342f8f2e4484dafee2662bf677e..ab1d11523d8fde740568d1f486f5bc469d69bd94 100644 |
| --- a/media/capture/webm_muxer.h |
| +++ b/media/capture/webm_muxer.h |
| @@ -44,19 +44,31 @@ class MEDIA_EXPORT WebmMuxer : public NON_EXPORTED_BASE(mkvmuxer::IMkvWriter) { |
| ~WebmMuxer() override; |
| // Adds a |video_frame| with |encoded_data.data()| to WebM Segment. |
| - void OnEncodedVideo(const scoped_refptr<VideoFrame>& video_frame, |
| + void OnEncodedVideo(int track_index, |
| + const scoped_refptr<VideoFrame>& video_frame, |
| scoped_ptr<std::string> encoded_data, |
| base::TimeTicks timestamp, |
| bool is_key_frame); |
| + int GetNextVideoTrackIndex(); |
|
mcasas
2015/10/06 17:53:13
Should be const.
Actually it shouldn't exist at a
msu.koo
2015/10/07 04:52:19
Cool way! Thank you for your advice. reflected.
|
| + |
| private: |
| friend class WebmMuxerTest; |
| + struct VideoMuxerArg { |
| + VideoMuxerArg( |
| + 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; |
| @@ -69,12 +81,8 @@ class MEDIA_EXPORT WebmMuxer : public NON_EXPORTED_BASE(mkvmuxer::IMkvWriter) { |
| // Used to DCHECK that we are called on the correct thread. |
| 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<VideoMuxerArg> video_muxer_args_; |
|
mcasas
2015/10/06 17:53:13
What about a std::map indexed by track indexes?
msu.koo
2015/10/07 04:52:19
I considered to use Map for this, but using vector
|
| // Callback to dump written data as being called by libwebm. |
| const WriteDataCB write_data_callback_; |