Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(573)

Unified Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 2491043003: MediaResource refactoring to support multiple streams (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/ffmpeg_demuxer_unittest.cc
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc
index 6699a93b1c28eceeac8e7e56b6a72ee0e18254db..ecb446af1a4f52cc0a3ca2473f2497d8b6e6bd16 100644
--- a/media/filters/ffmpeg_demuxer_unittest.cc
+++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -105,6 +105,15 @@ class FFmpegDemuxerTest : public testing::Test {
encrypted_media_init_data_cb, tracks_updated_cb, new MediaLog()));
}
+ DemuxerStream* GetStream(DemuxerStream::Type type) {
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ for (const auto& s : streams) {
+ if (s->type() == type)
+ return s;
+ }
+ return nullptr;
+ }
+
MOCK_METHOD1(CheckPoint, void(int v));
void InitializeDemuxerInternal(bool enable_text,
@@ -227,12 +236,6 @@ class FFmpegDemuxerTest : public testing::Test {
demuxer_->duration_known_ = duration_known;
}
- bool IsStreamStopped(DemuxerStream::Type type) {
- DemuxerStream* stream = demuxer_->GetStream(type);
- CHECK(stream);
- return !static_cast<FFmpegDemuxerStream*>(stream)->demuxer_;
- }
-
// Fixture members.
std::unique_ptr<FileDataSource> data_source_;
std::unique_ptr<FFmpegDemuxer> demuxer_;
@@ -316,8 +319,11 @@ TEST_F(FFmpegDemuxerTest, Initialize_Successful) {
CreateDemuxer("bear-320x240.webm");
InitializeDemuxer();
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ EXPECT_EQ(2u, streams.size());
+
// Video stream should be present.
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = streams[0];
ASSERT_TRUE(stream);
EXPECT_EQ(DemuxerStream::VIDEO, stream->type());
@@ -335,7 +341,7 @@ TEST_F(FFmpegDemuxerTest, Initialize_Successful) {
EXPECT_TRUE(video_config.extra_data().empty());
// Audio stream should be present.
- stream = demuxer_->GetStream(DemuxerStream::AUDIO);
+ stream = streams[1];
ASSERT_TRUE(stream);
EXPECT_EQ(DemuxerStream::AUDIO, stream->type());
@@ -346,9 +352,6 @@ TEST_F(FFmpegDemuxerTest, Initialize_Successful) {
EXPECT_EQ(44100, audio_config.samples_per_second());
EXPECT_EQ(kSampleFormatPlanarF32, audio_config.sample_format());
EXPECT_FALSE(audio_config.extra_data().empty());
-
- // Unknown stream should never be present.
- EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::UNKNOWN));
}
TEST_F(FFmpegDemuxerTest, Initialize_Multitrack) {
@@ -363,20 +366,20 @@ TEST_F(FFmpegDemuxerTest, Initialize_Multitrack) {
CreateDemuxer("bear-320x240-multitrack.webm");
InitializeDemuxer();
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ EXPECT_EQ(4u, streams.size());
+
// Video stream should be VP8.
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = streams[0];
ASSERT_TRUE(stream);
EXPECT_EQ(DemuxerStream::VIDEO, stream->type());
EXPECT_EQ(kCodecVP8, stream->video_decoder_config().codec());
// Audio stream should be Vorbis.
- stream = demuxer_->GetStream(DemuxerStream::AUDIO);
+ stream = streams[1];
ASSERT_TRUE(stream);
EXPECT_EQ(DemuxerStream::AUDIO, stream->type());
EXPECT_EQ(kCodecVorbis, stream->audio_decoder_config().codec());
-
- // Unknown stream should never be present.
- EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::UNKNOWN));
}
TEST_F(FFmpegDemuxerTest, Initialize_MultitrackText) {
@@ -393,20 +396,18 @@ TEST_F(FFmpegDemuxerTest, Initialize_MultitrackText) {
ASSERT_TRUE(text_stream);
EXPECT_EQ(DemuxerStream::TEXT, text_stream->type());
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
// Video stream should be VP8.
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = streams[0];
ASSERT_TRUE(stream);
EXPECT_EQ(DemuxerStream::VIDEO, stream->type());
EXPECT_EQ(kCodecVP8, stream->video_decoder_config().codec());
// Audio stream should be Vorbis.
- stream = demuxer_->GetStream(DemuxerStream::AUDIO);
+ stream = streams[1];
ASSERT_TRUE(stream);
EXPECT_EQ(DemuxerStream::AUDIO, stream->type());
EXPECT_EQ(kCodecVorbis, stream->audio_decoder_config().codec());
-
- // Unknown stream should never be present.
- EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::UNKNOWN));
}
TEST_F(FFmpegDemuxerTest, Initialize_Encrypted) {
@@ -428,7 +429,8 @@ TEST_F(FFmpegDemuxerTest, AbortPendingReads) {
InitializeDemuxer();
// Attempt a read from the audio stream and run the message loop until done.
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* audio = streams[1];
// Depending on where in the reading process ffmpeg is, an error may cause the
// stream to be marked as EOF. Simulate this here to ensure it is properly
@@ -457,7 +459,8 @@ TEST_F(FFmpegDemuxerTest, Read_Audio) {
InitializeDemuxer();
// Attempt a read from the audio stream and run the message loop until done.
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* audio = streams[1];
audio->Read(NewReadCB(FROM_HERE, 29, 0, true));
base::RunLoop().Run();
@@ -474,7 +477,8 @@ TEST_F(FFmpegDemuxerTest, Read_Video) {
InitializeDemuxer();
// Attempt a read from the video stream and run the message loop until done.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* video = streams[0];
video->Read(NewReadCB(FROM_HERE, 22084, 0, true));
base::RunLoop().Run();
@@ -507,7 +511,8 @@ TEST_F(FFmpegDemuxerTest, SeekInitialized_NoVideoStartTime) {
InitializeDemuxer();
// Video stream should be preferred for seeking even if video start time is
// unknown.
- DemuxerStream* vstream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* vstream = streams[0];
EXPECT_EQ(vstream, preferred_seeking_stream(base::TimeDelta()));
}
@@ -519,8 +524,9 @@ TEST_F(FFmpegDemuxerTest, Seeking_PreferredStreamSelection) {
InitializeDemuxerWithTimelineOffset(
base::Time::FromJsTime(kTimelineOffsetMs));
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* video = streams[0];
+ DemuxerStream* audio = streams[1];
const base::TimeDelta video_start_time =
base::TimeDelta::FromMicroseconds(400000);
@@ -566,8 +572,9 @@ TEST_F(FFmpegDemuxerTest, Read_VideoPositiveStartTime) {
base::Time::FromJsTime(kTimelineOffsetMs));
// Attempt a read from the video stream and run the message loop until done.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* video = streams[0];
+ DemuxerStream* audio = streams[1];
const base::TimeDelta video_start_time =
base::TimeDelta::FromMicroseconds(400000);
@@ -605,8 +612,7 @@ TEST_F(FFmpegDemuxerTest, Read_AudioNoStartTime) {
// Run the test twice with a seek in between.
for (int i = 0; i < 2; ++i) {
- demuxer_->GetStream(DemuxerStream::AUDIO)
- ->Read(NewReadCB(FROM_HERE, 4095, 0, true));
+ GetStream(DemuxerStream::AUDIO)->Read(NewReadCB(FROM_HERE, 4095, 0, true));
base::RunLoop().Run();
EXPECT_EQ(base::TimeDelta(), demuxer_->start_time());
@@ -629,8 +635,9 @@ TEST_F(FFmpegDemuxerTest,
InitializeDemuxer();
// Attempt a read from the video stream and run the message loop until done.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* video = streams[0];
+ DemuxerStream* audio = streams[1];
// Run the test twice with a seek in between.
for (int i = 0; i < 2; ++i) {
@@ -675,8 +682,9 @@ TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOggDiscard_Sync) {
InitializeDemuxer();
// Attempt a read from the video stream and run the message loop until done.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* video = streams[0];
+ DemuxerStream* audio = streams[1];
// Run the test twice with a seek in between.
for (int i = 0; i < 2; ++i) {
@@ -716,8 +724,9 @@ TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOpusDiscard_Sync) {
InitializeDemuxer();
// Attempt a read from the video stream and run the message loop until done.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* video = streams[0];
+ DemuxerStream* audio = streams[1];
EXPECT_EQ(audio->audio_decoder_config().codec_delay(), 65535);
// Packet size to timestamp (in microseconds) mapping for the first N packets
@@ -762,7 +771,8 @@ TEST_F(FFmpegDemuxerTest, Read_AudioNegativeStartTimeAndOpusSfxDiscard_Sync) {
InitializeDemuxer();
// Attempt a read from the video stream and run the message loop until done.
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* audio = streams[0];
EXPECT_EQ(audio->audio_decoder_config().codec_delay(), 312);
// Run the test twice with a seek in between.
@@ -788,7 +798,9 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream) {
// Verify that end of stream buffers are created.
CreateDemuxer("bear-320x240.webm");
InitializeDemuxer();
- ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
+ std::vector<DemuxerStream*> streams = demuxer_->GetStreams();
+ DemuxerStream* audio = streams[0];
+ ReadUntilEndOfStream(audio);
}
TEST_F(FFmpegDemuxerTest, Read_EndOfStreamText) {
@@ -817,8 +829,8 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration) {
InitializeDemuxer();
set_duration_known(false);
EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2767)));
- ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
- ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::VIDEO));
+ ReadUntilEndOfStream(GetStream(DemuxerStream::AUDIO));
+ ReadUntilEndOfStream(GetStream(DemuxerStream::VIDEO));
}
TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_VideoOnly) {
@@ -827,7 +839,7 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_VideoOnly) {
InitializeDemuxer();
set_duration_known(false);
EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2736)));
- ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::VIDEO));
+ ReadUntilEndOfStream(GetStream(DemuxerStream::VIDEO));
}
TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_AudioOnly) {
@@ -836,7 +848,7 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_AudioOnly) {
InitializeDemuxer();
set_duration_known(false);
EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2767)));
- ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
+ ReadUntilEndOfStream(GetStream(DemuxerStream::AUDIO));
}
TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_UnsupportedStream) {
@@ -846,7 +858,7 @@ TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_UnsupportedStream) {
InitializeDemuxer();
set_duration_known(false);
EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(1014)));
- ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
+ ReadUntilEndOfStream(GetStream(DemuxerStream::AUDIO));
}
TEST_F(FFmpegDemuxerTest, Seek) {
@@ -856,8 +868,8 @@ TEST_F(FFmpegDemuxerTest, Seek) {
InitializeDemuxer();
// Get our streams.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* video = GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* audio = GetStream(DemuxerStream::AUDIO);
ASSERT_TRUE(video);
ASSERT_TRUE(audio);
@@ -893,8 +905,8 @@ TEST_F(FFmpegDemuxerTest, CancelledSeek) {
InitializeDemuxer();
// Get our streams.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* video = GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* audio = GetStream(DemuxerStream::AUDIO);
ASSERT_TRUE(video);
ASSERT_TRUE(audio);
@@ -923,8 +935,8 @@ TEST_F(FFmpegDemuxerTest, SeekText) {
EXPECT_EQ(DemuxerStream::TEXT, text_stream->type());
// Get our streams.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* video = GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* audio = GetStream(DemuxerStream::AUDIO);
ASSERT_TRUE(video);
ASSERT_TRUE(audio);
@@ -970,7 +982,7 @@ TEST_F(FFmpegDemuxerTest, Stop) {
InitializeDemuxer();
// Get our stream.
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* audio = GetStream(DemuxerStream::AUDIO);
ASSERT_TRUE(audio);
demuxer_->Stop();
@@ -994,8 +1006,8 @@ TEST_F(FFmpegDemuxerTest, SeekWithCuesBeforeFirstCluster) {
InitializeDemuxer();
// Get our streams.
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* video = GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* audio = GetStream(DemuxerStream::AUDIO);
ASSERT_TRUE(video);
ASSERT_TRUE(audio);
@@ -1045,8 +1057,8 @@ TEST_F(FFmpegDemuxerTest, Mp3WithVideoStreamID3TagData) {
InitializeDemuxer();
// Ensure the expected streams are present.
- EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO));
- EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO));
+ EXPECT_FALSE(GetStream(DemuxerStream::VIDEO));
+ EXPECT_TRUE(GetStream(DemuxerStream::AUDIO));
}
#endif
@@ -1057,8 +1069,8 @@ TEST_F(FFmpegDemuxerTest, UnsupportedAudioSupportedVideoDemux) {
InitializeDemuxer();
// Ensure the expected streams are present.
- EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::VIDEO));
- EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::AUDIO));
+ EXPECT_TRUE(GetStream(DemuxerStream::VIDEO));
+ EXPECT_FALSE(GetStream(DemuxerStream::AUDIO));
}
// Ensure a video with an unsupported video track still results in the audio
@@ -1068,8 +1080,8 @@ TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) {
InitializeDemuxer();
// Ensure the expected streams are present.
- EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO));
- EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO));
+ EXPECT_FALSE(GetStream(DemuxerStream::VIDEO));
+ EXPECT_TRUE(GetStream(DemuxerStream::AUDIO));
}
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
@@ -1078,7 +1090,7 @@ TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) {
TEST_F(FFmpegDemuxerTest, MP4_ZeroStszEntry) {
CreateDemuxer("bear-1280x720-zero-stsz-entry.mp4");
InitializeDemuxer();
- ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
+ ReadUntilEndOfStream(GetStream(DemuxerStream::AUDIO));
}
class Mp3SeekFFmpegDemuxerTest
@@ -1095,8 +1107,8 @@ TEST_P(Mp3SeekFFmpegDemuxerTest, TestFastSeek) {
// to use a more narrow threshold for passing the test.
data_source_->reset_bytes_read_for_testing();
- FFmpegDemuxerStream* audio = static_cast<FFmpegDemuxerStream*>(
- demuxer_->GetStream(DemuxerStream::AUDIO));
+ FFmpegDemuxerStream* audio =
+ static_cast<FFmpegDemuxerStream*>(GetStream(DemuxerStream::AUDIO));
ASSERT_TRUE(audio);
// Seek to near the end of the file
@@ -1164,7 +1176,7 @@ TEST_F(FFmpegDemuxerTest, IsValidAnnexB) {
InitializeDemuxer();
// Ensure the expected streams are present.
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = GetStream(DemuxerStream::VIDEO);
ASSERT_TRUE(stream);
stream->EnableBitstreamConverter();
@@ -1181,7 +1193,7 @@ TEST_F(FFmpegDemuxerTest, Rotate_Metadata_0) {
CreateDemuxer("bear_rotate_0.mp4");
InitializeDemuxer();
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = GetStream(DemuxerStream::VIDEO);
ASSERT_TRUE(stream);
ASSERT_EQ(VIDEO_ROTATION_0, stream->video_rotation());
}
@@ -1190,7 +1202,7 @@ TEST_F(FFmpegDemuxerTest, Rotate_Metadata_90) {
CreateDemuxer("bear_rotate_90.mp4");
InitializeDemuxer();
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = GetStream(DemuxerStream::VIDEO);
ASSERT_TRUE(stream);
ASSERT_EQ(VIDEO_ROTATION_90, stream->video_rotation());
}
@@ -1199,7 +1211,7 @@ TEST_F(FFmpegDemuxerTest, Rotate_Metadata_180) {
CreateDemuxer("bear_rotate_180.mp4");
InitializeDemuxer();
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = GetStream(DemuxerStream::VIDEO);
ASSERT_TRUE(stream);
ASSERT_EQ(VIDEO_ROTATION_180, stream->video_rotation());
}
@@ -1208,7 +1220,7 @@ TEST_F(FFmpegDemuxerTest, Rotate_Metadata_270) {
CreateDemuxer("bear_rotate_270.mp4");
InitializeDemuxer();
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = GetStream(DemuxerStream::VIDEO);
ASSERT_TRUE(stream);
ASSERT_EQ(VIDEO_ROTATION_270, stream->video_rotation());
}
@@ -1217,7 +1229,7 @@ TEST_F(FFmpegDemuxerTest, NaturalSizeWithoutPASP) {
CreateDemuxer("bear-640x360-non_square_pixel-without_pasp.mp4");
InitializeDemuxer();
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = GetStream(DemuxerStream::VIDEO);
ASSERT_TRUE(stream);
const VideoDecoderConfig& video_config = stream->video_decoder_config();
@@ -1228,7 +1240,7 @@ TEST_F(FFmpegDemuxerTest, NaturalSizeWithPASP) {
CreateDemuxer("bear-640x360-non_square_pixel-with_pasp.mp4");
InitializeDemuxer();
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* stream = GetStream(DemuxerStream::VIDEO);
ASSERT_TRUE(stream);
const VideoDecoderConfig& video_config = stream->video_decoder_config();
@@ -1240,7 +1252,7 @@ TEST_F(FFmpegDemuxerTest, HEVC_in_MP4_container) {
#if BUILDFLAG(ENABLE_HEVC_DEMUXING)
InitializeDemuxer();
- DemuxerStream* video = demuxer_->GetStream(DemuxerStream::VIDEO);
+ DemuxerStream* video = GetStream(DemuxerStream::VIDEO);
ASSERT_TRUE(video);
video->Read(NewReadCB(FROM_HERE, 3569, 66733, true));
@@ -1259,7 +1271,7 @@ TEST_F(FFmpegDemuxerTest, Read_AC3_Audio) {
InitializeDemuxer();
// Attempt a read from the audio stream and run the message loop until done.
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* audio = GetStream(DemuxerStream::AUDIO);
// Read the first two frames and check that we are getting expected data
audio->Read(NewReadCB(FROM_HERE, 834, 0, true));
@@ -1278,7 +1290,7 @@ TEST_F(FFmpegDemuxerTest, Read_EAC3_Audio) {
InitializeDemuxer();
// Attempt a read from the audio stream and run the message loop until done.
- DemuxerStream* audio = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* audio = GetStream(DemuxerStream::AUDIO);
// Read the first two frames and check that we are getting expected data
audio->Read(NewReadCB(FROM_HERE, 870, 0, true));
@@ -1457,10 +1469,10 @@ TEST_F(FFmpegDemuxerTest, Read_Flac) {
InitializeDemuxer();
// Video stream should not be present.
- EXPECT_EQ(nullptr, demuxer_->GetStream(DemuxerStream::VIDEO));
+ EXPECT_EQ(nullptr, GetStream(DemuxerStream::VIDEO));
// Audio stream should be present.
- DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* stream = GetStream(DemuxerStream::AUDIO);
ASSERT_TRUE(stream);
EXPECT_EQ(DemuxerStream::AUDIO, stream->type());
@@ -1478,8 +1490,8 @@ TEST_F(FFmpegDemuxerTest, Seek_FallbackToDisabledVideoStream) {
// Input has only video stream, no audio.
CreateDemuxer("bear-320x240-video-only.webm");
InitializeDemuxer();
- EXPECT_EQ(nullptr, demuxer_->GetStream(DemuxerStream::AUDIO));
- DemuxerStream* vstream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ EXPECT_EQ(nullptr, GetStream(DemuxerStream::AUDIO));
+ DemuxerStream* vstream = GetStream(DemuxerStream::VIDEO);
EXPECT_NE(nullptr, vstream);
EXPECT_EQ(vstream, preferred_seeking_stream(base::TimeDelta()));
@@ -1494,9 +1506,9 @@ TEST_F(FFmpegDemuxerTest, Seek_FallbackToDisabledVideoStream) {
TEST_F(FFmpegDemuxerTest, Seek_FallbackToDisabledAudioStream) {
CreateDemuxer("bear-320x240-audio-only.webm");
InitializeDemuxer();
- DemuxerStream* astream = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* astream = GetStream(DemuxerStream::AUDIO);
EXPECT_NE(nullptr, astream);
- EXPECT_EQ(nullptr, demuxer_->GetStream(DemuxerStream::VIDEO));
+ EXPECT_EQ(nullptr, GetStream(DemuxerStream::VIDEO));
EXPECT_EQ(astream, preferred_seeking_stream(base::TimeDelta()));
// Now pretend that audio stream got disabled.

Powered by Google App Engine
This is Rietveld 408576698