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

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

Issue 2281843003: Move ownership of audio/video sinks to MojoRendererService. (Closed)
Patch Set: rebase Created 4 years, 4 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/services/mojo_media_client.cc ('k') | media/mojo/services/mojo_renderer_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_renderer_service.h
diff --git a/media/mojo/services/mojo_renderer_service.h b/media/mojo/services/mojo_renderer_service.h
index 44916c5eb1afd32d06b1b097bd7b9cd8a7a3703a..18130b5efb1af80e5492f07e344949e04e522d21 100644
--- a/media/mojo/services/mojo_renderer_service.h
+++ b/media/mojo/services/mojo_renderer_service.h
@@ -24,10 +24,12 @@
namespace media {
+class AudioRendererSink;
class DemuxerStreamProviderShim;
class MediaKeys;
class MojoCdmServiceContext;
class Renderer;
+class VideoRendererSink;
// A mojom::Renderer implementation that use a media::Renderer to render
// media streams.
@@ -39,6 +41,8 @@ class MEDIA_MOJO_EXPORT MojoRendererService
// encrypted media. If null, encrypted media is not supported.
MojoRendererService(
base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context,
+ scoped_refptr<AudioRendererSink> audio_sink,
+ std::unique_ptr<VideoRendererSink> video_sink,
std::unique_ptr<media::Renderer> renderer,
mojo::InterfaceRequest<mojom::Renderer> request);
~MojoRendererService() final;
@@ -114,8 +118,14 @@ class MEDIA_MOJO_EXPORT MojoRendererService
// destructed while the |renderer_| is still using it.
scoped_refptr<MediaKeys> cdm_;
+ // Audio and Video sinks.
+ // May be null if underlying |renderer_| does not use them.
+ scoped_refptr<AudioRendererSink> audio_sink_;
+ std::unique_ptr<VideoRendererSink> video_sink_;
+
// Note: Destroy |renderer_| first to avoid access violation into other
- // members, e.g. |stream_provider_| and |cdm_|.
+ // members, e.g. |stream_provider_|, |cdm_|, |audio_sink_|, and
+ // |video_sink_|.
// Must use "media::" because "Renderer" is ambiguous.
std::unique_ptr<media::Renderer> renderer_;
« no previous file with comments | « media/mojo/services/mojo_media_client.cc ('k') | media/mojo/services/mojo_renderer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698