Commit 377c2e7f authored by lionel.g.landwerlin's avatar lionel.g.landwerlin Committed by Commit bot

ppapi: VideoEncoder: Add proxy boilerplate

BUG=455409
TEST=none

Review URL: https://codereview.chromium.org/887223009

Cr-Commit-Position: refs/heads/master@{#315007}
parent 1ae0930d
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
#include "ppapi/c/ppb_var_array_buffer.h" #include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/ppb_var_dictionary.h" #include "ppapi/c/ppb_var_dictionary.h"
#include "ppapi/c/ppb_video_decoder.h" #include "ppapi/c/ppb_video_decoder.h"
#include "ppapi/c/ppb_video_encoder.h"
#include "ppapi/c/ppb_video_frame.h" #include "ppapi/c/ppb_video_frame.h"
#include "ppapi/c/ppb_view.h" #include "ppapi/c/ppb_view.h"
#include "ppapi/c/ppb_websocket.h" #include "ppapi/c/ppb_websocket.h"
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
#include "ppapi/c/ppb_var_array_buffer.h" #include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/ppb_var_dictionary.h" #include "ppapi/c/ppb_var_dictionary.h"
#include "ppapi/c/ppb_video_decoder.h" #include "ppapi/c/ppb_video_decoder.h"
#include "ppapi/c/ppb_video_encoder.h"
#include "ppapi/c/ppb_video_frame.h" #include "ppapi/c/ppb_video_frame.h"
#include "ppapi/c/ppb_view.h" #include "ppapi/c/ppb_view.h"
#include "ppapi/c/ppp.h" #include "ppapi/c/ppp.h"
......
...@@ -338,6 +338,10 @@ PP_Resource ResourceCreationImpl::CreateVideoDestination(PP_Instance instance) { ...@@ -338,6 +338,10 @@ PP_Resource ResourceCreationImpl::CreateVideoDestination(PP_Instance instance) {
return 0; // Not supported in-process. return 0; // Not supported in-process.
} }
PP_Resource ResourceCreationImpl::CreateVideoEncoder(PP_Instance instance) {
return 0; // Not supported in-process.
}
PP_Resource ResourceCreationImpl::CreateVideoSource(PP_Instance instance) { PP_Resource ResourceCreationImpl::CreateVideoSource(PP_Instance instance) {
return 0; // Not supported in-process. return 0; // Not supported in-process.
} }
......
...@@ -127,6 +127,7 @@ class ResourceCreationImpl : public ppapi::thunk::ResourceCreationAPI { ...@@ -127,6 +127,7 @@ class ResourceCreationImpl : public ppapi::thunk::ResourceCreationAPI {
PP_Resource graphics3d_id, PP_Resource graphics3d_id,
PP_VideoDecoder_Profile profile) override; PP_VideoDecoder_Profile profile) override;
PP_Resource CreateVideoDestination(PP_Instance instance) override; PP_Resource CreateVideoDestination(PP_Instance instance) override;
PP_Resource CreateVideoEncoder(PP_Instance instance) override;
PP_Resource CreateVideoSource(PP_Instance instance) override; PP_Resource CreateVideoSource(PP_Instance instance) override;
PP_Resource CreateWheelInputEvent(PP_Instance instance, PP_Resource CreateWheelInputEvent(PP_Instance instance,
PP_TimeTicks time_stamp, PP_TimeTicks time_stamp,
......
...@@ -332,6 +332,8 @@ component("ppapi_shared") { ...@@ -332,6 +332,8 @@ component("ppapi_shared") {
"thunk/ppb_video_decoder_thunk.cc", "thunk/ppb_video_decoder_thunk.cc",
"thunk/ppb_video_destination_private_api.h", "thunk/ppb_video_destination_private_api.h",
"thunk/ppb_video_destination_private_thunk.cc", "thunk/ppb_video_destination_private_thunk.cc",
"thunk/ppb_video_encoder_api.h",
"thunk/ppb_video_encoder_thunk.cc",
"thunk/ppb_video_frame_api.h", "thunk/ppb_video_frame_api.h",
"thunk/ppb_video_frame_thunk.cc", "thunk/ppb_video_frame_thunk.cc",
"thunk/ppb_video_source_private_api.h", "thunk/ppb_video_source_private_api.h",
...@@ -720,6 +722,8 @@ component("ppapi_proxy") { ...@@ -720,6 +722,8 @@ component("ppapi_proxy") {
"proxy/ppp_video_decoder_proxy.h", "proxy/ppp_video_decoder_proxy.h",
"proxy/video_decoder_resource.cc", "proxy/video_decoder_resource.cc",
"proxy/video_decoder_resource.h", "proxy/video_decoder_resource.h",
"proxy/video_encoder_resource.cc",
"proxy/video_encoder_resource.h",
"proxy/talk_resource.cc", "proxy/talk_resource.cc",
"proxy/talk_resource.h", "proxy/talk_resource.h",
"proxy/video_capture_resource.cc", "proxy/video_capture_resource.cc",
......
...@@ -45,15 +45,16 @@ int32_t VideoEncoder::GetSupportedProfiles(const CompletionCallbackWithOutput< ...@@ -45,15 +45,16 @@ int32_t VideoEncoder::GetSupportedProfiles(const CompletionCallbackWithOutput<
} }
int32_t VideoEncoder::Initialize(const PP_VideoFrame_Format& input_format, int32_t VideoEncoder::Initialize(const PP_VideoFrame_Format& input_format,
const PP_Size& input_visible_size, const Size& input_visible_size,
const PP_VideoProfile& output_profile, const PP_VideoProfile& output_profile,
const uint32_t initial_bitrate, const uint32_t initial_bitrate,
PP_HardwareAcceleration acceleration, PP_HardwareAcceleration acceleration,
const CompletionCallback& cc) { const CompletionCallback& cc) {
if (has_interface<PPB_VideoEncoder_0_1>()) { if (has_interface<PPB_VideoEncoder_0_1>()) {
return get_interface<PPB_VideoEncoder_0_1>()->Initialize( return get_interface<PPB_VideoEncoder_0_1>()->Initialize(
pp_resource(), input_format, &input_visible_size, output_profile, pp_resource(), input_format, &input_visible_size.pp_size(),
initial_bitrate, acceleration, cc.pp_completion_callback()); output_profile, initial_bitrate, acceleration,
cc.pp_completion_callback());
} }
return cc.MayForce(PP_ERROR_NOINTERFACE); return cc.MayForce(PP_ERROR_NOINTERFACE);
} }
...@@ -66,10 +67,10 @@ int32_t VideoEncoder::GetFramesRequired() { ...@@ -66,10 +67,10 @@ int32_t VideoEncoder::GetFramesRequired() {
return PP_ERROR_NOINTERFACE; return PP_ERROR_NOINTERFACE;
} }
int32_t VideoEncoder::GetFrameCodedSize(PP_Size* coded_size) { int32_t VideoEncoder::GetFrameCodedSize(Size* coded_size) {
if (has_interface<PPB_VideoEncoder_0_1>()) { if (has_interface<PPB_VideoEncoder_0_1>()) {
return get_interface<PPB_VideoEncoder_0_1>()->GetFrameCodedSize( return get_interface<PPB_VideoEncoder_0_1>()->GetFrameCodedSize(
pp_resource(), coded_size); pp_resource(), &coded_size->pp_size());
} }
return PP_ERROR_NOINTERFACE; return PP_ERROR_NOINTERFACE;
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "ppapi/c/pp_codecs.h" #include "ppapi/c/pp_codecs.h"
#include "ppapi/c/pp_size.h" #include "ppapi/c/pp_size.h"
#include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/graphics_3d.h"
#include "ppapi/cpp/resource.h" #include "ppapi/cpp/resource.h"
#include "ppapi/cpp/size.h" #include "ppapi/cpp/size.h"
#include "ppapi/cpp/video_frame.h" #include "ppapi/cpp/video_frame.h"
...@@ -74,7 +73,7 @@ class VideoEncoder : public Resource { ...@@ -74,7 +73,7 @@ class VideoEncoder : public Resource {
/// ///
/// @param[in] input_format The <code>PP_VideoFrame_Format</code> of the /// @param[in] input_format The <code>PP_VideoFrame_Format</code> of the
/// frames which will be encoded. /// frames which will be encoded.
/// @param[in] input_visible_size A <code>PP_Size</code> specifying the /// @param[in] input_visible_size A <code>Size</code> specifying the
/// dimensions of the visible part of the input frames. /// dimensions of the visible part of the input frames.
/// @param[in] output_profile A <code>PP_VideoProfile</code> specifying the /// @param[in] output_profile A <code>PP_VideoProfile</code> specifying the
/// codec profile of the encoded output stream. /// codec profile of the encoded output stream.
...@@ -88,7 +87,7 @@ class VideoEncoder : public Resource { ...@@ -88,7 +87,7 @@ class VideoEncoder : public Resource {
/// requested codec profile is not supported. /// requested codec profile is not supported.
/// Returns PP_ERROR_NOMEMORY if frame and bitstream buffers can't be created. /// Returns PP_ERROR_NOMEMORY if frame and bitstream buffers can't be created.
int32_t Initialize(const PP_VideoFrame_Format& input_format, int32_t Initialize(const PP_VideoFrame_Format& input_format,
const PP_Size& input_visible_size, const Size& input_visible_size,
const PP_VideoProfile& output_profile, const PP_VideoProfile& output_profile,
const uint32_t initial_bitrate, const uint32_t initial_bitrate,
PP_HardwareAcceleration acceleration, PP_HardwareAcceleration acceleration,
...@@ -108,10 +107,11 @@ class VideoEncoder : public Resource { ...@@ -108,10 +107,11 @@ class VideoEncoder : public Resource {
/// have hardware alignment requirements that make this different from /// have hardware alignment requirements that make this different from
/// |input_visible_size|, as requested in the call to Initialize(). /// |input_visible_size|, as requested in the call to Initialize().
/// ///
/// @param[in] coded_size A <code>PP_Size</code> to hold the coded size. /// @param[in] coded_size A <code>Size</code> to hold the coded size.
///
/// @return An int32_t containing a result code from <code>pp_errors.h</code>. /// @return An int32_t containing a result code from <code>pp_errors.h</code>.
/// Returns PP_ERROR_FAILED if Initialize() has not successfully completed. /// Returns PP_ERROR_FAILED if Initialize() has not successfully completed.
int32_t GetFrameCodedSize(PP_Size* coded_size); int32_t GetFrameCodedSize(Size* coded_size);
/// Gets a blank video frame which can be filled with video data and passed /// Gets a blank video frame which can be filled with video data and passed
/// to the encoder. /// to the encoder.
...@@ -132,6 +132,7 @@ class VideoEncoder : public Resource { ...@@ -132,6 +132,7 @@ class VideoEncoder : public Resource {
/// by other resources should wait for completion before reusing them. /// by other resources should wait for completion before reusing them.
/// ///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>. /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
/// Returns PP_ERROR_FAILED if Initialize() has not successfully completed.
int32_t Encode(const VideoFrame& video_frame, int32_t Encode(const VideoFrame& video_frame,
bool force_keyframe, bool force_keyframe,
const CompletionCallback& cc); const CompletionCallback& cc);
...@@ -146,6 +147,9 @@ class VideoEncoder : public Resource { ...@@ -146,6 +147,9 @@ class VideoEncoder : public Resource {
/// bitstream buffers from the encoder. /// bitstream buffers from the encoder.
/// ///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>. /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
/// Returns PP_ERROR_FAILED if Initialize() has not successfully completed.
/// Returns PP_ERROR_INPROGRESS if a prior call to GetBitstreamBuffer() has
/// not completed.
int32_t GetBitstreamBuffer( int32_t GetBitstreamBuffer(
const CompletionCallbackWithOutput<PP_BitstreamBuffer>& cc); const CompletionCallbackWithOutput<PP_BitstreamBuffer>& cc);
......
...@@ -234,6 +234,8 @@ ...@@ -234,6 +234,8 @@
'proxy/video_decoder_resource.h', 'proxy/video_decoder_resource.h',
'proxy/video_destination_resource.cc', 'proxy/video_destination_resource.cc',
'proxy/video_destination_resource.h', 'proxy/video_destination_resource.h',
'proxy/video_encoder_resource.cc',
'proxy/video_encoder_resource.h',
'proxy/video_frame_resource.cc', 'proxy/video_frame_resource.cc',
'proxy/video_frame_resource.h', 'proxy/video_frame_resource.h',
'proxy/video_source_resource.cc', 'proxy/video_source_resource.cc',
......
...@@ -280,6 +280,8 @@ ...@@ -280,6 +280,8 @@
'thunk/ppb_video_decoder_thunk.cc', 'thunk/ppb_video_decoder_thunk.cc',
'thunk/ppb_video_destination_private_api.h', 'thunk/ppb_video_destination_private_api.h',
'thunk/ppb_video_destination_private_thunk.cc', 'thunk/ppb_video_destination_private_thunk.cc',
'thunk/ppb_video_encoder_api.h',
'thunk/ppb_video_encoder_thunk.cc',
'thunk/ppb_video_frame_api.h', 'thunk/ppb_video_frame_api.h',
'thunk/ppb_video_frame_thunk.cc', 'thunk/ppb_video_frame_thunk.cc',
'thunk/ppb_video_source_private_api.h', 'thunk/ppb_video_source_private_api.h',
......
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
#include "ppapi/c/ppb_var_array_buffer.h" #include "ppapi/c/ppb_var_array_buffer.h"
#include "ppapi/c/ppb_var_dictionary.h" #include "ppapi/c/ppb_var_dictionary.h"
#include "ppapi/c/ppb_video_decoder.h" #include "ppapi/c/ppb_video_decoder.h"
#include "ppapi/c/ppb_video_encoder.h"
#include "ppapi/c/ppb_video_frame.h" #include "ppapi/c/ppb_video_frame.h"
#include "ppapi/c/ppb_view.h" #include "ppapi/c/ppb_view.h"
#include "ppapi/c/pp_errors.h" #include "ppapi/c/pp_errors.h"
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "ppapi/proxy/video_capture_resource.h" #include "ppapi/proxy/video_capture_resource.h"
#include "ppapi/proxy/video_decoder_resource.h" #include "ppapi/proxy/video_decoder_resource.h"
#include "ppapi/proxy/video_destination_resource.h" #include "ppapi/proxy/video_destination_resource.h"
#include "ppapi/proxy/video_encoder_resource.h"
#include "ppapi/proxy/video_source_resource.h" #include "ppapi/proxy/video_source_resource.h"
#include "ppapi/proxy/websocket_resource.h" #include "ppapi/proxy/websocket_resource.h"
#include "ppapi/shared_impl/api_id.h" #include "ppapi/shared_impl/api_id.h"
...@@ -387,6 +388,10 @@ PP_Resource ResourceCreationProxy::CreateVideoDestination( ...@@ -387,6 +388,10 @@ PP_Resource ResourceCreationProxy::CreateVideoDestination(
instance))->GetReference(); instance))->GetReference();
} }
PP_Resource ResourceCreationProxy::CreateVideoEncoder(PP_Instance instance) {
return (new VideoEncoderResource(GetConnection(), instance))->GetReference();
}
PP_Resource ResourceCreationProxy::CreateVideoSource( PP_Resource ResourceCreationProxy::CreateVideoSource(
PP_Instance instance) { PP_Instance instance) {
return (new VideoSourceResource(GetConnection(), instance))->GetReference(); return (new VideoSourceResource(GetConnection(), instance))->GetReference();
......
...@@ -156,6 +156,7 @@ class ResourceCreationProxy : public InterfaceProxy, ...@@ -156,6 +156,7 @@ class ResourceCreationProxy : public InterfaceProxy,
virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instance) override; virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instance) override;
virtual PP_Resource CreateVideoDecoder(PP_Instance instance) override; virtual PP_Resource CreateVideoDecoder(PP_Instance instance) override;
virtual PP_Resource CreateVideoDestination(PP_Instance instance) override; virtual PP_Resource CreateVideoDestination(PP_Instance instance) override;
virtual PP_Resource CreateVideoEncoder(PP_Instance instance) override;
virtual PP_Resource CreateVideoSource(PP_Instance instance) override; virtual PP_Resource CreateVideoSource(PP_Instance instance) override;
virtual PP_Resource CreateWebSocket(PP_Instance instance) override; virtual PP_Resource CreateWebSocket(PP_Instance instance) override;
virtual PP_Resource CreateX509CertificatePrivate( virtual PP_Resource CreateX509CertificatePrivate(
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/proxy/video_encoder_resource.h"
using ppapi::thunk::PPB_VideoEncoder_API;
namespace ppapi {
namespace proxy {
VideoEncoderResource::VideoEncoderResource(Connection connection,
PP_Instance instance)
: PluginResource(connection, instance) {
}
VideoEncoderResource::~VideoEncoderResource() {
}
PPB_VideoEncoder_API* VideoEncoderResource::AsPPB_VideoEncoder_API() {
return this;
}
int32_t VideoEncoderResource::GetSupportedProfiles(
const PP_ArrayOutput& output,
const scoped_refptr<TrackedCallback>& callback) {
return PP_ERROR_FAILED;
}
int32_t VideoEncoderResource::Initialize(
PP_VideoFrame_Format input_format,
const PP_Size* input_visible_size,
PP_VideoProfile output_profile,
uint32_t initial_bitrate,
PP_HardwareAcceleration acceleration,
const scoped_refptr<TrackedCallback>& callback) {
return PP_ERROR_FAILED;
}
int32_t VideoEncoderResource::GetFramesRequired() {
return PP_ERROR_FAILED;
}
int32_t VideoEncoderResource::GetFrameCodedSize(PP_Size* size) {
return PP_ERROR_FAILED;
}
int32_t VideoEncoderResource::GetVideoFrame(
PP_Resource* video_frame,
const scoped_refptr<TrackedCallback>& callback) {
return PP_ERROR_FAILED;
}
int32_t VideoEncoderResource::Encode(
PP_Resource video_frame,
PP_Bool force_keyframe,
const scoped_refptr<TrackedCallback>& callback) {
return PP_ERROR_FAILED;
}
int32_t VideoEncoderResource::GetBitstreamBuffer(
PP_BitstreamBuffer* picture,
const scoped_refptr<TrackedCallback>& callback) {
return PP_ERROR_FAILED;
}
void VideoEncoderResource::RecycleBitstreamBuffer(
const PP_BitstreamBuffer* picture) {
}
void VideoEncoderResource::RequestEncodingParametersChange(uint32_t bitrate,
uint32_t framerate) {
}
void VideoEncoderResource::Close() {
}
} // namespace proxy
} // namespace ppapi
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_PROXY_VIDEO_ENCODER_RESOURCE_H_
#define PPAPI_PROXY_VIDEO_ENCODER_RESOURCE_H_
#include "base/memory/ref_counted.h"
#include "ppapi/proxy/connection.h"
#include "ppapi/proxy/plugin_resource.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/thunk/ppb_video_encoder_api.h"
namespace ppapi {
class TrackedCallback;
namespace proxy {
class PPAPI_PROXY_EXPORT VideoEncoderResource
: public PluginResource,
public thunk::PPB_VideoEncoder_API {
public:
VideoEncoderResource(Connection connection, PP_Instance instance);
~VideoEncoderResource() override;
thunk::PPB_VideoEncoder_API* AsPPB_VideoEncoder_API() override;
private:
// PPB_VideoEncoder_API implementation.
int32_t GetSupportedProfiles(
const PP_ArrayOutput& output,
const scoped_refptr<TrackedCallback>& callback) override;
int32_t Initialize(PP_VideoFrame_Format input_format,
const PP_Size* input_visible_size,
PP_VideoProfile output_profile,
uint32_t initial_bitrate,
PP_HardwareAcceleration acceleration,
const scoped_refptr<TrackedCallback>& callback) override;
int32_t GetFramesRequired() override;
int32_t GetFrameCodedSize(PP_Size* size) override;
int32_t GetVideoFrame(
PP_Resource* video_frame,
const scoped_refptr<TrackedCallback>& callback) override;
int32_t Encode(PP_Resource video_frame,
PP_Bool force_keyframe,
const scoped_refptr<TrackedCallback>& callback) override;
int32_t GetBitstreamBuffer(
PP_BitstreamBuffer* picture,
const scoped_refptr<TrackedCallback>& callback) override;
void RecycleBitstreamBuffer(const PP_BitstreamBuffer* picture) override;
void RequestEncodingParametersChange(uint32_t bitrate,
uint32_t framerate) override;
void Close() override;
DISALLOW_COPY_AND_ASSIGN(VideoEncoderResource);
};
} // namespace proxy
} // namespace ppapi
#endif // PPAPI_PROXY_VIDEO_ENCODER_RESOURCE_H_
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
F(PPB_VideoDecoder_API) \ F(PPB_VideoDecoder_API) \
F(PPB_VideoDecoder_Dev_API) \ F(PPB_VideoDecoder_Dev_API) \
F(PPB_VideoDestination_Private_API) \ F(PPB_VideoDestination_Private_API) \
F(PPB_VideoEncoder_API) \
F(PPB_VideoFrame_API) \ F(PPB_VideoFrame_API) \
F(PPB_VideoLayer_API) \ F(PPB_VideoLayer_API) \
F(PPB_VideoSource_Private_API) \ F(PPB_VideoSource_Private_API) \
......
...@@ -14,6 +14,7 @@ PROXIED_IFACE(PPB_FILEMAPPING_INTERFACE_0_1, PPB_FileMapping_0_1) ...@@ -14,6 +14,7 @@ PROXIED_IFACE(PPB_FILEMAPPING_INTERFACE_0_1, PPB_FileMapping_0_1)
PROXIED_IFACE(PPB_MESSAGING_INTERFACE_1_1_DEPRECATED, PROXIED_IFACE(PPB_MESSAGING_INTERFACE_1_1_DEPRECATED,
PPB_Messaging_1_1_Deprecated) PPB_Messaging_1_1_Deprecated)
PROXIED_IFACE(PPB_VIDEODECODER_INTERFACE_0_1, PPB_VideoDecoder_0_1) PROXIED_IFACE(PPB_VIDEODECODER_INTERFACE_0_1, PPB_VideoDecoder_0_1)
PROXIED_IFACE(PPB_VIDEOENCODER_INTERFACE_0_1, PPB_VideoEncoder_0_1)
// Note, PPB_TraceEvent is special. We don't want to actually make it stable, // Note, PPB_TraceEvent is special. We don't want to actually make it stable,
// but we want developers to be able to leverage it when running Chrome Dev or // but we want developers to be able to leverage it when running Chrome Dev or
......
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_
#define PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_
#include "ppapi/c/pp_codecs.h"
#include "ppapi/c/ppb_video_encoder.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
namespace ppapi {
class TrackedCallback;
namespace thunk {
class PPAPI_THUNK_EXPORT PPB_VideoEncoder_API {
public:
virtual ~PPB_VideoEncoder_API() {}
virtual int32_t GetSupportedProfiles(
const PP_ArrayOutput& output,
const scoped_refptr<TrackedCallback>& callback) = 0;
virtual int32_t Initialize(
PP_VideoFrame_Format input_format,
const PP_Size* input_visible_size,
PP_VideoProfile output_profile,
uint32_t initial_bitrate,
PP_HardwareAcceleration acceleration,
const scoped_refptr<TrackedCallback>& callback) = 0;
virtual int32_t GetFramesRequired() = 0;
virtual int32_t GetFrameCodedSize(PP_Size* size) = 0;
virtual int32_t GetVideoFrame(
PP_Resource* video_frame,
const scoped_refptr<TrackedCallback>& callback) = 0;
virtual int32_t Encode(PP_Resource video_frame,
PP_Bool force_keyframe,
const scoped_refptr<TrackedCallback>& callback) = 0;
virtual int32_t GetBitstreamBuffer(
PP_BitstreamBuffer* bitstream_buffer,
const scoped_refptr<TrackedCallback>& callback) = 0;
virtual void RecycleBitstreamBuffer(
const PP_BitstreamBuffer* bitstream_buffer) = 0;
virtual void RequestEncodingParametersChange(uint32_t bitrate,
uint32_t framerate) = 0;
virtual void Close() = 0;
};
} // namespace thunk
} // namespace ppapi
#endif // PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_
...@@ -171,6 +171,7 @@ class ResourceCreationAPI { ...@@ -171,6 +171,7 @@ class ResourceCreationAPI {
virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instace) = 0; virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instace) = 0;
virtual PP_Resource CreateVideoDecoder(PP_Instance instance) = 0; virtual PP_Resource CreateVideoDecoder(PP_Instance instance) = 0;
virtual PP_Resource CreateVideoDestination(PP_Instance instance) = 0; virtual PP_Resource CreateVideoDestination(PP_Instance instance) = 0;
virtual PP_Resource CreateVideoEncoder(PP_Instance instance) = 0;
virtual PP_Resource CreateVideoSource(PP_Instance instance) = 0; virtual PP_Resource CreateVideoSource(PP_Instance instance) = 0;
virtual PP_Resource CreateWebSocket(PP_Instance instance) = 0; virtual PP_Resource CreateWebSocket(PP_Instance instance) = 0;
virtual PP_Resource CreateX509CertificatePrivate(PP_Instance instance) = 0; virtual PP_Resource CreateX509CertificatePrivate(PP_Instance instance) = 0;
......
...@@ -54311,6 +54311,7 @@ To add a new entry, add it with any value and run test to compute valid value. ...@@ -54311,6 +54311,7 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="1681523535" label="PPB_TCPSocket;1.2"/> <int value="1681523535" label="PPB_TCPSocket;1.2"/>
<int value="1703245231" label="PPB_NetworkList;1.0"/> <int value="1703245231" label="PPB_NetworkList;1.0"/>
<int value="1721408268" label="PPB_URLLoader;1.0"/> <int value="1721408268" label="PPB_URLLoader;1.0"/>
<int value="1735606779" label="PPB_VideoEncoder;0.1"/>
<int value="1753813390" label="PPB_Flash_Clipboard;4.0"/> <int value="1753813390" label="PPB_Flash_Clipboard;4.0"/>
<int value="1773992510" label="PPB_PDF;1"/> <int value="1773992510" label="PPB_PDF;1"/>
<int value="1775059283" label="PPB_Flash_FontFile;0.1"/> <int value="1775059283" label="PPB_Flash_FontFile;0.1"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment