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

Unified Diff: mojo/services/public/interfaces/media/media_renderer.mojom

Issue 491733004: media: add basic MediaRenderer mojom and TypeConverters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: mojo/services/public/interfaces/media/media_renderer.mojom
diff --git a/mojo/services/public/interfaces/media/media_renderer.mojom b/mojo/services/public/interfaces/media/media_renderer.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..08d154e941dc6474c646672336bd383e88458b14
--- /dev/null
+++ b/mojo/services/public/interfaces/media/media_renderer.mojom
@@ -0,0 +1,57 @@
+// Copyright 2014 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.
+
+import "mojo/services/public/interfaces/media/media_types.mojom"
+
+module mojo {
+
+[Client=MediaRendererClient]
+interface MediaRenderer {
+ // Initializes the Renderer, calling back with status upon completion.
+ Initialize(handle<data_pipe_consumer> demuxer_stream) =>
+ (PipelineStatus pipeline_status);
+
+ // Discards any buffered data, executing callback when completed.
+ Flush() => ();
+
+ // Starts rendering from |time|.
+ StartPlayingFrom(int64 time_delta_usec);
+
+ // Updates the current playback rate. The default playback rate should be 1.
+ SetPlaybackRate(float playback_rate);
+
+ // Sets the output volume. The default volume should be 1.
+ SetVolume(float volume);
+
+ /* TODO(tim): Figure out these
+ GetMediaTime() => (int64 time_delta_usec);
xhwang 2014/08/22 23:30:02 Since we have OnTimeAdvanced, we probably don't ne
+ HasAudio()
+ HasVideo()
+ */
+};
+
+interface MediaRendererClient {
+ OnNewStatistics(PipelineStatistics statistics);
xhwang 2014/08/22 23:30:02 nit: OnStatistics
+ OnTimeAdvanced(int64 time_delta_usec);
xhwang 2014/08/22 23:30:02 OnTimeUpdate() would be a more media-ish term :)
+ OnBufferingStateChange(BufferingState state);
+ OnEndOfStream();
xhwang 2014/08/22 23:30:02 OnEnded() to be more consistent with media Pipelin
+ OnPipelineError(PipelineStatus error);
xhwang 2014/08/22 23:30:02 Renderer knows nothing about Pipeline. So just OnE
+};
+
+}
+
+/* REMOVE THIS
+
+e.g
+
+class MojoRendererImpl : public media::Renderer,
+ mojo::MediaRendererClient {
+
+ ...
+ mojo::MediaRendererPtr renderer;
+ <magic_thing>->ConnectToService("lib with InterfaceImpl<MediaRenderer>", &renderer);
+
+
+};
+*/

Powered by Google App Engine
This is Rietveld 408576698