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

Unified Diff: trunk/src/content/renderer/media/rtc_video_capture_delegate.h

Issue 135683002: Revert 244074 "Eliminate video capture thread in renderer" (Closed) Base URL: svn://svn.chromium.org/chrome/
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
Index: trunk/src/content/renderer/media/rtc_video_capture_delegate.h
===================================================================
--- trunk/src/content/renderer/media/rtc_video_capture_delegate.h (revision 244357)
+++ trunk/src/content/renderer/media/rtc_video_capture_delegate.h (working copy)
@@ -8,12 +8,11 @@
#include "base/callback.h"
#include "base/message_loop/message_loop_proxy.h"
#include "content/common/media/video_capture.h"
+#include "content/renderer/media/video_capture_impl_manager.h"
#include "media/video/capture/video_capture.h"
namespace content {
-class VideoCaptureHandle;
-
// Implements a simple reference counted video capturer that guarantees that
// methods in RtcVideoCaptureDelegateEventHandler is only called from when
// StartCapture have been called until after StopCapture have been called.
@@ -34,17 +33,16 @@
FrameCapturedCallback;
typedef base::Callback<void(CaptureState)> StateChangeCallback;
- RtcVideoCaptureDelegate(const media::VideoCaptureSessionId id);
+ RtcVideoCaptureDelegate(const media::VideoCaptureSessionId id,
+ VideoCaptureImplManager* vc_manager);
void StartCapture(const media::VideoCaptureParams& params,
const FrameCapturedCallback& captured_callback,
const StateChangeCallback& state_callback);
void StopCapture();
- protected:
// media::VideoCapture::EventHandler implementation.
- // These functions are called on the IO thread (same as where
- // |capture_engine_| runs).
+ // These functions are called from a thread owned by |vc_manager_|.
virtual void OnStarted(media::VideoCapture* capture) OVERRIDE;
virtual void OnStopped(media::VideoCapture* capture) OVERRIDE;
virtual void OnPaused(media::VideoCapture* capture) OVERRIDE;
@@ -68,7 +66,9 @@
// The id identifies which video capture device is used for this video
// capture session.
media::VideoCaptureSessionId session_id_;
- scoped_ptr<VideoCaptureHandle> capture_engine_;
+ // The video capture manager handles open/close of video capture devices.
+ scoped_refptr<VideoCaptureImplManager> vc_manager_;
+ media::VideoCapture* capture_engine_;
// Accessed on the thread where StartCapture is called.
bool got_first_frame_;

Powered by Google App Engine
This is Rietveld 408576698