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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 std::unique_ptr<StreamParser> stream_parser) | 37 std::unique_ptr<StreamParser> stream_parser) |
38 : parser_(std::move(stream_parser)) { | 38 : parser_(std::move(stream_parser)) { |
39 parser_->Init( | 39 parser_->Init( |
40 base::Bind(&StreamParserTestBase::OnInitDone, base::Unretained(this)), | 40 base::Bind(&StreamParserTestBase::OnInitDone, base::Unretained(this)), |
41 base::Bind(&StreamParserTestBase::OnNewConfig, base::Unretained(this)), | 41 base::Bind(&StreamParserTestBase::OnNewConfig, base::Unretained(this)), |
42 base::Bind(&StreamParserTestBase::OnNewBuffers, base::Unretained(this)), | 42 base::Bind(&StreamParserTestBase::OnNewBuffers, base::Unretained(this)), |
43 true, | 43 true, |
44 base::Bind(&StreamParserTestBase::OnKeyNeeded, base::Unretained(this)), | 44 base::Bind(&StreamParserTestBase::OnKeyNeeded, base::Unretained(this)), |
45 base::Bind(&StreamParserTestBase::OnNewSegment, base::Unretained(this)), | 45 base::Bind(&StreamParserTestBase::OnNewSegment, base::Unretained(this)), |
46 base::Bind(&StreamParserTestBase::OnEndOfSegment, base::Unretained(this)), | 46 base::Bind(&StreamParserTestBase::OnEndOfSegment, base::Unretained(this)), |
47 new MediaLog()); | 47 &media_log_); |
48 } | 48 } |
49 | 49 |
50 StreamParserTestBase::~StreamParserTestBase() {} | 50 StreamParserTestBase::~StreamParserTestBase() {} |
51 | 51 |
52 std::string StreamParserTestBase::ParseFile(const std::string& filename, | 52 std::string StreamParserTestBase::ParseFile(const std::string& filename, |
53 int append_bytes) { | 53 int append_bytes) { |
54 results_stream_.clear(); | 54 results_stream_.clear(); |
55 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); | 55 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); |
56 EXPECT_TRUE( | 56 EXPECT_TRUE( |
57 AppendDataInPieces(buffer->data(), buffer->data_size(), append_bytes)); | 57 AppendDataInPieces(buffer->data(), buffer->data_size(), append_bytes)); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 DVLOG(1) << __func__; | 128 DVLOG(1) << __func__; |
129 results_stream_ << "NewSegment"; | 129 results_stream_ << "NewSegment"; |
130 } | 130 } |
131 | 131 |
132 void StreamParserTestBase::OnEndOfSegment() { | 132 void StreamParserTestBase::OnEndOfSegment() { |
133 DVLOG(1) << __func__; | 133 DVLOG(1) << __func__; |
134 results_stream_ << "EndOfSegment"; | 134 results_stream_ << "EndOfSegment"; |
135 } | 135 } |
136 | 136 |
137 } // namespace media | 137 } // namespace media |
OLD | NEW |