| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Multiply-included message file, hence no include guard here, but see below | 5 // Multiply-included message file, hence no include guard here, but see below |
| 6 // for a much smaller-than-usual include guard section. | 6 // for a much smaller-than-usual include guard section. |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 #include "content/common/gpu/media/create_video_encoder_params.h" |
| 9 #include "gpu/config/gpu_info.h" | 10 #include "gpu/config/gpu_info.h" |
| 10 #include "ipc/ipc_message_macros.h" | 11 #include "ipc/ipc_message_macros.h" |
| 11 #include "ipc/param_traits_macros.h" | 12 #include "ipc/param_traits_macros.h" |
| 12 #include "media/base/bitstream_buffer.h" | 13 #include "media/base/bitstream_buffer.h" |
| 13 #include "media/base/decrypt_config.h" | 14 #include "media/base/decrypt_config.h" |
| 14 #include "media/base/video_types.h" | 15 #include "media/base/video_types.h" |
| 15 #include "media/video/jpeg_decode_accelerator.h" | 16 #include "media/video/jpeg_decode_accelerator.h" |
| 16 #include "media/video/video_decode_accelerator.h" | 17 #include "media/video/video_decode_accelerator.h" |
| 17 #include "media/video/video_encode_accelerator.h" | 18 #include "media/video/video_encode_accelerator.h" |
| 18 | 19 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 IPC_STRUCT_TRAITS_MEMBER(max_resolution) | 95 IPC_STRUCT_TRAITS_MEMBER(max_resolution) |
| 95 IPC_STRUCT_TRAITS_MEMBER(max_framerate_numerator) | 96 IPC_STRUCT_TRAITS_MEMBER(max_framerate_numerator) |
| 96 IPC_STRUCT_TRAITS_MEMBER(max_framerate_denominator) | 97 IPC_STRUCT_TRAITS_MEMBER(max_framerate_denominator) |
| 97 IPC_STRUCT_TRAITS_END() | 98 IPC_STRUCT_TRAITS_END() |
| 98 | 99 |
| 99 IPC_STRUCT_TRAITS_BEGIN(media::SubsampleEntry) | 100 IPC_STRUCT_TRAITS_BEGIN(media::SubsampleEntry) |
| 100 IPC_STRUCT_TRAITS_MEMBER(clear_bytes) | 101 IPC_STRUCT_TRAITS_MEMBER(clear_bytes) |
| 101 IPC_STRUCT_TRAITS_MEMBER(cypher_bytes) | 102 IPC_STRUCT_TRAITS_MEMBER(cypher_bytes) |
| 102 IPC_STRUCT_TRAITS_END() | 103 IPC_STRUCT_TRAITS_END() |
| 103 | 104 |
| 105 IPC_STRUCT_TRAITS_BEGIN(content::CreateVideoEncoderParams) |
| 106 IPC_STRUCT_TRAITS_MEMBER(input_format) |
| 107 IPC_STRUCT_TRAITS_MEMBER(input_visible_size) |
| 108 IPC_STRUCT_TRAITS_MEMBER(output_profile) |
| 109 IPC_STRUCT_TRAITS_MEMBER(initial_bitrate) |
| 110 IPC_STRUCT_TRAITS_MEMBER(encoder_route_id) |
| 111 IPC_STRUCT_TRAITS_END() |
| 112 |
| 113 //------------------------------------------------------------------------------ |
| 114 // Accelerated Video Decoder Messages |
| 115 // These messages are sent from Renderer process to GPU process. |
| 116 |
| 104 // Create and initialize a hardware video decoder using the specified route_id. | 117 // Create and initialize a hardware video decoder using the specified route_id. |
| 105 // Created decoders should be freed with AcceleratedVideoDecoderMsg_Destroy when | 118 // Created decoders should be freed with AcceleratedVideoDecoderMsg_Destroy when |
| 106 // no longer needed. | 119 // no longer needed. |
| 107 IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_CreateVideoDecoder, | 120 IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_CreateVideoDecoder, |
| 108 media::VideoDecodeAccelerator::Config, /* config */ | 121 media::VideoDecodeAccelerator::Config /* config */, |
| 109 int32_t, /* route_id */ | 122 int32_t /* decoder_route_id */, |
| 110 bool /* succeeded */) | 123 bool /* succeeded */) |
| 111 | 124 |
| 112 // Create and initialize a hardware video encoder using the specified route_id. | |
| 113 // Created encoders should be freed with AcceleratedVideoEncoderMsg_Destroy when | |
| 114 // no longer needed. | |
| 115 IPC_SYNC_MESSAGE_ROUTED5_1(GpuCommandBufferMsg_CreateVideoEncoder, | |
| 116 media::VideoPixelFormat /* input_format */, | |
| 117 gfx::Size /* input_visible_size */, | |
| 118 media::VideoCodecProfile /* output_profile */, | |
| 119 uint32_t /* initial_bitrate */, | |
| 120 int32_t, /* route_id */ | |
| 121 bool /* succeeded */) | |
| 122 | |
| 123 //------------------------------------------------------------------------------ | |
| 124 // Accelerated Video Decoder Messages | |
| 125 // These messages are sent from Renderer process to GPU process. | |
| 126 | |
| 127 // Set a CDM on the decoder to handle encrypted buffers. | 125 // Set a CDM on the decoder to handle encrypted buffers. |
| 128 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_SetCdm, int32_t /* CDM ID */) | 126 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_SetCdm, int32_t /* CDM ID */) |
| 129 | 127 |
| 130 // Send input buffer for decoding. | 128 // Send input buffer for decoding. |
| 131 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_Decode, media::BitstreamBuffer) | 129 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_Decode, media::BitstreamBuffer) |
| 132 | 130 |
| 133 // Give the texture IDs for the textures the decoder will use for output. | 131 // Give the texture IDs for the textures the decoder will use for output. |
| 134 IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderMsg_AssignPictureBuffers, | 132 IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderMsg_AssignPictureBuffers, |
| 135 std::vector<int32_t>, /* Picture buffer ID */ | 133 std::vector<int32_t>, /* Picture buffer ID */ |
| 136 std::vector<uint32_t>) /* Texture ID */ | 134 std::vector<uint32_t>) /* Texture ID */ |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) | 186 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) |
| 189 | 187 |
| 190 // Video decoder has encountered an error. | 188 // Video decoder has encountered an error. |
| 191 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, | 189 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, |
| 192 uint32_t /* Error ID */) | 190 uint32_t /* Error ID */) |
| 193 | 191 |
| 194 //------------------------------------------------------------------------------ | 192 //------------------------------------------------------------------------------ |
| 195 // Accelerated Video Encoder Messages | 193 // Accelerated Video Encoder Messages |
| 196 // These messages are sent from the Renderer process to GPU process. | 194 // These messages are sent from the Renderer process to GPU process. |
| 197 | 195 |
| 196 // Create and initialize a hardware video encoder using the specified route_id. |
| 197 // Created encoders should be freed with AcceleratedVideoEncoderMsg_Destroy when |
| 198 // no longer needed. |
| 199 IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateVideoEncoder, |
| 200 content::CreateVideoEncoderParams, |
| 201 bool /* succeeded */) |
| 202 |
| 198 // Queue a video frame to the encoder to encode. |frame_id| will be returned | 203 // Queue a video frame to the encoder to encode. |frame_id| will be returned |
| 199 // by AcceleratedVideoEncoderHostMsg_NotifyInputDone. | 204 // by AcceleratedVideoEncoderHostMsg_NotifyInputDone. |
| 200 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderMsg_Encode, | 205 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderMsg_Encode, |
| 201 AcceleratedVideoEncoderMsg_Encode_Params) | 206 AcceleratedVideoEncoderMsg_Encode_Params) |
| 202 | 207 |
| 203 // Queue a GpuMemoryBuffer backed video frame to the encoder to encode. | 208 // Queue a GpuMemoryBuffer backed video frame to the encoder to encode. |
| 204 // |frame_id| will be returned by | 209 // |frame_id| will be returned by |
| 205 // AcceleratedVideoEncoderHostMsg_NotifyInputDone. | 210 // AcceleratedVideoEncoderHostMsg_NotifyInputDone. |
| 206 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderMsg_Encode2, | 211 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderMsg_Encode2, |
| 207 AcceleratedVideoEncoderMsg_Encode_Params2) | 212 AcceleratedVideoEncoderMsg_Encode_Params2) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, | 250 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, |
| 246 media::VideoEncodeAccelerator::Error /* error */) | 251 media::VideoEncodeAccelerator::Error /* error */) |
| 247 | 252 |
| 248 // Send destroy request to the encoder. | 253 // Send destroy request to the encoder. |
| 249 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderMsg_Destroy) | 254 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderMsg_Destroy) |
| 250 | 255 |
| 251 //------------------------------------------------------------------------------ | 256 //------------------------------------------------------------------------------ |
| 252 // Accelerated JPEG Decoder Messages | 257 // Accelerated JPEG Decoder Messages |
| 253 // These messages are sent from the Browser process to GPU process. | 258 // These messages are sent from the Browser process to GPU process. |
| 254 | 259 |
| 260 // Create and initialize a hardware jpeg decoder using the specified route_id. |
| 261 // Created decoders should be freed with AcceleratedJpegDecoderMsg_Destroy when |
| 262 // no longer needed. |
| 263 IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_CreateJpegDecoder, |
| 264 int32_t /* route_id */, |
| 265 bool /* succeeded */) |
| 266 |
| 255 // Decode one JPEG image from shared memory |input_buffer_handle| with size | 267 // Decode one JPEG image from shared memory |input_buffer_handle| with size |
| 256 // |input_buffer_size|. The input buffer is associated with |input_buffer_id| | 268 // |input_buffer_size|. The input buffer is associated with |input_buffer_id| |
| 257 // and the size of JPEG image is |coded_size|. Decoded I420 frame data will | 269 // and the size of JPEG image is |coded_size|. Decoded I420 frame data will |
| 258 // be put onto shared memory associated with |output_video_frame_handle| | 270 // be put onto shared memory associated with |output_video_frame_handle| |
| 259 // with size limit |output_buffer_size|. | 271 // with size limit |output_buffer_size|. |
| 260 IPC_MESSAGE_ROUTED1(AcceleratedJpegDecoderMsg_Decode, | 272 IPC_MESSAGE_ROUTED1(AcceleratedJpegDecoderMsg_Decode, |
| 261 AcceleratedJpegDecoderMsg_Decode_Params) | 273 AcceleratedJpegDecoderMsg_Decode_Params) |
| 262 | 274 |
| 263 // Send destroy request to the decoder. | 275 // Send destroy request to the decoder. |
| 264 IPC_MESSAGE_ROUTED0(AcceleratedJpegDecoderMsg_Destroy) | 276 IPC_MESSAGE_ROUTED0(AcceleratedJpegDecoderMsg_Destroy) |
| 265 | 277 |
| 266 //------------------------------------------------------------------------------ | 278 //------------------------------------------------------------------------------ |
| 267 // Accelerated JPEG Decoder Host Messages | 279 // Accelerated JPEG Decoder Host Messages |
| 268 // These messages are sent from the GPU process to Browser process. | 280 // These messages are sent from the GPU process to Browser process. |
| 269 // | 281 // |
| 270 // Report decode status. | 282 // Report decode status. |
| 271 IPC_MESSAGE_ROUTED2(AcceleratedJpegDecoderHostMsg_DecodeAck, | 283 IPC_MESSAGE_ROUTED2(AcceleratedJpegDecoderHostMsg_DecodeAck, |
| 272 int32_t, /* bitstream_buffer_id */ | 284 int32_t, /* bitstream_buffer_id */ |
| 273 media::JpegDecodeAccelerator::Error /* error */) | 285 media::JpegDecodeAccelerator::Error /* error */) |
| OLD | NEW |