| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/formats/webm/tracks_builder.h" | 5 #include "media/formats/webm/tracks_builder.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "media/formats/webm/webm_constants.h" | 8 #include "media/formats/webm/webm_constants.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 if (track_type == kWebMTrackTypeAudio) { | 287 if (track_type == kWebMTrackTypeAudio) { |
| 288 CHECK_GT(audio_channels_, 0); | 288 CHECK_GT(audio_channels_, 0); |
| 289 CHECK_GT(audio_sampling_frequency_, 0.0); | 289 CHECK_GT(audio_sampling_frequency_, 0.0); |
| 290 } else { | 290 } else { |
| 291 CHECK_EQ(audio_channels_, -1); | 291 CHECK_EQ(audio_channels_, -1); |
| 292 CHECK_EQ(audio_sampling_frequency_, -1.0); | 292 CHECK_EQ(audio_sampling_frequency_, -1.0); |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 TracksBuilder::Track::Track(const Track& other) = default; |
| 298 |
| 297 int TracksBuilder::Track::GetSize() const { | 299 int TracksBuilder::Track::GetSize() const { |
| 298 return MasterElementSize(kWebMIdTrackEntry, GetPayloadSize()); | 300 return MasterElementSize(kWebMIdTrackEntry, GetPayloadSize()); |
| 299 } | 301 } |
| 300 | 302 |
| 301 int TracksBuilder::Track::GetVideoPayloadSize() const { | 303 int TracksBuilder::Track::GetVideoPayloadSize() const { |
| 302 int payload_size = 0; | 304 int payload_size = 0; |
| 303 | 305 |
| 304 if (video_pixel_width_ >= 0) | 306 if (video_pixel_width_ >= 0) |
| 305 payload_size += UIntElementSize(kWebMIdPixelWidth, video_pixel_width_); | 307 payload_size += UIntElementSize(kWebMIdPixelWidth, video_pixel_width_); |
| 306 if (video_pixel_height_ >= 0) | 308 if (video_pixel_height_ >= 0) |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 WriteUIntElement(buf, buf_size, kWebMIdChannels, audio_channels_); | 388 WriteUIntElement(buf, buf_size, kWebMIdChannels, audio_channels_); |
| 387 | 389 |
| 388 if (audio_sampling_frequency_ >= 0) { | 390 if (audio_sampling_frequency_ >= 0) { |
| 389 WriteDoubleElement(buf, buf_size, kWebMIdSamplingFrequency, | 391 WriteDoubleElement(buf, buf_size, kWebMIdSamplingFrequency, |
| 390 audio_sampling_frequency_); | 392 audio_sampling_frequency_); |
| 391 } | 393 } |
| 392 } | 394 } |
| 393 } | 395 } |
| 394 | 396 |
| 395 } // namespace media | 397 } // namespace media |
| OLD | NEW |