| Index: content/browser/renderer_host/media/video_capture_host.h
|
| diff --git a/content/browser/renderer_host/media/video_capture_host.h b/content/browser/renderer_host/media/video_capture_host.h
|
| index 581ae885816965ef65e01dd55757b1a53f4be072..d6ddb1955fb5fc0a851ce4b2442f05058654ec0c 100644
|
| --- a/content/browser/renderer_host/media/video_capture_host.h
|
| +++ b/content/browser/renderer_host/media/video_capture_host.h
|
| @@ -37,6 +37,7 @@
|
| #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_
|
|
|
| #include <map>
|
| +#include <vector>
|
|
|
| #include "base/memory/ref_counted.h"
|
| #include "base/sequenced_task_runner_helpers.h"
|
| @@ -44,6 +45,14 @@
|
| #include "content/common/content_export.h"
|
| #include "content/public/browser/browser_message_filter.h"
|
| #include "ipc/ipc_message.h"
|
| +#include "media/video/capture/video_capture_types.h"
|
| +
|
| +namespace media {
|
| +
|
| +struct RuntimeVideoEncodingParameters;
|
| +struct VideoEncodingParameters;
|
| +
|
| +} // namespace media
|
|
|
| namespace content {
|
|
|
| @@ -61,16 +70,23 @@ class CONTENT_EXPORT VideoCaptureHost
|
|
|
| // VideoCaptureControllerEventHandler implementation.
|
| virtual void OnError(const VideoCaptureControllerID& id) OVERRIDE;
|
| - virtual void OnBufferCreated(const VideoCaptureControllerID& id,
|
| - base::SharedMemoryHandle handle,
|
| - int length, int buffer_id) OVERRIDE;
|
| virtual void OnBufferReady(const VideoCaptureControllerID& id,
|
| int buffer_id,
|
| - base::Time timestamp) OVERRIDE;
|
| + size_t data_size,
|
| + base::Time timestamp,
|
| + bool key_frame) OVERRIDE;
|
| virtual void OnFrameInfo(const VideoCaptureControllerID& id,
|
| - int width,
|
| - int height,
|
| - int frame_per_second) OVERRIDE;
|
| + const media::VideoCaptureParams& params,
|
| + const std::vector<base::SharedMemoryHandle>& buffers,
|
| + size_t buffer_size) OVERRIDE;
|
| + virtual void OnEncodedFrameInfo(
|
| + const VideoCaptureControllerID& id,
|
| + const media::VideoEncodingParameters& params,
|
| + const std::vector<base::SharedMemoryHandle>& buffers,
|
| + size_t buffer_size) OVERRIDE;
|
| + virtual void OnBitstreamConfigChanged(
|
| + const VideoCaptureControllerID& id,
|
| + const media::RuntimeVideoEncodingParameters& params) OVERRIDE;
|
| virtual void OnEnded(const VideoCaptureControllerID& id) OVERRIDE;
|
|
|
| private:
|
| @@ -83,8 +99,8 @@ class CONTENT_EXPORT VideoCaptureHost
|
|
|
| // IPC message: Start capture on the VideoCaptureDevice referenced by
|
| // VideoCaptureParams::session_id. |device_id| is an id created by
|
| - // VideoCaptureMessageFilter to identify a session
|
| - // between a VideoCaptureMessageFilter and a VideoCaptureHost.
|
| + // VideoCaptureMessageFilter to identify a session between a
|
| + // VideoCaptureMessageFilter and a VideoCaptureHost.
|
| void OnStartCapture(int device_id,
|
| const media::VideoCaptureParams& params);
|
| void OnControllerAdded(
|
| @@ -104,6 +120,38 @@ class CONTENT_EXPORT VideoCaptureHost
|
| // referenced by |device_id|.
|
| void OnReceiveEmptyBuffer(int device_id, int buffer_id);
|
|
|
| + // IPC message: Request the encoding capabilities for the capture session
|
| + // referenced by |session_id|.
|
| + void OnGetCapability(int device_id,
|
| + const media::VideoCaptureSessionId& session_id);
|
| + void OnEncodingCapabilityFound(
|
| + int device_id,
|
| + const media::VideoEncodingCapability& capability);
|
| + void DoEncodingCapabilityFoundOnIOThread(
|
| + int device_id,
|
| + const media::VideoEncodingCapability& capability);
|
| +
|
| + // IPC message: Start the encoded bitstream on the VideoCaptureDevice
|
| + // referenced by |session_id|. |device_id| is an id created y
|
| + // VideoCaptureMessageFilter to identify a session between a
|
| + // VideoCaptureMessageFilter and a VideoCaptureHost.
|
| + void OnCreateBitstream(int device_id,
|
| + const media::VideoCaptureSessionId& session_id,
|
| + const media::VideoEncodingParameters& params);
|
| +
|
| + // IPC message: Stop capture on device referenced by |device_id|.
|
| + void OnDestroyBitstream(int device_id);
|
| +
|
| + // IPC message: Attempt to configure the encoded bitstream output from the
|
| + // device referenced by |device_id|.
|
| + void OnTryConfigureBitstream(
|
| + int device_id,
|
| + const media::RuntimeVideoEncodingParameters& params);
|
| +
|
| + // IPC message: Receive an empty buffer from renderer. Send it to device
|
| + // referenced by |device_id|.
|
| + void OnBitstreamBufferConsumed(int device_id, int buffer_id);
|
| +
|
| // Send a newly created buffer to the VideoCaptureMessageFilter.
|
| void DoSendNewBufferOnIOThread(
|
| const VideoCaptureControllerID& controller_id,
|
| @@ -115,21 +163,32 @@ class CONTENT_EXPORT VideoCaptureHost
|
| void DoSendFilledBufferOnIOThread(
|
| const VideoCaptureControllerID& controller_id,
|
| int buffer_id,
|
| - base::Time timestamp);
|
| + size_t size,
|
| + base::Time timestamp,
|
| + bool key_frame);
|
| +
|
| + // Handle error coming from VideoCaptureDevice.
|
| + void DoHandleErrorOnIOThread(const VideoCaptureControllerID& controller_id);
|
|
|
| // Send information about frame resolution and frame rate
|
| // to the VideoCaptureMessageFilter.
|
| void DoSendFrameInfoOnIOThread(
|
| const VideoCaptureControllerID& controller_id,
|
| - int width,
|
| - int height,
|
| - int frame_per_second);
|
| -
|
| - // Handle error coming from VideoCaptureDevice.
|
| - void DoHandleErrorOnIOThread(const VideoCaptureControllerID& controller_id);
|
| + const media::VideoCaptureParams& params,
|
| + const std::vector<base::SharedMemoryHandle>& buffers,
|
| + size_t buffer_size);
|
| + void DoSendEncodedFrameInfoOnIOThread(
|
| + const VideoCaptureControllerID& controller_id,
|
| + const media::VideoEncodingParameters& params,
|
| + const std::vector<base::SharedMemoryHandle>& buffers,
|
| + size_t buffer_size);
|
|
|
| void DoEndedOnIOThread(const VideoCaptureControllerID& controller_id);
|
|
|
| + void DoBitstreamConfigChangedOnIOThread(
|
| + const VideoCaptureControllerID& controller_id,
|
| + const media::RuntimeVideoEncodingParameters& params);
|
| +
|
| void DeleteVideoCaptureControllerOnIOThread(
|
| const VideoCaptureControllerID& controller_id);
|
|
|
|
|