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

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,
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 19 matching lines...) Expand all
91 94
92 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) 95 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params)
93 IPC_STRUCT_MEMBER(int32, surface_id) 96 IPC_STRUCT_MEMBER(int32, surface_id)
94 IPC_STRUCT_MEMBER(uint64, surface_handle) 97 IPC_STRUCT_MEMBER(uint64, surface_handle)
95 IPC_STRUCT_MEMBER(int32, route_id) 98 IPC_STRUCT_MEMBER(int32, route_id)
96 IPC_STRUCT_MEMBER(gfx::Size, size) 99 IPC_STRUCT_MEMBER(gfx::Size, size)
97 IPC_STRUCT_MEMBER(float, scale_factor) 100 IPC_STRUCT_MEMBER(float, scale_factor)
98 IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) 101 IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info)
99 IPC_STRUCT_END() 102 IPC_STRUCT_END()
100 103
104 IPC_STRUCT_BEGIN(AcceleratedJpegDecoderMsg_Decode_Params)
105 IPC_STRUCT_MEMBER(int32, input_buffer_id)
106 IPC_STRUCT_MEMBER(gfx::Size, coded_size)
107 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, input_buffer_handle)
108 IPC_STRUCT_MEMBER(uint32, input_buffer_size)
109 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, output_video_frame_handle)
110 IPC_STRUCT_MEMBER(uint32, output_buffer_size)
111 IPC_STRUCT_END()
112
101 #if defined(OS_MACOSX) 113 #if defined(OS_MACOSX)
102 IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params) 114 IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params)
103 // If the browser needs framerate throttling based on GPU back-pressure to be 115 // If the browser needs framerate throttling based on GPU back-pressure to be
104 // disabled (e.g, because the NSView isn't visible but tab capture is active), 116 // disabled (e.g, because the NSView isn't visible but tab capture is active),
105 // then this is set to true. 117 // then this is set to true.
106 IPC_STRUCT_MEMBER(bool, disable_throttling) 118 IPC_STRUCT_MEMBER(bool, disable_throttling)
107 // If the browser is drawing to the screen, this is the CGL renderer ID of 119 // If the browser is drawing to the screen, this is the CGL renderer ID of
108 // the GL context that the brower is using. 120 // the GL context that the brower is using.
109 IPC_STRUCT_MEMBER(int32, renderer_id) 121 IPC_STRUCT_MEMBER(int32, renderer_id)
110 IPC_STRUCT_END() 122 IPC_STRUCT_END()
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // Tells the GPU process to create a new gpu memory buffer. 279 // Tells the GPU process to create a new gpu memory buffer.
268 IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBuffer, 280 IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBuffer,
269 GpuMsg_CreateGpuMemoryBuffer_Params) 281 GpuMsg_CreateGpuMemoryBuffer_Params)
270 282
271 // Tells the GPU process to destroy buffer. 283 // Tells the GPU process to destroy buffer.
272 IPC_MESSAGE_CONTROL3(GpuMsg_DestroyGpuMemoryBuffer, 284 IPC_MESSAGE_CONTROL3(GpuMsg_DestroyGpuMemoryBuffer,
273 gfx::GpuMemoryBufferId, /* id */ 285 gfx::GpuMemoryBufferId, /* id */
274 int32, /* client_id */ 286 int32, /* client_id */
275 int32 /* sync_point */) 287 int32 /* sync_point */)
276 288
289 // Create and initialize a hardware jpeg decoder using the specified route_id.
290 // Created decoders should be freed with AcceleratedJpegDecoderMsg_Destroy when
291 // no longer needed.
292 IPC_SYNC_MESSAGE_CONTROL1_1(GpuMsg_CreateJpegDecoder,
293 int32 /* route_id */,
294 bool /* succeeded */)
295
277 // Tells the GPU process to create a context for collecting graphics card 296 // Tells the GPU process to create a context for collecting graphics card
278 // information. 297 // information.
279 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) 298 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)
280 299
281 // Tells the GPU process to report video_memory information for the task manager 300 // Tells the GPU process to report video_memory information for the task manager
282 IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats) 301 IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats)
283 302
284 #if defined(OS_MACOSX) 303 #if defined(OS_MACOSX)
285 // Tells the GPU process that the browser process has handled the swap 304 // Tells the GPU process that the browser process has handled the swap
286 // buffers or post sub-buffer request. 305 // buffers or post sub-buffer request.
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 int32 /* bitstream_buffer_id */, 766 int32 /* bitstream_buffer_id */,
748 uint32 /* payload_size */, 767 uint32 /* payload_size */,
749 bool /* key_frame */) 768 bool /* key_frame */)
750 769
751 // Report error condition. 770 // Report error condition.
752 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, 771 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError,
753 media::VideoEncodeAccelerator::Error /* error */) 772 media::VideoEncodeAccelerator::Error /* error */)
754 773
755 // Send destroy request to the encoder. 774 // Send destroy request to the encoder.
756 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderMsg_Destroy) 775 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderMsg_Destroy)
776
777 //------------------------------------------------------------------------------
778 // Accelerated JPEG Decoder Messages
779 // These messages are sent from the Browser process to GPU process.
780
781 // Decode one JPEG image from shared memory |input_buffer_handle| with size
782 // |input_buffer_size|. The input buffer is associated with |input_buffer_id|
783 // and the size of JPEG image is |coded_size|. Decoded I420 frame data will
784 // be put onto shared memory associated with |output_video_frame_handle|
785 // with size limit |output_buffer_size|.
786 IPC_MESSAGE_ROUTED1(AcceleratedJpegDecoderMsg_Decode,
787 AcceleratedJpegDecoderMsg_Decode_Params)
788
789 // Send destroy request to the decoder.
790 IPC_MESSAGE_ROUTED0(AcceleratedJpegDecoderMsg_Destroy)
791
792 //------------------------------------------------------------------------------
793 // Accelerated JPEG Decoder Host Messages
794 // These messages are sent from the GPU process to Browser process.
795 //
796 // Report decode status.
797 IPC_MESSAGE_ROUTED2(AcceleratedJpegDecoderHostMsg_DecodeAck,
798 int32, /* bitstream_buffer_id */
799 media::JpegDecodeAccelerator::Error /* error */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698