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

Unified Diff: media/mojo/services/mojo_video_decoder.h

Issue 1899363002: Finish plumbing MojoVideoDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Spaaace. Created 4 years, 7 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
Index: media/mojo/services/mojo_video_decoder.h
diff --git a/media/mojo/services/mojo_video_decoder.h b/media/mojo/services/mojo_video_decoder.h
index cee3a0d86ffce501b269aa2df1399b3f2b6026da..9de763a61ea30d6eed3ea0cfcc2983d8e6ba05a5 100644
--- a/media/mojo/services/mojo_video_decoder.h
+++ b/media/mojo/services/mojo_video_decoder.h
@@ -8,6 +8,9 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "media/base/video_decoder.h"
+#include "media/mojo/interfaces/video_decoder.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/system/data_pipe.h"
namespace base {
class SingleThreadTaskRunner;
@@ -15,10 +18,15 @@ class SingleThreadTaskRunner;
namespace media {
+class GpuVideoAcceleratorFactories;
+
// A VideoDecoder that proxies to an interfaces::VideoDecoder.
-class MojoVideoDecoder : public VideoDecoder {
+class MojoVideoDecoder : public VideoDecoder,
+ public interfaces::VideoDecoderClient {
public:
- MojoVideoDecoder();
+ MojoVideoDecoder(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ GpuVideoAcceleratorFactories* gpu_factories,
+ interfaces::VideoDecoderPtr remote_decoder);
~MojoVideoDecoder() final;
// VideoDecoder implementation.
@@ -35,8 +43,34 @@ class MojoVideoDecoder : public VideoDecoder {
bool CanReadWithoutStalling() const final;
int GetMaxDecodeRequests() const final;
+ // interfaces::VideoDecoderClient implementation.
+ void OnVideoFrameDecoded(interfaces::VideoFramePtr frame) final;
+
private:
+ void OnInitializeDone(bool status);
+ void OnDecodeDone(interfaces::DecodeStatus status);
+ void OnResetDone();
+
+ void BindRemoteDecoder();
+ void OnConnectionError();
+
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ GpuVideoAcceleratorFactories* gpu_factories_;
+
+ // Used to pass the remote decoder from the constructor (on the main thread)
+ // to Initialize() (on the media thread).
+ interfaces::VideoDecoderPtrInfo remote_decoder_info_;
+
+ InitCB init_cb_;
+ OutputCB output_cb_;
+ DecodeCB decode_cb_;
+ base::Closure reset_cb_;
+
+ interfaces::VideoDecoderPtr remote_decoder_;
+ mojo::ScopedDataPipeProducerHandle decoder_buffer_pipe_;
+ bool remote_decoder_bound_ = false;
+ bool has_connection_error_ = false;
+ mojo::Binding<VideoDecoderClient> binding_;
DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698