Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: media/base/android/sdk_media_codec_bridge_unittest.cc

Issue 2047003003: Rename MediaCodecBridge::Reset() to Flush() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed a couple Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/base/android/sdk_media_codec_bridge.h" 5 #include "media/base/android/sdk_media_codec_bridge.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 EXPECT_TRUE(media_codec.get()); 279 EXPECT_TRUE(media_codec.get());
280 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile("vp8-I-frame-320x240"); 280 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile("vp8-I-frame-320x240");
281 DecodeMediaFrame(media_codec.get(), buffer->data(), buffer->data_size(), 281 DecodeMediaFrame(media_codec.get(), buffer->data(), buffer->data_size(),
282 base::TimeDelta(), base::TimeDelta()); 282 base::TimeDelta(), base::TimeDelta());
283 283
284 // Simulate a seek to 10 seconds, and each chunk has 2 I-frames. 284 // Simulate a seek to 10 seconds, and each chunk has 2 I-frames.
285 std::vector<uint8_t> chunk(buffer->data(), 285 std::vector<uint8_t> chunk(buffer->data(),
286 buffer->data() + buffer->data_size()); 286 buffer->data() + buffer->data_size());
287 chunk.insert(chunk.end(), buffer->data(), 287 chunk.insert(chunk.end(), buffer->data(),
288 buffer->data() + buffer->data_size()); 288 buffer->data() + buffer->data_size());
289 media_codec->Reset(); 289 media_codec->Flush();
290 DecodeMediaFrame(media_codec.get(), &chunk[0], chunk.size(), 290 DecodeMediaFrame(media_codec.get(), &chunk[0], chunk.size(),
291 base::TimeDelta::FromMicroseconds(10000000), 291 base::TimeDelta::FromMicroseconds(10000000),
292 base::TimeDelta::FromMicroseconds(9900000)); 292 base::TimeDelta::FromMicroseconds(9900000));
293 293
294 // Simulate a seek to 5 seconds. 294 // Simulate a seek to 5 seconds.
295 media_codec->Reset(); 295 media_codec->Flush();
296 DecodeMediaFrame(media_codec.get(), &chunk[0], chunk.size(), 296 DecodeMediaFrame(media_codec.get(), &chunk[0], chunk.size(),
297 base::TimeDelta::FromMicroseconds(5000000), 297 base::TimeDelta::FromMicroseconds(5000000),
298 base::TimeDelta::FromMicroseconds(4900000)); 298 base::TimeDelta::FromMicroseconds(4900000));
299 } 299 }
300 300
301 TEST(SdkMediaCodecBridgeTest, CreateUnsupportedCodec) { 301 TEST(SdkMediaCodecBridgeTest, CreateUnsupportedCodec) {
302 EXPECT_EQ(nullptr, AudioCodecBridge::Create(kUnknownAudioCodec)); 302 EXPECT_EQ(nullptr, AudioCodecBridge::Create(kUnknownAudioCodec));
303 EXPECT_EQ(nullptr, VideoCodecBridge::CreateDecoder(kUnknownVideoCodec, false, 303 EXPECT_EQ(nullptr, VideoCodecBridge::CreateDecoder(kUnknownVideoCodec, false,
304 gfx::Size(320, 240), 304 gfx::Size(320, 240),
305 nullptr, nullptr)); 305 nullptr, nullptr));
306 } 306 }
307 307
308 } // namespace media 308 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/sdk_media_codec_bridge.cc ('k') | media/filters/android/media_codec_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698