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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_VIDEO_RENDERER_SINK_IMPL_H_
6 #define MEDIA_MOJO_CLIENTS_MOJO_VIDEO_RENDERER_SINK_IMPL_H_
7
8 #include "media/base/video_renderer_sink.h"
9 #include "media/mojo/interfaces/video_renderer_sink.mojom.h"
10 #include "mojo/public/cpp/bindings/binding.h"
11
12 namespace media {
13
14 class MojoVideoRendererSinkImpl
15 : public NON_EXPORTED_BASE(media::VideoRendererSink::RenderCallback),
16 public mojom::VideoRendererSink {
17 public:
18 MojoVideoRendererSinkImpl(
19 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
20 media::VideoRendererSink* sink,
21 mojo::InterfaceRequest<mojom::VideoRendererSink> request);
22 ~MojoVideoRendererSinkImpl() override;
23
24 // VideoRendererSink::RenderCallback implementation.
25 scoped_refptr<VideoFrame> Render(base::TimeTicks deadline_min,
26 base::TimeTicks deadline_max,
27 bool background_rendering) override;
28 void OnFrameDropped() override;
29
30 // mojom::VideoRendererSink implementation.
31 void Start(
32 mojom::VideoRendererSinkRenderCallbackAssociatedPtrInfo callback) final;
33 void Stop() override;
34 void PaintSingleFrame(mojom::VideoFramePtr mojo_frame,
35 bool repaint_duplicate_frame) final;
36
37 // Sets an error handler that will be called if a connection error occurs on
38 // the bound message pipe.
39 void set_connection_error_handler(const base::Closure& error_handler) {
40 binding_.set_connection_error_handler(error_handler);
41 }
42
43 private:
44 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
45 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
46
47 mojo::Binding<mojom::VideoRendererSink> binding_;
48
49 media::VideoRendererSink* sink_;
50 bool started_;
51
52 mojom::VideoRendererSinkRenderCallbackAssociatedPtrInfo callback_info_;
53 mojom::VideoRendererSinkRenderCallbackAssociatedPtr callback_;
54 };
55
56 } // namespace media
57
58 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_RENDERER_SINK_IMPL_H_
OLDNEW
« 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