Commit 79f43439 authored by mcasas's avatar mcasas Committed by Commit bot

Revert: Issue 545053002: Add still image capture interface for VideoCaptureDevice.

These parts are not used ATM, this CL removes them until further notice.

> Add still image capture interface for VideoCaptureDevice.
>
> BUG=413086
> TEST=Run the media_unittests on peach_pit.
>
> Committed: https://crrev.com/fd5bdd2688768683e30b27941f181597a849656d
> Cr-Commit-Position: refs/heads/master@{#298009}

TBR=posciak@chromium.org, perkj@chromium.org, tommi@chromium.org

BUG=413086, 440843

Review URL: https://codereview.chromium.org/921683004

Cr-Commit-Position: refs/heads/master@{#318183}
parent e1fd5037
......@@ -101,13 +101,4 @@ std::string VideoCaptureFormat::PixelFormatToString(VideoPixelFormat format) {
VideoCaptureParams::VideoCaptureParams()
: resolution_change_policy(RESOLUTION_POLICY_FIXED) {}
ImageCaptureFormat::ImageCaptureFormat() : pixel_format(PIXEL_FORMAT_UNKNOWN) {
}
ImageCaptureFormat::ImageCaptureFormat(const gfx::Size& frame_size,
VideoPixelFormat pixel_format)
: frame_size(frame_size), pixel_format(pixel_format) {
}
} // namespace media
......@@ -80,25 +80,8 @@ class MEDIA_EXPORT VideoCaptureFormat {
VideoPixelFormat pixel_format;
};
// Image capture format specification.
// This class is used by the video capture device to specify the format of a
// still image captured and returned to a client. A list of these is also
// provided when client queries supported formats for still image capture.
class MEDIA_EXPORT ImageCaptureFormat {
public:
ImageCaptureFormat();
ImageCaptureFormat(const gfx::Size& frame_size,
VideoPixelFormat pixel_format);
gfx::Size frame_size;
VideoPixelFormat pixel_format;
};
typedef std::vector<VideoCaptureFormat> VideoCaptureFormats;
typedef std::vector<ImageCaptureFormat> ImageCaptureFormats;
// Parameters for starting video capture.
// This class is used by the client of a video capture device to specify the
// format of frames in which the client would like to have captured frames
......
......@@ -109,10 +109,4 @@ int VideoCaptureDevice::GetPowerLineFrequencyForLocation() const {
return kPowerLine60Hz;
}
bool VideoCaptureDevice::InitializeImageCapture(
const ImageCaptureFormat& image_format,
scoped_ptr<ImageClient> client) {
return false;
}
} // namespace media
......@@ -229,41 +229,6 @@ 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() has called. After the still image captured, the client
// will get notified by OnUnmute() and the video stream will be resumed.
virtual void OnMute() {}
// The video stream has resumed.
virtual void OnUnmute() {}
};
// Interface for clients that use VideoCaptureDevice for taking still images.
class MEDIA_EXPORT ImageClient {
public:
virtual ~ImageClient() {}
// Callback function to notify the client a captured image is available.
//
// The captured still image is stored at address |data| and is of |length|
// bytes. The format of the frame is described by |format|, and is assumed
// to be tightly packed. The still image should be rotated |rotation|
// degrees clockwise for viewing.
//
// Note that the content in |data| will not be valid after this callback
// returns. Copy the content to use it later.
virtual void OnIncomingCapturedData(const uint8* data,
size_t length,
const ImageCaptureFormat& format,
int rotation,
base::TimeTicks timestamp) = 0;
// Callback function to notify the client about a failure of the image
// capture. The VideoCaptureDevice must be StopAndDeAllocate()-ed.
// |reason| contains a text description of the error.
virtual void OnError(const std::string& reason) = 0;
};
virtual ~VideoCaptureDevice();
......@@ -291,32 +256,6 @@ class MEDIA_EXPORT VideoCaptureDevice {
// defined, otherwise returns 0.
int GetPowerLineFrequencyForLocation() const;
// Initializes the device for still image capture for the given image format.
// This call is synchronous and returns true iff the initialization is
// successful.
//
// This function must be called between AllocateAndStart() and
// StopAndDeAllocate().
virtual bool InitializeImageCapture(const ImageCaptureFormat& image_format,
scoped_ptr<ImageClient> client);
// Releases resources for image capture.
//
// The ImageClient passed from InitializeImageCapture will be freed. This
// method must be called between InitializeImageCapture() and
// StopAndDeAllocate().
virtual void ReleaseImageCapture() {}
// Requests one image from the device.
//
// The image will be returned via 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.
//
// This function must be called between InitializeImageCapture() and
// ReleaseImageCapture().
virtual void CaptureImage() {}
protected:
static const int kPowerLine50Hz = 50;
static const int kPowerLine60Hz = 60;
......
......@@ -38,13 +38,6 @@ class MEDIA_EXPORT VideoCaptureDeviceFactory {
const VideoCaptureDevice::Name& device,
VideoCaptureFormats* supported_formats) = 0;
// Gets the supported formats for still image of a particular device attached
// to the system. In case format enumeration is not supported, or there was
// a problem, the formats array will be empty.
virtual void GetDeviceSupportedImageFormats(
const VideoCaptureDevice::Name& device,
ImageCaptureFormats* supported_formats) {}
protected:
// Gets the names of all video capture devices connected to this computer.
// Used by the default implementation of EnumerateDeviceNames().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment