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

Side by Side Diff: media/muxers/webm_muxer.h

Issue 1863893002: MediaStreamRecorder: Separate video/audio origin of timestamps for WebM muxer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | media/muxers/webm_muxer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef MEDIA_MUXERS_WEBM_MUXER_H_ 5 #ifndef MEDIA_MUXERS_WEBM_MUXER_H_
6 #define MEDIA_MUXERS_WEBM_MUXER_H_ 6 #define MEDIA_MUXERS_WEBM_MUXER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 mkvmuxer::int32 Write(const void* buf, mkvmuxer::uint32 len) override; 82 mkvmuxer::int32 Write(const void* buf, mkvmuxer::uint32 len) override;
83 mkvmuxer::int64 Position() const override; 83 mkvmuxer::int64 Position() const override;
84 mkvmuxer::int32 Position(mkvmuxer::int64 position) override; 84 mkvmuxer::int32 Position(mkvmuxer::int64 position) override;
85 bool Seekable() const override; 85 bool Seekable() const override;
86 void ElementStartNotify(mkvmuxer::uint64 element_id, 86 void ElementStartNotify(mkvmuxer::uint64 element_id,
87 mkvmuxer::int64 position) override; 87 mkvmuxer::int64 position) override;
88 88
89 // Helper to simplify saving frames. 89 // Helper to simplify saving frames.
90 void AddFrame(scoped_ptr<std::string> encoded_data, 90 void AddFrame(scoped_ptr<std::string> encoded_data,
91 uint8_t track_index, 91 uint8_t track_index,
92 base::TimeTicks timestamp, 92 base::TimeDelta timestamp,
93 bool is_key_frame); 93 bool is_key_frame);
94 94
95 // Used to DCHECK that we are called on the correct thread. 95 // Used to DCHECK that we are called on the correct thread.
96 base::ThreadChecker thread_checker_; 96 base::ThreadChecker thread_checker_;
97 97
98 // Video Codec configured: VP9 if true, otherwise VP8 is used by default. 98 // Video Codec configured: VP9 if true, otherwise VP8 is used by default.
99 const bool use_vp9_; 99 const bool use_vp9_;
100 100
101 // Caller-side identifiers to interact with |segment_|, initialised upon 101 // Caller-side identifiers to interact with |segment_|, initialised upon
102 // first frame arrival to Add{Video, Audio}Track(). 102 // first frame arrival to Add{Video, Audio}Track().
103 uint8_t video_track_index_; 103 uint8_t video_track_index_;
104 uint8_t audio_track_index_; 104 uint8_t audio_track_index_;
105 105
106 // Origin of times for frame timestamps. 106 // Origin of times for frame timestamps.
107 base::TimeTicks first_frame_timestamp_; 107 base::TimeTicks first_frame_timestamp_video_;
108 base::TimeTicks first_frame_timestamp_audio_;
108 base::TimeDelta most_recent_timestamp_; 109 base::TimeDelta most_recent_timestamp_;
109 110
110 // Variables to measure and accumulate, respectively, the time in pause state. 111 // Variables to measure and accumulate, respectively, the time in pause state.
111 scoped_ptr<base::ElapsedTimer> elapsed_time_in_pause_; 112 scoped_ptr<base::ElapsedTimer> elapsed_time_in_pause_;
112 base::TimeDelta total_time_in_pause_; 113 base::TimeDelta total_time_in_pause_;
113 114
114 // TODO(ajose): Change these when support is added for multiple tracks. 115 // TODO(ajose): Change these when support is added for multiple tracks.
115 // http://crbug.com/528523 116 // http://crbug.com/528523
116 const bool has_video_; 117 const bool has_video_;
117 const bool has_audio_; 118 const bool has_audio_;
(...skipping 23 matching lines...) Expand all
141 DISALLOW_IMPLICIT_CONSTRUCTORS(EncodedVideoFrame); 142 DISALLOW_IMPLICIT_CONSTRUCTORS(EncodedVideoFrame);
142 }; 143 };
143 std::deque<scoped_ptr<EncodedVideoFrame>> encoded_frames_queue_; 144 std::deque<scoped_ptr<EncodedVideoFrame>> encoded_frames_queue_;
144 145
145 DISALLOW_COPY_AND_ASSIGN(WebmMuxer); 146 DISALLOW_COPY_AND_ASSIGN(WebmMuxer);
146 }; 147 };
147 148
148 } // namespace media 149 } // namespace media
149 150
150 #endif // MEDIA_MUXERS_WEBM_MUXER_H_ 151 #endif // MEDIA_MUXERS_WEBM_MUXER_H_
OLDNEW
« no previous file with comments | « no previous file | media/muxers/webm_muxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698