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(target_bitrate) |
| 27 IPC_STRUCT_TRAITS_MEMBER(max_bitrate) |
| 28 IPC_STRUCT_TRAITS_MEMBER(frames_per_second) |
| 29 IPC_STRUCT_TRAITS_END() |
| 30 |
| 31 IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingParameters) |
| 32 IPC_STRUCT_TRAITS_MEMBER(codec_name) |
| 33 IPC_STRUCT_TRAITS_MEMBER(resolution) |
| 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 //------------------------------------------------------------------------------ |
| 43 // Renderer Source Messages |
| 44 // These are messages from the Renderer to the Browser process. |
| 45 |
| 46 // Queries the encoding capabilities for the device. A successful request |
| 47 // results in EncoderVideoSourceMessage_CapabilitiesAvailable message. |
| 48 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_GetCapabilities, |
| 49 int /* device_id */, |
| 50 media::VideoCaptureSessionId /* session_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 // EncoderVideoCaptureMsg_BitstreamCreated message to Renderer. A failed request |
| 55 // triggers EncodedVideoCaptureMsg_BitstreamDestroyed message. |session_id| is |
| 56 // the capture session id returned by the MediaStreamManager. The renderer is |
| 57 // responsible for generating unique |device_id| within its context that will be |
| 58 // used to identify bitstreams in IPC. |
| 59 IPC_MESSAGE_CONTROL3(EncodedVideoCaptureHostMsg_OpenBitstream, |
| 60 int /* device_id */, |
| 61 media::VideoCaptureSessionId /* session_id */, |
| 62 media::VideoEncodingParameters /* params */) |
| 63 |
| 64 // Stops streaming a bitstream. When Browser has finalized the bitstream it will |
| 65 // trigger EncodedVideoCaptureMsg_BitstreamClosed message back to Renderer. |
| 66 // Renderer must be prepared to receive EncodedVideoCaptureMsg_BitstreamReady |
| 67 // messages until it receives EncodedVideoCaptureMsg_BitstreamClosed message. |
| 68 IPC_MESSAGE_CONTROL1(EncodedVideoCaptureHostMsg_CloseBitstream, |
| 69 int /* device_id */) |
| 70 |
| 71 // Sets a stream's bitstream configuration. Will always result in |
| 72 // EncodedVideoCaptureMsg_BitstreamConfigChanged message containing |
| 73 // currently active parameters, regardless of whether this call succeeded or |
| 74 // not. |
| 75 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_TryConfigureBitstream, |
| 76 int /* device_id */, |
| 77 media::RuntimeVideoEncodingParameters /* params */) |
| 78 |
| 79 // Notifies that the data within a buffer has been processed and it can be |
| 80 // reused to encode upcoming bitstream. |
| 81 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureHostMsg_BitstreamBufferConsumed, |
| 82 int /* device_id */, |
| 83 int /* buffer_id */) |
| 84 |
| 85 //------------------------------------------------------------------------------ |
| 86 // Renderer Messages |
| 87 // These are messages from the Browser to the Renderer process. |
| 88 |
| 89 // Reports the encoding capabilities of the device. |
| 90 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureMsg_CapabilitiesAvailable, |
| 91 int /* device_id */, |
| 92 media::VideoEncodingCapabilities /* capabilities */) |
| 93 |
| 94 // Acknowledges a request to open an encoded video bitstream. When this message |
| 95 // occurs, bitstream can be considered to be streaming, and Renderer should be |
| 96 // ready to start accepting EncodedVideoCaptureMsg_BitstreamReady messages and |
| 97 // buffers contained within them. Shared memory buffers used to deliver the |
| 98 // bitstream are assigned with buffer ids as specified by the buffers parameter. |
| 99 // All buffers have the same size as indicated by |buffer_size|. |
| 100 IPC_MESSAGE_CONTROL4(EncodedVideoCaptureMsg_BitstreamOpened, |
| 101 int /* device_id */, |
| 102 media::VideoEncodingParameters /* params */, |
| 103 std::vector<base::SharedMemoryHandle> /* buffers */, |
| 104 uint32 /* buffer_size */) |
| 105 |
| 106 // Acknowledges a request to close an encoded video bitstream. |
| 107 IPC_MESSAGE_CONTROL1(EncodedVideoCaptureMsg_BitstreamClosed, |
| 108 int /* device_id */) |
| 109 |
| 110 // Informs the clients of the current encoding parameters, regardless of whether |
| 111 // the previous request to change them has been successful or not. It is usually |
| 112 // called in response to EncodedVideoCaptureHostMsg_TryConfigureBitstream |
| 113 // at runtime, but can occur also as a result of config change initiated by |
| 114 // encoder or other clients in the system, e.g. if there are multiple clients |
| 115 // and bitstream config change is requested from one client, all clients should |
| 116 // be prepared to handle the configuration change. |
| 117 IPC_MESSAGE_CONTROL2(EncodedVideoCaptureMsg_BitstreamConfigChanged, |
| 118 int /* device_id */, |
| 119 media::RuntimeVideoEncodingParameters /* current_params */) |
| 120 |
| 121 // Indicates that a bitstream buffer is available for the stream. The value of |
| 122 // |size| indicates the amount of valid bitstream data (in bytes). |
| 123 IPC_MESSAGE_CONTROL4(EncodedVideoCaptureMsg_BitstreamReady, |
| 124 int /* device_id */, |
| 125 int /* buffer_id */, |
| 126 uint32 /* size */, |
| 127 media::BufferEncodingMetadata /* metadata */) |
OLD | NEW |