| OLD | NEW |
| 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/move.h" | 12 #include "base/move.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "media/base/audio_decoder_config.h" | 14 #include "media/base/audio_decoder_config.h" |
| 15 #include "media/base/decoder_buffer.h" | 15 #include "media/base/decoder_buffer.h" |
| 16 #include "media/base/stream_parser_buffer.h" | 16 #include "media/base/stream_parser_buffer.h" |
| 17 #include "media/base/test_data_util.h" | 17 #include "media/base/test_data_util.h" |
| 18 #include "media/base/video_decoder_config.h" | 18 #include "media/base/video_decoder_config.h" |
| 19 #include "media/mp4/mp4_stream_parser.h" | 19 #include "media/mp4/mp4_stream_parser.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 21 |
| 22 using base::TimeDelta; | 22 using base::TimeDelta; |
| 23 | 23 |
| 24 namespace media { | 24 namespace media { |
| 25 namespace mp4 { | 25 namespace mp4 { |
| 26 | 26 |
| 27 class MP4StreamParserTest : public testing::Test { | 27 class MP4StreamParserTest : public testing::Test { |
| 28 public: | 28 public: |
| 29 MP4StreamParserTest() | 29 MP4StreamParserTest() |
| 30 : parser_(new MP4StreamParser), | 30 : parser_(new MP4StreamParser(false)), |
| 31 got_configs_(false) { | 31 got_configs_(false) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 scoped_ptr<MP4StreamParser> parser_; | 35 scoped_ptr<MP4StreamParser> parser_; |
| 36 base::TimeDelta segment_start_; | 36 base::TimeDelta segment_start_; |
| 37 bool got_configs_; | 37 bool got_configs_; |
| 38 | 38 |
| 39 bool AppendData(const uint8* data, size_t length) { | 39 bool AppendData(const uint8* data, size_t length) { |
| 40 parser_->Parse(data, length); | 40 parser_->Parse(data, length); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), | 135 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), |
| 136 buffer->GetDataSize(), | 136 buffer->GetDataSize(), |
| 137 512)); | 137 512)); |
| 138 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), | 138 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), |
| 139 buffer->GetDataSize(), | 139 buffer->GetDataSize(), |
| 140 512)); | 140 512)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace mp4 | 143 } // namespace mp4 |
| 144 } // namespace media | 144 } // namespace media |
| OLD | NEW |