OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/filters/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 cb.AddBlockGroup(track_number, timecode, block_duration, | 1005 cb.AddBlockGroup(track_number, timecode, block_duration, |
1006 kWebMFlagKeyframe, static_cast<bool>(kWebMFlagKeyframe), | 1006 kWebMFlagKeyframe, static_cast<bool>(kWebMFlagKeyframe), |
1007 &data[0], data.size()); | 1007 &data[0], data.size()); |
1008 } | 1008 } |
1009 | 1009 |
1010 return cb.Finish(); | 1010 return cb.Finish(); |
1011 } | 1011 } |
1012 | 1012 |
1013 DemuxerStream* GetStream(DemuxerStream::Type type) { | 1013 DemuxerStream* GetStream(DemuxerStream::Type type) { |
1014 std::vector<DemuxerStream*> streams = demuxer_->GetAllStreams(); | 1014 std::vector<DemuxerStream*> streams = demuxer_->GetAllStreams(); |
1015 for (auto* stream : streams) { | 1015 for (const auto& stream : streams) { |
1016 if (stream->type() == type) | 1016 if (stream->type() == type) |
1017 return stream; | 1017 return stream; |
1018 } | 1018 } |
1019 return nullptr; | 1019 return nullptr; |
1020 } | 1020 } |
1021 | 1021 |
1022 void Read(DemuxerStream::Type type, const DemuxerStream::ReadCB& read_cb) { | 1022 void Read(DemuxerStream::Type type, const DemuxerStream::ReadCB& read_cb) { |
1023 GetStream(type)->Read(read_cb); | 1023 GetStream(type)->Read(read_cb); |
1024 base::RunLoop().RunUntilIdle(); | 1024 base::RunLoop().RunUntilIdle(); |
1025 } | 1025 } |
(...skipping 3767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4793 EXPECT_EQ( | 4793 EXPECT_EQ( |
4794 demuxer_->AddId("source_id", "video/mp4", "vp09.00.01.08.02.01.01.00"), | 4794 demuxer_->AddId("source_id", "video/mp4", "vp09.00.01.08.02.01.01.00"), |
4795 expected); | 4795 expected); |
4796 } | 4796 } |
4797 | 4797 |
4798 INSTANTIATE_TEST_CASE_P(EnableDisableMp4Vp9Demuxing, | 4798 INSTANTIATE_TEST_CASE_P(EnableDisableMp4Vp9Demuxing, |
4799 ChunkDemuxerMp4Vp9Test, | 4799 ChunkDemuxerMp4Vp9Test, |
4800 ::testing::Bool()); | 4800 ::testing::Bool()); |
4801 | 4801 |
4802 } // namespace media | 4802 } // namespace media |
OLD | NEW |