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/gpu/gpu_memory_allocation.h" | 13 #include "content/common/gpu/gpu_memory_allocation.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_rendering_stats.h" | 16 #include "content/common/gpu/gpu_rendering_stats.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/command_buffer.h" | 19 #include "gpu/command_buffer/common/command_buffer.h" |
20 #include "gpu/command_buffer/common/constants.h" | 20 #include "gpu/command_buffer/common/constants.h" |
21 #include "gpu/command_buffer/common/mailbox.h" | 21 #include "gpu/command_buffer/common/mailbox.h" |
22 #include "gpu/config/gpu_info.h" | 22 #include "gpu/config/gpu_info.h" |
23 #include "gpu/ipc/gpu_command_buffer_traits.h" | 23 #include "gpu/ipc/gpu_command_buffer_traits.h" |
24 #include "ipc/ipc_channel_handle.h" | 24 #include "ipc/ipc_channel_handle.h" |
25 #include "ipc/ipc_message_macros.h" | 25 #include "ipc/ipc_message_macros.h" |
| 26 #include "media/base/video_frame.h" |
26 #include "media/video/video_decode_accelerator.h" | 27 #include "media/video/video_decode_accelerator.h" |
| 28 #include "media/video/video_encode_accelerator.h" |
27 #include "ui/base/latency_info.h" | 29 #include "ui/base/latency_info.h" |
28 #include "ui/gfx/native_widget_types.h" | 30 #include "ui/gfx/native_widget_types.h" |
29 #include "ui/gfx/size.h" | 31 #include "ui/gfx/size.h" |
30 #include "ui/gl/gpu_preference.h" | 32 #include "ui/gl/gpu_preference.h" |
31 | 33 |
32 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
33 #include "content/common/android/surface_texture_peer.h" | 35 #include "content/common/android/surface_texture_peer.h" |
34 #endif | 36 #endif |
35 | 37 |
36 #define IPC_MESSAGE_START GpuMsgStart | 38 #define IPC_MESSAGE_START GpuMsgStart |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 211 |
210 IPC_STRUCT_TRAITS_BEGIN(content::GpuRenderingStats) | 212 IPC_STRUCT_TRAITS_BEGIN(content::GpuRenderingStats) |
211 IPC_STRUCT_TRAITS_MEMBER(global_texture_upload_count) | 213 IPC_STRUCT_TRAITS_MEMBER(global_texture_upload_count) |
212 IPC_STRUCT_TRAITS_MEMBER(global_total_texture_upload_time) | 214 IPC_STRUCT_TRAITS_MEMBER(global_total_texture_upload_time) |
213 IPC_STRUCT_TRAITS_MEMBER(texture_upload_count) | 215 IPC_STRUCT_TRAITS_MEMBER(texture_upload_count) |
214 IPC_STRUCT_TRAITS_MEMBER(total_texture_upload_time) | 216 IPC_STRUCT_TRAITS_MEMBER(total_texture_upload_time) |
215 IPC_STRUCT_TRAITS_MEMBER(global_total_processing_commands_time) | 217 IPC_STRUCT_TRAITS_MEMBER(global_total_processing_commands_time) |
216 IPC_STRUCT_TRAITS_MEMBER(total_processing_commands_time) | 218 IPC_STRUCT_TRAITS_MEMBER(total_processing_commands_time) |
217 IPC_STRUCT_TRAITS_END() | 219 IPC_STRUCT_TRAITS_END() |
218 | 220 |
| 221 IPC_ENUM_TRAITS(media::VideoFrame::Format) |
| 222 |
| 223 IPC_ENUM_TRAITS(media::VideoEncodeAccelerator::Error) |
| 224 |
219 //------------------------------------------------------------------------------ | 225 //------------------------------------------------------------------------------ |
220 // GPU Messages | 226 // GPU Messages |
221 // These are messages from the browser to the GPU process. | 227 // These are messages from the browser to the GPU process. |
222 | 228 |
223 // Tells the GPU process to initialize itself. The browser explicitly | 229 // Tells the GPU process to initialize itself. The browser explicitly |
224 // requests this be done so that we are guaranteed that the channel is set | 230 // requests this be done so that we are guaranteed that the channel is set |
225 // up between the browser and GPU process before doing any work that might | 231 // up between the browser and GPU process before doing any work that might |
226 // potentially crash the GPU process. Detection of the child process | 232 // potentially crash the GPU process. Detection of the child process |
227 // exiting abruptly is predicated on having the IPC channel set up. | 233 // exiting abruptly is predicated on having the IPC channel set up. |
228 IPC_MESSAGE_CONTROL0(GpuMsg_Initialize) | 234 IPC_MESSAGE_CONTROL0(GpuMsg_Initialize) |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 std::vector<gpu::Mailbox> /* mailbox_names */) | 445 std::vector<gpu::Mailbox> /* mailbox_names */) |
440 | 446 |
441 // Generates n new unique mailbox names asynchronously. | 447 // Generates n new unique mailbox names asynchronously. |
442 IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesAsync, | 448 IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesAsync, |
443 unsigned /* num */) | 449 unsigned /* num */) |
444 | 450 |
445 // Reply to GpuChannelMsg_GenerateMailboxNamesAsync. | 451 // Reply to GpuChannelMsg_GenerateMailboxNamesAsync. |
446 IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesReply, | 452 IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesReply, |
447 std::vector<gpu::Mailbox> /* mailbox_names */) | 453 std::vector<gpu::Mailbox> /* mailbox_names */) |
448 | 454 |
| 455 // Create a new GPU-accelerated video encoder. |
| 456 IPC_SYNC_MESSAGE_CONTROL0_1(GpuChannelMsg_CreateVideoEncoder, |
| 457 int32 /* route_id */) |
| 458 |
| 459 IPC_MESSAGE_CONTROL1(GpuChannelMsg_DestroyVideoEncoder, int32 /* route_id */) |
| 460 |
449 #if defined(OS_ANDROID) | 461 #if defined(OS_ANDROID) |
450 // Register the StreamTextureProxy class with the GPU process, so that | 462 // Register the StreamTextureProxy class with the GPU process, so that |
451 // the renderer process will get notified whenever a frame becomes available. | 463 // the renderer process will get notified whenever a frame becomes available. |
452 IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_RegisterStreamTextureProxy, | 464 IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_RegisterStreamTextureProxy, |
453 int32, /* stream_id */ | 465 int32, /* stream_id */ |
454 int /* route_id */) | 466 int /* route_id */) |
455 | 467 |
456 // Tells the GPU process create and send the java surface texture object to | 468 // Tells the GPU process create and send the java surface texture object to |
457 // the renderer process through the binder thread. | 469 // the renderer process through the binder thread. |
458 IPC_MESSAGE_CONTROL3(GpuChannelMsg_EstablishStreamTexture, | 470 IPC_MESSAGE_CONTROL3(GpuChannelMsg_EstablishStreamTexture, |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 | 694 |
683 // Confirm decoder has been flushed. | 695 // Confirm decoder has been flushed. |
684 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone) | 696 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone) |
685 | 697 |
686 // Confirm decoder has been reset. | 698 // Confirm decoder has been reset. |
687 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) | 699 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) |
688 | 700 |
689 // Video decoder has encountered an error. | 701 // Video decoder has encountered an error. |
690 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, | 702 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, |
691 uint32) /* Error ID */ | 703 uint32) /* Error ID */ |
| 704 |
| 705 //------------------------------------------------------------------------------ |
| 706 // Accelerated Video Encoder Messages |
| 707 // These messages are sent from the Renderer process to GPU process. |
| 708 |
| 709 // Initialize the accelerated encoder. |
| 710 IPC_MESSAGE_ROUTED4(AcceleratedVideoEncoderMsg_Initialize, |
| 711 media::VideoFrame::Format /* input_format */, |
| 712 gfx::Size /* input_resolution */, |
| 713 media::VideoCodecProfile /* output_profile */, |
| 714 int32 /* initial_bitrate */) |
| 715 |
| 716 // Queue a input buffer to the encoder to encode. |
| 717 IPC_MESSAGE_ROUTED4(AcceleratedVideoEncoderMsg_Encode, |
| 718 int32 /* buffer_id */, |
| 719 base::SharedMemoryHandle /* buffer_handle */, |
| 720 uint32 /* buffer_size */, |
| 721 bool /* force_keyframe */) |
| 722 |
| 723 // Queue a buffer to the encoder for use in returning output. |
| 724 IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderMsg_UseOutputBitstreamBuffer, |
| 725 int32 /* buffer_id */, |
| 726 base::SharedMemoryHandle /* buffer_handle */, |
| 727 uint32 /* buffer_size */) |
| 728 |
| 729 // Request a runtime encoding parameter change. |
| 730 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderMsg_RequestEncodingParameterChange, |
| 731 int32 /* bitrate */) |
| 732 |
| 733 //------------------------------------------------------------------------------ |
| 734 // Accelerated Video Encoder Host Messages |
| 735 // These messages are sent from GPU process to Renderer process. |
| 736 |
| 737 IPC_MESSAGE_ROUTED0(AcceleratedVideoEncoderHostMsg_NotifyInitializeDone) |
| 738 |
| 739 IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_RequireBitstreamBuffers, |
| 740 int /* input_count */, |
| 741 gfx::Size /* input_dimensions */, |
| 742 uint32 /* output_size */) |
| 743 |
| 744 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyInputDone, |
| 745 int32 /* bitstream_buffer_id */) |
| 746 |
| 747 IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_BitstreamBufferReady, |
| 748 int32 /* bitstream_buffer_id */, |
| 749 uint32 /* payload_size */, |
| 750 bool /* key_frame */) |
| 751 |
| 752 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, |
| 753 media::VideoEncodeAccelerator::Error /* error */) |
OLD | NEW |