|
|
|
@ -31,34 +31,32 @@ extern "C" {
|
|
|
|
|
|
|
|
|
|
namespace android {
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
constexpr char COMPONENT_NAME[] = "c2.android.opus.decoder";
|
|
|
|
|
|
|
|
|
|
class C2SoftOpusDec::IntfImpl : public C2InterfaceHelper {
|
|
|
|
|
public:
|
|
|
|
|
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper>& helper)
|
|
|
|
|
: C2InterfaceHelper(helper) {
|
|
|
|
|
setDerivedInstance(this);
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
addParameter(
|
|
|
|
|
DefineParam(mInputFormat, C2_PARAMKEY_INPUT_STREAM_BUFFER_TYPE)
|
|
|
|
|
.withConstValue(new C2StreamBufferTypeSetting::input(0u, C2BufferData::LINEAR))
|
|
|
|
|
.build());
|
|
|
|
|
|
|
|
|
|
addParameter(
|
|
|
|
|
DefineParam(mOutputFormat, C2_PARAMKEY_OUTPUT_STREAM_BUFFER_TYPE)
|
|
|
|
|
.withConstValue(new C2StreamBufferTypeSetting::output(0u, C2BufferData::LINEAR))
|
|
|
|
|
.build());
|
|
|
|
|
|
|
|
|
|
addParameter(
|
|
|
|
|
DefineParam(mInputMediaType, C2_PARAMKEY_INPUT_MEDIA_TYPE)
|
|
|
|
|
.withConstValue(AllocSharedString<C2PortMediaTypeSetting::input>(
|
|
|
|
|
MEDIA_MIMETYPE_AUDIO_OPUS))
|
|
|
|
|
.build());
|
|
|
|
|
class C2SoftOpusDec::IntfImpl : public SimpleInterface<void>::BaseParams {
|
|
|
|
|
public:
|
|
|
|
|
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
|
|
|
|
|
: SimpleInterface<void>::BaseParams(
|
|
|
|
|
helper,
|
|
|
|
|
COMPONENT_NAME,
|
|
|
|
|
C2Component::KIND_DECODER,
|
|
|
|
|
C2Component::DOMAIN_AUDIO,
|
|
|
|
|
MEDIA_MIMETYPE_AUDIO_OPUS) {
|
|
|
|
|
noPrivateBuffers();
|
|
|
|
|
noInputReferences();
|
|
|
|
|
noOutputReferences();
|
|
|
|
|
noInputLatency();
|
|
|
|
|
noTimeStretch();
|
|
|
|
|
setDerivedInstance(this);
|
|
|
|
|
|
|
|
|
|
addParameter(
|
|
|
|
|
DefineParam(mOutputMediaType, C2_PARAMKEY_OUTPUT_MEDIA_TYPE)
|
|
|
|
|
.withConstValue(AllocSharedString<C2PortMediaTypeSetting::output>(
|
|
|
|
|
MEDIA_MIMETYPE_AUDIO_RAW))
|
|
|
|
|
DefineParam(mAttrib, C2_PARAMKEY_COMPONENT_ATTRIBUTES)
|
|
|
|
|
.withConstValue(new C2ComponentAttributesSetting(
|
|
|
|
|
C2Component::ATTRIB_IS_TEMPORAL))
|
|
|
|
|
.build());
|
|
|
|
|
|
|
|
|
|
addParameter(
|
|
|
|
@ -88,11 +86,7 @@ class C2SoftOpusDec::IntfImpl : public C2InterfaceHelper {
|
|
|
|
|
.build());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::shared_ptr<C2StreamBufferTypeSetting::input> mInputFormat;
|
|
|
|
|
std::shared_ptr<C2StreamBufferTypeSetting::output> mOutputFormat;
|
|
|
|
|
std::shared_ptr<C2PortMediaTypeSetting::input> mInputMediaType;
|
|
|
|
|
std::shared_ptr<C2PortMediaTypeSetting::output> mOutputMediaType;
|
|
|
|
|
private:
|
|
|
|
|
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
|
|
|
|
|
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
|
|
|
|
|
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;
|
|
|
|
|