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 GetSupportedProfiles0_1(
26 const PP_ArrayOutput
& output
,
27 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
28 virtual int32_t Initialize(
29 PP_VideoFrame_Format input_format
,
30 const PP_Size
* input_visible_size
,
31 PP_VideoProfile output_profile
,
32 uint32_t initial_bitrate
,
33 PP_HardwareAcceleration acceleration
,
34 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
35 virtual int32_t GetFramesRequired() = 0;
36 virtual int32_t GetFrameCodedSize(PP_Size
* size
) = 0;
37 virtual int32_t GetVideoFrame(
38 PP_Resource
* video_frame
,
39 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
40 virtual int32_t Encode(PP_Resource video_frame
,
41 PP_Bool force_keyframe
,
42 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
43 virtual int32_t GetBitstreamBuffer(
44 PP_BitstreamBuffer
* bitstream_buffer
,
45 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
46 virtual void RecycleBitstreamBuffer(
47 const PP_BitstreamBuffer
* bitstream_buffer
) = 0;
48 virtual void RequestEncodingParametersChange(uint32_t bitrate
,
49 uint32_t framerate
) = 0;
50 virtual void Close() = 0;
56 #endif // PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_