| 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/mp4/mp4_stream_parser.h" | 5 #include "media/formats/mp4/mp4_stream_parser.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 313 } |
| 314 | 314 |
| 315 is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted; | 315 is_audio_track_encrypted_ = entry.sinf.info.track_encryption.is_encrypted; |
| 316 DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_; | 316 DVLOG(1) << "is_audio_track_encrypted_: " << is_audio_track_encrypted_; |
| 317 audio_config.Initialize( | 317 audio_config.Initialize( |
| 318 codec, sample_format, channel_layout, sample_per_second, extra_data, | 318 codec, sample_format, channel_layout, sample_per_second, extra_data, |
| 319 is_audio_track_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted(), | 319 is_audio_track_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted(), |
| 320 base::TimeDelta(), 0); | 320 base::TimeDelta(), 0); |
| 321 has_audio_ = true; | 321 has_audio_ = true; |
| 322 audio_track_id_ = track->header.track_id; | 322 audio_track_id_ = track->header.track_id; |
| 323 media_tracks->AddAudioTrack( | 323 media_tracks->AddAudioTrack(audio_config, audio_track_id_, "main", |
| 324 audio_config, base::UintToString(audio_track_id_), "main", | 324 track->media.handler.name, |
| 325 track->media.handler.name, track->media.header.language()); | 325 track->media.header.language()); |
| 326 continue; | 326 continue; |
| 327 } | 327 } |
| 328 | 328 |
| 329 if (track->media.handler.type == kVideo) { | 329 if (track->media.handler.type == kVideo) { |
| 330 detected_video_track_count++; | 330 detected_video_track_count++; |
| 331 if (video_config.IsValidConfig()) | 331 if (video_config.IsValidConfig()) |
| 332 continue; // Skip other video tracks once we found a supported one. | 332 continue; // Skip other video tracks once we found a supported one. |
| 333 | 333 |
| 334 RCHECK(!samp_descr.video_entries.empty()); | 334 RCHECK(!samp_descr.video_entries.empty()); |
| 335 if (desc_idx >= samp_descr.video_entries.size()) | 335 if (desc_idx >= samp_descr.video_entries.size()) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 364 DVLOG(1) << "is_video_track_encrypted_: " << is_video_track_encrypted_; | 364 DVLOG(1) << "is_video_track_encrypted_: " << is_video_track_encrypted_; |
| 365 video_config.Initialize( | 365 video_config.Initialize( |
| 366 entry.video_codec, entry.video_codec_profile, PIXEL_FORMAT_YV12, | 366 entry.video_codec, entry.video_codec_profile, PIXEL_FORMAT_YV12, |
| 367 COLOR_SPACE_HD_REC709, coded_size, visible_rect, natural_size, | 367 COLOR_SPACE_HD_REC709, coded_size, visible_rect, natural_size, |
| 368 // No decoder-specific buffer needed for AVC; | 368 // No decoder-specific buffer needed for AVC; |
| 369 // SPS/PPS are embedded in the video stream | 369 // SPS/PPS are embedded in the video stream |
| 370 EmptyExtraData(), | 370 EmptyExtraData(), |
| 371 is_video_track_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted()); | 371 is_video_track_encrypted_ ? AesCtrEncryptionScheme() : Unencrypted()); |
| 372 has_video_ = true; | 372 has_video_ = true; |
| 373 video_track_id_ = track->header.track_id; | 373 video_track_id_ = track->header.track_id; |
| 374 media_tracks->AddVideoTrack( | 374 media_tracks->AddVideoTrack(video_config, video_track_id_, "main", |
| 375 video_config, base::UintToString(video_track_id_), "main", | 375 track->media.handler.name, |
| 376 track->media.handler.name, track->media.header.language()); | 376 track->media.header.language()); |
| 377 continue; | 377 continue; |
| 378 } | 378 } |
| 379 | 379 |
| 380 // TODO(wolenetz): Investigate support in MSE and Chrome MSE for CEA 608/708 | 380 // TODO(wolenetz): Investigate support in MSE and Chrome MSE for CEA 608/708 |
| 381 // embedded caption data in video track. At time of init segment parsing, we | 381 // embedded caption data in video track. At time of init segment parsing, we |
| 382 // don't have this data (unless maybe by SourceBuffer's mimetype). | 382 // don't have this data (unless maybe by SourceBuffer's mimetype). |
| 383 // See https://crbug.com/597073 | 383 // See https://crbug.com/597073 |
| 384 if (track->media.handler.type == kText) | 384 if (track->media.handler.type == kText) |
| 385 detected_text_track_count++; | 385 detected_text_track_count++; |
| 386 } | 386 } |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 runs.AdvanceSample(); | 698 runs.AdvanceSample(); |
| 699 } | 699 } |
| 700 runs.AdvanceRun(); | 700 runs.AdvanceRun(); |
| 701 } | 701 } |
| 702 | 702 |
| 703 return true; | 703 return true; |
| 704 } | 704 } |
| 705 | 705 |
| 706 } // namespace mp4 | 706 } // namespace mp4 |
| 707 } // namespace media | 707 } // namespace media |
| OLD | NEW |