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

Side by Side Diff: content/renderer/pepper/pepper_platform_image_capture.h

Issue 848863002: PPAPI: implement GetSupportedPreviewSizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a compile error Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/threading/thread_checker.h" 15 #include "base/threading/thread_checker.h"
16 #include "base/time/time.h"
17 #include "content/common/media/video_capture.h" 16 #include "content/common/media/video_capture.h"
18 #include "media/video/capture/video_capture_types.h" 17 #include "media/video/capture/video_capture_types.h"
19 18
20 class GURL; 19 class GURL;
21 20
22 namespace content { 21 namespace content {
23 class PepperMediaDeviceManager; 22 class PepperMediaDeviceManager;
24 class PepperVideoCaptureHost; 23 class PepperImageCaptureHost;
25 24
26 // This object must only be used on the thread it's constructed on. 25 // This object must only be used on the thread it's constructed on.
27 class PepperPlatformVideoCapture { 26 class PepperPlatformImageCapture {
28 public: 27 public:
29 PepperPlatformVideoCapture(int render_frame_id, 28 PepperPlatformImageCapture(int render_frame_id,
30 const std::string& device_id, 29 const std::string& device_id,
31 const GURL& document_url, 30 const GURL& document_url,
32 PepperVideoCaptureHost* handler); 31 PepperImageCaptureHost* handler);
33 virtual ~PepperPlatformVideoCapture(); 32 virtual ~PepperPlatformImageCapture();
dmichael (off chromium) 2015/02/09 22:26:59 nit: Doesn't seem like this needs to be virtual
Justin Chuang 2015/02/10 16:01:02 Done. Thanks
34 33
35 // Detaches the event handler and stops sending notifications to it. 34 // Detaches the event handler and stops sending notifications to it.
36 void DetachEventHandler(); 35 void DetachEventHandler();
37 36
38 void StartCapture(const media::VideoCaptureParams& params); 37 void GetPreviewSizes();
39 void StopCapture();
40 38
41 private: 39 private:
42 void OnDeviceOpened(int request_id, bool succeeded, const std::string& label); 40 void OnDeviceOpened(int request_id, bool succeeded, const std::string& label);
43 void OnStateUpdate(VideoCaptureState state); 41
44 void OnFrameReady(const scoped_refptr<media::VideoFrame>& frame, 42 // Called by VideoCaptureImplManager.
45 const media::VideoCaptureFormat& format, 43 void OnDeviceSupportedFormatsEnumerated(
46 const base::TimeTicks& estimated_capture_time); 44 const media::VideoCaptureFormats& formats);
47 45
48 // Can return NULL if the RenderFrame referenced by |render_frame_id_| has 46 // Can return NULL if the RenderFrame referenced by |render_frame_id_| has
49 // gone away. 47 // gone away.
50 PepperMediaDeviceManager* GetMediaDeviceManager(); 48 PepperMediaDeviceManager* GetMediaDeviceManager();
51 49
52 const int render_frame_id_; 50 const int render_frame_id_;
53 const std::string device_id_; 51 const std::string device_id_;
54 52
55 std::string label_; 53 std::string label_;
56 int session_id_; 54 int session_id_;
57 base::Closure release_device_cb_; 55 base::Closure release_device_cb_;
58 base::Closure stop_capture_cb_;
59 56
60 PepperVideoCaptureHost* handler_; 57 PepperImageCaptureHost* handler_;
61 58
62 // Whether we have a pending request to open a device. We have to make sure 59 // Whether we have a pending request to open a device. We have to make sure
63 // there isn't any pending request before this object goes away. 60 // there isn't any pending request before this object goes away.
64 bool pending_open_device_; 61 bool pending_open_device_;
65 int pending_open_device_id_; 62 int pending_open_device_id_;
66 63
67 base::ThreadChecker thread_checker_; 64 base::ThreadChecker thread_checker_;
68 65
69 base::WeakPtrFactory<PepperPlatformVideoCapture> weak_factory_; 66 base::WeakPtrFactory<PepperPlatformImageCapture> weak_factory_;
70 67
71 DISALLOW_COPY_AND_ASSIGN(PepperPlatformVideoCapture); 68 DISALLOW_COPY_AND_ASSIGN(PepperPlatformImageCapture);
72 }; 69 };
73 70
74 } // namespace content 71 } // namespace content
75 72
76 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ 73 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698