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_AUDIO_ENCODER_API_H_
6 #define PPAPI_THUNK_AUDIO_ENCODER_API_H_
8 #include "ppapi/c/ppb_audio_encoder.h"
9 #include "ppapi/thunk/ppapi_thunk_export.h"
14 class PPAPI_THUNK_EXPORT PPB_AudioEncoder_API
{
16 virtual ~PPB_AudioEncoder_API() {}
18 virtual int32_t GetSupportedProfiles(
19 const PP_ArrayOutput
& output
,
20 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
21 virtual int32_t Initialize(
23 PP_AudioBuffer_SampleRate input_sample_rate
,
24 PP_AudioBuffer_SampleSize input_sample_size
,
25 PP_AudioProfile output_profile
,
26 uint32_t initial_bitrate
,
27 PP_HardwareAcceleration acceleration
,
28 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
29 virtual int32_t GetNumberOfSamples() = 0;
30 virtual int32_t GetBuffer(PP_Resource
* audio_buffer
,
31 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
32 virtual int32_t Encode(PP_Resource audio_buffer
,
33 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
34 virtual int32_t GetBitstreamBuffer(
35 PP_AudioBitstreamBuffer
* bitstream_buffer
,
36 const scoped_refptr
<TrackedCallback
>& callback
) = 0;
37 virtual void RecycleBitstreamBuffer(
38 const PP_AudioBitstreamBuffer
* bitstream_buffer
) = 0;
39 virtual void RequestBitrateChange(uint32_t bitrate
) = 0;
40 virtual void Close() = 0;
46 #endif // PPAPI_THUNK_AUDIO_ENCODER_API_H_