diff options
author | Chih-yu Huang <akahuang@google.com> | 2021-04-02 04:57:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-04-02 04:57:52 +0000 |
commit | 2d2ba2625aa3e1ac14792c7409a27a282fb0e581 (patch) | |
tree | b00698868815190b90a7863d12d2bbf8d78f0804 /components | |
parent | 50e77c4f67e2c15ec5fa4f8d9604f5d7abf65725 (diff) | |
parent | 5aaed6a72c2eb8e6069c0ca6f8b46a654dc271cd (diff) | |
download | v4l2_codec2-2d2ba2625aa3e1ac14792c7409a27a282fb0e581.tar.gz |
Merge "components: Add C2_PARAMKEY_COMPONENT_KIND parameter" into sc-dev
Diffstat (limited to 'components')
4 files changed, 12 insertions, 0 deletions
diff --git a/components/V4L2DecodeInterface.cpp b/components/V4L2DecodeInterface.cpp index 7a43a07..305af4a 100644 --- a/components/V4L2DecodeInterface.cpp +++ b/components/V4L2DecodeInterface.cpp @@ -122,6 +122,10 @@ V4L2DecodeInterface::V4L2DecodeInterface(const std::string& name, return; } + addParameter(DefineParam(mKind, C2_PARAMKEY_COMPONENT_KIND) + .withConstValue(new C2ComponentKindSetting(C2Component::KIND_DECODER)) + .build()); + std::string inputMime; switch (*mVideoCodec) { case VideoCodec::H264: diff --git a/components/V4L2EncodeInterface.cpp b/components/V4L2EncodeInterface.cpp index d5a9bc4..7b4d96c 100644 --- a/components/V4L2EncodeInterface.cpp +++ b/components/V4L2EncodeInterface.cpp @@ -343,6 +343,10 @@ void V4L2EncodeInterface::Initialize(const C2String& name) { // parameters. Please make sure the dependent parameters are added prior to the // one needs the setter dependency. + addParameter(DefineParam(mKind, C2_PARAMKEY_COMPONENT_KIND) + .withConstValue(new C2ComponentKindSetting(C2Component::KIND_ENCODER)) + .build()); + addParameter(DefineParam(mInputVisibleSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::input(0u, 320, 240)) .withFields({ diff --git a/components/include/v4l2_codec2/components/V4L2DecodeInterface.h b/components/include/v4l2_codec2/components/V4L2DecodeInterface.h index 204496c..3dc97fa 100644 --- a/components/include/v4l2_codec2/components/V4L2DecodeInterface.h +++ b/components/include/v4l2_codec2/components/V4L2DecodeInterface.h @@ -50,6 +50,8 @@ private: const C2P<C2StreamColorAspectsTuning::output>& def, const C2P<C2StreamColorAspectsInfo::input>& coded); + // The kind of the component; should be C2Component::KIND_DECODER. + std::shared_ptr<C2ComponentKindSetting> mKind; // The input format kind; should be C2FormatCompressed. std::shared_ptr<C2StreamBufferTypeSetting::input> mInputFormat; // The memory usage flag of input buffer; should be BufferUsage::VIDEO_DECODER. diff --git a/components/include/v4l2_codec2/components/V4L2EncodeInterface.h b/components/include/v4l2_codec2/components/V4L2EncodeInterface.h index 73d6d5c..47ffd53 100644 --- a/components/include/v4l2_codec2/components/V4L2EncodeInterface.h +++ b/components/include/v4l2_codec2/components/V4L2EncodeInterface.h @@ -63,6 +63,8 @@ protected: // Constant parameters + // The kind of the component; should be C2Component::KIND_ENCODER. + std::shared_ptr<C2ComponentKindSetting> mKind; // The input format kind; should be C2FormatVideo. std::shared_ptr<C2StreamBufferTypeSetting::input> mInputFormat; // The memory usage flag of input buffer; should be BufferUsage::VIDEO_ENCODER. |