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

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

Issue 848863002: PPAPI: implement GetSupportedPreviewSizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split ImageCapture_Config to 881743005 Created 5 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: content/renderer/pepper/pepper_image_capture_host.h
diff --git a/content/renderer/pepper/pepper_image_capture_host.h b/content/renderer/pepper/pepper_image_capture_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..f588986e594aaf4dde5bddfba6fd2cf35d641c1e
--- /dev/null
+++ b/content/renderer/pepper/pepper_image_capture_host.h
@@ -0,0 +1,73 @@
+// 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.
+
+#ifndef CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_
+
+#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/ppb_buffer_impl.h"
+#include "media/video/capture/video_capture_types.h"
+#include "ppapi/c/pp_size.h"
+#include "ppapi/host/host_message_context.h"
+#include "ppapi/host/resource_host.h"
+
+namespace content {
+class PepperPlatformImageCapture;
+class RendererPpapiHostImpl;
+
+class PepperImageCaptureHost : public ppapi::host::ResourceHost {
+ public:
+ PepperImageCaptureHost(RendererPpapiHostImpl* host,
+ PP_Instance instance,
+ PP_Resource resource);
+
+ ~PepperImageCaptureHost() override;
+
+ bool Init();
+
+ int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) override;
+
+ // These methods are called by PepperPlatformImageCapture only.
+
+ // Called when image capture is initialized. We can start
+ // image capture if |succeeded| is true.
+ void OnInitialized(bool succeeded);
+
+ // Called when the preview frame sizes are enumerated.
+ void OnPlatformPreviewSizesEnumerated(const std::vector<PP_Size>& sizes);
+
+ private:
+ // Plugin -> host message handlers.
+
+ int32_t OnOpen(ppapi::host::HostMessageContext* context,
+ const std::string& device_id);
+ int32_t OnClose(ppapi::host::HostMessageContext* context);
+ int32_t OnGetPreviewSizes(ppapi::host::HostMessageContext* context);
+
+ // Utility methods.
+
+ int32_t Close();
+
+ void DetachPlatformImageCapture();
+
+ scoped_ptr<PepperPlatformImageCapture> platform_image_capture_;
+
+ RendererPpapiHostImpl* renderer_ppapi_host_;
+
+ ppapi::host::ReplyMessageContext open_reply_context_;
+
+ ppapi::host::ReplyMessageContext preview_sizes_reply_context_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperImageCaptureHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_IMAGE_CAPTURE_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698