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

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

Issue 10918052: create a separate WebMediaPlayer for URL derived from media stream (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 8 years, 3 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/public/common/content_switches.cc ('k') | content/renderer/media/local_video_capture.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/local_video_capture.h
===================================================================
--- content/renderer/media/local_video_capture.h (revision 0)
+++ content/renderer/media/local_video_capture.h (revision 0)
@@ -0,0 +1,79 @@
+// Copyright (c) 2012 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_LOCAL_VIDEO_CAPTURE_H_
+#define CONTENT_RENDERER_MEDIA_LOCAL_VIDEO_CAPTURE_H_
+
+#include "content/common/content_export.h"
+#include "content/common/media/video_capture.h"
+#include "media/video/capture/video_capture.h"
+#include "webkit/media/video_frame_provider.h"
+
+namespace base {
+class MessageLoopProxy;
+}
+
+namespace media {
+class VideoCaptureHandlerProxy;
+}
+
+class VideoCaptureImplManager;
+
+namespace content {
+
+// This class takes raw frames from video capture engine via VideoCaptureProxy
+// and passes them to media player as a video frame provider.
+// This class lives on main thread.
+class CONTENT_EXPORT LocalVideoCapture
+ : NON_EXPORTED_BASE(public webkit_media::VideoFrameProvider),
+ public media::VideoCapture::EventHandler {
+ public:
+ LocalVideoCapture(
+ media::VideoCaptureSessionId video_stream_id,
+ VideoCaptureImplManager* vc_manager,
+ const media::VideoCaptureCapability& capability,
+ const base::Closure& error_cb,
+ const RepaintCB& repaint_cb);
+
+ // webkit_media::VideoFrameProvider implementation.
+ virtual void Start() OVERRIDE;
+ virtual void Stop() OVERRIDE;
+ virtual void Play() OVERRIDE;
+ virtual void Pause() OVERRIDE;
+
+ // VideoCapture::EventHandler implementation.
+ virtual void OnStarted(media::VideoCapture* capture) OVERRIDE;
+ virtual void OnStopped(media::VideoCapture* capture) OVERRIDE;
+ virtual void OnPaused(media::VideoCapture* capture) OVERRIDE;
+ virtual void OnError(media::VideoCapture* capture, int error_code) OVERRIDE;
+ virtual void OnRemoved(media::VideoCapture* capture) OVERRIDE;
+ virtual void OnBufferReady(
+ media::VideoCapture* capture,
+ scoped_refptr<media::VideoCapture::VideoFrameBuffer> buf) OVERRIDE;
+ virtual void OnDeviceInfoReceived(
+ media::VideoCapture* capture,
+ const media::VideoCaptureParams& device_info) OVERRIDE;
+
+ protected:
+ virtual ~LocalVideoCapture();
+
+ private:
+ friend class LocalVideoCaptureTest;
+
+ media::VideoCaptureSessionId video_stream_id_;
+ scoped_refptr<VideoCaptureImplManager> vc_manager_;
+ media::VideoCaptureCapability capability_;
+ base::Closure error_cb_;
+ RepaintCB repaint_cb_;
+ media::VideoCapture* capture_engine_;
+ scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
+ scoped_ptr<media::VideoCaptureHandlerProxy> handler_proxy_;
+ video_capture::State state_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocalVideoCapture);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_LOCAL_VIDEO_CAPTURE_H_
Property changes on: content/renderer/media/local_video_capture.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/renderer/media/local_video_capture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698