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

Unified Diff: media/filters/opus_audio_decoder_unittest.cc

Issue 297553002: Add callback in VideoDecoder and AudioDecoder to return decoded frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/opus_audio_decoder.cc ('k') | media/filters/video_decoder_selector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/opus_audio_decoder_unittest.cc
diff --git a/media/filters/opus_audio_decoder_unittest.cc b/media/filters/opus_audio_decoder_unittest.cc
index 3e17e15afb241fe51f043206ff127cbdb658bcdf..38e9f6f4f8d7cc56e29a7bb49963e29ceccd5009 100644
--- a/media/filters/opus_audio_decoder_unittest.cc
+++ b/media/filters/opus_audio_decoder_unittest.cc
@@ -57,7 +57,10 @@ class OpusAudioDecoderTest : public testing::Test {
}
void InitializeDecoder(const AudioDecoderConfig& config) {
- decoder_->Initialize(config, NewExpectedStatusCB(PIPELINE_OK));
+ decoder_->Initialize(config,
+ NewExpectedStatusCB(PIPELINE_OK),
+ base::Bind(&OpusAudioDecoderTest::OnDecoderOutput,
+ base::Unretained(this)));
base::RunLoop().RunUntilIdle();
}
@@ -91,22 +94,16 @@ class OpusAudioDecoderTest : public testing::Test {
base::RunLoop().RunUntilIdle();
}
- void DecodeFinished(AudioDecoder::Status status,
- const scoped_refptr<AudioBuffer>& buffer) {
+ void OnDecoderOutput(const scoped_refptr<AudioBuffer>& buffer) {
+ decoded_audio_.push_back(buffer);
+ }
+
+ void DecodeFinished(AudioDecoder::Status status) {
EXPECT_TRUE(pending_decode_);
pending_decode_ = false;
- if (status == AudioDecoder::kNotEnoughData) {
- EXPECT_TRUE(buffer.get() == NULL);
- Decode();
- return;
- }
-
- decoded_audio_.push_back(buffer);
-
- // If we hit a NULL buffer or have a pending reset, we expect an abort.
- if (buffer.get() == NULL || pending_reset_) {
- EXPECT_TRUE(buffer.get() == NULL);
+ // If we have a pending reset, we expect an abort.
+ if (pending_reset_) {
EXPECT_EQ(status, AudioDecoder::kAborted);
return;
}
« no previous file with comments | « media/filters/opus_audio_decoder.cc ('k') | media/filters/video_decoder_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698