OLD | NEW |
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 #include "media/muxers/webm_muxer.h" | 5 #include "media/muxers/webm_muxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 reinterpret_cast<mkvmuxer::VideoTrack*>( | 229 reinterpret_cast<mkvmuxer::VideoTrack*>( |
230 segment_.GetTrackByNumber(video_track_index_)); | 230 segment_.GetTrackByNumber(video_track_index_)); |
231 DCHECK(video_track); | 231 DCHECK(video_track); |
232 video_track->set_codec_id(MkvCodeIcForMediaVideoCodecId(video_codec_)); | 232 video_track->set_codec_id(MkvCodeIcForMediaVideoCodecId(video_codec_)); |
233 DCHECK_EQ(0ull, video_track->crop_right()); | 233 DCHECK_EQ(0ull, video_track->crop_right()); |
234 DCHECK_EQ(0ull, video_track->crop_left()); | 234 DCHECK_EQ(0ull, video_track->crop_left()); |
235 DCHECK_EQ(0ull, video_track->crop_top()); | 235 DCHECK_EQ(0ull, video_track->crop_top()); |
236 DCHECK_EQ(0ull, video_track->crop_bottom()); | 236 DCHECK_EQ(0ull, video_track->crop_bottom()); |
237 DCHECK_EQ(0.0f, video_track->frame_rate()); | 237 DCHECK_EQ(0.0f, video_track->frame_rate()); |
238 | 238 |
239 video_track->set_default_duration(base::Time::kNanosecondsPerSecond / | |
240 frame_rate); | |
241 // Segment's timestamps should be in milliseconds, DCHECK it. See | 239 // Segment's timestamps should be in milliseconds, DCHECK it. See |
242 // http://www.webmproject.org/docs/container/#muxer-guidelines | 240 // http://www.webmproject.org/docs/container/#muxer-guidelines |
243 DCHECK_EQ(1000000ull, segment_.GetSegmentInfo()->timecode_scale()); | 241 DCHECK_EQ(1000000ull, segment_.GetSegmentInfo()->timecode_scale()); |
244 } | 242 } |
245 | 243 |
246 void WebmMuxer::AddAudioTrack(const media::AudioParameters& params) { | 244 void WebmMuxer::AddAudioTrack(const media::AudioParameters& params) { |
247 DVLOG(1) << __func__ << " " << params.AsHumanReadableString(); | 245 DVLOG(1) << __func__ << " " << params.AsHumanReadableString(); |
248 DCHECK(thread_checker_.CalledOnValidThread()); | 246 DCHECK(thread_checker_.CalledOnValidThread()); |
249 DCHECK_EQ(0u, audio_track_index_) | 247 DCHECK_EQ(0u, audio_track_index_) |
250 << "WebmMuxer audio can only be initialised once."; | 248 << "WebmMuxer audio can only be initialised once."; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 323 |
326 WebmMuxer::EncodedVideoFrame::EncodedVideoFrame( | 324 WebmMuxer::EncodedVideoFrame::EncodedVideoFrame( |
327 std::unique_ptr<std::string> data, | 325 std::unique_ptr<std::string> data, |
328 base::TimeTicks timestamp, | 326 base::TimeTicks timestamp, |
329 bool is_keyframe) | 327 bool is_keyframe) |
330 : data(std::move(data)), timestamp(timestamp), is_keyframe(is_keyframe) {} | 328 : data(std::move(data)), timestamp(timestamp), is_keyframe(is_keyframe) {} |
331 | 329 |
332 WebmMuxer::EncodedVideoFrame::~EncodedVideoFrame() {} | 330 WebmMuxer::EncodedVideoFrame::~EncodedVideoFrame() {} |
333 | 331 |
334 } // namespace media | 332 } // namespace media |
OLD | NEW |