Chromium Code Reviews| 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..fbc3ce14581c179aec4c23fa272111209e33b67f |
| --- /dev/null |
| +++ b/content/renderer/pepper/pepper_image_capture_host.h |
| @@ -0,0 +1,77 @@ |
| +// 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 media { |
| +class VideoFrame; |
|
wuchengli
2015/01/19 14:05:02
Remove. Not used in this file.
Justin Chuang
2015/01/26 15:00:50
Done.
|
| +} // namespace media |
| + |
| +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 OnPlatformInitialized(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_ |