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

Side by Side Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 1230793009: Initial support for the desktop media pipeline on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: I forgot what year it is Created 5 years, 5 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 unified diff | Download patch
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <deque> 6 #include <deque>
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2767))); 629 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2767)));
630 ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO)); 630 ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
631 ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::VIDEO)); 631 ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::VIDEO));
632 } 632 }
633 633
634 TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_VideoOnly) { 634 TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_VideoOnly) {
635 // Verify that end of stream buffers are created. 635 // Verify that end of stream buffers are created.
636 CreateDemuxer("bear-320x240-video-only.webm"); 636 CreateDemuxer("bear-320x240-video-only.webm");
637 InitializeDemuxer(); 637 InitializeDemuxer();
638 set_duration_known(false); 638 set_duration_known(false);
639 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2703))); 639 // FFmpeg produces two durations: one from the container and one from the
640 // stream. If decoders are disabled, only the container one is available.
641 #if defined(DISABLE_FFMPEG_VIDEO_DECODERS)
642 auto expected_duration = base::TimeDelta::FromMilliseconds(2736);
643 #else
644 auto expected_duration = base::TimeDelta::FromMilliseconds(2703);
645 #endif
646 EXPECT_CALL(host_, SetDuration(expected_duration));
640 ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::VIDEO)); 647 ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::VIDEO));
641 } 648 }
642 649
643 TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_AudioOnly) { 650 TEST_F(FFmpegDemuxerTest, Read_EndOfStream_NoDuration_AudioOnly) {
644 // Verify that end of stream buffers are created. 651 // Verify that end of stream buffers are created.
645 CreateDemuxer("bear-320x240-audio-only.webm"); 652 CreateDemuxer("bear-320x240-audio-only.webm");
646 InitializeDemuxer(); 653 InitializeDemuxer();
647 set_duration_known(false); 654 set_duration_known(false);
648 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2767))); 655 EXPECT_CALL(host_, SetDuration(base::TimeDelta::FromMilliseconds(2767)));
649 ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO)); 656 ReadUntilEndOfStream(demuxer_->GetStream(DemuxerStream::AUDIO));
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 InitializeDemuxer(); 975 InitializeDemuxer();
969 976
970 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO); 977 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
971 ASSERT_TRUE(stream); 978 ASSERT_TRUE(stream);
972 ASSERT_EQ(VIDEO_ROTATION_270, stream->video_rotation()); 979 ASSERT_EQ(VIDEO_ROTATION_270, stream->video_rotation());
973 } 980 }
974 981
975 #endif 982 #endif
976 983
977 } // namespace media 984 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698