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

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

Issue 1840173004: Flip unified media pipeline to default-on w/ disabled holdback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Comments. Fix UMA. Created 4 years, 8 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
« no previous file with comments | « media/base/run_all_unittests.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
17 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
18 #include "media/base/audio_decoder_config.h" 18 #include "media/base/audio_decoder_config.h"
19 #include "media/base/decoder_buffer.h" 19 #include "media/base/decoder_buffer.h"
20 #include "media/base/decrypt_config.h" 20 #include "media/base/decrypt_config.h"
21 #include "media/base/media.h"
21 #include "media/base/media_tracks.h" 22 #include "media/base/media_tracks.h"
22 #include "media/base/mock_demuxer_host.h" 23 #include "media/base/mock_demuxer_host.h"
23 #include "media/base/mock_media_log.h" 24 #include "media/base/mock_media_log.h"
24 #include "media/base/test_data_util.h" 25 #include "media/base/test_data_util.h"
25 #include "media/base/test_helpers.h" 26 #include "media/base/test_helpers.h"
26 #include "media/base/timestamp_constants.h" 27 #include "media/base/timestamp_constants.h"
27 #include "media/formats/webm/cluster_builder.h" 28 #include "media/formats/webm/cluster_builder.h"
28 #include "media/formats/webm/webm_cluster_parser.h" 29 #include "media/formats/webm/webm_cluster_parser.h"
29 #include "media/formats/webm/webm_constants.h" 30 #include "media/formats/webm/webm_constants.h"
30 #include "media/media_features.h" 31 #include "media/media_features.h"
(...skipping 3048 matching lines...) Expand 10 before | Expand all | Expand 10 after
3079 demuxer_->Seek(seek_time, 3080 demuxer_->Seek(seek_time,
3080 NewExpectedStatusCB(PIPELINE_ERROR_ABORT)); 3081 NewExpectedStatusCB(PIPELINE_ERROR_ABORT));
3081 ExpectRead(DemuxerStream::AUDIO, 0); 3082 ExpectRead(DemuxerStream::AUDIO, 0);
3082 ExpectEndOfStream(DemuxerStream::VIDEO); 3083 ExpectEndOfStream(DemuxerStream::VIDEO);
3083 } 3084 }
3084 3085
3085 TEST_F(ChunkDemuxerTest, CodecPrefixMatching) { 3086 TEST_F(ChunkDemuxerTest, CodecPrefixMatching) {
3086 ChunkDemuxer::Status expected = ChunkDemuxer::kNotSupported; 3087 ChunkDemuxer::Status expected = ChunkDemuxer::kNotSupported;
3087 3088
3088 #if defined(USE_PROPRIETARY_CODECS) 3089 #if defined(USE_PROPRIETARY_CODECS)
3090 #if defined(OS_ANDROID)
3091 if (HasPlatformDecoderSupport())
3092 expected = ChunkDemuxer::kOk;
3093 #else
3089 expected = ChunkDemuxer::kOk; 3094 expected = ChunkDemuxer::kOk;
3090 #endif 3095 #endif
3096 #endif
3091 3097
3092 std::vector<std::string> codecs; 3098 std::vector<std::string> codecs;
3093 codecs.push_back("avc1.4D4041"); 3099 codecs.push_back("avc1.4D4041");
3094 3100
3095 EXPECT_EQ(demuxer_->AddId("source_id", "video/mp4", codecs), expected); 3101 EXPECT_EQ(demuxer_->AddId("source_id", "video/mp4", codecs), expected);
3096 } 3102 }
3097 3103
3098 // Test codec ID's that are not compliant with RFC6381, but have been 3104 // Test codec ID's that are not compliant with RFC6381, but have been
3099 // seen in the wild. 3105 // seen in the wild.
3100 TEST_F(ChunkDemuxerTest, CodecIDsThatAreNotRFC6381Compliant) { 3106 TEST_F(ChunkDemuxerTest, CodecIDsThatAreNotRFC6381Compliant) {
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after
4634 cluster->size() - video_start); 4640 cluster->size() - video_start);
4635 4641
4636 CheckExpectedRanges(DemuxerStream::AUDIO, "{ [30,90) }"); 4642 CheckExpectedRanges(DemuxerStream::AUDIO, "{ [30,90) }");
4637 CheckExpectedRanges(DemuxerStream::VIDEO, "{ [0,91) }"); 4643 CheckExpectedRanges(DemuxerStream::VIDEO, "{ [0,91) }");
4638 CheckExpectedRanges("{ [30,90) }"); 4644 CheckExpectedRanges("{ [30,90) }");
4639 CheckExpectedBuffers(audio_stream, "30K 40K 50K 60K 70K 80K"); 4645 CheckExpectedBuffers(audio_stream, "30K 40K 50K 60K 70K 80K");
4640 CheckExpectedBuffers(video_stream, "71K 81"); 4646 CheckExpectedBuffers(video_stream, "71K 81");
4641 } 4647 }
4642 4648
4643 } // namespace media 4649 } // namespace media
OLDNEW
« no previous file with comments | « media/base/run_all_unittests.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698