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

Commit ce21b65e authored by David Ng's avatar David Ng Committed by Ricardo Cerqueira
Browse files

libstagefright: Add property to enable software decoder for video

Add sys property to enable software decoder for video in AwesomePlayer.

Enable software decoder using the adb shell command:
 setprop sys.media.vdec.sw 1

Disable software decoder using the adb shell command:
 setprop sys.media.vdec.sw 0

Change-Id: I9ae6c139575761d2b374b447f38dc5d43172ab40
parent dd148551
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1435,11 +1435,12 @@ status_t AwesomePlayer::initVideoDecoder(uint32_t flags) {
    //   (mSurface->getFlags() & ISurfaceComposer::eProtectedByApp))
    // will be true, but that part is already handled by SurfaceFlinger.

    char value[PROPERTY_VALUE_MAX];

#ifdef DEBUG_HDCP
    // For debugging, we allow a system property to control the protected usage.
    // In case of uninitialized or unexpected property, we default to "DRM only".
    bool setProtectionBit = false;
    char value[PROPERTY_VALUE_MAX];
    if (property_get("persist.sys.hdcp_checking", value, NULL)) {
        if (!strcmp(value, "never")) {
            // nop
@@ -1470,6 +1471,13 @@ status_t AwesomePlayer::initVideoDecoder(uint32_t flags) {
        flags |= OMXCodec::kEnableGrallocUsageProtected;
    }
#endif

    property_get("sys.media.vdec.sw", value, "0");
    if (atoi(value)) {
        LOGW("Software Codec is preferred for Video");
        flags |= OMXCodec::kPreferSoftwareCodecs;
    }

    LOGV("initVideoDecoder flags=0x%x", flags);
    mVideoSource = OMXCodec::Create(
            mClient.interface(), mVideoTrack->getFormat(),