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

Side by Side Diff: media/formats/mp4/mp4_stream_parser_unittest.cc

Issue 812643005: Re-add AC3/EAC3 audio demuxing support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: buildfix Created 4 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 unified diff | Download patch
« no previous file with comments | « media/formats/mp4/mp4_stream_parser.cc ('k') | media/media.gyp » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 9 #include <string>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "media/base/audio_decoder_config.h" 16 #include "media/base/audio_decoder_config.h"
17 #include "media/base/decoder_buffer.h" 17 #include "media/base/decoder_buffer.h"
18 #include "media/base/mock_media_log.h" 18 #include "media/base/mock_media_log.h"
19 #include "media/base/stream_parser_buffer.h" 19 #include "media/base/stream_parser_buffer.h"
20 #include "media/base/test_data_util.h" 20 #include "media/base/test_data_util.h"
21 #include "media/base/text_track_config.h" 21 #include "media/base/text_track_config.h"
22 #include "media/base/video_decoder_config.h" 22 #include "media/base/video_decoder_config.h"
23 #include "media/formats/mp4/es_descriptor.h" 23 #include "media/formats/mp4/es_descriptor.h"
24 #include "media/formats/mp4/mp4_stream_parser.h" 24 #include "media/formats/mp4/mp4_stream_parser.h"
25 #include "media/media_features.h"
25 #include "testing/gmock/include/gmock/gmock.h" 26 #include "testing/gmock/include/gmock/gmock.h"
26 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
27 28
28 using ::testing::InSequence; 29 using ::testing::InSequence;
29 using ::testing::StrictMock; 30 using ::testing::StrictMock;
30 using base::TimeDelta; 31 using base::TimeDelta;
31 32
32 namespace media { 33 namespace media {
33 namespace mp4 { 34 namespace mp4 {
34 35
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); 335 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED);
335 336
336 scoped_refptr<DecoderBuffer> buffer = 337 scoped_refptr<DecoderBuffer> buffer =
337 ReadTestDataFile("bear-640x360-non_square_pixel-with_pasp.mp4"); 338 ReadTestDataFile("bear-640x360-non_square_pixel-with_pasp.mp4");
338 339
339 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.6401e")); 340 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.6401e"));
340 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); 341 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512));
341 EXPECT_EQ(gfx::Size(639, 360), video_decoder_config_.natural_size()); 342 EXPECT_EQ(gfx::Size(639, 360), video_decoder_config_.natural_size());
342 } 343 }
343 344
345 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING)
346 TEST_F(MP4StreamParserTest, DemuxingAC3) {
347 std::set<int> audio_object_types;
348 audio_object_types.insert(kAC3);
349 parser_.reset(new MP4StreamParser(audio_object_types, false));
350 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED);
351 scoped_refptr<DecoderBuffer> buffer =
352 ReadTestDataFile("bear-ac3-only-frag.mp4");
353 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512));
354 }
355
356 TEST_F(MP4StreamParserTest, DemuxingEAC3) {
357 std::set<int> audio_object_types;
358 audio_object_types.insert(kEAC3);
359 parser_.reset(new MP4StreamParser(audio_object_types, false));
360 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED);
361 scoped_refptr<DecoderBuffer> buffer =
362 ReadTestDataFile("bear-eac3-only-frag.mp4");
363 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512));
364 }
365 #endif
366
344 } // namespace mp4 367 } // namespace mp4
345 } // namespace media 368 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp4/mp4_stream_parser.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698