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

Side by Side Diff: media/gpu/ipc/service/gpu_video_encode_accelerator.h

Issue 2395913003: Cleanup of passing GpuMemoryBuffer backed video frames (Closed)
Patch Set: Rebase Created 4 years, 2 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 MEDIA_GPU_IPC_SERVICE_GPU_VIDEO_ENCODE_ACCELERATOR_H_ 5 #ifndef MEDIA_GPU_IPC_SERVICE_GPU_VIDEO_ENCODE_ACCELERATOR_H_
6 #define MEDIA_GPU_IPC_SERVICE_GPU_VIDEO_ENCODE_ACCELERATOR_H_ 6 #define MEDIA_GPU_IPC_SERVICE_GPU_VIDEO_ENCODE_ACCELERATOR_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory> 11 #include <memory>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "gpu/config/gpu_info.h" 16 #include "gpu/config/gpu_info.h"
17 #include "gpu/ipc/service/gpu_command_buffer_stub.h" 17 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
18 #include "ipc/ipc_listener.h" 18 #include "ipc/ipc_listener.h"
19 #include "media/video/video_encode_accelerator.h" 19 #include "media/video/video_encode_accelerator.h"
20 #include "ui/gfx/geometry/size.h" 20 #include "ui/gfx/geometry/size.h"
21 21
22 struct AcceleratedVideoEncoderMsg_Encode_Params; 22 struct AcceleratedVideoEncoderMsg_Encode_Params;
23 struct AcceleratedVideoEncoderMsg_Encode_Params2;
24 23
25 namespace base { 24 namespace base {
26 class SharedMemory; 25 class SharedMemory;
27 } // namespace base 26 } // namespace base
28 27
29 namespace gpu { 28 namespace gpu {
30 struct GpuPreferences; 29 struct GpuPreferences;
31 } // namespace gpu 30 } // namespace gpu
32 31
33 namespace media { 32 namespace media {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 private: 75 private:
77 // Returns a vector of VEAFactoryFunctions for the current platform. 76 // Returns a vector of VEAFactoryFunctions for the current platform.
78 using VEAFactoryFunction = 77 using VEAFactoryFunction =
79 base::Callback<std::unique_ptr<VideoEncodeAccelerator>()>; 78 base::Callback<std::unique_ptr<VideoEncodeAccelerator>()>;
80 static std::vector<VEAFactoryFunction> GetVEAFactoryFunctions( 79 static std::vector<VEAFactoryFunction> GetVEAFactoryFunctions(
81 const gpu::GpuPreferences& gpu_preferences); 80 const gpu::GpuPreferences& gpu_preferences);
82 81
83 // IPC handlers, proxying VideoEncodeAccelerator for the renderer 82 // IPC handlers, proxying VideoEncodeAccelerator for the renderer
84 // process. 83 // process.
85 void OnEncode(const AcceleratedVideoEncoderMsg_Encode_Params& params); 84 void OnEncode(const AcceleratedVideoEncoderMsg_Encode_Params& params);
86 void OnEncode2(const AcceleratedVideoEncoderMsg_Encode_Params2& params);
87 void OnUseOutputBitstreamBuffer(int32_t buffer_id, 85 void OnUseOutputBitstreamBuffer(int32_t buffer_id,
88 base::SharedMemoryHandle buffer_handle, 86 base::SharedMemoryHandle buffer_handle,
89 uint32_t buffer_size); 87 uint32_t buffer_size);
90 void OnRequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate); 88 void OnRequestEncodingParametersChange(uint32_t bitrate, uint32_t framerate);
91 89
92 void OnDestroy(); 90 void OnDestroy();
93 91
94 void EncodeFrameFinished(int32_t frame_id, 92 void EncodeFrameFinished(int32_t frame_id,
95 std::unique_ptr<base::SharedMemory> shm); 93 std::unique_ptr<base::SharedMemory> shm);
96 void Send(IPC::Message* message); 94 void Send(IPC::Message* message);
(...skipping 18 matching lines...) Expand all
115 113
116 // Weak pointer for VideoFrames that refer back to |this|. 114 // Weak pointer for VideoFrames that refer back to |this|.
117 base::WeakPtrFactory<GpuVideoEncodeAccelerator> weak_this_factory_; 115 base::WeakPtrFactory<GpuVideoEncodeAccelerator> weak_this_factory_;
118 116
119 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAccelerator); 117 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAccelerator);
120 }; 118 };
121 119
122 } // namespace media 120 } // namespace media
123 121
124 #endif // MEDIA_GPU_IPC_SERVICE_GPU_VIDEO_ENCODE_ACCELERATOR_H_ 122 #endif // MEDIA_GPU_IPC_SERVICE_GPU_VIDEO_ENCODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « media/gpu/ipc/common/media_messages.h ('k') | media/gpu/ipc/service/gpu_video_encode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698