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

Side by Side Diff: content/common/gpu/client/gpu_video_encode_accelerator_host.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: posciak@ and magjed@ comments. 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_CLIENT_GPU_VIDEO_ENCODE_ACCELERATOR_HOST_H_ 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_ENCODE_ACCELERATOR_HOST_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_ENCODE_ACCELERATOR_HOST_H_ 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_ENCODE_ACCELERATOR_HOST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/threading/non_thread_safe.h" 13 #include "base/threading/non_thread_safe.h"
14 #include "content/common/gpu/client/command_buffer_proxy_impl.h" 14 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
15 #include "gpu/config/gpu_info.h" 15 #include "gpu/config/gpu_info.h"
16 #include "ipc/ipc_listener.h" 16 #include "ipc/ipc_listener.h"
17 #include "media/video/video_encode_accelerator.h" 17 #include "media/video/video_encode_accelerator.h"
18 18
19 namespace gfx { 19 namespace gfx {
20 20
mcasas 2015/06/04 15:20:55 i know this is not your code, but please remove th
emircan 2015/06/04 22:04:40 Done.
21 class Size; 21 class Size;
22 22
23 } // namespace gfx 23 } // namespace gfx
24 24
25 namespace media { 25 namespace media {
26 26
27 class VideoFrame; 27 class VideoFrame;
28 28
29 } // namespace media 29 } // namespace media
30 30
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 uint32 framerate_num) override; 63 uint32 framerate_num) override;
64 void Destroy() override; 64 void Destroy() override;
65 65
66 // CommandBufferProxyImpl::DeletionObserver implemetnation. 66 // CommandBufferProxyImpl::DeletionObserver implemetnation.
67 void OnWillDeleteImpl() override; 67 void OnWillDeleteImpl() override;
68 68
69 private: 69 private:
70 // Only Destroy() should be deleting |this|. 70 // Only Destroy() should be deleting |this|.
71 ~GpuVideoEncodeAcceleratorHost() override; 71 ~GpuVideoEncodeAcceleratorHost() override;
72 72
73 // Encode implementations for video frames with different storage types.
74 // Return true on successful completion.
75 bool EncodeNativeTexture(const scoped_refptr<media::VideoFrame>& frame,
76 bool force_keyframe);
77 bool EncodeSharedMemory(const scoped_refptr<media::VideoFrame>& frame,
78 bool force_keyframe);
79
73 // Notify |client_| of an error. Posts a task to avoid re-entrancy. 80 // Notify |client_| of an error. Posts a task to avoid re-entrancy.
74 void PostNotifyError(Error); 81 void PostNotifyError(Error);
75 82
76 void Send(IPC::Message* message); 83 void Send(IPC::Message* message);
77 84
78 // IPC handlers, proxying media::VideoEncodeAccelerator::Client for the GPU 85 // IPC handlers, proxying media::VideoEncodeAccelerator::Client for the GPU
79 // process. Should not be called directly. 86 // process. Should not be called directly.
80 void OnRequireBitstreamBuffers(uint32 input_count, 87 void OnRequireBitstreamBuffers(uint32 input_count,
81 const gfx::Size& input_coded_size, 88 const gfx::Size& input_coded_size,
82 uint32 output_buffer_size); 89 uint32 output_buffer_size);
(...skipping 29 matching lines...) Expand all
112 119
113 // WeakPtr factory for posting tasks back to itself. 120 // WeakPtr factory for posting tasks back to itself.
114 base::WeakPtrFactory<GpuVideoEncodeAcceleratorHost> weak_this_factory_; 121 base::WeakPtrFactory<GpuVideoEncodeAcceleratorHost> weak_this_factory_;
115 122
116 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAcceleratorHost); 123 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAcceleratorHost);
117 }; 124 };
118 125
119 } // namespace content 126 } // namespace content
120 127
121 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_ENCODE_ACCELERATOR_HOST_H_ 128 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_ENCODE_ACCELERATOR_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698