 Chromium Code Reviews
 Chromium Code Reviews Issue 15906019:
  Hook up EncodedVideoSource on the browser side  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@screencast_cl_6
    
  
    Issue 15906019:
  Hook up EncodedVideoSource on the browser side  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@screencast_cl_6| 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..5731003ed0739903927f2d756a6001b2a2cfcd83 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(). | 
| 
Ami GONE FROM CHROMIUM
2013/06/18 18:35:55
TODO to drop this & point to EVS->VEA crbug?
 
sheu
2013/08/22 22:40:31
Done.
 | 
| + 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::VideoEncodingCapabilities GetEncodingCapabilities() = 0; | 
| + | 
| + // Attempts to configure the encoded bitstream output of this device, if any. | 
| + virtual void TryConfigureEncodedBitstream( | 
| + const media::RuntimeVideoEncodingParameters& params) = 0; | 
| 
Ami GONE FROM CHROMIUM
2013/06/18 18:35:55
I think the majority of files & lines in this CL w
 
sheu
2013/08/22 22:40:31
I thought we tried to keep interfaces pure virtual
 | 
| + | 
| // 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. |