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

Unified Diff: media/capture/webm_muxer.h

Issue 1352243002: Implemented Multiple video track recoding. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/media_recorder_handler.cc ('k') | media/capture/webm_muxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « content/renderer/media/media_recorder_handler.cc ('k') | media/capture/webm_muxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698