Chromium Code Reviews| Index: media/video/capture/video_capture_device.h |
| diff --git a/media/video/capture/video_capture_device.h b/media/video/capture/video_capture_device.h |
| index 382dad6cdc461d7d6d20bf04ab8e7e91693ae503..e09c10f727d9e6cb544dc5278da8ab01ae016198 100644 |
| --- a/media/video/capture/video_capture_device.h |
| +++ b/media/video/capture/video_capture_device.h |
| @@ -216,6 +216,33 @@ class MEDIA_EXPORT VideoCaptureDevice { |
| // VideoCaptureDevice requests the |message| to be logged. |
| virtual void OnLog(const std::string& message) {} |
| + |
| + // The video stream has been muted. After this callback, no more |
| + // OnIncomingCapturedData() will be called. This may happen when |
| + // CaptureImage() is being called. After the still image has been |
|
wuchengli
2014/09/11 08:50:05
s/is being/has/
80 char alignment. Run git cl for
Owen Lin
2014/09/12 09:07:55
I think git cl won't help us on comment.
|
| + // captured, the video stream will be resumed and the client would be |
|
wuchengli
2014/09/11 08:50:05
Remove the extra space. I think the order should b
Owen Lin
2014/09/12 09:07:55
Done. Thanks.
|
| + // notified by OnUnmute(). |
| + virtual void OnMute() {} |
| + |
| + // The video stream has resumed. |
| + virtual void OnUnmute() {} |
| + }; |
| + |
| + class MEDIA_EXPORT ImageClient { |
| + public: |
| + virtual ~ImageClient() {} |
| + |
| + // Callback function to notify the client the caputred image is available. |
| + virtual void OnIncomingCapturedData(const uint8* data, |
| + int length, |
| + const ImageCaptureFormat& format, |
| + int rotation, |
| + base::TimeTicks timestamp) = 0; |
| + |
| + // Callback function to notify client the failure of the image capturing. |
| + // The VideoCaptureDevice must be StopAndDeAllocate()-ed. |reason| is a |
| + // text description of the error. |
| + virtual void OnError(const std::string& reason) = 0; |
| }; |
| // Creates a VideoCaptureDevice object. |
| @@ -235,6 +262,12 @@ class MEDIA_EXPORT VideoCaptureDevice { |
| static void GetDeviceSupportedFormats(const Name& device, |
| VideoCaptureFormats* supported_formats); |
| + // Gets the supported formats for still image of a particular device attached |
| + // to the system. |
| + static void GetDeviceSupportedImageFormats( |
|
wuchengli
2014/09/11 08:50:05
Does this compile? You need to implement it somewh
Owen Lin
2014/09/12 09:07:55
Yes. It compiles. I don't need if no one use it.
|
| + const Name& device, |
| + ImageCaptureFormats* supported_formats); |
| + |
| // Prepares the camera for use. After this function has been called no other |
| // applications can use the camera. StopAndDeAllocate() must be called before |
| // the object is deleted. |
| @@ -258,6 +291,26 @@ class MEDIA_EXPORT VideoCaptureDevice { |
| // defined, otherwise returns 0. |
| int GetPowerLineFrequencyForLocation() const; |
| + // Initializes the device for still image capture for the given image format. |
| + // This function must be called between AllocateAndStart() and |
| + // StopAndDeAllocate(). |
| + virtual void InitializeImageCapture(const ImageCaptureFormat& image_format, |
| + scoped_ptr<ImageClient> client) {} |
| + |
| + // Releases resources for image capture. The ImageClient passed from |
| + // InitializeImageCapture would be freed. This method must be called between |
| + // InitializeImageCapture() and StopAndDeAllocate(). |
| + virtual void CloseImageCapture() {} |
|
wuchengli
2014/09/11 08:50:05
s/CloseImageCapture/ReleaseImageCapture/. Close sh
Owen Lin
2014/09/12 09:07:55
Sure. However, I remember this is the name you sug
|
| + |
| + // Gets one image from the device asynchronously. It will return the image |
|
wuchengli
2014/09/11 08:50:05
More readable to put a blank line after "asynchron
|
| + // by the ImageClient::OnIncomingCapturedData() callback. |
| + // If the video stream has to be stopped to capture the still image, the |
| + // Client::OnMute() and Client::OnUnmute() will be called. |
|
wuchengli
2014/09/11 08:50:05
s/Client/ImageClient/
Owen Lin
2014/09/12 09:07:55
It's Client. The callback is go to the client of t
|
| + // |
| + // This function must be called between InitializeImageCapture() and |
| + // CloseImageCapture(). |
| + virtual void CaptureImage() {} |
| + |
| protected: |
| static const int kPowerLine50Hz = 50; |
| static const int kPowerLine60Hz = 60; |