codec2: Add support to derive from base class for audio decoders

Test: run cts -m CtsMediaTestCases --test android.media.cts.DecoderTest
Bug: 124962433

Change-Id: I7b53404423eb1978b9739128324b1ffa009d9926
gugelfrei
Rakesh Kumar 5 years ago committed by Sungtak Lee
parent 66d9d0617a
commit ed13464033

@ -205,10 +205,6 @@ public:
int32_t getDrcEffectType() const { return mDrcEffectType->value; }
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

@ -33,43 +33,41 @@
namespace android {
namespace {
#ifdef AMRNB
constexpr char COMPONENT_NAME[] = "c2.android.amrnb.decoder";
#else
constexpr char COMPONENT_NAME[] = "c2.android.amrwb.decoder";
#endif
class C2SoftAmrDec::IntfImpl : public C2InterfaceHelper {
} // namespace
class C2SoftAmrDec::IntfImpl : public SimpleInterface<void>::BaseParams {
public:
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
: C2InterfaceHelper(helper) {
setDerivedInstance(this);
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>(
: SimpleInterface<void>::BaseParams(
helper,
COMPONENT_NAME,
C2Component::KIND_DECODER,
C2Component::DOMAIN_AUDIO,
#ifdef AMRNB
MEDIA_MIMETYPE_AUDIO_AMR_NB
MEDIA_MIMETYPE_AUDIO_AMR_NB
#else
MEDIA_MIMETYPE_AUDIO_AMR_WB
MEDIA_MIMETYPE_AUDIO_AMR_WB
#endif
)).build());
) {
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(
@ -110,10 +108,6 @@ public:
}
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

@ -27,35 +27,32 @@
namespace android {
namespace {
constexpr char COMPONENT_NAME[] = "c2.android.flac.decoder";
class C2SoftFlacDec::IntfImpl : public C2InterfaceHelper {
} // namespace
class C2SoftFlacDec::IntfImpl : public SimpleInterface<void>::BaseParams {
public:
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
: C2InterfaceHelper(helper) {
: SimpleInterface<void>::BaseParams(
helper,
COMPONENT_NAME,
C2Component::KIND_DECODER,
C2Component::DOMAIN_AUDIO,
MEDIA_MIMETYPE_AUDIO_FLAC) {
noPrivateBuffers();
noInputReferences();
noOutputReferences();
noInputLatency();
noTimeStretch();
setDerivedInstance(this);
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_FLAC))
.build());
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(
@ -99,10 +96,6 @@ public:
int32_t getPcmEncodingInfo() const { return mPcmEncodingInfo->value; }
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

@ -27,43 +27,41 @@
namespace android {
namespace {
#ifdef ALAW
constexpr char COMPONENT_NAME[] = "c2.android.g711.alaw.decoder";
#else
constexpr char COMPONENT_NAME[] = "c2.android.g711.mlaw.decoder";
#endif
class C2SoftG711Dec::IntfImpl : public C2InterfaceHelper {
} // namespace
class C2SoftG711Dec::IntfImpl : public SimpleInterface<void>::BaseParams {
public:
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
: C2InterfaceHelper(helper) {
setDerivedInstance(this);
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>(
: SimpleInterface<void>::BaseParams(
helper,
COMPONENT_NAME,
C2Component::KIND_DECODER,
C2Component::DOMAIN_AUDIO,
#ifdef ALAW
MEDIA_MIMETYPE_AUDIO_G711_ALAW
MEDIA_MIMETYPE_AUDIO_G711_ALAW
#else
MEDIA_MIMETYPE_AUDIO_G711_MLAW
MEDIA_MIMETYPE_AUDIO_G711_MLAW
#endif
)).build());
) {
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(
@ -94,10 +92,6 @@ public:
}
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

@ -27,34 +27,32 @@
namespace android {
constexpr char COMPONENT_NAME[] = "c2.android.gsm.decoder";
class C2SoftGsmDec::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());
constexpr char COMPONENT_NAME[] = "c2.android.gsm.decoder";
addParameter(
DefineParam(mOutputFormat, C2_PARAMKEY_OUTPUT_STREAM_BUFFER_TYPE)
.withConstValue(new C2StreamBufferTypeSetting::output(0u, C2BufferData::LINEAR))
.build());
} // namespace
addParameter(
DefineParam(mInputMediaType, C2_PARAMKEY_INPUT_MEDIA_TYPE)
.withConstValue(AllocSharedString<C2PortMediaTypeSetting::input>(
MEDIA_MIMETYPE_AUDIO_MSGSM))
.build());
class C2SoftGsmDec::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_MSGSM) {
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(
@ -85,10 +83,6 @@ class C2SoftGsmDec::IntfImpl : public C2InterfaceHelper {
}
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

@ -30,35 +30,32 @@
namespace android {
namespace {
constexpr char COMPONENT_NAME[] = "c2.android.mp3.decoder";
class C2SoftMP3::IntfImpl : public C2InterfaceHelper {
} // namespace
class C2SoftMP3::IntfImpl : public SimpleInterface<void>::BaseParams {
public:
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
: C2InterfaceHelper(helper) {
: SimpleInterface<void>::BaseParams(
helper,
COMPONENT_NAME,
C2Component::KIND_DECODER,
C2Component::DOMAIN_AUDIO,
MEDIA_MIMETYPE_AUDIO_MPEG) {
noPrivateBuffers();
noInputReferences();
noOutputReferences();
noInputLatency();
noTimeStretch();
setDerivedInstance(this);
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_MPEG))
.build());
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(
@ -90,10 +87,6 @@ public:
}
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

@ -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;

@ -27,35 +27,32 @@
namespace android {
namespace {
constexpr char COMPONENT_NAME[] = "c2.android.raw.decoder";
class C2SoftRawDec::IntfImpl : public C2InterfaceHelper {
} // namespace
class C2SoftRawDec::IntfImpl : public SimpleInterface<void>::BaseParams {
public:
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
: C2InterfaceHelper(helper) {
: SimpleInterface<void>::BaseParams(
helper,
COMPONENT_NAME,
C2Component::KIND_DECODER,
C2Component::DOMAIN_AUDIO,
MEDIA_MIMETYPE_AUDIO_RAW) {
noPrivateBuffers();
noInputReferences();
noOutputReferences();
noInputLatency();
noTimeStretch();
setDerivedInstance(this);
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_RAW))
.build());
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(
@ -98,10 +95,6 @@ public:
}
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

@ -35,35 +35,32 @@ extern "C" {
namespace android {
namespace {
constexpr char COMPONENT_NAME[] = "c2.android.vorbis.decoder";
class C2SoftVorbisDec::IntfImpl : public C2InterfaceHelper {
} // namespace
class C2SoftVorbisDec::IntfImpl : public SimpleInterface<void>::BaseParams {
public:
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
: C2InterfaceHelper(helper) {
: SimpleInterface<void>::BaseParams(
helper,
COMPONENT_NAME,
C2Component::KIND_DECODER,
C2Component::DOMAIN_AUDIO,
MEDIA_MIMETYPE_AUDIO_VORBIS) {
noPrivateBuffers();
noInputReferences();
noOutputReferences();
noInputLatency();
noTimeStretch();
setDerivedInstance(this);
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_VORBIS))
.build());
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(
@ -94,10 +91,6 @@ public:
}
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

@ -56,35 +56,31 @@
namespace android {
namespace {
constexpr char COMPONENT_NAME[] = "c2.android.xaac.decoder";
class C2SoftXaacDec::IntfImpl : public C2InterfaceHelper {
} // namespace
class C2SoftXaacDec::IntfImpl : public SimpleInterface<void>::BaseParams {
public:
explicit IntfImpl(const std::shared_ptr<C2ReflectorHelper> &helper)
: C2InterfaceHelper(helper) {
setDerivedInstance(this);
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_AAC))
.build());
: SimpleInterface<void>::BaseParams(
helper,
COMPONENT_NAME,
C2Component::KIND_DECODER,
C2Component::DOMAIN_AUDIO,
MEDIA_MIMETYPE_AUDIO_AAC) {
noPrivateBuffers();
noInputReferences();
noOutputReferences();
noInputLatency();
noTimeStretch();
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(
@ -218,10 +214,6 @@ public:
int32_t getDrcEffectType() const { return mDrcEffectType->value; }
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;
std::shared_ptr<C2StreamSampleRateInfo::output> mSampleRate;
std::shared_ptr<C2StreamChannelCountInfo::output> mChannelCount;
std::shared_ptr<C2StreamBitrateInfo::input> mBitrate;

Loading…
Cancel
Save