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

Side by Side Diff: content/common/gpu/media/gpu_video_encode_accelerator.h

Issue 1128213005: Passing Native Texture backed Video Frame from Renderer to GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "content/common/gpu/gpu_command_buffer_stub.h" 12 #include "content/common/gpu/gpu_command_buffer_stub.h"
13 #include "gpu/command_buffer/common/mailbox_holder.h"
13 #include "gpu/config/gpu_info.h" 14 #include "gpu/config/gpu_info.h"
14 #include "ipc/ipc_listener.h" 15 #include "ipc/ipc_listener.h"
15 #include "media/video/video_encode_accelerator.h" 16 #include "media/video/video_encode_accelerator.h"
16 #include "ui/gfx/geometry/size.h" 17 #include "ui/gfx/geometry/size.h"
17 18
18 namespace base { 19 namespace base {
19 20
20 class SharedMemory; 21 class SharedMemory;
21 22
22 } // namespace base 23 } // namespace base
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 68
68 // Return a set of VEA Create function pointers applicable to the current 69 // Return a set of VEA Create function pointers applicable to the current
69 // platform. 70 // platform.
70 static std::vector<CreateVEAFp> CreateVEAFps(); 71 static std::vector<CreateVEAFp> CreateVEAFps();
71 static scoped_ptr<media::VideoEncodeAccelerator> CreateV4L2VEA(); 72 static scoped_ptr<media::VideoEncodeAccelerator> CreateV4L2VEA();
72 static scoped_ptr<media::VideoEncodeAccelerator> CreateVaapiVEA(); 73 static scoped_ptr<media::VideoEncodeAccelerator> CreateVaapiVEA();
73 static scoped_ptr<media::VideoEncodeAccelerator> CreateAndroidVEA(); 74 static scoped_ptr<media::VideoEncodeAccelerator> CreateAndroidVEA();
74 75
75 // IPC handlers, proxying media::VideoEncodeAccelerator for the renderer 76 // IPC handlers, proxying media::VideoEncodeAccelerator for the renderer
76 // process. 77 // process.
77 void OnEncode(int32 frame_id, 78 void OnEncodeSharedMemory(int32 frame_id,
78 base::SharedMemoryHandle buffer_handle, 79 base::SharedMemoryHandle buffer_handle,
79 uint32 buffer_offset, 80 uint32 buffer_offset,
80 uint32 buffer_size, 81 uint32 buffer_size,
81 bool force_keyframe); 82 bool force_keyframe);
83 void OnEncodeNativeTexture(int32 frame_id,
84 gpu::MailboxHolder buffer_handle,
85 bool force_keyframe);
82 void OnUseOutputBitstreamBuffer(int32 buffer_id, 86 void OnUseOutputBitstreamBuffer(int32 buffer_id,
83 base::SharedMemoryHandle buffer_handle, 87 base::SharedMemoryHandle buffer_handle,
84 uint32 buffer_size); 88 uint32 buffer_size);
85 void OnRequestEncodingParametersChange(uint32 bitrate, uint32 framerate); 89 void OnRequestEncodingParametersChange(uint32 bitrate, uint32 framerate);
86 90
87 void OnDestroy(); 91 void OnDestroy();
88 92
89 void EncodeFrameFinished(int32 frame_id, scoped_ptr<base::SharedMemory> shm); 93 void EncodeFrameFinished(int32 frame_id, scoped_ptr<base::SharedMemory> shm);
magjed_chromium 2015/06/03 08:40:00 Maybe rename this function to EncodeSharedMemoryFr
Pawel Osciak 2015/06/03 10:28:56 +1.
emircan 2015/06/03 20:56:12 Done.
90 94
95 void EncodeNativeTextureFrameFinished(int32 frame_id);
96
91 void Send(IPC::Message* message); 97 void Send(IPC::Message* message);
92 // Helper for replying to the creation request. 98 // Helper for replying to the creation request.
93 void SendCreateEncoderReply(IPC::Message* message, bool succeeded); 99 void SendCreateEncoderReply(IPC::Message* message, bool succeeded);
94 100
95 // Route ID to communicate with the host. 101 // Route ID to communicate with the host.
96 int32 host_route_id_; 102 int32 host_route_id_;
97 103
98 // Unowned pointer to the underlying GpuCommandBufferStub. |this| is 104 // Unowned pointer to the underlying GpuCommandBufferStub. |this| is
99 // registered as a DestuctionObserver of |stub_| and will self-delete when 105 // registered as a DestuctionObserver of |stub_| and will self-delete when
100 // |stub_| is destroyed. 106 // |stub_| is destroyed.
(...skipping 11 matching lines...) Expand all
112 118
113 // Weak pointer for media::VideoFrames that refer back to |this|. 119 // Weak pointer for media::VideoFrames that refer back to |this|.
114 base::WeakPtrFactory<GpuVideoEncodeAccelerator> weak_this_factory_; 120 base::WeakPtrFactory<GpuVideoEncodeAccelerator> weak_this_factory_;
115 121
116 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAccelerator); 122 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAccelerator);
117 }; 123 };
118 124
119 } // namespace content 125 } // namespace content
120 126
121 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_ 127 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ENCODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698