| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RENDERER_PEPPER_PEPPER_VIDEO_ENCODER_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_ENCODER_HOST_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_ENCODER_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_ENCODER_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "media/video/video_encode_accelerator.h" | 16 #include "media/video/video_encode_accelerator.h" |
| 17 #include "ppapi/c/pp_codecs.h" | 17 #include "ppapi/c/pp_codecs.h" |
| 18 #include "ppapi/c/ppb_video_frame.h" | 18 #include "ppapi/c/ppb_video_frame.h" |
| 19 #include "ppapi/host/host_message_context.h" | 19 #include "ppapi/host/host_message_context.h" |
| 20 #include "ppapi/host/resource_host.h" | 20 #include "ppapi/host/resource_host.h" |
| 21 #include "ppapi/proxy/resource_message_params.h" | 21 #include "ppapi/proxy/resource_message_params.h" |
| 22 #include "ppapi/shared_impl/media_stream_buffer_manager.h" | 22 #include "ppapi/shared_impl/media_stream_buffer_manager.h" |
| 23 | 23 |
| 24 namespace gpu { |
| 25 class CommandBufferProxyImpl; |
| 26 class GpuChannelHost; |
| 27 } |
| 28 |
| 24 namespace media { | 29 namespace media { |
| 25 class GpuVideoAcceleratorFactories; | 30 class GpuVideoAcceleratorFactories; |
| 26 } | 31 } |
| 27 | 32 |
| 28 namespace content { | 33 namespace content { |
| 29 | 34 |
| 30 class CommandBufferProxyImpl; | |
| 31 class GpuChannelHost; | |
| 32 class RendererPpapiHost; | 35 class RendererPpapiHost; |
| 33 class VideoEncoderShim; | 36 class VideoEncoderShim; |
| 34 | 37 |
| 35 class CONTENT_EXPORT PepperVideoEncoderHost | 38 class CONTENT_EXPORT PepperVideoEncoderHost |
| 36 : public ppapi::host::ResourceHost, | 39 : public ppapi::host::ResourceHost, |
| 37 public media::VideoEncodeAccelerator::Client, | 40 public media::VideoEncodeAccelerator::Client, |
| 38 public ppapi::MediaStreamBufferManager::Delegate { | 41 public ppapi::MediaStreamBufferManager::Delegate { |
| 39 public: | 42 public: |
| 40 PepperVideoEncoderHost(RendererPpapiHost* host, | 43 PepperVideoEncoderHost(RendererPpapiHost* host, |
| 41 PP_Instance instance, | 44 PP_Instance instance, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 uint8_t* ShmHandleToAddress(int32_t buffer_id); | 122 uint8_t* ShmHandleToAddress(int32_t buffer_id); |
| 120 | 123 |
| 121 // Non-owning pointer. | 124 // Non-owning pointer. |
| 122 RendererPpapiHost* renderer_ppapi_host_; | 125 RendererPpapiHost* renderer_ppapi_host_; |
| 123 | 126 |
| 124 ScopedVector<ShmBuffer> shm_buffers_; | 127 ScopedVector<ShmBuffer> shm_buffers_; |
| 125 | 128 |
| 126 // Buffer manager for shared memory that holds video frames. | 129 // Buffer manager for shared memory that holds video frames. |
| 127 ppapi::MediaStreamBufferManager buffer_manager_; | 130 ppapi::MediaStreamBufferManager buffer_manager_; |
| 128 | 131 |
| 129 scoped_refptr<GpuChannelHost> channel_; | 132 scoped_refptr<gpu::GpuChannelHost> channel_; |
| 130 scoped_ptr<CommandBufferProxyImpl> command_buffer_; | 133 scoped_ptr<gpu::CommandBufferProxyImpl> command_buffer_; |
| 131 | 134 |
| 132 scoped_ptr<media::VideoEncodeAccelerator> encoder_; | 135 scoped_ptr<media::VideoEncodeAccelerator> encoder_; |
| 133 | 136 |
| 134 // Whether the encoder has been successfully initialized. | 137 // Whether the encoder has been successfully initialized. |
| 135 bool initialized_; | 138 bool initialized_; |
| 136 | 139 |
| 137 // Saved context to answer an Initialize message from the plugin. | 140 // Saved context to answer an Initialize message from the plugin. |
| 138 ppapi::host::ReplyMessageContext initialize_reply_context_; | 141 ppapi::host::ReplyMessageContext initialize_reply_context_; |
| 139 | 142 |
| 140 // Saved context to answer a GetVideoFrames message from the plugin. | 143 // Saved context to answer a GetVideoFrames message from the plugin. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 159 media::VideoPixelFormat media_input_format_; | 162 media::VideoPixelFormat media_input_format_; |
| 160 | 163 |
| 161 base::WeakPtrFactory<PepperVideoEncoderHost> weak_ptr_factory_; | 164 base::WeakPtrFactory<PepperVideoEncoderHost> weak_ptr_factory_; |
| 162 | 165 |
| 163 DISALLOW_COPY_AND_ASSIGN(PepperVideoEncoderHost); | 166 DISALLOW_COPY_AND_ASSIGN(PepperVideoEncoderHost); |
| 164 }; | 167 }; |
| 165 | 168 |
| 166 } // namespace content | 169 } // namespace content |
| 167 | 170 |
| 168 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_ENCODER_HOST_H_ | 171 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_ENCODER_HOST_H_ |
| OLD | NEW |