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

Unified Diff: content/renderer/media/media_stream_video_source.h

Issue 99113003: Define the interface for MediaStreamVideoSource. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 11 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 | « content/content_tests.gypi ('k') | content/renderer/media/media_stream_video_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_video_source.h
===================================================================
--- content/renderer/media/media_stream_video_source.h (revision 0)
+++ content/renderer/media/media_stream_video_source.h (revision 0)
@@ -0,0 +1,50 @@
+// Copyright 2013 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 CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_
+#define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_
+
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
+#include "content/renderer/media/media_stream_source_extra_data.h"
+#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
+#include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
+#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
+
+namespace media {
+class VideoFrame;
+}
+
+namespace content {
+
+// MediaStreamVideoSource is an interface used for sending video frames to a
+// MediaStreamVideoTrack.
+// http://dev.w3.org/2011/webrtc/editor/getusermedia.html
+// All methods calls will be done from the main render thread.
+class CONTENT_EXPORT MediaStreamVideoSource
+ : public MediaStreamSourceExtraData {
+ public:
+ // Puts |track| in the registered tracks list. Will later
+ // deliver frames to it according to |constraints|.
+ void AddTrack(const blink::WebMediaStreamTrack& track,
+ const blink::WebMediaConstraints& constraints);
+
+ // Removes |track| from the registered tracks list, i.e. will stop delivering
+ // frame to |track|.
+ void RemoveTrack(const blink::WebMediaStreamTrack& track);
+
+ protected:
+ // Sets ready state and notifies the ready state to all registered tracks.
+ virtual void SetReadyState(blink::WebMediaStreamSource::ReadyState state);
+
+ // Delivers |frame| to registered tracks according to their constraints.
+ virtual void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame);
+
+ virtual ~MediaStreamVideoSource();
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_SOURCE_H_
Property changes on: content/renderer/media/media_stream_video_source.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/media_stream_video_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698