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 <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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 DemuxerStream::Liveness expected_liveness) { | 138 DemuxerStream::Liveness expected_liveness) { |
139 parser_->Init( | 139 parser_->Init( |
140 base::Bind(&MP4StreamParserTest::InitF, base::Unretained(this), | 140 base::Bind(&MP4StreamParserTest::InitF, base::Unretained(this), |
141 expected_liveness), | 141 expected_liveness), |
142 base::Bind(&MP4StreamParserTest::NewConfigF, base::Unretained(this)), | 142 base::Bind(&MP4StreamParserTest::NewConfigF, base::Unretained(this)), |
143 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), | 143 base::Bind(&MP4StreamParserTest::NewBuffersF, base::Unretained(this)), |
144 true, | 144 true, |
145 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)), | 145 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)), |
146 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)), | 146 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)), |
147 base::Bind(&MP4StreamParserTest::EndOfSegmentF, base::Unretained(this)), | 147 base::Bind(&MP4StreamParserTest::EndOfSegmentF, base::Unretained(this)), |
148 LogCB()); | 148 new MediaLog()); |
149 } | 149 } |
150 | 150 |
151 void InitializeParser() { | 151 void InitializeParser() { |
152 // Most unencrypted test mp4 files have zero duration and are treated as | 152 // Most unencrypted test mp4 files have zero duration and are treated as |
153 // live streams. | 153 // live streams. |
154 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_LIVE); | 154 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_LIVE); |
155 } | 155 } |
156 | 156 |
157 bool ParseMP4File(const std::string& filename, int append_bytes) { | 157 bool ParseMP4File(const std::string& filename, int append_bytes) { |
158 InitializeParser(); | 158 InitializeParser(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // recorded streams. | 256 // recorded streams. |
257 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); | 257 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); |
258 | 258 |
259 scoped_refptr<DecoderBuffer> buffer = | 259 scoped_refptr<DecoderBuffer> buffer = |
260 ReadTestDataFile("bear-1280x720-v_frag-cenc.mp4"); | 260 ReadTestDataFile("bear-1280x720-v_frag-cenc.mp4"); |
261 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); | 261 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
262 } | 262 } |
263 | 263 |
264 } // namespace mp4 | 264 } // namespace mp4 |
265 } // namespace media | 265 } // namespace media |
OLD | NEW |