Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: content/common/gpu/media_messages.h

Issue 1645873002: Use ParamTraits for media::BitstreamBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "gpu/config/gpu_info.h" 9 #include "gpu/config/gpu_info.h"
9 #include "ipc/ipc_message_macros.h" 10 #include "ipc/ipc_message_macros.h"
10 #include "ipc/param_traits_macros.h" 11 #include "ipc/param_traits_macros.h"
12 #include "media/base/bitstream_buffer.h"
11 #include "media/base/decrypt_config.h" 13 #include "media/base/decrypt_config.h"
12 #include "media/base/video_types.h" 14 #include "media/base/video_types.h"
13 #include "media/video/jpeg_decode_accelerator.h" 15 #include "media/video/jpeg_decode_accelerator.h"
14 #include "media/video/video_decode_accelerator.h" 16 #include "media/video/video_decode_accelerator.h"
15 #include "media/video/video_encode_accelerator.h" 17 #include "media/video/video_encode_accelerator.h"
16 18
17 #undef IPC_MESSAGE_EXPORT 19 #undef IPC_MESSAGE_EXPORT
18 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
19 21
20 #define IPC_MESSAGE_START MediaMsgStart 22 #define IPC_MESSAGE_START MediaMsgStart
21 23
24 #ifndef CONTENT_COMMON_GPU_MEDIA_MESSAGES_H_
25 #define CONTENT_COMMON_GPU_MEDIA_MESSAGES_H_
26
27 namespace IPC {
28 template <>
29 struct ParamTraits<media::BitstreamBuffer> {
30 using param_type = media::BitstreamBuffer;
31 static void Write(base::Pickle* m, const param_type& p);
32 static bool Read(const base::Pickle* m,
33 base::PickleIterator* iter,
34 param_type* r);
35 static void Log(const param_type& p, std::string* l);
36 };
37
38 } // namespace IPC
39
40 #endif // CONTENT_COMMON_GPU_MEDIA_MESSAGES_H_
41
22 IPC_ENUM_TRAITS_MAX_VALUE(media::JpegDecodeAccelerator::Error, 42 IPC_ENUM_TRAITS_MAX_VALUE(media::JpegDecodeAccelerator::Error,
23 media::JpegDecodeAccelerator::LARGEST_ERROR_ENUM) 43 media::JpegDecodeAccelerator::LARGEST_ERROR_ENUM)
24 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoEncodeAccelerator::Error, 44 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoEncodeAccelerator::Error,
25 media::VideoEncodeAccelerator::kErrorMax) 45 media::VideoEncodeAccelerator::kErrorMax)
26 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile, 46 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile,
27 media::VIDEO_CODEC_PROFILE_MIN, 47 media::VIDEO_CODEC_PROFILE_MIN,
28 media::VIDEO_CODEC_PROFILE_MAX) 48 media::VIDEO_CODEC_PROFILE_MAX)
29 49
30 IPC_STRUCT_BEGIN(AcceleratedJpegDecoderMsg_Decode_Params) 50 IPC_STRUCT_BEGIN(AcceleratedJpegDecoderMsg_Decode_Params)
31 IPC_STRUCT_MEMBER(int32_t, input_buffer_id) 51 IPC_STRUCT_MEMBER(media::BitstreamBuffer, input_buffer)
32 IPC_STRUCT_MEMBER(gfx::Size, coded_size) 52 IPC_STRUCT_MEMBER(gfx::Size, coded_size)
33 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, input_buffer_handle)
34 IPC_STRUCT_MEMBER(uint32_t, input_buffer_size)
35 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, output_video_frame_handle) 53 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, output_video_frame_handle)
36 IPC_STRUCT_MEMBER(uint32_t, output_buffer_size) 54 IPC_STRUCT_MEMBER(uint32_t, output_buffer_size)
37 IPC_STRUCT_END() 55 IPC_STRUCT_END()
38 56
39 IPC_STRUCT_BEGIN(AcceleratedVideoDecoderMsg_Decode_Params)
40 IPC_STRUCT_MEMBER(int32_t, bitstream_buffer_id)
41 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, buffer_handle)
42 IPC_STRUCT_MEMBER(uint32_t, size)
43 IPC_STRUCT_MEMBER(base::TimeDelta, presentation_timestamp)
44 IPC_STRUCT_MEMBER(std::string, key_id)
45 IPC_STRUCT_MEMBER(std::string, iv)
46 IPC_STRUCT_MEMBER(std::vector<media::SubsampleEntry>, subsamples)
47 IPC_STRUCT_END()
48
49 IPC_STRUCT_BEGIN(AcceleratedVideoEncoderMsg_Encode_Params) 57 IPC_STRUCT_BEGIN(AcceleratedVideoEncoderMsg_Encode_Params)
50 IPC_STRUCT_MEMBER(int32_t, frame_id) 58 IPC_STRUCT_MEMBER(int32_t, frame_id)
51 IPC_STRUCT_MEMBER(base::TimeDelta, timestamp) 59 IPC_STRUCT_MEMBER(base::TimeDelta, timestamp)
52 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, buffer_handle) 60 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, buffer_handle)
53 IPC_STRUCT_MEMBER(uint32_t, buffer_offset) 61 IPC_STRUCT_MEMBER(uint32_t, buffer_offset)
54 IPC_STRUCT_MEMBER(uint32_t, buffer_size) 62 IPC_STRUCT_MEMBER(uint32_t, buffer_size)
55 IPC_STRUCT_MEMBER(bool, force_keyframe) 63 IPC_STRUCT_MEMBER(bool, force_keyframe)
56 IPC_STRUCT_END() 64 IPC_STRUCT_END()
57 65
58 IPC_STRUCT_BEGIN(AcceleratedVideoEncoderMsg_Encode_Params2) 66 IPC_STRUCT_BEGIN(AcceleratedVideoEncoderMsg_Encode_Params2)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 bool /* succeeded */) 121 bool /* succeeded */)
114 122
115 //------------------------------------------------------------------------------ 123 //------------------------------------------------------------------------------
116 // Accelerated Video Decoder Messages 124 // Accelerated Video Decoder Messages
117 // These messages are sent from Renderer process to GPU process. 125 // These messages are sent from Renderer process to GPU process.
118 126
119 // Set a CDM on the decoder to handle encrypted buffers. 127 // Set a CDM on the decoder to handle encrypted buffers.
120 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_SetCdm, int32_t /* CDM ID */) 128 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_SetCdm, int32_t /* CDM ID */)
121 129
122 // Send input buffer for decoding. 130 // Send input buffer for decoding.
123 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_Decode, 131 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_Decode, media::BitstreamBuffer)
124 AcceleratedVideoDecoderMsg_Decode_Params)
125 132
126 // Give the texture IDs for the textures the decoder will use for output. 133 // Give the texture IDs for the textures the decoder will use for output.
127 IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderMsg_AssignPictureBuffers, 134 IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderMsg_AssignPictureBuffers,
128 std::vector<int32_t>, /* Picture buffer ID */ 135 std::vector<int32_t>, /* Picture buffer ID */
129 std::vector<uint32_t>) /* Texture ID */ 136 std::vector<uint32_t>) /* Texture ID */
130 137
131 // Send from Renderer process to the GPU process to recycle the given picture 138 // Send from Renderer process to the GPU process to recycle the given picture
132 // buffer for further decoding. 139 // buffer for further decoding.
133 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_ReusePictureBuffer, 140 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_ReusePictureBuffer,
134 int32_t) /* Picture buffer ID */ 141 int32_t) /* Picture buffer ID */
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 IPC_MESSAGE_ROUTED0(AcceleratedJpegDecoderMsg_Destroy) 264 IPC_MESSAGE_ROUTED0(AcceleratedJpegDecoderMsg_Destroy)
258 265
259 //------------------------------------------------------------------------------ 266 //------------------------------------------------------------------------------
260 // Accelerated JPEG Decoder Host Messages 267 // Accelerated JPEG Decoder Host Messages
261 // These messages are sent from the GPU process to Browser process. 268 // These messages are sent from the GPU process to Browser process.
262 // 269 //
263 // Report decode status. 270 // Report decode status.
264 IPC_MESSAGE_ROUTED2(AcceleratedJpegDecoderHostMsg_DecodeAck, 271 IPC_MESSAGE_ROUTED2(AcceleratedJpegDecoderHostMsg_DecodeAck,
265 int32_t, /* bitstream_buffer_id */ 272 int32_t, /* bitstream_buffer_id */
266 media::JpegDecodeAccelerator::Error /* error */) 273 media::JpegDecodeAccelerator::Error /* error */)
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_decode_accelerator.cc ('k') | content/common/gpu/media_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698