OLD | NEW |
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/gl/gpu_preference.h" | 37 #include "ui/gl/gpu_preference.h" |
37 | 38 |
38 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
39 #include "content/common/android/surface_texture_peer.h" | 40 #include "content/common/android/surface_texture_peer.h" |
40 #endif | 41 #endif |
41 | 42 |
42 #undef IPC_MESSAGE_EXPORT | 43 #undef IPC_MESSAGE_EXPORT |
43 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 44 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
44 | 45 |
45 #define IPC_MESSAGE_START GpuMsgStart | 46 #define IPC_MESSAGE_START GpuMsgStart |
46 | 47 |
47 IPC_ENUM_TRAITS_MAX_VALUE(content::CauseForGpuLaunch, | 48 IPC_ENUM_TRAITS_MAX_VALUE(content::CauseForGpuLaunch, |
48 content::CAUSE_FOR_GPU_LAUNCH_MAX_ENUM - 1) | 49 content::CAUSE_FOR_GPU_LAUNCH_MAX_ENUM - 1) |
49 IPC_ENUM_TRAITS_MAX_VALUE(content::CreateCommandBufferResult, | 50 IPC_ENUM_TRAITS_MAX_VALUE(content::CreateCommandBufferResult, |
50 content::CREATE_COMMAND_BUFFER_RESULT_LAST) | 51 content::CREATE_COMMAND_BUFFER_RESULT_LAST) |
51 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference, | 52 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference, |
52 gfx::GpuPreferenceLast) | 53 gfx::GpuPreferenceLast) |
53 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SurfaceType, | 54 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SurfaceType, |
54 gfx::SURFACE_TYPE_LAST) | 55 gfx::SURFACE_TYPE_LAST) |
55 IPC_ENUM_TRAITS_MAX_VALUE(gpu::MemoryAllocation::PriorityCutoff, | 56 IPC_ENUM_TRAITS_MAX_VALUE(gpu::MemoryAllocation::PriorityCutoff, |
56 gpu::MemoryAllocation::CUTOFF_LAST) | 57 gpu::MemoryAllocation::CUTOFF_LAST) |
57 IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::ContextLostReason, | 58 IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::ContextLostReason, |
58 gpu::error::kContextLostReasonLast) | 59 gpu::error::kContextLostReasonLast) |
| 60 IPC_ENUM_TRAITS_MAX_VALUE(media::JpegDecodeAccelerator::Error, |
| 61 media::JpegDecodeAccelerator::LARGEST_ERROR_ENUM) |
59 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoEncodeAccelerator::Error, | 62 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoEncodeAccelerator::Error, |
60 media::VideoEncodeAccelerator::kErrorMax) | 63 media::VideoEncodeAccelerator::kErrorMax) |
61 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoFrame::Format, | 64 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoFrame::Format, |
62 media::VideoFrame::FORMAT_MAX) | 65 media::VideoFrame::FORMAT_MAX) |
63 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile, | 66 IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile, |
64 media::VIDEO_CODEC_PROFILE_MIN, | 67 media::VIDEO_CODEC_PROFILE_MIN, |
65 media::VIDEO_CODEC_PROFILE_MAX) | 68 media::VIDEO_CODEC_PROFILE_MAX) |
66 IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::CollectInfoResult, | 69 IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::CollectInfoResult, |
67 gpu::kCollectInfoNone, | 70 gpu::kCollectInfoNone, |
68 gpu::kCollectInfoFatalFailure) | 71 gpu::kCollectInfoFatalFailure) |
(...skipping 19 matching lines...) Expand all Loading... |
88 | 91 |
89 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) | 92 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) |
90 IPC_STRUCT_MEMBER(int32, surface_id) | 93 IPC_STRUCT_MEMBER(int32, surface_id) |
91 IPC_STRUCT_MEMBER(uint64, surface_handle) | 94 IPC_STRUCT_MEMBER(uint64, surface_handle) |
92 IPC_STRUCT_MEMBER(int32, route_id) | 95 IPC_STRUCT_MEMBER(int32, route_id) |
93 IPC_STRUCT_MEMBER(gfx::Size, size) | 96 IPC_STRUCT_MEMBER(gfx::Size, size) |
94 IPC_STRUCT_MEMBER(float, scale_factor) | 97 IPC_STRUCT_MEMBER(float, scale_factor) |
95 IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) | 98 IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) |
96 IPC_STRUCT_END() | 99 IPC_STRUCT_END() |
97 | 100 |
| 101 IPC_STRUCT_BEGIN(AcceleratedJpegDecoderMsg_Decode_Params) |
| 102 IPC_STRUCT_MEMBER(int32, input_buffer_id) |
| 103 IPC_STRUCT_MEMBER(gfx::Size, coded_size) |
| 104 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, input_buffer_handle) |
| 105 IPC_STRUCT_MEMBER(uint32, input_buffer_size) |
| 106 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, output_video_frame_handle) |
| 107 IPC_STRUCT_MEMBER(uint32, output_buffer_size) |
| 108 IPC_STRUCT_END() |
| 109 |
98 #if defined(OS_MACOSX) | 110 #if defined(OS_MACOSX) |
99 IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params) | 111 IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params) |
100 // If the browser needs framerate throttling based on GPU back-pressure to be | 112 // If the browser needs framerate throttling based on GPU back-pressure to be |
101 // disabled (e.g, because the NSView isn't visible but tab capture is active), | 113 // disabled (e.g, because the NSView isn't visible but tab capture is active), |
102 // then this is set to true. | 114 // then this is set to true. |
103 IPC_STRUCT_MEMBER(bool, disable_throttling) | 115 IPC_STRUCT_MEMBER(bool, disable_throttling) |
104 // If the browser is drawing to the screen, this is the CGL renderer ID of | 116 // If the browser is drawing to the screen, this is the CGL renderer ID of |
105 // the GL context that the brower is using. | 117 // the GL context that the brower is using. |
106 IPC_STRUCT_MEMBER(int32, renderer_id) | 118 IPC_STRUCT_MEMBER(int32, renderer_id) |
107 IPC_STRUCT_END() | 119 IPC_STRUCT_END() |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // Tells the GPU process to create a new gpu memory buffer. | 275 // Tells the GPU process to create a new gpu memory buffer. |
264 IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBuffer, | 276 IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBuffer, |
265 GpuMsg_CreateGpuMemoryBuffer_Params) | 277 GpuMsg_CreateGpuMemoryBuffer_Params) |
266 | 278 |
267 // Tells the GPU process to destroy buffer. | 279 // Tells the GPU process to destroy buffer. |
268 IPC_MESSAGE_CONTROL3(GpuMsg_DestroyGpuMemoryBuffer, | 280 IPC_MESSAGE_CONTROL3(GpuMsg_DestroyGpuMemoryBuffer, |
269 gfx::GpuMemoryBufferId, /* id */ | 281 gfx::GpuMemoryBufferId, /* id */ |
270 int32, /* client_id */ | 282 int32, /* client_id */ |
271 int32 /* sync_point */) | 283 int32 /* sync_point */) |
272 | 284 |
| 285 // Create and initialize a hardware jpeg decoder using the specified route_id. |
| 286 // Created decoders should be freed with AcceleratedJpegDecoderMsg_Destroy when |
| 287 // no longer needed. |
| 288 IPC_SYNC_MESSAGE_CONTROL1_1(GpuMsg_CreateJpegDecoder, |
| 289 int32 /* route_id */, |
| 290 bool /* succeeded */) |
| 291 |
273 // Tells the GPU process to create a context for collecting graphics card | 292 // Tells the GPU process to create a context for collecting graphics card |
274 // information. | 293 // information. |
275 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) | 294 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) |
276 | 295 |
277 // Tells the GPU process to report video_memory information for the task manager | 296 // Tells the GPU process to report video_memory information for the task manager |
278 IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats) | 297 IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats) |
279 | 298 |
280 #if defined(OS_MACOSX) | 299 #if defined(OS_MACOSX) |
281 // Tells the GPU process that the browser process has handled the swap | 300 // Tells the GPU process that the browser process has handled the swap |
282 // buffers or post sub-buffer request. | 301 // buffers or post sub-buffer request. |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 int32 /* bitstream_buffer_id */, | 760 int32 /* bitstream_buffer_id */, |
742 uint32 /* payload_size */, | 761 uint32 /* payload_size */, |
743 bool /* key_frame */) | 762 bool /* key_frame */) |
744 | 763 |
745 // Report error condition. | 764 // Report error condition. |
746 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, | 765 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, |
747 media::VideoEncodeAccelerator::Error /* error */) | 766 media::VideoEncodeAccelerator::Error /* error */) |
748 | 767 |
749 // Send destroy request to the encoder. | 768 // Send destroy request to the encoder. |
750 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderMsg_Destroy) | 769 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderMsg_Destroy) |
| 770 |
| 771 //------------------------------------------------------------------------------ |
| 772 // Accelerated JPEG Decoder Messages |
| 773 // These messages are sent from the Browser process to GPU process. |
| 774 |
| 775 // Decode one JPEG image from shared memory |input_buffer_handle| with size |
| 776 // |input_buffer_size|. The input buffer is associated with |input_buffer_id| |
| 777 // and the size of JPEG image is |coded_size|. Decoded I420 frame data will |
| 778 // be put onto shared memory associated with |output_video_frame_handle| |
| 779 // with size limit |output_buffer_size|. |
| 780 IPC_MESSAGE_ROUTED1(AcceleratedJpegDecoderMsg_Decode, |
| 781 AcceleratedJpegDecoderMsg_Decode_Params) |
| 782 |
| 783 IPC_MESSAGE_ROUTED0(AcceleratedJpegDecoderMsg_Destroy) |
| 784 |
| 785 //------------------------------------------------------------------------------ |
| 786 // Accelerated JPEG Decoder Host Messages |
| 787 // These messages are sent from the GPU process to Browser process. |
| 788 // Decoder reports that a video frame is ready. |
| 789 IPC_MESSAGE_ROUTED1(AcceleratedJpegDecoderHostMsg_VideoFrameReady, |
| 790 int32) /* Bitstream buffer ID */ |
| 791 |
| 792 IPC_MESSAGE_ROUTED2(AcceleratedJpegDecoderHostMsg_NotifyError, |
| 793 int32_t, /* bitstream_buffer_id */ |
| 794 media::JpegDecodeAccelerator::Error) /* error */ |
OLD | NEW |