Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ipc/ipc_message_macros.h" | |
| 6 #include "media/video/encoded_video_source.h" | |
| 7 #include "media/video/video_encode_types.h" | |
| 8 | |
| 9 #undef IPC_MESSAGE_EXPORT | |
| 10 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | |
| 11 #define IPC_MESSAGE_START EncodedVideoSourceMsgStart | |
| 12 | |
| 13 #if !defined(OS_ANDROID) | |
| 14 IPC_ENUM_TRAITS(media::VideoCodec) | |
| 15 #endif // !defined(OS_ANDROID) | |
| 16 | |
| 17 IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingConfig) | |
| 18 IPC_STRUCT_TRAITS_MEMBER(codec_type) | |
| 19 IPC_STRUCT_TRAITS_MEMBER(codec_name) | |
| 20 IPC_STRUCT_TRAITS_MEMBER(max_resolution) | |
| 21 IPC_STRUCT_TRAITS_MEMBER(max_frames_per_second) | |
| 22 IPC_STRUCT_TRAITS_MEMBER(max_bitrate) | |
| 23 IPC_STRUCT_TRAITS_END() | |
| 24 | |
| 25 IPC_STRUCT_TRAITS_BEGIN(media::RuntimeVideoEncodingParameters) | |
| 26 IPC_STRUCT_TRAITS_MEMBER(average_bitrate) | |
| 27 IPC_STRUCT_TRAITS_MEMBER(max_bitrate) | |
| 28 IPC_STRUCT_TRAITS_END() | |
| 29 | |
| 30 IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingParameters) | |
| 31 IPC_STRUCT_TRAITS_MEMBER(codec_name) | |
| 32 IPC_STRUCT_TRAITS_MEMBER(resolution) | |
| 33 IPC_STRUCT_TRAITS_MEMBER(frames_per_second) | |
| 34 IPC_STRUCT_TRAITS_MEMBER(runtime_params) | |
| 35 IPC_STRUCT_TRAITS_END() | |
| 36 | |
| 37 IPC_STRUCT_TRAITS_BEGIN(media::BufferEncodingMetadata) | |
| 38 IPC_STRUCT_TRAITS_MEMBER(timestamp) | |
| 39 IPC_STRUCT_TRAITS_MEMBER(key_frame) | |
| 40 IPC_STRUCT_TRAITS_END() | |
| 41 | |
| 42 // Need to typedef BitstreamBufferMap in order to prevent the IPC message macros | |
| 43 // from choking on the comma. | |
| 44 typedef std::map<int, base::SharedMemoryHandle> BitstreamBufferMap; | |
| 45 | |
| 46 // 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.
| |
| 47 // for the device. A successful request results in | |
| 48 // EncoderVideoSourceMessage_CapabilityAvailable message. | |
| 49 IPC_MESSAGE_CONTROL1(EncodedVideoSourceHostMsg_GetCapability, | |
| 50 int /* device_id */) | |
| 51 | |
| 52 // Message from Renderer to Browser process to create a bitstream with specific | |
| 53 // parameters. A successful request results in beginning of streaming and | |
| 54 // EncoderVideoSourceMsg_BitstreamCreated message to Renderer. A failed request | |
| 55 // triggers EncodedVideoSourceMsg_BitstreamDestroyed message. As this set of | |
| 56 // messages is designed to work with existing device, device_id is determined | |
| 57 // on the basis which device is providing the encoded video source | |
| 58 // functionality. Renderer is responsible for generating unique stream_id within | |
| 59 // its context that will be used to identify bitstreams in IPC. | |
| 60 IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_CreateBitstream, | |
| 61 int /* device_id */, | |
| 62 int /* stream_id */, | |
| 63 media::VideoEncodingParameters /* params */) | |
| 64 | |
| 65 // Message from Renderer to Browser process to stop streaming a bitstream. When | |
| 66 // Browser has finalized the bitstream it will trigger | |
| 67 // EncodedVideoSourceMsg_BitstreamDestroyed message back from Browser to | |
| 68 // Renderer. Renderer must be prepared to receive | |
| 69 // EncodedVideoSourceMsg_BitstreamReady messages until it has received the | |
| 70 // EncodedVideoSourceMsg_BitstreamDestroyed message. | |
| 71 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
| |
| 72 int /* device_id */, | |
| 73 int /* stream_id */) | |
| 74 | |
| 75 // Message from Renderer to Browser process to set a stream's bitstream config. | |
| 76 // Will always result in EncodedVideoSourceMsg_BitstreamConfigChanged containing | |
| 77 // currently active parameters, regardless of whether this call succeeded or | |
| 78 // not. | |
| 79 IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_TryConfigureBitstream, | |
| 80 int /* device_id */, | |
| 81 int /* stream_id */, | |
| 82 media::RuntimeVideoEncodingParameters /* params */) | |
| 83 | |
| 84 // Message from Renderer to Browser process to tell that the data within a | |
| 85 // buffer has been processed and it can be reused to encode upcoming bitstream. | |
| 86 IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_BitstreamBufferConsumed, | |
| 87 int /* device_id */, | |
| 88 int /* stream_id */, | |
| 89 int /* buffer_id */) | |
| 90 | |
| 91 // Message from Browser to Renderer process to report the encoding capability | |
| 92 // of the device. | |
| 93 IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_CapabilityAvailable, | |
| 94 int /* device id */, | |
| 95 media::VideoEncodingCapability /* capability */) | |
| 96 | |
| 97 // Message from Browser to Renderer process to acknowledge a request to create | |
| 98 // an encoded video bitstream. When this message occurs bitstream can be | |
| 99 // considered to be streaming and Renderer should be ready to start accepting | |
| 100 // EncodedVideoSourceMsg_BitstreamReady messages and buffers contained within | |
| 101 // them. Shared memory buffers used to deliver the bitstream are assigned with | |
| 102 // buffer ids as specified by the buffers parameter. | |
| 103 IPC_MESSAGE_CONTROL4(EncodedVideoSourceMsg_BitstreamCreated, | |
| 104 int /* device id */, | |
| 105 int /* stream id */, | |
| 106 media::VideoEncodingParameters /* params */, | |
| 107 BitstreamBufferMap /* buffers */) | |
| 108 | |
| 109 // Message from Browser to Renderer process to acknowledge a request to destroy | |
| 110 // an encoded video bitstream. | |
| 111 IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_BitstreamDestroyed, | |
| 112 int /* device id */, | |
| 113 int /* stream id */) | |
| 114 | |
| 115 // Message from Browser to Renderer process to inform the clients of the current | |
| 116 // encoding parameters, regardless of whether the previous request to change | |
| 117 // them has been successful or not. This is called usually as a response to | |
| 118 // EncodedVideoSourceHostMsg_TryConfigureBitstream during runtime, but can occur | |
| 119 // also as a result of config change initiated by encoder or other clients in | |
| 120 // the system. E.g. if there are multiple clients and bitstream config change is | |
| 121 // requested from one client, all clients should be prepared to handle the | |
| 122 // configuration change. | |
| 123 IPC_MESSAGE_CONTROL3(EncodedVideoSourceMsg_BitstreamConfigChanged, | |
| 124 int /* device id */, | |
| 125 int /* stream id */, | |
| 126 media::RuntimeVideoEncodingParameters /* current_params */) | |
| 127 | |
| 128 // Message from Browser to Renderer process indicating that a bitstream buffer | |
| 129 // is available for the stream. The value of |size| indicates the amount of | |
| 130 // valid bitstream data (in bytes). | |
| 131 IPC_MESSAGE_CONTROL5(EncodedVideoSourceMsg_BitstreamReady, | |
| 132 int /* device id */, | |
| 133 int /* stream_id */, | |
| 134 int /* buffer_id */, | |
| 135 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.
| |
| 136 media::BufferEncodingMetadata /* metadata */) | |
| OLD | NEW |