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

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

Issue 2750233003: Change segment width dynamically in MediaRecorder
Patch Set: Created 3 years, 9 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 std::unique_ptr<std::string> encoded_alpha, 74 std::unique_ptr<std::string> encoded_alpha,
75 base::TimeTicks timestamp, 75 base::TimeTicks timestamp,
76 bool is_key_frame); 76 bool is_key_frame);
77 bool OnEncodedAudio(const media::AudioParameters& params, 77 bool OnEncodedAudio(const media::AudioParameters& params,
78 std::unique_ptr<std::string> encoded_data, 78 std::unique_ptr<std::string> encoded_data,
79 base::TimeTicks timestamp); 79 base::TimeTicks timestamp);
80 80
81 void Pause(); 81 void Pause();
82 void Resume(); 82 void Resume();
83 83
84 bool ResolutionChanged();
85
84 void ForceOneLibWebmErrorForTesting() { force_one_libwebm_error_ = true; } 86 void ForceOneLibWebmErrorForTesting() { force_one_libwebm_error_ = true; }
85 87
86 private: 88 private:
87 friend class WebmMuxerTest; 89 friend class WebmMuxerTest;
88 90
89 // Methods for creating and adding video and audio tracks, called upon 91 // Methods for creating and adding video and audio tracks, called upon
90 // receiving the first frame of a given Track. 92 // receiving the first frame of a given Track.
91 // AddVideoTrack adds |frame_size| and |frame_rate| to the Segment 93 // AddVideoTrack adds |frame_size| and |frame_rate| to the Segment
92 // info, although individual frames passed to OnEncodedVideo() can have any 94 // info, although individual frames passed to OnEncodedVideo() can have any
93 // frame size. 95 // frame size.
(...skipping 24 matching lines...) Expand all
118 // Caller-side identifiers to interact with |segment_|, initialised upon 120 // Caller-side identifiers to interact with |segment_|, initialised upon
119 // first frame arrival to Add{Video, Audio}Track(). 121 // first frame arrival to Add{Video, Audio}Track().
120 uint8_t video_track_index_; 122 uint8_t video_track_index_;
121 uint8_t audio_track_index_; 123 uint8_t audio_track_index_;
122 124
123 // Origin of times for frame timestamps. 125 // Origin of times for frame timestamps.
124 base::TimeTicks first_frame_timestamp_video_; 126 base::TimeTicks first_frame_timestamp_video_;
125 base::TimeTicks first_frame_timestamp_audio_; 127 base::TimeTicks first_frame_timestamp_audio_;
126 base::TimeDelta most_recent_timestamp_; 128 base::TimeDelta most_recent_timestamp_;
127 129
130 gfx::Size last_frame_size_;
131
128 // Variables to measure and accumulate, respectively, the time in pause state. 132 // Variables to measure and accumulate, respectively, the time in pause state.
129 std::unique_ptr<base::ElapsedTimer> elapsed_time_in_pause_; 133 std::unique_ptr<base::ElapsedTimer> elapsed_time_in_pause_;
130 base::TimeDelta total_time_in_pause_; 134 base::TimeDelta total_time_in_pause_;
131 135
132 // TODO(ajose): Change these when support is added for multiple tracks. 136 // TODO(ajose): Change these when support is added for multiple tracks.
133 // http://crbug.com/528523 137 // http://crbug.com/528523
134 const bool has_video_; 138 const bool has_video_;
135 const bool has_audio_; 139 const bool has_audio_;
136 140
137 // Callback to dump written data as being called by libwebm. 141 // Callback to dump written data as being called by libwebm.
(...skipping 25 matching lines...) Expand all
163 DISALLOW_IMPLICIT_CONSTRUCTORS(EncodedVideoFrame); 167 DISALLOW_IMPLICIT_CONSTRUCTORS(EncodedVideoFrame);
164 }; 168 };
165 std::deque<std::unique_ptr<EncodedVideoFrame>> encoded_frames_queue_; 169 std::deque<std::unique_ptr<EncodedVideoFrame>> encoded_frames_queue_;
166 170
167 DISALLOW_COPY_AND_ASSIGN(WebmMuxer); 171 DISALLOW_COPY_AND_ASSIGN(WebmMuxer);
168 }; 172 };
169 173
170 } // namespace media 174 } // namespace media
171 175
172 #endif // MEDIA_MUXERS_WEBM_MUXER_H_ 176 #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