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

Unified Diff: media/mojo/clients/mojo_video_renderer_sink_impl.h

Issue 2643713003: Allow to use the DefaultRendererFactory from a Utility Process (Closed)
Patch Set: Rebase Created 3 years, 10 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/mojo/clients/mojo_renderer.cc ('k') | media/mojo/clients/mojo_video_renderer_sink_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/clients/mojo_video_renderer_sink_impl.h
diff --git a/media/mojo/clients/mojo_video_renderer_sink_impl.h b/media/mojo/clients/mojo_video_renderer_sink_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..4d698a8c1352d89b6d8da0e2a3b969555ce2ace5
--- /dev/null
+++ b/media/mojo/clients/mojo_video_renderer_sink_impl.h
@@ -0,0 +1,58 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_MOJO_CLIENTS_MOJO_VIDEO_RENDERER_SINK_IMPL_H_
+#define MEDIA_MOJO_CLIENTS_MOJO_VIDEO_RENDERER_SINK_IMPL_H_
+
+#include "media/base/video_renderer_sink.h"
+#include "media/mojo/interfaces/video_renderer_sink.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace media {
+
+class MojoVideoRendererSinkImpl
+ : public NON_EXPORTED_BASE(media::VideoRendererSink::RenderCallback),
+ public mojom::VideoRendererSink {
+ public:
+ MojoVideoRendererSinkImpl(
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+ media::VideoRendererSink* sink,
+ mojo::InterfaceRequest<mojom::VideoRendererSink> request);
+ ~MojoVideoRendererSinkImpl() override;
+
+ // VideoRendererSink::RenderCallback implementation.
+ scoped_refptr<VideoFrame> Render(base::TimeTicks deadline_min,
+ base::TimeTicks deadline_max,
+ bool background_rendering) override;
+ void OnFrameDropped() override;
+
+ // mojom::VideoRendererSink implementation.
+ void Start(
+ mojom::VideoRendererSinkRenderCallbackAssociatedPtrInfo callback) final;
+ void Stop() override;
+ void PaintSingleFrame(mojom::VideoFramePtr mojo_frame,
+ bool repaint_duplicate_frame) final;
+
+ // Sets an error handler that will be called if a connection error occurs on
+ // the bound message pipe.
+ void set_connection_error_handler(const base::Closure& error_handler) {
+ binding_.set_connection_error_handler(error_handler);
+ }
+
+ private:
+ scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
+
+ mojo::Binding<mojom::VideoRendererSink> binding_;
+
+ media::VideoRendererSink* sink_;
+ bool started_;
+
+ mojom::VideoRendererSinkRenderCallbackAssociatedPtrInfo callback_info_;
+ mojom::VideoRendererSinkRenderCallbackAssociatedPtr callback_;
+};
+
+} // namespace media
+
+#endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_RENDERER_SINK_IMPL_H_
« no previous file with comments | « media/mojo/clients/mojo_renderer.cc ('k') | media/mojo/clients/mojo_video_renderer_sink_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698