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" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 bool KeyNeededF(scoped_array<uint8> init_data, int init_data_size) { | 91 bool KeyNeededF(scoped_array<uint8> init_data, int init_data_size) { |
92 DVLOG(1) << "KeyNeededF: " << init_data_size; | 92 DVLOG(1) << "KeyNeededF: " << init_data_size; |
93 return true; | 93 return true; |
94 } | 94 } |
95 | 95 |
96 void NewSegmentF(TimeDelta start_dts) { | 96 void NewSegmentF(TimeDelta start_dts) { |
97 DVLOG(1) << "NewSegmentF: " << start_dts.InMilliseconds(); | 97 DVLOG(1) << "NewSegmentF: " << start_dts.InMilliseconds(); |
98 segment_start_ = start_dts; | 98 segment_start_ = start_dts; |
99 } | 99 } |
100 | 100 |
| 101 void EndOfSegmentF() { |
| 102 DVLOG(1) << "EndOfSegmentF()"; |
| 103 } |
| 104 |
101 void InitializeParser() { | 105 void InitializeParser() { |
102 parser_->Init( | 106 parser_->Init( |
103 base::Bind(&MP4StreamParserTest::InitF, base::Unretained(this)), | 107 base::Bind(&MP4StreamParserTest::InitF, base::Unretained(this)), |
104 base::Bind(&MP4StreamParserTest::NewConfigF, base::Unretained(this)), | 108 base::Bind(&MP4StreamParserTest::NewConfigF, base::Unretained(this)), |
105 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), | 109 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), |
106 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), | 110 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), |
107 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)), | 111 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)), |
108 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this))); | 112 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)), |
| 113 base::Bind(&MP4StreamParserTest::EndOfSegmentF, |
| 114 base::Unretained(this))); |
109 } | 115 } |
110 | 116 |
111 bool ParseMP4File(const std::string& filename, int append_size) { | 117 bool ParseMP4File(const std::string& filename, int append_size) { |
112 InitializeParser(); | 118 InitializeParser(); |
113 | 119 |
114 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); | 120 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile(filename); |
115 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), | 121 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), |
116 buffer->GetDataSize(), | 122 buffer->GetDataSize(), |
117 append_size)); | 123 append_size)); |
118 return true; | 124 return true; |
(...skipping 16 matching lines...) Expand all Loading... |
135 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), | 141 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), |
136 buffer->GetDataSize(), | 142 buffer->GetDataSize(), |
137 512)); | 143 512)); |
138 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), | 144 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), |
139 buffer->GetDataSize(), | 145 buffer->GetDataSize(), |
140 512)); | 146 512)); |
141 } | 147 } |
142 | 148 |
143 } // namespace mp4 | 149 } // namespace mp4 |
144 } // namespace media | 150 } // namespace media |
OLD | NEW |