| 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> |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 DVLOG(1) << "Testing " << files[i]; | 1070 DVLOG(1) << "Testing " << files[i]; |
| 1071 CreateDemuxer(files[i]); | 1071 CreateDemuxer(files[i]); |
| 1072 InitializeDemuxer(); | 1072 InitializeDemuxer(); |
| 1073 | 1073 |
| 1074 // Ensure the expected streams are present. | 1074 // Ensure the expected streams are present. |
| 1075 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO); | 1075 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO); |
| 1076 ASSERT_TRUE(stream); | 1076 ASSERT_TRUE(stream); |
| 1077 stream->EnableBitstreamConverter(); | 1077 stream->EnableBitstreamConverter(); |
| 1078 | 1078 |
| 1079 stream->Read(base::Bind(&ValidateAnnexB, stream)); | 1079 stream->Read(base::Bind(&ValidateAnnexB, stream)); |
| 1080 message_loop_.Run(); | 1080 base::RunLoop().Run(); |
| 1081 | 1081 |
| 1082 demuxer_->Stop(); | 1082 demuxer_->Stop(); |
| 1083 demuxer_.reset(); | 1083 demuxer_.reset(); |
| 1084 data_source_.reset(); | 1084 data_source_.reset(); |
| 1085 } | 1085 } |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 TEST_F(FFmpegDemuxerTest, Rotate_Metadata_0) { | 1088 TEST_F(FFmpegDemuxerTest, Rotate_Metadata_0) { |
| 1089 CreateDemuxer("bear_rotate_0.mp4"); | 1089 CreateDemuxer("bear_rotate_0.mp4"); |
| 1090 InitializeDemuxer(); | 1090 InitializeDemuxer(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 | 1145 |
| 1146 TEST_F(FFmpegDemuxerTest, HEVC_in_MP4_container) { | 1146 TEST_F(FFmpegDemuxerTest, HEVC_in_MP4_container) { |
| 1147 CreateDemuxer("bear-hevc-frag.mp4"); | 1147 CreateDemuxer("bear-hevc-frag.mp4"); |
| 1148 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 1148 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| 1149 InitializeDemuxer(); | 1149 InitializeDemuxer(); |
| 1150 | 1150 |
| 1151 DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO); | 1151 DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO); |
| 1152 ASSERT_TRUE(video); | 1152 ASSERT_TRUE(video); |
| 1153 | 1153 |
| 1154 video->Read(NewReadCB(FROM_HERE, 3569, 66733, true)); | 1154 video->Read(NewReadCB(FROM_HERE, 3569, 66733, true)); |
| 1155 message_loop_.Run(); | 1155 base::RunLoop().Run(); |
| 1156 | 1156 |
| 1157 video->Read(NewReadCB(FROM_HERE, 1042, 200200, false)); | 1157 video->Read(NewReadCB(FROM_HERE, 1042, 200200, false)); |
| 1158 message_loop_.Run(); | 1158 base::RunLoop().Run(); |
| 1159 #else | 1159 #else |
| 1160 InitializeDemuxerAndExpectPipelineStatus(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); | 1160 InitializeDemuxerAndExpectPipelineStatus(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); |
| 1161 #endif | 1161 #endif |
| 1162 } | 1162 } |
| 1163 | 1163 |
| 1164 TEST_F(FFmpegDemuxerTest, Read_AC3_Audio) { | 1164 TEST_F(FFmpegDemuxerTest, Read_AC3_Audio) { |
| 1165 CreateDemuxer("bear-ac3-only-frag.mp4"); | 1165 CreateDemuxer("bear-ac3-only-frag.mp4"); |
| 1166 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) | 1166 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
| 1167 InitializeDemuxer(); | 1167 InitializeDemuxer(); |
| 1168 | 1168 |
| 1169 // Attempt a read from the audio stream and run the message loop until done. | 1169 // Attempt a read from the audio stream and run the message loop until done. |
| 1170 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); | 1170 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); |
| 1171 | 1171 |
| 1172 // Read the first two frames and check that we are getting expected data | 1172 // Read the first two frames and check that we are getting expected data |
| 1173 audio->Read(NewReadCB(FROM_HERE, 834, 0, true)); | 1173 audio->Read(NewReadCB(FROM_HERE, 834, 0, true)); |
| 1174 message_loop_.Run(); | 1174 base::RunLoop().Run(); |
| 1175 | 1175 |
| 1176 audio->Read(NewReadCB(FROM_HERE, 836, 34830, true)); | 1176 audio->Read(NewReadCB(FROM_HERE, 836, 34830, true)); |
| 1177 message_loop_.Run(); | 1177 base::RunLoop().Run(); |
| 1178 #else | 1178 #else |
| 1179 InitializeDemuxerAndExpectPipelineStatus(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); | 1179 InitializeDemuxerAndExpectPipelineStatus(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); |
| 1180 #endif | 1180 #endif |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 TEST_F(FFmpegDemuxerTest, Read_EAC3_Audio) { | 1183 TEST_F(FFmpegDemuxerTest, Read_EAC3_Audio) { |
| 1184 CreateDemuxer("bear-eac3-only-frag.mp4"); | 1184 CreateDemuxer("bear-eac3-only-frag.mp4"); |
| 1185 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) | 1185 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
| 1186 InitializeDemuxer(); | 1186 InitializeDemuxer(); |
| 1187 | 1187 |
| 1188 // Attempt a read from the audio stream and run the message loop until done. | 1188 // Attempt a read from the audio stream and run the message loop until done. |
| 1189 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); | 1189 DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO); |
| 1190 | 1190 |
| 1191 // Read the first two frames and check that we are getting expected data | 1191 // Read the first two frames and check that we are getting expected data |
| 1192 audio->Read(NewReadCB(FROM_HERE, 870, 0, true)); | 1192 audio->Read(NewReadCB(FROM_HERE, 870, 0, true)); |
| 1193 message_loop_.Run(); | 1193 base::RunLoop().Run(); |
| 1194 | 1194 |
| 1195 audio->Read(NewReadCB(FROM_HERE, 872, 34830, true)); | 1195 audio->Read(NewReadCB(FROM_HERE, 872, 34830, true)); |
| 1196 message_loop_.Run(); | 1196 base::RunLoop().Run(); |
| 1197 #else | 1197 #else |
| 1198 InitializeDemuxerAndExpectPipelineStatus(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); | 1198 InitializeDemuxerAndExpectPipelineStatus(DEMUXER_ERROR_NO_SUPPORTED_STREAMS); |
| 1199 #endif | 1199 #endif |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 TEST_F(FFmpegDemuxerTest, Read_Mp4_Media_Track_Info) { | 1202 TEST_F(FFmpegDemuxerTest, Read_Mp4_Media_Track_Info) { |
| 1203 CreateDemuxer("bear.mp4"); | 1203 CreateDemuxer("bear.mp4"); |
| 1204 InitializeDemuxer(); | 1204 InitializeDemuxer(); |
| 1205 | 1205 |
| 1206 EXPECT_EQ(media_tracks_->tracks().size(), 2u); | 1206 EXPECT_EQ(media_tracks_->tracks().size(), 2u); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1237 | 1237 |
| 1238 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]); | 1238 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]); |
| 1239 EXPECT_EQ(audio_track.type(), MediaTrack::Audio); | 1239 EXPECT_EQ(audio_track.type(), MediaTrack::Audio); |
| 1240 EXPECT_EQ(audio_track.bytestream_track_id(), 2); | 1240 EXPECT_EQ(audio_track.bytestream_track_id(), 2); |
| 1241 EXPECT_EQ(audio_track.kind(), "main"); | 1241 EXPECT_EQ(audio_track.kind(), "main"); |
| 1242 EXPECT_EQ(audio_track.label(), ""); | 1242 EXPECT_EQ(audio_track.label(), ""); |
| 1243 EXPECT_EQ(audio_track.language(), ""); | 1243 EXPECT_EQ(audio_track.language(), ""); |
| 1244 } | 1244 } |
| 1245 | 1245 |
| 1246 } // namespace media | 1246 } // namespace media |
| OLD | NEW |