OLD | NEW |
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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 public media::VideoEncodeAccelerator, | 38 public media::VideoEncodeAccelerator, |
39 public CommandBufferProxyImpl::DeletionObserver, | 39 public CommandBufferProxyImpl::DeletionObserver, |
40 public base::NonThreadSafe { | 40 public base::NonThreadSafe { |
41 public: | 41 public: |
42 // |this| is guaranteed not to outlive |channel| and |impl|. (See comments | 42 // |this| is guaranteed not to outlive |channel| and |impl|. (See comments |
43 // for |channel_| and |impl_|.) | 43 // for |channel_| and |impl_|.) |
44 GpuVideoEncodeAcceleratorHost(GpuChannelHost* channel, | 44 GpuVideoEncodeAcceleratorHost(GpuChannelHost* channel, |
45 CommandBufferProxyImpl* impl); | 45 CommandBufferProxyImpl* impl); |
46 | 46 |
47 // IPC::Listener implementation. | 47 // IPC::Listener implementation. |
48 virtual bool OnMessageReceived(const IPC::Message& message) override; | 48 bool OnMessageReceived(const IPC::Message& message) override; |
49 virtual void OnChannelError() override; | 49 void OnChannelError() override; |
50 | 50 |
51 // media::VideoEncodeAccelerator implementation. | 51 // media::VideoEncodeAccelerator implementation. |
52 virtual std::vector<SupportedProfile> GetSupportedProfiles() override; | 52 std::vector<SupportedProfile> GetSupportedProfiles() override; |
53 virtual bool Initialize(media::VideoFrame::Format input_format, | 53 bool Initialize(media::VideoFrame::Format input_format, |
54 const gfx::Size& input_visible_size, | 54 const gfx::Size& input_visible_size, |
55 media::VideoCodecProfile output_profile, | 55 media::VideoCodecProfile output_profile, |
56 uint32 initial_bitrate, | 56 uint32 initial_bitrate, |
57 Client* client) override; | 57 Client* client) override; |
58 virtual void Encode(const scoped_refptr<media::VideoFrame>& frame, | 58 void Encode(const scoped_refptr<media::VideoFrame>& frame, |
59 bool force_keyframe) override; | 59 bool force_keyframe) override; |
60 virtual void UseOutputBitstreamBuffer( | 60 void UseOutputBitstreamBuffer(const media::BitstreamBuffer& buffer) override; |
61 const media::BitstreamBuffer& buffer) override; | 61 void RequestEncodingParametersChange(uint32 bitrate, |
62 virtual void RequestEncodingParametersChange(uint32 bitrate, | 62 uint32 framerate_num) override; |
63 uint32 framerate_num) override; | 63 void Destroy() override; |
64 virtual void Destroy() override; | |
65 | 64 |
66 // CommandBufferProxyImpl::DeletionObserver implemetnation. | 65 // CommandBufferProxyImpl::DeletionObserver implemetnation. |
67 virtual void OnWillDeleteImpl() override; | 66 void OnWillDeleteImpl() override; |
68 | 67 |
69 private: | 68 private: |
70 // Only Destroy() should be deleting |this|. | 69 // Only Destroy() should be deleting |this|. |
71 virtual ~GpuVideoEncodeAcceleratorHost(); | 70 ~GpuVideoEncodeAcceleratorHost() override; |
72 | 71 |
73 // Notify |client_| of an error. Posts a task to avoid re-entrancy. | 72 // Notify |client_| of an error. Posts a task to avoid re-entrancy. |
74 void PostNotifyError(Error); | 73 void PostNotifyError(Error); |
75 | 74 |
76 void Send(IPC::Message* message); | 75 void Send(IPC::Message* message); |
77 | 76 |
78 // IPC handlers, proxying media::VideoEncodeAccelerator::Client for the GPU | 77 // IPC handlers, proxying media::VideoEncodeAccelerator::Client for the GPU |
79 // process. Should not be called directly. | 78 // process. Should not be called directly. |
80 void OnRequireBitstreamBuffers(uint32 input_count, | 79 void OnRequireBitstreamBuffers(uint32 input_count, |
81 const gfx::Size& input_coded_size, | 80 const gfx::Size& input_coded_size, |
(...skipping 30 matching lines...) Expand all Loading... |
112 | 111 |
113 // WeakPtr factory for posting tasks back to itself. | 112 // WeakPtr factory for posting tasks back to itself. |
114 base::WeakPtrFactory<GpuVideoEncodeAcceleratorHost> weak_this_factory_; | 113 base::WeakPtrFactory<GpuVideoEncodeAcceleratorHost> weak_this_factory_; |
115 | 114 |
116 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAcceleratorHost); | 115 DISALLOW_COPY_AND_ASSIGN(GpuVideoEncodeAcceleratorHost); |
117 }; | 116 }; |
118 | 117 |
119 } // namespace content | 118 } // namespace content |
120 | 119 |
121 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_ENCODE_ACCELERATOR_HOST_H_ | 120 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_ENCODE_ACCELERATOR_HOST_H_ |
OLD | NEW |