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/mp2t/mp2t_stream_parser.h" | 5 #include "media/formats/mp2t/mp2t_stream_parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 505 } |
506 } | 506 } |
507 | 507 |
508 std::unique_ptr<MediaTracks> GenerateMediaTrackInfo( | 508 std::unique_ptr<MediaTracks> GenerateMediaTrackInfo( |
509 const AudioDecoderConfig& audio_config, | 509 const AudioDecoderConfig& audio_config, |
510 const VideoDecoderConfig& video_config) { | 510 const VideoDecoderConfig& video_config) { |
511 std::unique_ptr<MediaTracks> media_tracks(new MediaTracks()); | 511 std::unique_ptr<MediaTracks> media_tracks(new MediaTracks()); |
512 // TODO(servolk): Implement proper sourcing of media track info as described | 512 // TODO(servolk): Implement proper sourcing of media track info as described |
513 // in crbug.com/590085 | 513 // in crbug.com/590085 |
514 if (audio_config.IsValidConfig()) { | 514 if (audio_config.IsValidConfig()) { |
515 media_tracks->AddAudioTrack(audio_config, "audio", "main", "", ""); | 515 media_tracks->AddAudioTrack(audio_config, 1, "main", "", ""); |
516 } | 516 } |
517 if (video_config.IsValidConfig()) { | 517 if (video_config.IsValidConfig()) { |
518 media_tracks->AddVideoTrack(video_config, "video", "main", "", ""); | 518 media_tracks->AddVideoTrack(video_config, 2, "main", "", ""); |
519 } | 519 } |
520 return media_tracks; | 520 return media_tracks; |
521 } | 521 } |
522 | 522 |
523 bool Mp2tStreamParser::FinishInitializationIfNeeded() { | 523 bool Mp2tStreamParser::FinishInitializationIfNeeded() { |
524 // Nothing to be done if already initialized. | 524 // Nothing to be done if already initialized. |
525 if (is_initialized_) | 525 if (is_initialized_) |
526 return true; | 526 return true; |
527 | 527 |
528 // Wait for more data to come to finish initialization. | 528 // Wait for more data to come to finish initialization. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 // so that buffers with the same config can be added later on. | 672 // so that buffers with the same config can be added later on. |
673 BufferQueueWithConfig queue_with_config( | 673 BufferQueueWithConfig queue_with_config( |
674 true, last_audio_config, last_video_config); | 674 true, last_audio_config, last_video_config); |
675 buffer_queue_chain_.push_back(queue_with_config); | 675 buffer_queue_chain_.push_back(queue_with_config); |
676 | 676 |
677 return true; | 677 return true; |
678 } | 678 } |
679 | 679 |
680 } // namespace mp2t | 680 } // namespace mp2t |
681 } // namespace media | 681 } // namespace media |
OLD | NEW |