| 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 |
| 11 namespace media { | 11 namespace media { |
| 12 | 12 |
| 13 static std::string BufferQueueToString( | 13 static std::string BufferQueueToString( |
| 14 const StreamParser::BufferQueue& buffers) { | 14 const StreamParser::BufferQueue& buffers) { |
| 15 std::stringstream ss; | 15 std::stringstream ss; |
| 16 | 16 |
| 17 ss << "{"; | 17 ss << "{"; |
| 18 for (StreamParser::BufferQueue::const_iterator itr = buffers.begin(); | 18 for (StreamParser::BufferQueue::const_iterator itr = buffers.begin(); |
| 19 itr != buffers.end(); | 19 itr != buffers.end(); |
| 20 ++itr) { | 20 ++itr) { |
| 21 ss << " " << (*itr)->timestamp().InMilliseconds(); | 21 ss << " " << (*itr)->timestamp().InMilliseconds(); |
| 22 if ((*itr)->IsKeyframe()) | 22 if ((*itr)->is_keyframe()) |
| 23 ss << "K"; | 23 ss << "K"; |
| 24 } | 24 } |
| 25 ss << " }"; | 25 ss << " }"; |
| 26 | 26 |
| 27 return ss.str(); | 27 return ss.str(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 StreamParserTestBase::StreamParserTestBase( | 30 StreamParserTestBase::StreamParserTestBase( |
| 31 scoped_ptr<StreamParser> stream_parser) | 31 scoped_ptr<StreamParser> stream_parser) |
| 32 : parser_(stream_parser.Pass()) { | 32 : parser_(stream_parser.Pass()) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 DVLOG(1) << __FUNCTION__; | 119 DVLOG(1) << __FUNCTION__; |
| 120 results_stream_ << "NewSegment"; | 120 results_stream_ << "NewSegment"; |
| 121 } | 121 } |
| 122 | 122 |
| 123 void StreamParserTestBase::OnEndOfSegment() { | 123 void StreamParserTestBase::OnEndOfSegment() { |
| 124 DVLOG(1) << __FUNCTION__; | 124 DVLOG(1) << __FUNCTION__; |
| 125 results_stream_ << "EndOfSegment"; | 125 results_stream_ << "EndOfSegment"; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace media | 128 } // namespace media |
| OLD | NEW |