Index: content/common/media/encoded_video_source_messages.h |
diff --git a/content/common/media/encoded_video_source_messages.h b/content/common/media/encoded_video_source_messages.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dea50256613b1039a7ec5cc8171e28bc69998241 |
--- /dev/null |
+++ b/content/common/media/encoded_video_source_messages.h |
@@ -0,0 +1,136 @@ |
+// 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/encoded_video_source.h" |
+#include "media/video/video_encode_types.h" |
+ |
+#undef IPC_MESSAGE_EXPORT |
+#define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
+#define IPC_MESSAGE_START EncodedVideoSourceMsgStart |
+ |
+#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(average_bitrate) |
+ IPC_STRUCT_TRAITS_MEMBER(max_bitrate) |
+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(frames_per_second) |
+ 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() |
+ |
+// Need to typedef BitstreamBufferMap in order to prevent the IPC message macros |
+// from choking on the comma. |
+typedef std::map<int, base::SharedMemoryHandle> BitstreamBufferMap; |
+ |
+// Message from Renderer to Browser process to query the encoding capability |
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
Please mimic gpu_messages.h where all the messages
hshi1
2013/06/10 19:12:31
Done.
|
+// for the device. A successful request results in |
+// EncoderVideoSourceMessage_CapabilityAvailable message. |
+IPC_MESSAGE_CONTROL1(EncodedVideoSourceHostMsg_GetCapability, |
+ int /* device_id */) |
+ |
+// Message from Renderer to Browser process to create a bitstream with specific |
+// parameters. A successful request results in beginning of streaming and |
+// EncoderVideoSourceMsg_BitstreamCreated message to Renderer. A failed request |
+// triggers EncodedVideoSourceMsg_BitstreamDestroyed 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. Renderer is responsible for generating unique stream_id within |
+// its context that will be used to identify bitstreams in IPC. |
+IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_CreateBitstream, |
+ int /* device_id */, |
+ int /* stream_id */, |
+ media::VideoEncodingParameters /* params */) |
+ |
+// Message from Renderer to Browser process to stop streaming a bitstream. When |
+// Browser has finalized the bitstream it will trigger |
+// EncodedVideoSourceMsg_BitstreamDestroyed message back from Browser to |
+// Renderer. Renderer must be prepared to receive |
+// EncodedVideoSourceMsg_BitstreamReady messages until it has received the |
+// EncodedVideoSourceMsg_BitstreamDestroyed message. |
+IPC_MESSAGE_CONTROL2(EncodedVideoSourceHostMsg_DestroyBitstream, |
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
"Destroy" or "Close"? Please ensure that the IPC
hshi1
2013/06/10 19:12:31
Done. I'm unifying the names - use "Open" to repla
|
+ int /* device_id */, |
+ int /* stream_id */) |
+ |
+// Message from Renderer to Browser process to set a stream's bitstream config. |
+// Will always result in EncodedVideoSourceMsg_BitstreamConfigChanged containing |
+// currently active parameters, regardless of whether this call succeeded or |
+// not. |
+IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_TryConfigureBitstream, |
+ int /* device_id */, |
+ int /* stream_id */, |
+ media::RuntimeVideoEncodingParameters /* params */) |
+ |
+// Message from Renderer to Browser process to tell that the data within a |
+// buffer has been processed and it can be reused to encode upcoming bitstream. |
+IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_BitstreamBufferConsumed, |
+ int /* device_id */, |
+ int /* stream_id */, |
+ int /* buffer_id */) |
+ |
+// Message from Browser to Renderer process to report the encoding capability |
+// of the device. |
+IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_CapabilityAvailable, |
+ int /* device id */, |
+ media::VideoEncodingCapability /* capability */) |
+ |
+// Message from Browser to Renderer process to acknowledge a request to create |
+// an encoded video bitstream. When this message occurs bitstream can be |
+// considered to be streaming and Renderer should be ready to start accepting |
+// EncodedVideoSourceMsg_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. |
+IPC_MESSAGE_CONTROL4(EncodedVideoSourceMsg_BitstreamCreated, |
+ int /* device id */, |
+ int /* stream id */, |
+ media::VideoEncodingParameters /* params */, |
+ BitstreamBufferMap /* buffers */) |
+ |
+// Message from Browser to Renderer process to acknowledge a request to destroy |
+// an encoded video bitstream. |
+IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_BitstreamDestroyed, |
+ int /* device id */, |
+ int /* stream id */) |
+ |
+// Message from Browser to Renderer process to inform the clients of the current |
+// encoding parameters, regardless of whether the previous request to change |
+// them has been successful or not. This is called usually as a response to |
+// EncodedVideoSourceHostMsg_TryConfigureBitstream during 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_CONTROL3(EncodedVideoSourceMsg_BitstreamConfigChanged, |
+ int /* device id */, |
+ int /* stream id */, |
+ media::RuntimeVideoEncodingParameters /* current_params */) |
+ |
+// Message from Browser to Renderer process indicating that a bitstream buffer |
+// is available for the stream. The value of |size| indicates the amount of |
+// valid bitstream data (in bytes). |
+IPC_MESSAGE_CONTROL5(EncodedVideoSourceMsg_BitstreamReady, |
+ int /* device id */, |
+ int /* stream_id */, |
+ int /* buffer_id */, |
+ size_t /* size */, |
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
"size_t" is verboten in IPC - use an explicitly-si
hshi1
2013/06/10 19:12:31
Done.
|
+ media::BufferEncodingMetadata /* metadata */) |