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 "content/common/content_export.h" | |
| 6 #include "ipc/ipc_message_macros.h" | |
| 7 #include "ipc/ipc_message_start.h" | |
| 8 #include "media/video/video_encode_types.h" | |
| 9 | |
| 10 #undef IPC_MESSAGE_EXPORT | |
| 11 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | |
| 12 #define IPC_MESSAGE_START EncodedVideoSourceMsgStart | |
|
Ami GONE FROM CHROMIUM
2013/03/18 22:53:45
I thought you were going to merge into this CL the
Ville-Mikko Rautio
2013/03/19 16:45:43
I agreed offline with Cris that I'll add just empt
| |
| 13 | |
| 14 IPC_ENUM_TRAITS(media::VideoCodec) | |
| 15 | |
| 16 IPC_STRUCT_TRAITS_BEGIN(media::TemporalLayerParameters) | |
| 17 IPC_STRUCT_TRAITS_MEMBER(enabled) | |
| 18 IPC_STRUCT_TRAITS_MEMBER(target_bitrate) | |
| 19 IPC_STRUCT_TRAITS_END() | |
| 20 | |
| 21 IPC_STRUCT_TRAITS_BEGIN(media::RuntimeVideoEncodingParameters) | |
| 22 IPC_STRUCT_TRAITS_MEMBER(frames_per_second) | |
| 23 IPC_STRUCT_TRAITS_MEMBER(max_bitrate) | |
| 24 IPC_STRUCT_TRAITS_MEMBER(max_qp) | |
| 25 IPC_STRUCT_TRAITS_MEMBER(temporal_layer_params) | |
| 26 IPC_STRUCT_TRAITS_END() | |
| 27 | |
| 28 IPC_STRUCT_TRAITS_BEGIN(media::VideoEncodingParameters) | |
| 29 IPC_STRUCT_TRAITS_MEMBER(codec) | |
| 30 IPC_STRUCT_TRAITS_MEMBER(resolution) | |
| 31 IPC_STRUCT_TRAITS_MEMBER(temporal_layer_count) | |
| 32 IPC_STRUCT_TRAITS_MEMBER(runtime_params) | |
| 33 IPC_STRUCT_TRAITS_END() | |
| 34 | |
| 35 IPC_STRUCT_TRAITS_BEGIN(media::BufferEncodingMetadata) | |
| 36 IPC_STRUCT_TRAITS_MEMBER(timestamp) | |
| 37 IPC_STRUCT_TRAITS_MEMBER(frame_type_flags) | |
| 38 IPC_STRUCT_TRAITS_MEMBER(temporal_layer_id) | |
| 39 IPC_STRUCT_TRAITS_MEMBER(layer_sync) | |
| 40 IPC_STRUCT_TRAITS_MEMBER(droppable) | |
| 41 IPC_STRUCT_TRAITS_END() | |
| 42 | |
| 43 // Message from Renderer to Browser process to add a bitstream with specific | |
| 44 // parameters. A successful request results in beginning of streaming and | |
| 45 // EncoderVideoSourceMsg_BitstreamAdded message to Renderer. A failed request | |
| 46 // triggers EncodedVideoSourceMsg_BitstreamRemoved message. | |
| 47 IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_AddBitstream, | |
| 48 int /* device_id */, | |
| 49 int /* stream_id */, | |
|
Ami GONE FROM CHROMIUM
2013/03/18 22:53:45
How does the renderer get these IDs? (device & st
Ville-Mikko Rautio
2013/03/19 16:45:43
Added comments on device_id & stream_id.
| |
| 50 media::VideoEncodingParameters /* params */) | |
| 51 | |
| 52 // Message from Renderer to Browser process to stop streaming a bitstream. When | |
| 53 // Browser has finalized the bitstream it will trigger | |
| 54 // EncodedVideoSourceMsg_BitstreamRemoved message back from Browser to Renderer. | |
| 55 // Renderer must be prepared to receive EncodedVideoSourceMsg_BitstreamReady | |
| 56 // messages until it has received the EncodedVideoSourceMsg_BitstreamRemoved | |
| 57 // message. | |
| 58 IPC_MESSAGE_CONTROL2(EncodedVideoSourceHostMsg_RemoveBitstream, | |
|
Ami GONE FROM CHROMIUM
2013/03/18 22:53:45
Now you have Add/Remove -> Added/Removed but Remov
Ville-Mikko Rautio
2013/03/19 16:45:43
Changed wording for Add/Remove wording to Create/D
| |
| 59 int /* device_id */, | |
| 60 int /* stream_id */) | |
| 61 | |
| 62 // Message from Renderer to Browser process to set a stream's bitstream config. | |
| 63 // Will always result in EncodedVideoSourceMsg_BitstreamConfigChanged containing | |
| 64 // currently active parameters, regardless of whether this call succeeded or | |
| 65 // not. | |
|
Ami GONE FROM CHROMIUM
2013/03/18 22:53:45
This guarantee is not present in the .h.
Ville-Mikko Rautio
2013/03/19 16:45:43
Added to the header.
| |
| 66 IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_TrySetBitstreamConfig, | |
| 67 int /* device_id */, | |
| 68 int /* stream_id */, | |
| 69 media::RuntimeVideoEncodingParameters /* params */) | |
| 70 | |
| 71 // Message from Renderer to Browser process to request special frames from the | |
| 72 // encoded video source. There will be no acknowledgement for this request and | |
| 73 // the effect is only visible in the bitstream buffers passed to client | |
| 74 // through the EncodedVideoSourceMsg_BitstreamReady message. This request is | |
| 75 // served on a best-effort basis and client is not given any guarantees of the | |
| 76 // realization or timing of the request. Flags parameter will be interpreted in | |
| 77 // format-specific manner using enumerations. | |
|
Ami GONE FROM CHROMIUM
2013/03/18 22:53:45
s/format/codec/
Ville-Mikko Rautio
2013/03/19 16:45:43
Done.
| |
| 78 IPC_MESSAGE_CONTROL3(EncodedVideoSourceHostMsg_RequestSpecialFrame, | |
| 79 int /* device_id */, | |
| 80 int /* stream_id */, | |
| 81 int /* flags */) | |
| 82 | |
| 83 // Message from Browser to Renderer process to acknowledge a request to add an | |
| 84 // encoded video bitstream. Modifiable boolean value informs whether client can | |
| 85 // adjust the bitstream config using TrySetBitstreamConfig. When this message | |
| 86 // occurs bitstream can be considered to be streaming and Renderer should be | |
| 87 // ready to start accepting EncodedVideoSourceMsg_BitstreamReady messages and | |
| 88 // buffers contained within them. | |
| 89 IPC_MESSAGE_CONTROL3(EncodedVideoSourceMsg_BitstreamAdded, | |
| 90 int /* device id */, | |
| 91 int /* stream id */, | |
| 92 bool /* modifiable */) | |
| 93 | |
| 94 // Message from Browser to Renderer process to acknowledge a request to remove | |
| 95 // an encoded video bitstream. Also used to signal renderer process that an | |
| 96 // unrecoverable error has occurred and as a result bitstream has been removed. | |
| 97 IPC_MESSAGE_CONTROL2(EncodedVideoSourceMsg_BitstreamRemoved, | |
| 98 int /* device id */, | |
| 99 int /* stream id */) | |
| 100 | |
| 101 // Message from Browser to Renderer process to inform the clients of the current | |
| 102 // encoding parameters, regardless of whether the previous request to change | |
| 103 // them has been successful or not. This is called usually as a response to | |
| 104 // EncodedVideoSourceHostMsg_TrySetBitstreamConfig during runtime, but can occur | |
| 105 // also as a result of config change initiated by encoder or other clients in | |
| 106 // the system. E.g. if there are multiple clients and bitstream config change is | |
| 107 // requested from one client, all clients should be prepared to handle the | |
| 108 // configuration change. | |
| 109 IPC_MESSAGE_CONTROL3(EncodedVideoSourceMsg_BitstreamConfigChanged, | |
| 110 int /* device id */, | |
| 111 int /* stream id */, | |
| 112 media::RuntimeVideoEncodingParameters /* current_params */) | |
| 113 | |
| 114 // Message from Browser to Renderer process indicating that a bitstream buffer | |
| 115 // is available for the stream. | |
| 116 // TODO(vmr): Consider using SharedMemory instead. | |
|
Ami GONE FROM CHROMIUM
2013/03/18 22:53:45
I really think you want this now, not in the futur
Ville-Mikko Rautio
2013/03/19 16:45:43
Fair enough. Done.
| |
| 117 IPC_MESSAGE_CONTROL4(EncodedVideoSourceMsg_BitstreamReady, | |
| 118 int /* device id */, | |
| 119 int /* stream_id */, | |
| 120 std::vector<uint8> /* bitstream */, | |
| 121 media::BufferEncodingMetadata /* metadata */) | |
| 122 | |
| OLD | NEW |