Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1962)

Unified Diff: content/common/media/encoded_video_capture_messages.h

Issue 16320005: Define EncodedVideoSource and RtcCapturedEncodingVideoCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename encoded_video_source_messages to encoded_video_capture_messages. Add buffer_size in OnOpened… Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/media/encoded_video_capture_messages.h
diff --git a/content/common/media/encoded_video_capture_messages.h b/content/common/media/encoded_video_capture_messages.h
new file mode 100644
index 0000000000000000000000000000000000000000..00f195984be4bc4e81d89a1e20f2718dd3b8639a
--- /dev/null
+++ b/content/common/media/encoded_video_capture_messages.h
@@ -0,0 +1,124 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ipc/ipc_message_macros.h"
+#include "media/video/capture/video_capture_types.h"
+#include "media/video/video_encode_types.h"
+
+#undef IPC_MESSAGE_EXPORT
+#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
+#define IPC_MESSAGE_START EncodedVideoCaptureMsgStart
+
+#if !defined(OS_ANDROID)
+IPC_ENUM_TRAITS(media::VideoCodec)
+#endif // !defined(OS_ANDROID)
+
+IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingConfig)
+ IPC_STRUCT_TRAITS_MEMBER(codec_type)
+ IPC_STRUCT_TRAITS_MEMBER(codec_name)
+ IPC_STRUCT_TRAITS_MEMBER(max_resolution)
+ IPC_STRUCT_TRAITS_MEMBER(max_frames_per_second)
+ IPC_STRUCT_TRAITS_MEMBER(max_bitrate)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(media::RuntimeVideoEncodingParameters)
+ IPC_STRUCT_TRAITS_MEMBER(target_bitrate)
+ IPC_STRUCT_TRAITS_MEMBER(max_bitrate)
+ IPC_STRUCT_TRAITS_MEMBER(frames_per_second)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingParameters)
+ IPC_STRUCT_TRAITS_MEMBER(codec_name)
+ IPC_STRUCT_TRAITS_MEMBER(resolution)
+ IPC_STRUCT_TRAITS_MEMBER(runtime_params)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(media::BufferEncodingMetadata)
+ IPC_STRUCT_TRAITS_MEMBER(timestamp)
+ IPC_STRUCT_TRAITS_MEMBER(key_frame)
+IPC_STRUCT_TRAITS_END()
+
+//------------------------------------------------------------------------------
+// Renderer Source Messages
+// These are messages from the Renderer to the Browser process.
+
+// Queries the encoding capabilities for the device. A successful request
+// results in EncoderVideoSourceMessage_CapabilitiesAvailable message.
+IPC_MESSAGE_CONTROL1(EncodedVideoCaptureHostMsg_GetCapabilities,
+ int /* device_id */)
+
+// Opens a bitstream with specific parameters. A successful request results in
+// beginning of streaming and EncoderVideoSourceMsg_BitstreamOpened message.
+// A failed request triggers EncodedVideoCaptureMsg_BitstreamClosed message. As
+// this set of messages is designed to work with existing device, device_id is
+// determined on the basis which device is providing the encoded video source
+// functionality. Only one bitstream can be opened for a given device.
+IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_OpenBitstream,
+ int /* device_id */,
+ media::VideoEncodingParameters /* params */)
+
+// Stops streaming a bitstream. When Browser has finalized the bitstream it will
+// trigger EncodedVideoCaptureMsg_BitstreamClosed message back to Renderer.
+// Renderer must be prepared to receive EncodedVideoCaptureMsg_BitstreamReady
+// messages until it receives EncodedVideoCaptureMsg_BitstreamClosed message.
+IPC_MESSAGE_CONTROL1(EncodedVideoCaptureHostMsg_CloseBitstream,
+ int /* device_id */)
+
+// Sets a stream's bitstream configuration. Will always result in
+// EncodedVideoCaptureMsg_BitstreamConfigChanged message containing
+// currently active parameters, regardless of whether this call succeeded or
+// not.
+IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_TryConfigureBitstream,
+ int /* device_id */,
+ media::RuntimeVideoEncodingParameters /* params */)
+
+// Notifies that the data within a buffer has been processed and it can be
+// reused to encode upcoming bitstream.
+IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_BitstreamBufferConsumed,
+ int /* device_id */,
+ int /* buffer_id */)
+
+//------------------------------------------------------------------------------
+// Renderer Messages
+// These are messages from the Browser to the Renderer process.
+
+// Reports the encoding capabilities of the device.
+IPC_MESSAGE_CONTROL2(EncodedVideoCaptureMsg_CapabilitiesAvailable,
+ int /* device_id */,
+ media::VideoEncodingCapabilities /* capabilities */)
+
+// Acknowledges a request to open an encoded video bitstream. When this message
+// occurs, bitstream can be considered to be streaming, and Renderer should be
+// ready to start accepting EncodedVideoCaptureMsg_BitstreamReady messages and
+// buffers contained within them. Shared memory buffers used to deliver the
+// bitstream are assigned with buffer ids as specified by the buffers parameter.
+// All buffers have the same size as indicated by |buffer_size|.
+IPC_MESSAGE_CONTROL4(EncodedVideoCaptureMsg_BitstreamOpened,
+ int /* device_id */,
+ media::VideoEncodingParameters /* params */,
+ std::vector<base::SharedMemoryHandle> /* buffers */,
+ int /* buffer_size */)
+
+// Acknowledges a request to close an encoded video bitstream.
+IPC_MESSAGE_CONTROL1(EncodedVideoCaptureMsg_BitstreamClosed,
+ int /* device_id */)
+
+// Informs the clients of the current encoding parameters, regardless of whether
+// the previous request to change them has been successful or not. It is usually
+// called in response to EncodedVideoCaptureHostMsg_TryConfigureBitstream
+// at runtime, but can occur also as a result of config change initiated by
+// encoder or other clients in the system, e.g. if there are multiple clients
+// and bitstream config change is requested from one client, all clients should
+// be prepared to handle the configuration change.
+IPC_MESSAGE_CONTROL2(EncodedVideoCaptureMsg_BitstreamConfigChanged,
+ int /* device_id */,
+ media::RuntimeVideoEncodingParameters /* current_params */)
+
+// Indicates that a bitstream buffer is available for the stream. The value of
+// |size| indicates the amount of valid bitstream data (in bytes).
+IPC_MESSAGE_CONTROL4(EncodedVideoCaptureMsg_BitstreamReady,
+ int /* device_id */,
+ int /* buffer_id */,
+ int /* size */,
+ media::BufferEncodingMetadata /* metadata */)

Powered by Google App Engine
This is Rietveld 408576698