| 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 9177302a92f9528d60da6b6c999c12b5f2b0b4f0..687cbde86597f1ec8af013d702d6f26799020c30 100644
|
| --- a/media/video/capture/video_capture_device.h
|
| +++ b/media/video/capture/video_capture_device.h
|
| @@ -18,9 +18,12 @@
|
| #include "base/time.h"
|
| #include "media/base/media_export.h"
|
| #include "media/video/capture/video_capture_types.h"
|
| +#include "media/video/video_encode_types.h"
|
|
|
| namespace media {
|
|
|
| +class EncodedBitstreamBuffer;
|
| +
|
| class MEDIA_EXPORT VideoCaptureDevice {
|
| public:
|
|
|
| @@ -37,7 +40,7 @@ class MEDIA_EXPORT VideoCaptureDevice {
|
| class MEDIA_EXPORT EventHandler {
|
| public:
|
|
|
| - // Reserve an output buffer into which a video frame can be captured
|
| + // Reserve an output VideoFrame into which a video frame can be captured
|
| // directly. If all buffers are currently busy, returns NULL.
|
| //
|
| // The returned VideoFrames will always be allocated with a YV12 format. The
|
| @@ -45,9 +48,9 @@ class MEDIA_EXPORT VideoCaptureDevice {
|
| // the VideoCaptureDevice's responsibility to obey whatever stride and
|
| // memory layout are indicated on the returned VideoFrame object.
|
| //
|
| - // The output buffer stays reserved for use by the calling
|
| + // The output frame stays reserved for use by the calling
|
| // VideoCaptureDevice until either the last reference to the VideoFrame is
|
| - // released, or until the buffer is passed back to the EventHandler's
|
| + // released, or until the frame is passed back to the EventHandler's
|
| // OnIncomingCapturedFrame() method.
|
| //
|
| // Threading note: After VideoCaptureDevice::DeAllocate() occurs, the
|
| @@ -56,7 +59,14 @@ class MEDIA_EXPORT VideoCaptureDevice {
|
| // DO remain valid after DeAllocate(). The VideoCaptureDevice must still
|
| // eventually release them, but it may do so later -- e.g., after a queued
|
| // capture operation completes.
|
| - virtual scoped_refptr<media::VideoFrame> ReserveOutputBuffer() = 0;
|
| + virtual scoped_refptr<media::VideoFrame> ReserveOutputVideoFrame() = 0;
|
| +
|
| + // Reserve an output EncodedBitstreamBuffer into which an encoded video
|
| + // frame can be captured directly. If all buffers are currently busy,
|
| + // returns NULL. Semantics for reservation and threading are same as with
|
| + // ReserveOutputVideoFrame().
|
| + virtual scoped_refptr<media::EncodedBitstreamBuffer>
|
| + ReserveOutputEncodedBitstreamBuffer() = 0;
|
|
|
| // Captured a new video frame as a raw buffer. The size, color format, and
|
| // layout are taken from the parameters specified by an earlier call to
|
| @@ -92,14 +102,29 @@ class MEDIA_EXPORT VideoCaptureDevice {
|
| const scoped_refptr<media::VideoFrame>& frame,
|
| base::Time timestamp) = 0;
|
|
|
| + virtual void OnIncomingCapturedEncodedBitstreamBuffer(
|
| + const scoped_refptr<media::EncodedBitstreamBuffer>& buffer,
|
| + size_t data_size,
|
| + base::Time timestamp) = 0;
|
| +
|
| // An error has occurred that cannot be handled and VideoCaptureDevice must
|
| // be DeAllocate()-ed.
|
| virtual void OnError() = 0;
|
|
|
| // Called when VideoCaptureDevice::Allocate() has been called to inform of
|
| - // the resulting frame size.
|
| + // the resulting frame size, for unencoded capture.
|
| virtual void OnFrameInfo(const VideoCaptureCapability& info) = 0;
|
|
|
| + // As above, but for encoded capture.
|
| + virtual void OnEncodedFrameInfo(
|
| + const media::VideoEncodingParameters& info) = 0;
|
| +
|
| + // Called when the EncodedVideoBitstream's encoding parameters has changed
|
| + // during runtime, to inform client of new parameters. Valid only for
|
| + // capture devices exporting an EncodedVideoBitstream.
|
| + virtual void OnBitstreamConfigChanged(
|
| + const media::RuntimeVideoEncodingParameters& parameters) = 0;
|
| +
|
| protected:
|
| virtual ~EventHandler() {}
|
| };
|
| @@ -111,6 +136,13 @@ class MEDIA_EXPORT VideoCaptureDevice {
|
| // Gets the names of all video capture devices connected to this computer.
|
| static void GetDeviceNames(Names* device_names);
|
|
|
| + // Gets the encoding capablities of this capture device, if any.
|
| + virtual media::VideoEncodingCapability GetEncodingCapability() = 0;
|
| +
|
| + // Attempts to configure the encoded bitstream output of this device, if any.
|
| + virtual void TryConfigureEncodedBitstream(
|
| + const media::RuntimeVideoEncodingParameters& params) = 0;
|
| +
|
| // Prepare the camera for use. After this function has been called no other
|
| // applications can use the camera. On completion EventHandler::OnFrameInfo()
|
| // is called informing of the resulting resolution and frame rate.
|
|
|