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

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

Issue 1124423008: MJPEG acceleration for video capture using VAAPI, the GPU and IPC part (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mjpeg-1-media
Patch Set: Created 5 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/shared_memory.h" 11 #include "base/memory/shared_memory.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/common/content_param_traits.h" 13 #include "content/common/content_param_traits.h"
14 #include "content/common/gpu/gpu_memory_uma_stats.h" 14 #include "content/common/gpu/gpu_memory_uma_stats.h"
15 #include "content/common/gpu/gpu_process_launch_causes.h" 15 #include "content/common/gpu/gpu_process_launch_causes.h"
16 #include "content/common/gpu/gpu_result_codes.h" 16 #include "content/common/gpu/gpu_result_codes.h"
17 #include "content/public/common/common_param_traits.h" 17 #include "content/public/common/common_param_traits.h"
18 #include "content/public/common/gpu_memory_stats.h" 18 #include "content/public/common/gpu_memory_stats.h"
19 #include "gpu/command_buffer/common/capabilities.h" 19 #include "gpu/command_buffer/common/capabilities.h"
20 #include "gpu/command_buffer/common/command_buffer.h" 20 #include "gpu/command_buffer/common/command_buffer.h"
21 #include "gpu/command_buffer/common/constants.h" 21 #include "gpu/command_buffer/common/constants.h"
22 #include "gpu/command_buffer/common/gpu_memory_allocation.h" 22 #include "gpu/command_buffer/common/gpu_memory_allocation.h"
23 #include "gpu/command_buffer/common/mailbox.h" 23 #include "gpu/command_buffer/common/mailbox.h"
24 #include "gpu/command_buffer/common/value_state.h" 24 #include "gpu/command_buffer/common/value_state.h"
25 #include "gpu/config/gpu_info.h" 25 #include "gpu/config/gpu_info.h"
26 #include "gpu/ipc/gpu_command_buffer_traits.h" 26 #include "gpu/ipc/gpu_command_buffer_traits.h"
27 #include "ipc/ipc_channel_handle.h" 27 #include "ipc/ipc_channel_handle.h"
28 #include "ipc/ipc_message_macros.h" 28 #include "ipc/ipc_message_macros.h"
29 #include "media/base/video_frame.h" 29 #include "media/base/video_frame.h"
30 #include "media/video/jpeg_decode_accelerator.h"
30 #include "media/video/video_decode_accelerator.h" 31 #include "media/video/video_decode_accelerator.h"
31 #include "media/video/video_encode_accelerator.h" 32 #include "media/video/video_encode_accelerator.h"
32 #include "ui/events/latency_info.h" 33 #include "ui/events/latency_info.h"
33 #include "ui/gfx/geometry/size.h" 34 #include "ui/gfx/geometry/size.h"
34 #include "ui/gfx/gpu_memory_buffer.h" 35 #include "ui/gfx/gpu_memory_buffer.h"
35 #include "ui/gfx/native_widget_types.h" 36 #include "ui/gfx/native_widget_types.h"
36 #include "ui/gfx/swap_result.h" 37 #include "ui/gfx/swap_result.h"
37 #include "ui/gl/gpu_preference.h" 38 #include "ui/gl/gpu_preference.h"
38 39
39 #if defined(OS_ANDROID) 40 #if defined(OS_ANDROID)
(...skipping 12 matching lines...) Expand all
52 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference, 53 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference,
53 gfx::GpuPreferenceLast) 54 gfx::GpuPreferenceLast)
54 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SurfaceType, 55 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SurfaceType,
55 gfx::SURFACE_TYPE_LAST) 56 gfx::SURFACE_TYPE_LAST)
56 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SwapResult, gfx::SwapResult::SWAP_RESULT_LAST) 57 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SwapResult, gfx::SwapResult::SWAP_RESULT_LAST)
57 IPC_ENUM_TRAITS_MAX_VALUE(gpu::MemoryAllocation::PriorityCutoff, 58 IPC_ENUM_TRAITS_MAX_VALUE(gpu::MemoryAllocation::PriorityCutoff,
58 gpu::MemoryAllocation::CUTOFF_LAST) 59 gpu::MemoryAllocation::CUTOFF_LAST)
59 IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::Error, gpu::error::kErrorLast) 60 IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::Error, gpu::error::kErrorLast)
60 IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::ContextLostReason, 61 IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::ContextLostReason,
61 gpu::error::kContextLostReasonLast) 62 gpu::error::kContextLostReasonLast)
63 IPC_ENUM_TRAITS_MAX_VALUE(media::JpegDecodeAccelerator::Error,
palmer 2015/06/11 23:28:28 It might be a good idea to use IPC_ENUM_TRAITS_MIN
kcwu 2015/06/12 12:22:00 For IPC, the minimum is actually NO_ERROR(0). Acce
64 media::JpegDecodeAccelerator::LARGEST_ERROR_ENUM)
62 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoEncodeAccelerator::Error, 65 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoEncodeAccelerator::Error,
63 media::VideoEncodeAccelerator::kErrorMax) 66 media::VideoEncodeAccelerator::kErrorMax)
64 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoFrame::Format, 67 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoFrame::Format,
65 media::VideoFrame::FORMAT_MAX) 68 media::VideoFrame::FORMAT_MAX)
66 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile, 69 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile,
67 media::VIDEO_CODEC_PROFILE_MIN, 70 media::VIDEO_CODEC_PROFILE_MIN,
68 media::VIDEO_CODEC_PROFILE_MAX) 71 media::VIDEO_CODEC_PROFILE_MAX)
69 IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::CollectInfoResult, 72 IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::CollectInfoResult,
70 gpu::kCollectInfoNone, 73 gpu::kCollectInfoNone,
71 gpu::kCollectInfoFatalFailure) 74 gpu::kCollectInfoFatalFailure)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // If the browser needs framerate throttling based on GPU back-pressure to be 107 // If the browser needs framerate throttling based on GPU back-pressure to be
105 // disabled (e.g, because the NSView isn't visible but tab capture is active), 108 // disabled (e.g, because the NSView isn't visible but tab capture is active),
106 // then this is set to true. 109 // then this is set to true.
107 IPC_STRUCT_MEMBER(bool, disable_throttling) 110 IPC_STRUCT_MEMBER(bool, disable_throttling)
108 // If the browser is drawing to the screen, this is the CGL renderer ID of 111 // If the browser is drawing to the screen, this is the CGL renderer ID of
109 // the GL context that the brower is using. 112 // the GL context that the brower is using.
110 IPC_STRUCT_MEMBER(int32, renderer_id) 113 IPC_STRUCT_MEMBER(int32, renderer_id)
111 IPC_STRUCT_END() 114 IPC_STRUCT_END()
112 #endif 115 #endif
113 116
117 IPC_STRUCT_BEGIN(AcceleratedJpegDecoderMsg_Decode_Params)
118 IPC_STRUCT_MEMBER(int32, input_buffer_id)
119 IPC_STRUCT_MEMBER(gfx::Size, coded_size)
120 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, input_buffer_handle)
121 IPC_STRUCT_MEMBER(uint32, input_buffer_size)
122 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, output_video_frame_handle)
123 IPC_STRUCT_MEMBER(uint32, output_buffer_size)
124 IPC_STRUCT_END()
125
114 IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage) 126 IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage)
115 IPC_STRUCT_MEMBER(int32, id) 127 IPC_STRUCT_MEMBER(int32, id)
116 IPC_STRUCT_MEMBER(std::string, message) 128 IPC_STRUCT_MEMBER(std::string, message)
117 IPC_STRUCT_END() 129 IPC_STRUCT_END()
118 130
119 #if defined(OS_ANDROID) 131 #if defined(OS_ANDROID)
120 IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params) 132 IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params)
121 IPC_STRUCT_MEMBER(float, m00) 133 IPC_STRUCT_MEMBER(float, m00)
122 IPC_STRUCT_MEMBER(float, m01) 134 IPC_STRUCT_MEMBER(float, m01)
123 IPC_STRUCT_MEMBER(float, m02) 135 IPC_STRUCT_MEMBER(float, m02)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // Tells the GPU process to create a new gpu memory buffer. 280 // Tells the GPU process to create a new gpu memory buffer.
269 IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBuffer, 281 IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBuffer,
270 GpuMsg_CreateGpuMemoryBuffer_Params) 282 GpuMsg_CreateGpuMemoryBuffer_Params)
271 283
272 // Tells the GPU process to destroy buffer. 284 // Tells the GPU process to destroy buffer.
273 IPC_MESSAGE_CONTROL3(GpuMsg_DestroyGpuMemoryBuffer, 285 IPC_MESSAGE_CONTROL3(GpuMsg_DestroyGpuMemoryBuffer,
274 gfx::GpuMemoryBufferId, /* id */ 286 gfx::GpuMemoryBufferId, /* id */
275 int32, /* client_id */ 287 int32, /* client_id */
276 int32 /* sync_point */) 288 int32 /* sync_point */)
277 289
290 // Create and initialize a hardware jpeg decoder using the specified route_id.
291 // Created decoders should be freed with AcceleratedJpegDecoderMsg_Destroy when
292 // no longer needed.
293 IPC_SYNC_MESSAGE_CONTROL1_1(GpuMsg_CreateJpegDecoder,
294 int32 /* route_id */,
295 bool /* succeeded */)
296
278 // Tells the GPU process to create a context for collecting graphics card 297 // Tells the GPU process to create a context for collecting graphics card
279 // information. 298 // information.
280 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) 299 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)
281 300
282 // Tells the GPU process to report video_memory information for the task manager 301 // Tells the GPU process to report video_memory information for the task manager
283 IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats) 302 IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats)
284 303
285 #if defined(OS_MACOSX) 304 #if defined(OS_MACOSX)
286 // Tells the GPU process that the browser process has handled the swap 305 // Tells the GPU process that the browser process has handled the swap
287 // buffers or post sub-buffer request. 306 // buffers or post sub-buffer request.
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 int32 /* bitstream_buffer_id */, 770 int32 /* bitstream_buffer_id */,
752 uint32 /* payload_size */, 771 uint32 /* payload_size */,
753 bool /* key_frame */) 772 bool /* key_frame */)
754 773
755 // Report error condition. 774 // Report error condition.
756 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, 775 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError,
757 media::VideoEncodeAccelerator::Error /* error */) 776 media::VideoEncodeAccelerator::Error /* error */)
758 777
759 // Send destroy request to the encoder. 778 // Send destroy request to the encoder.
760 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderMsg_Destroy) 779 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderMsg_Destroy)
780
781 //------------------------------------------------------------------------------
782 // Accelerated JPEG Decoder Messages
783 // These messages are sent from the Browser process to GPU process.
784
785 // Decode one JPEG image from shared memory |input_buffer_handle| with size
786 // |input_buffer_size|. The input buffer is associated with |input_buffer_id|
787 // and the size of JPEG image is |coded_size|. Decoded I420 frame data will
788 // be put onto shared memory associated with |output_video_frame_handle|
789 // with size limit |output_buffer_size|.
790 IPC_MESSAGE_ROUTED1(AcceleratedJpegDecoderMsg_Decode,
791 AcceleratedJpegDecoderMsg_Decode_Params)
792
793 // Send destroy request to the decoder.
794 IPC_MESSAGE_ROUTED0(AcceleratedJpegDecoderMsg_Destroy)
795
796 //------------------------------------------------------------------------------
797 // Accelerated JPEG Decoder Host Messages
798 // These messages are sent from the GPU process to Browser process.
799 //
800 // Report decode status.
801 IPC_MESSAGE_ROUTED2(AcceleratedJpegDecoderHostMsg_DecodeAck,
802 int32, /* bitstream_buffer_id */
803 media::JpegDecodeAccelerator::Error /* error */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698