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

Commit 4cb1afd1 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8485504 from 32009fed to tm-release

Change-Id: I9d567a1669bff56d2dc9a42803f1364d7c67b3e1
parents 9eebddd9 32009fed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ cc_library_shared {
        "libstagefright_codecbase",
        "libstagefright_foundation",
        "libstagefright_omx",
	"libstagefright_surface_utils",
        "libstagefright_xmlparser",
        "libui",
        "libutils",
+19 −1
Original line number Diff line number Diff line
@@ -871,6 +871,11 @@ void CCodec::configure(const sp<AMessage> &msg) {
                        }
                        config->mTunneled = true;
                    }

                    int32_t pushBlankBuffersOnStop = 0;
                    if (msg->findInt32(KEY_PUSH_BLANK_BUFFERS_ON_STOP, &pushBlankBuffersOnStop)) {
                        config->mPushBlankBuffersOnStop = pushBlankBuffersOnStop == 1;
                    }
                }
            }
            setSurface(surface);
@@ -1841,7 +1846,13 @@ void CCodec::initiateStop() {
        }
        state->set(STOPPING);
    }

    {
        Mutexed<std::unique_ptr<Config>>::Locked configLocked(mConfig);
        const std::unique_ptr<Config> &config = *configLocked;
        if (config->mPushBlankBuffersOnStop) {
            mChannel->pushBlankBufferToOutputSurface();
        }
    }
    mChannel->reset();
    (new AMessage(kWhatStop, this))->post();
}
@@ -1929,6 +1940,13 @@ void CCodec::initiateRelease(bool sendCallback /* = true */) {
            config->mInputSurfaceDataspace = HAL_DATASPACE_UNKNOWN;
        }
    }
    {
        Mutexed<std::unique_ptr<Config>>::Locked configLocked(mConfig);
        const std::unique_ptr<Config> &config = *configLocked;
        if (config->mPushBlankBuffersOnStop) {
            mChannel->pushBlankBufferToOutputSurface();
        }
    }

    mChannel->reset();
    // thiz holds strong ref to this while the thread is running.
+11 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */

//#define LOG_NDEBUG 0
#include <utils/Errors.h>
#define LOG_TAG "CCodecBufferChannel"
#define ATRACE_TAG  ATRACE_TAG_VIDEO
#include <utils/Log.h>
@@ -48,6 +49,7 @@
#include <media/stagefright/foundation/hexdump.h>
#include <media/stagefright/MediaCodecConstants.h>
#include <media/stagefright/SkipCutBuffer.h>
#include <media/stagefright/SurfaceUtils.h>
#include <media/MediaCodecBuffer.h>
#include <mediadrm/ICrypto.h>
#include <system/window.h>
@@ -2180,4 +2182,13 @@ status_t toStatusT(c2_status_t c2s, c2_operation_t c2op) {
    }
}

status_t CCodecBufferChannel::pushBlankBufferToOutputSurface() {
  Mutexed<OutputSurface>::Locked output(mOutputSurface);
  sp<ANativeWindow> nativeWindow = static_cast<ANativeWindow *>(output->surface.get());
  if (nativeWindow == nullptr) {
      return INVALID_OPERATION;
  }
  return pushBlankBuffersToNativeWindow(nativeWindow.get());
}

}  // namespace android
+5 −0
Original line number Diff line number Diff line
@@ -181,6 +181,11 @@ public:

    void setMetaMode(MetaMode mode);

    /**
     * Push a blank buffer to the configured native output surface.
     */
    status_t pushBlankBufferToOutputSurface();

private:
    class QueueGuard;

+2 −3
Original line number Diff line number Diff line
@@ -324,7 +324,8 @@ CCodecConfig::CCodecConfig()
    : mInputFormat(new AMessage),
      mOutputFormat(new AMessage),
      mUsingSurface(false),
      mTunneled(false) { }
      mTunneled(false),
      mPushBlankBuffersOnStop(false) { }

void CCodecConfig::initializeStandardParams() {
    typedef Domain D;
@@ -963,8 +964,6 @@ void CCodecConfig::initializeStandardParams() {
        .limitTo(D::ENCODER & D::VIDEO & D::READ));

    /* still to do
    constexpr char KEY_PUSH_BLANK_BUFFERS_ON_STOP[] = "push-blank-buffers-on-shutdown";

       not yet used by MediaCodec, but defined as MediaFormat
    KEY_AUDIO_SESSION_ID // we use "audio-hw-sync"
    KEY_OUTPUT_REORDER_DEPTH
Loading