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

Side by Side Diff: media/test/pipeline_integration_test.cc

Issue 2773793002: Allow mp3 audio codec for mpeg2ts containers in MSE (Closed)
Patch Set: Created 3 years, 9 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 const char kADTS[] = "audio/aac"; 105 const char kADTS[] = "audio/aac";
106 const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\""; 106 const char kMP4[] = "video/mp4; codecs=\"avc1.4D4041,mp4a.40.2\"";
107 const char kMP4VideoAVC3[] = "video/mp4; codecs=\"avc3.64001f\""; 107 const char kMP4VideoAVC3[] = "video/mp4; codecs=\"avc3.64001f\"";
108 const char kMP4VideoVP9[] = "video/mp4; codecs=\"vp09.00.10.08.01.05.01\""; 108 const char kMP4VideoVP9[] = "video/mp4; codecs=\"vp09.00.10.08.01.05.01\"";
109 const char kMP4VideoHEVC1[] = "video/mp4; codecs=\"hvc1.1.6.L93.B0\""; 109 const char kMP4VideoHEVC1[] = "video/mp4; codecs=\"hvc1.1.6.L93.B0\"";
110 const char kMP4VideoHEVC2[] = "video/mp4; codecs=\"hev1.1.6.L93.B0\""; 110 const char kMP4VideoHEVC2[] = "video/mp4; codecs=\"hev1.1.6.L93.B0\"";
111 const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\""; 111 const char kMP4Video[] = "video/mp4; codecs=\"avc1.4D4041\"";
112 const char kMP4Audio[] = "audio/mp4; codecs=\"mp4a.40.2\""; 112 const char kMP4Audio[] = "audio/mp4; codecs=\"mp4a.40.2\"";
113 const char kMP3[] = "audio/mpeg"; 113 const char kMP3[] = "audio/mpeg";
114 const char kMP2AudioSBR[] = "video/mp2t; codecs=\"avc1.4D4041,mp4a.40.5\""; 114 const char kMP2AudioSBR[] = "video/mp2t; codecs=\"avc1.4D4041,mp4a.40.5\"";
115 const char kMPEG2TS_MP3Audio[] = "video/mp2t; codecs=\"avc1.4D4041,mp3\"";
wolenetz 2017/03/23 20:17:39 ditto
115 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) 116 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
116 117
117 const size_t kAppendWholeFile = std::numeric_limits<size_t>::max(); 118 const size_t kAppendWholeFile = std::numeric_limits<size_t>::max();
118 119
119 // Constants for the Media Source config change tests. 120 // Constants for the Media Source config change tests.
120 const int kAppendTimeSec = 1; 121 const int kAppendTimeSec = 1;
121 const int kAppendTimeMs = kAppendTimeSec * 1000; 122 const int kAppendTimeMs = kAppendTimeSec * 1000;
122 const int k320WebMFileDurationMs = 2736; 123 const int k320WebMFileDurationMs = 2736;
123 const int k640WebMFileDurationMs = 2749; 124 const int k640WebMFileDurationMs = 2749;
124 const int kOpusEndTrimmingWebMFileDurationMs = 2741; 125 const int kOpusEndTrimmingWebMFileDurationMs = 2741;
(...skipping 2002 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 // calculated incorrectly and that leads to gaps in buffered ranges (so this 2128 // calculated incorrectly and that leads to gaps in buffered ranges (so this
2128 // check will fail) and eventually leads to stalled playback. 2129 // check will fail) and eventually leads to stalled playback.
2129 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 2130 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
2130 #else 2131 #else
2131 EXPECT_EQ( 2132 EXPECT_EQ(
2132 DEMUXER_ERROR_COULD_NOT_OPEN, 2133 DEMUXER_ERROR_COULD_NOT_OPEN,
2133 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr)); 2134 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr));
2134 #endif 2135 #endif
2135 } 2136 }
2136 2137
2138 TEST_F(PipelineIntegrationTest, Mpeg2ts_MP3Audio) {
2139 MockMediaSource source("bear-mp3-audio.ts", kMPEG2TS_MP3Audio,
2140 kAppendWholeFile);
2141 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER)
2142 EXPECT_EQ(PIPELINE_OK, StartPipelineWithMediaSource(&source));
2143 source.EndOfStream();
2144 ASSERT_EQ(PIPELINE_OK, pipeline_status_);
2145 #else
2146 EXPECT_EQ(
2147 DEMUXER_ERROR_COULD_NOT_OPEN,
2148 StartPipelineWithMediaSource(&source, kExpectDemuxerFailure, nullptr));
2149 #endif
2150 }
2151
2137 TEST_F(PipelineIntegrationTest, 2152 TEST_F(PipelineIntegrationTest,
2138 MAYBE_EME(EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly)) { 2153 MAYBE_EME(EncryptedPlayback_NoEncryptedFrames_MP4_CENC_AudioOnly)) {
2139 MockMediaSource source("bear-1280x720-a_frag-cenc_clear-all.mp4", kMP4Audio, 2154 MockMediaSource source("bear-1280x720-a_frag-cenc_clear-all.mp4", kMP4Audio,
2140 kAppendWholeFile); 2155 kAppendWholeFile);
2141 FakeEncryptedMedia encrypted_media(new NoResponseApp()); 2156 FakeEncryptedMedia encrypted_media(new NoResponseApp());
2142 EXPECT_EQ(PIPELINE_OK, 2157 EXPECT_EQ(PIPELINE_OK,
2143 StartPipelineWithEncryptedMedia(&source, &encrypted_media)); 2158 StartPipelineWithEncryptedMedia(&source, &encrypted_media));
2144 2159
2145 source.EndOfStream(); 2160 source.EndOfStream();
2146 2161
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 2631
2617 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 2632 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
2618 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 2633 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
2619 Play(); 2634 Play();
2620 ASSERT_TRUE(WaitUntilOnEnded()); 2635 ASSERT_TRUE(WaitUntilOnEnded());
2621 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 2636 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
2622 demuxer_->GetStartTime()); 2637 demuxer_->GetStartTime());
2623 } 2638 }
2624 2639
2625 } // namespace media 2640 } // namespace media
OLDNEW
« media/filters/stream_parser_factory.cc ('K') | « media/test/data/bear-mp3-audio.ts ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698