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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Ensure no incremental errors occur when parsing | 130 // Ensure no incremental errors occur when parsing |
131 ParseMP4File("bear.1280x720_dash.mp4", 1); | 131 ParseMP4File("bear.1280x720_dash.mp4", 1); |
132 } | 132 } |
133 | 133 |
134 TEST_F(MP4StreamParserTest, TestMultiFragmentAppend) { | 134 TEST_F(MP4StreamParserTest, TestMultiFragmentAppend) { |
135 // Large size ensures multiple fragments are appended in one call (size is | 135 // Large size ensures multiple fragments are appended in one call (size is |
136 // larger than this particular test file) | 136 // larger than this particular test file) |
137 ParseMP4File("bear.1280x720_dash.mp4", 768432); | 137 ParseMP4File("bear.1280x720_dash.mp4", 768432); |
138 } | 138 } |
139 | 139 |
| 140 TEST_F(MP4StreamParserTest, TestFlush) { |
| 141 // Flush while reading sample data, then start a new stream. |
| 142 InitializeParser(); |
| 143 |
| 144 scoped_refptr<DecoderBuffer> buffer = |
| 145 ReadTestDataFile("bear.1280x720_dash.mp4"); |
| 146 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), 65536, 512)); |
| 147 parser_->Flush(); |
| 148 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), |
| 149 buffer->GetDataSize(), |
| 150 512)); |
| 151 } |
| 152 |
140 TEST_F(MP4StreamParserTest, TestReinitialization) { | 153 TEST_F(MP4StreamParserTest, TestReinitialization) { |
141 InitializeParser(); | 154 InitializeParser(); |
142 | 155 |
143 scoped_refptr<DecoderBuffer> buffer = | 156 scoped_refptr<DecoderBuffer> buffer = |
144 ReadTestDataFile("bear.1280x720_dash.mp4"); | 157 ReadTestDataFile("bear.1280x720_dash.mp4"); |
145 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), | 158 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), |
146 buffer->GetDataSize(), | 159 buffer->GetDataSize(), |
147 512)); | 160 512)); |
148 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), | 161 EXPECT_TRUE(AppendDataInPieces(buffer->GetData(), |
149 buffer->GetDataSize(), | 162 buffer->GetDataSize(), |
150 512)); | 163 512)); |
151 } | 164 } |
152 | 165 |
153 // TODO(strobe): Create and test media which uses CENC auxiliary info stored | 166 // TODO(strobe): Create and test media which uses CENC auxiliary info stored |
154 // inside a private box | 167 // inside a private box |
155 | 168 |
156 } // namespace mp4 | 169 } // namespace mp4 |
157 } // namespace media | 170 } // namespace media |
OLD | NEW |