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

Unified Diff: media/filters/fake_video_decoder.cc

Issue 141243003: Add AudioBufferStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decoderstream_rebased
Patch Set: Rebase! Created 6 years, 9 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/fake_video_decoder.h ('k') | media/filters/fake_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/fake_video_decoder.cc
diff --git a/media/filters/fake_video_decoder.cc b/media/filters/fake_video_decoder.cc
index f3c4ef112d765173aed83226ed57f2835470b1e0..d5bb03bf6884f2044cbad0464e3ebde5c32aa149 100644
--- a/media/filters/fake_video_decoder.cc
+++ b/media/filters/fake_video_decoder.cc
@@ -13,10 +13,12 @@
namespace media {
-FakeVideoDecoder::FakeVideoDecoder(int decoding_delay)
+FakeVideoDecoder::FakeVideoDecoder(int decoding_delay,
+ bool supports_get_decode_output)
: task_runner_(base::MessageLoopProxy::current()),
weak_factory_(this),
decoding_delay_(decoding_delay),
+ supports_get_decode_output_(supports_get_decode_output),
state_(UNINITIALIZED),
total_bytes_decoded_(0) {
DCHECK_GE(decoding_delay, 0);
@@ -103,6 +105,15 @@ void FakeVideoDecoder::Stop(const base::Closure& closure) {
DoStop();
}
+scoped_refptr<VideoFrame> FakeVideoDecoder::GetDecodeOutput() {
+ DCHECK(task_runner_->BelongsToCurrentThread());
+ if (!supports_get_decode_output_ || decoded_frames_.empty())
+ return NULL;
+ scoped_refptr<VideoFrame> out = decoded_frames_.front();
+ decoded_frames_.pop_front();
+ return out;
+}
+
void FakeVideoDecoder::HoldNextInit() {
DCHECK(task_runner_->BelongsToCurrentThread());
init_cb_.HoldCallback();
« no previous file with comments | « media/filters/fake_video_decoder.h ('k') | media/filters/fake_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698