| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
| 18 #include "media/base/decrypt_config.h" | 18 #include "media/base/decrypt_config.h" |
| 19 #include "media/base/media_log.h" | 19 #include "media/base/media_log.h" |
| 20 #include "media/base/mock_demuxer_host.h" | 20 #include "media/base/mock_demuxer_host.h" |
| 21 #include "media/base/test_helpers.h" | 21 #include "media/base/test_helpers.h" |
| 22 #include "media/base/timestamp_constants.h" | 22 #include "media/base/timestamp_constants.h" |
| 23 #include "media/ffmpeg/ffmpeg_common.h" | 23 #include "media/ffmpeg/ffmpeg_common.h" |
| 24 #include "media/filters/ffmpeg_demuxer.h" | 24 #include "media/filters/ffmpeg_demuxer.h" |
| 25 #include "media/filters/file_data_source.h" | 25 #include "media/filters/file_data_source.h" |
| 26 #include "media/formats/mp4/avc.h" | 26 #include "media/formats/mp4/avc.h" |
| 27 #include "media/media_features.h" |
| 27 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 28 | 29 |
| 29 using ::testing::AnyNumber; | 30 using ::testing::AnyNumber; |
| 30 using ::testing::DoAll; | 31 using ::testing::DoAll; |
| 31 using ::testing::Exactly; | 32 using ::testing::Exactly; |
| 32 using ::testing::InSequence; | 33 using ::testing::InSequence; |
| 33 using ::testing::Invoke; | 34 using ::testing::Invoke; |
| 34 using ::testing::NotNull; | 35 using ::testing::NotNull; |
| 35 using ::testing::Return; | 36 using ::testing::Return; |
| 36 using ::testing::SaveArg; | 37 using ::testing::SaveArg; |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 ASSERT_TRUE(video); | 1126 ASSERT_TRUE(video); |
| 1126 | 1127 |
| 1127 video->Read(NewReadCB(FROM_HERE, 3569, 66733, true)); | 1128 video->Read(NewReadCB(FROM_HERE, 3569, 66733, true)); |
| 1128 message_loop_.Run(); | 1129 message_loop_.Run(); |
| 1129 | 1130 |
| 1130 video->Read(NewReadCB(FROM_HERE, 1042, 200200, false)); | 1131 video->Read(NewReadCB(FROM_HERE, 1042, 200200, false)); |
| 1131 message_loop_.Run(); | 1132 message_loop_.Run(); |
| 1132 } | 1133 } |
| 1133 #endif | 1134 #endif |
| 1134 | 1135 |
| 1136 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
| 1137 TEST_F(FFmpegDemuxerTest, Read_AC3_Audio) { |
| 1138 CreateDemuxer("bear-ac3-only-frag.mp4"); |
| 1139 InitializeDemuxer(); |
| 1140 |
| 1141 // Attempt a read from the audio stream and run the message loop until done. |
| 1142 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); |
| 1143 |
| 1144 // Read the first two frames and check that we are getting expected data |
| 1145 audio->Read(NewReadCB(FROM_HERE, 834, 0, true)); |
| 1146 message_loop_.Run(); |
| 1147 |
| 1148 audio->Read(NewReadCB(FROM_HERE, 836, 34830, true)); |
| 1149 message_loop_.Run(); |
| 1150 } |
| 1151 |
| 1152 TEST_F(FFmpegDemuxerTest, Read_EAC3_Audio) { |
| 1153 CreateDemuxer("bear-eac3-only-frag.mp4"); |
| 1154 InitializeDemuxer(); |
| 1155 |
| 1156 // Attempt a read from the audio stream and run the message loop until done. |
| 1157 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); |
| 1158 |
| 1159 // Read the first two frames and check that we are getting expected data |
| 1160 audio->Read(NewReadCB(FROM_HERE, 870, 0, true)); |
| 1161 message_loop_.Run(); |
| 1162 |
| 1163 audio->Read(NewReadCB(FROM_HERE, 872, 34830, true)); |
| 1164 message_loop_.Run(); |
| 1165 } |
| 1166 #endif // ENABLE_AC3_EAC3_AUDIO_DEMUXING |
| 1167 |
| 1135 } // namespace media | 1168 } // namespace media |
| OLD | NEW |