Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4715d73 authored by Manisha Jajoo's avatar Manisha Jajoo Committed by Wonsik Kim
Browse files

codec2: fix C2SoftMpeg4Dec initialization and release

Bug: 74770949
Test: adb push frameworks/av/media/libstagefright/data/media_codecs_google_c2_*.xml /etc/
Test: adb push frameworks/av/media/libstagefright/data/media_codecs_google_c2.xml /etc/media_codecs_c2.xml
Test: setprop debug.stagefright.ccodec yes
Test: killall mediaserver
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.MediaCodecListTest

Change-Id: Ic259cf29970d5724f3ec81b3acbb6960747c303b
parent b239bdd1
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ static std::shared_ptr<C2ComponentInterface> BuildIntf(

C2SoftMpeg4Dec::C2SoftMpeg4Dec(const char *name, c2_node_id_t id)
    : SimpleC2Component(BuildIntf(name, id)),
      mDecHandle(nullptr) {
      mDecHandle(nullptr),
      mOutputBuffer{} {
}

C2SoftMpeg4Dec::~C2SoftMpeg4Dec() {
@@ -95,6 +96,7 @@ void C2SoftMpeg4Dec::onReset() {
void C2SoftMpeg4Dec::onRelease() {
    if (mInitialized) {
        PVCleanUpVideoDecoder(mDecHandle);
        mInitialized = false;
    }
    if (mOutBlock) {
        mOutBlock.reset();
@@ -130,10 +132,6 @@ status_t C2SoftMpeg4Dec::initDecoder() {
    }
    memset(mDecHandle, 0, sizeof(tagvideoDecControls));

    for (int32_t i = 0; i < kNumOutputBuffers; ++i) {
        mOutputBuffer[i] = nullptr;
    }

    /* TODO: bring these values to 352 and 288. It cannot be done as of now
     * because, h263 doesn't seem to allow port reconfiguration. In OMX, the
     * problem of larger width and height than default width and height is