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

Unified Diff: content/renderer/pepper/pepper_video_capture_host.h

Issue 242013002: Refactor video capturing code in the render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge again and again :( Created 6 years, 8 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: content/renderer/pepper/pepper_video_capture_host.h
diff --git a/content/renderer/pepper/pepper_video_capture_host.h b/content/renderer/pepper/pepper_video_capture_host.h
index 8f5b77ad3b1778894631d1f45ea7544eb20243eb..0be84371ab17db62a42be2ded328a290d08c2f69 100644
--- a/content/renderer/pepper/pepper_video_capture_host.h
+++ b/content/renderer/pepper/pepper_video_capture_host.h
@@ -7,21 +7,25 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/common/media/video_capture.h"
#include "content/public/renderer/renderer_ppapi_host.h"
#include "content/renderer/pepper/pepper_device_enumeration_host_helper.h"
#include "content/renderer/pepper/ppb_buffer_impl.h"
-#include "media/video/capture/video_capture.h"
#include "media/video/capture/video_capture_types.h"
#include "ppapi/c/dev/ppp_video_capture_dev.h"
#include "ppapi/host/host_message_context.h"
#include "ppapi/host/resource_host.h"
+namespace media {
+class VideoFrame;
+} // namespace media
+
namespace content {
class PepperPlatformVideoCapture;
class RendererPpapiHostImpl;
-class PepperVideoCaptureHost : public ppapi::host::ResourceHost,
- public media::VideoCapture::EventHandler {
+class PepperVideoCaptureHost : public ppapi::host::ResourceHost {
public:
PepperVideoCaptureHost(RendererPpapiHostImpl* host,
PP_Instance instance,
@@ -35,17 +39,28 @@ class PepperVideoCaptureHost : public ppapi::host::ResourceHost,
const IPC::Message& msg,
ppapi::host::HostMessageContext* context) OVERRIDE;
- void OnInitialized(media::VideoCapture* capture, bool succeeded);
+ // These methods are called by PepperPlatformVideoCapture only.
+
+ // Called when video capturing is initialized. We can start
bbudge 2014/04/25 23:18:58 s/capturing/capture here and below
Alpha Left Google 2014/04/25 23:33:23 Done.
+ // video capturing if |succeeded| is true.
+ void OnInitialized(bool succeeded);
+
+ // Called when video capturing has started successfully.
+ void OnStarted();
+
+ // Called when video capturing has stopped. There will be no more
+ // frame delivered.
bbudge 2014/04/25 23:18:58 s/frame/frames
Alpha Left Google 2014/04/25 23:33:23 Done.
+ void OnStopped();
+
+ // Called when video capturing has paused.
+ void OnPaused();
+
+ // Called when video capturing cannot be start because of an error.
bbudge 2014/04/25 23:18:58 s/start/started Is this comment true? It seems li
Alpha Left Google 2014/04/25 23:33:23 Realistically error only happens during start.
Alpha Left Google 2014/04/25 23:33:23 Done.
+ void OnError();
- // media::VideoCapture::EventHandler
- 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 OnFrameReady(media::VideoCapture* capture,
- const scoped_refptr<media::VideoFrame>& frame)
- OVERRIDE;
+ // Called when a video frame is ready.
+ void OnFrameReady(const scoped_refptr<media::VideoFrame>& frame,
+ media::VideoCaptureFormat format);
private:
int32_t OnOpen(ppapi::host::HostMessageContext* context,
@@ -72,7 +87,7 @@ class PepperVideoCaptureHost : public ppapi::host::ResourceHost,
bool SetStatus(PP_VideoCaptureStatus_Dev status, bool forced);
- scoped_refptr<PepperPlatformVideoCapture> platform_video_capture_;
+ scoped_ptr<PepperPlatformVideoCapture> platform_video_capture_;
// Buffers of video frame.
struct BufferInfo {

Powered by Google App Engine
This is Rietveld 408576698