| OLD | NEW |
| 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 "media/formats/common/stream_parser_test_base.h" | 5 #include "media/formats/common/stream_parser_test_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "media/base/test_data_util.h" | 8 #include "media/base/test_data_util.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const uint8* end = data + length; | 65 const uint8* end = data + length; |
| 66 while (start < end) { | 66 while (start < end) { |
| 67 size_t append_size = std::min(piece_size, static_cast<size_t>(end - start)); | 67 size_t append_size = std::min(piece_size, static_cast<size_t>(end - start)); |
| 68 if (!parser_->Parse(start, append_size)) | 68 if (!parser_->Parse(start, append_size)) |
| 69 return false; | 69 return false; |
| 70 start += append_size; | 70 start += append_size; |
| 71 } | 71 } |
| 72 return true; | 72 return true; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void StreamParserTestBase::OnInitDone(bool success, | 75 void StreamParserTestBase::OnInitDone( |
| 76 base::TimeDelta duration, | 76 bool success, |
| 77 base::Time wallclock_timeline_offset, | 77 const StreamParser::StreamParameters& params) { |
| 78 bool auto_update_timestamp_offset) { | 78 EXPECT_TRUE(params.auto_update_timestamp_offset); |
| 79 EXPECT_TRUE(auto_update_timestamp_offset); | |
| 80 DVLOG(1) << __FUNCTION__ << "(" << success << ", " | 79 DVLOG(1) << __FUNCTION__ << "(" << success << ", " |
| 81 << duration.InMilliseconds() << ", " << auto_update_timestamp_offset | 80 << params.duration.InMilliseconds() << ", " |
| 82 << ")"; | 81 << params.auto_update_timestamp_offset << ")"; |
| 83 } | 82 } |
| 84 | 83 |
| 85 bool StreamParserTestBase::OnNewConfig( | 84 bool StreamParserTestBase::OnNewConfig( |
| 86 const AudioDecoderConfig& audio_config, | 85 const AudioDecoderConfig& audio_config, |
| 87 const VideoDecoderConfig& video_config, | 86 const VideoDecoderConfig& video_config, |
| 88 const StreamParser::TextTrackConfigMap& text_config) { | 87 const StreamParser::TextTrackConfigMap& text_config) { |
| 89 DVLOG(1) << __FUNCTION__ << "(" << audio_config.IsValidConfig() << ", " | 88 DVLOG(1) << __FUNCTION__ << "(" << audio_config.IsValidConfig() << ", " |
| 90 << video_config.IsValidConfig() << ")"; | 89 << video_config.IsValidConfig() << ")"; |
| 91 EXPECT_TRUE(audio_config.IsValidConfig()); | 90 EXPECT_TRUE(audio_config.IsValidConfig()); |
| 92 EXPECT_FALSE(video_config.IsValidConfig()); | 91 EXPECT_FALSE(video_config.IsValidConfig()); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 120 DVLOG(1) << __FUNCTION__; | 119 DVLOG(1) << __FUNCTION__; |
| 121 results_stream_ << "NewSegment"; | 120 results_stream_ << "NewSegment"; |
| 122 } | 121 } |
| 123 | 122 |
| 124 void StreamParserTestBase::OnEndOfSegment() { | 123 void StreamParserTestBase::OnEndOfSegment() { |
| 125 DVLOG(1) << __FUNCTION__; | 124 DVLOG(1) << __FUNCTION__; |
| 126 results_stream_ << "EndOfSegment"; | 125 results_stream_ << "EndOfSegment"; |
| 127 } | 126 } |
| 128 | 127 |
| 129 } // namespace media | 128 } // namespace media |
| OLD | NEW |