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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "media/base/audio_decoder_config.h" | 6 #include "media/base/audio_decoder_config.h" |
7 #include "media/base/decoder_buffer.h" | 7 #include "media/base/decoder_buffer.h" |
8 #include "media/base/mock_callback.h" | 8 #include "media/base/mock_callback.h" |
9 #include "media/base/mock_demuxer_host.h" | 9 #include "media/base/mock_demuxer_host.h" |
10 #include "media/base/test_data_util.h" | 10 #include "media/base/test_data_util.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 std::vector<std::string> codecs(2); | 178 std::vector<std::string> codecs(2); |
179 codecs[0] = "vp8"; | 179 codecs[0] = "vp8"; |
180 codecs[1] = "vorbis"; | 180 codecs[1] = "vorbis"; |
181 return demuxer_->AddId(kSourceId, "video/webm", codecs); | 181 return demuxer_->AddId(kSourceId, "video/webm", codecs); |
182 } | 182 } |
183 | 183 |
184 bool AppendData(const uint8* data, size_t length) { | 184 bool AppendData(const uint8* data, size_t length) { |
185 CHECK(length); | 185 CHECK(length); |
186 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber()) | 186 EXPECT_CALL(host_, AddBufferedByteRange(_, _)).Times(AnyNumber()) |
187 .WillRepeatedly(SaveArg<1>(&buffered_bytes_)); | 187 .WillRepeatedly(SaveArg<1>(&buffered_bytes_)); |
188 EXPECT_CALL(host_, SetNetworkActivity(true)) | |
189 .Times(AnyNumber()); | |
190 return demuxer_->AppendData(kSourceId, data, length); | 188 return demuxer_->AppendData(kSourceId, data, length); |
191 } | 189 } |
192 | 190 |
193 bool AppendDataInPieces(const uint8* data, size_t length) { | 191 bool AppendDataInPieces(const uint8* data, size_t length) { |
194 return AppendDataInPieces(data, length, 7); | 192 return AppendDataInPieces(data, length, 7); |
195 } | 193 } |
196 | 194 |
197 bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size) { | 195 bool AppendDataInPieces(const uint8* data, size_t length, size_t piece_size) { |
198 const uint8* start = data; | 196 const uint8* start = data; |
199 const uint8* end = data + length; | 197 const uint8* end = data + length; |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 | 1088 |
1091 std::vector<std::string> codecs(1); | 1089 std::vector<std::string> codecs(1); |
1092 codecs[0] = "vp8"; | 1090 codecs[0] = "vp8"; |
1093 ASSERT_EQ(demuxer_->AddId(kSourceId, "video/webm", codecs), | 1091 ASSERT_EQ(demuxer_->AddId(kSourceId, "video/webm", codecs), |
1094 ChunkDemuxer::kOk); | 1092 ChunkDemuxer::kOk); |
1095 | 1093 |
1096 ASSERT_TRUE(AppendInfoTracks(true, true, false)); | 1094 ASSERT_TRUE(AppendInfoTracks(true, true, false)); |
1097 } | 1095 } |
1098 | 1096 |
1099 } // namespace media | 1097 } // namespace media |
OLD | NEW |