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/capture/video_capture_types.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 EncodedVideoCaptureMsgStart | |
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) | |
hshi1
2013/06/13 00:28:35
Please move frames_per_second to the runtime_param
sheu
2013/06/13 06:08:18
Done.
| |
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 // Message from Renderer to Browser process to query the encoding capability | |
43 // for the capture session. A successful request results in | |
44 // EncoderVideoCaptureMessage_CapabilityAvailable message. | |
45 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_GetCapability, | |
46 int /* device_id */, | |
47 media::VideoCaptureSessionId /* session_id */) | |
48 | |
49 // Message from Renderer to Browser process to create a bitstream with specific | |
50 // parameters. A successful request results in beginning of streaming and | |
51 // EncoderVideoCaptureMsg_BitstreamCreated message to Renderer. A failed request | |
52 // triggers EncodedVideoCaptureMsg_BitstreamDestroyed message. |session_id| is | |
53 // the capture session id returned by the MediaStreamManager. The renderer is | |
54 // responsible for generating unique |device_id| within its context that will be | |
55 // used to identify bitstreams in IPC. | |
56 IPC_MESSAGE_CONTROL3(EncodedVideoCaptureHostMsg_CreateBitstream, | |
57 int /* device_id */, | |
58 media::VideoCaptureSessionId /* session_id */, | |
59 media::VideoEncodingParameters /* params */) | |
60 | |
61 // Message from Renderer to Browser process to stop streaming a bitstream. When | |
62 // Browser has finalized the bitstream it will trigger | |
63 // EncodedVideoCaptureMsg_BitstreamDestroyed message back from Browser to | |
64 // Renderer. Renderer must be prepared to receive | |
65 // EncodedVideoCaptureMsg_BitstreamReady messages until it has received the | |
66 // EncodedVideoCaptureMsg_BitstreamDestroyed message. | |
67 IPC_MESSAGE_CONTROL1(EncodedVideoCaptureHostMsg_DestroyBitstream, | |
68 int /* device_id */) | |
69 | |
70 // Message from Renderer to Browser process to set a stream's bitstream config. | |
71 // Will always result in EncodedVideoCaptureMsg_BitstreamConfigChanged | |
72 // containing currently active parameters, regardless of whether this call | |
73 // succeeded or not. | |
74 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_TryConfigureBitstream, | |
75 int /* device_id */, | |
76 media::RuntimeVideoEncodingParameters /* params */) | |
77 | |
78 // Message from Renderer to Browser process to tell that the data within a | |
79 // buffer has been processed and it can be reused to encode upcoming bitstream. | |
80 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_BitstreamBufferConsumed, | |
81 int /* device_id */, | |
82 int /* buffer_id */) | |
83 | |
84 // Message from Browser to Renderer process to report the encoding capability | |
85 // of the device. | |
86 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureMsg_CapabilityAvailable, | |
87 int /* device_id */, | |
88 media::VideoEncodingCapability /* capability */) | |
89 | |
90 // Message from Browser to Renderer process to acknowledge a request to create | |
91 // an encoded video bitstream. When this message occurs bitstream can be | |
92 // considered to be streaming and Renderer should be ready to start accepting | |
93 // EncodedVideoCaptureMsg_BitstreamReady messages and buffers contained within | |
94 // them. Shared memory buffers used to deliver the bitstream are assigned with | |
95 // buffer ids as specified by the buffers parameter. | |
96 IPC_MESSAGE_CONTROL4(EncodedVideoCaptureMsg_BitstreamCreated, | |
97 int /* device id */, | |
98 media::VideoEncodingParameters /* params */, | |
99 std::vector<base::SharedMemoryHandle> /* buffers */, | |
100 size_t /* buffer_size */) | |
101 | |
102 // Message from Browser to Renderer process to acknowledge a request to destroy | |
103 // an encoded video bitstream. | |
104 IPC_MESSAGE_CONTROL1(EncodedVideoCaptureMsg_BitstreamDestroyed, | |
105 int /* device id */) | |
106 | |
107 // Message from Browser to Renderer process to inform the clients of the current | |
108 // encoding parameters, regardless of whether the previous request to change | |
109 // them has been successful or not. This is called usually as a response to | |
110 // EncodedVideoCaptureHostMsg_TryConfigureBitstream during runtime, but can | |
111 // occur also as a result of config change initiated by encoder or other clients | |
112 // in the system. E.g. if there are multiple clients and bitstream config change | |
113 // is requested from one client, all clients should be prepared to handle the | |
114 // configuration change. | |
115 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureMsg_BitstreamConfigChanged, | |
116 int /* device id */, | |
117 media::RuntimeVideoEncodingParameters /* current_params */) | |
118 | |
119 // Message from Browser to Renderer process indicating that a bitstream buffer | |
120 // is available for the stream. The value of |size| indicates the amount of | |
121 // valid bitstream data (in bytes). | |
122 IPC_MESSAGE_CONTROL4(EncodedVideoCaptureMsg_BitstreamReady, | |
123 int /* device id */, | |
124 int /* buffer_id */, | |
125 size_t /* size */, | |
hshi1
2013/06/13 00:28:35
Per Ami: size_t is verboten in IPC. But I wonder i
sheu
2013/06/13 06:08:18
I'm going to specify it as a uint32.
| |
126 media::BufferEncodingMetadata /* metadata */) | |
OLD | NEW |