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
3 // found in the LICENSE file.
5 #ifndef PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_
6 #define PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_
8 #include "ppapi/c/pp_codecs.h"
9 #include "ppapi/c/ppb_video_encoder.h"
10 #include "ppapi/thunk/ppapi_thunk_export.h"
14 class TrackedCallback
;
18 class PPAPI_THUNK_EXPORT PPB_VideoEncoder_API
{
20 virtual ~PPB_VideoEncoder_API() {}
22 virtual int32_t GetSupportedProfiles(
23 const PP_ArrayOutput
& output
,
24 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
25 virtual int32_t Initialize(
26 PP_VideoFrame_Format input_format
,
27 const PP_Size
* input_visible_size
,
28 PP_VideoProfile output_profile
,
29 uint32_t initial_bitrate
,
30 PP_HardwareAcceleration acceleration
,
31 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
32 virtual int32_t GetFramesRequired() = 0;
33 virtual int32_t GetFrameCodedSize(PP_Size
* size
) = 0;
34 virtual int32_t GetVideoFrame(
35 PP_Resource
* video_frame
,
36 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
37 virtual int32_t Encode(PP_Resource video_frame
,
38 PP_Bool force_keyframe
,
39 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
40 virtual int32_t GetBitstreamBuffer(
41 PP_BitstreamBuffer
* bitstream_buffer
,
42 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
43 virtual void RecycleBitstreamBuffer(
44 const PP_BitstreamBuffer
* bitstream_buffer
) = 0;
45 virtual void RequestEncodingParametersChange(uint32_t bitrate
,
46 uint32_t framerate
) = 0;
47 virtual void Close() = 0;
53 #endif // PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_