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

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

Issue 11819013: Add support for accepting MPEG2 AAC-LC bitstreams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "media/base/audio_decoder_config.h" 13 #include "media/base/audio_decoder_config.h"
14 #include "media/base/decoder_buffer.h" 14 #include "media/base/decoder_buffer.h"
15 #include "media/base/stream_parser_buffer.h" 15 #include "media/base/stream_parser_buffer.h"
16 #include "media/base/test_data_util.h" 16 #include "media/base/test_data_util.h"
17 #include "media/base/video_decoder_config.h" 17 #include "media/base/video_decoder_config.h"
18 #include "media/mp4/es_descriptor.h"
18 #include "media/mp4/mp4_stream_parser.h" 19 #include "media/mp4/mp4_stream_parser.h"
19 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
20 21
21 using base::TimeDelta; 22 using base::TimeDelta;
22 23
23 namespace media { 24 namespace media {
24 namespace mp4 { 25 namespace mp4 {
25 26
26 // TODO(xhwang): Figure out the init data type appropriately once it's spec'ed. 27 // TODO(xhwang): Figure out the init data type appropriately once it's spec'ed.
27 static const char kMp4InitDataType[] = "video/mp4"; 28 static const char kMp4InitDataType[] = "video/mp4";
28 29
29 class MP4StreamParserTest : public testing::Test { 30 class MP4StreamParserTest : public testing::Test {
30 public: 31 public:
31 MP4StreamParserTest() 32 MP4StreamParserTest()
32 : parser_(new MP4StreamParser(false)), 33 : configs_received_(false) {
33 configs_received_(false) { 34 std::set<int> audio_object_types;
35 audio_object_types.insert(kISO_14496_3);
scherkus (not reviewing) 2013/01/08 23:51:08 OOC doing this provides sufficient test coverage?
acolwell GONE FROM CHROMIUM 2013/01/16 17:35:09 Added test for MPEG2 AAC-LC code path.
36 parser_.reset(new MP4StreamParser(audio_object_types, false));
34 } 37 }
35 38
36 protected: 39 protected:
37 scoped_ptr<MP4StreamParser> parser_; 40 scoped_ptr<MP4StreamParser> parser_;
38 base::TimeDelta segment_start_; 41 base::TimeDelta segment_start_;
39 bool configs_received_; 42 bool configs_received_;
40 43
41 bool AppendData(const uint8* data, size_t length) { 44 bool AppendData(const uint8* data, size_t length) {
42 return parser_->Parse(data, length); 45 return parser_->Parse(data, length);
43 } 46 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 165 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(),
163 buffer->GetDataSize(), 166 buffer->GetDataSize(),
164 512)); 167 512));
165 } 168 }
166 169
167 // TODO(strobe): Create and test media which uses CENC auxiliary info stored 170 // TODO(strobe): Create and test media which uses CENC auxiliary info stored
168 // inside a private box 171 // inside a private box
169 172
170 } // namespace mp4 173 } // namespace mp4
171 } // namespace media 174 } // namespace media
OLDNEW
« media/mp4/mp4_stream_parser.cc ('K') | « media/mp4/mp4_stream_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698