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

Commit ac9dde59 authored by Danny Fernandes's avatar Danny Fernandes
Browse files

Fixed issue 3421896 Slide transition causes images to jump in exported movie playback

Change-Id: I78cbe7e3509f65ce651de926267fad4f65c3c263
parent 8b95de2c
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -84,14 +84,21 @@ M4VSS3GPP_EditState;

typedef enum
{
    M4VSS3GPP_kEditVideoState_READ_WRITE    = 10,    /**< Doing Read/Write operation
                                                        (no decoding/encoding) */
    M4VSS3GPP_kEditVideoState_BEGIN_CUT     = 11,    /**< Decode encode to create an I frame */
    M4VSS3GPP_kEditVideoState_DECODE_ENCODE = 12,    /**< Doing Read-Decode/Filter/
                                                        Encode-Write operation */
    M4VSS3GPP_kEditVideoState_TRANSITION    = 13,    /**< Transition; blending of two videos */
    M4VSS3GPP_kEditVideoState_AFTER_CUT     = 14    /**< Special Read/Write mode after a
                                                            begin cut (time frozen) */
    /**< Doing Read/Write operation. This operation will have no processing
     * on input frames. Only time stamp manipulations in output file. */
    M4VSS3GPP_kEditVideoState_READ_WRITE    = 10,
    /**< Decode encode to create an I frame. This is done for a single frame
     * to create a new reference frame. */
    M4VSS3GPP_kEditVideoState_BEGIN_CUT     = 11,
    /**< Doing Read->Decode->Filter->Encode->Write operation on the input file
     * to create the output file. */
    M4VSS3GPP_kEditVideoState_DECODE_ENCODE = 12,
    /**< Applied when Transition is active and blending of two videos is
     * required. */
    M4VSS3GPP_kEditVideoState_TRANSITION    = 13,
    /**< Special Read/Write mode used after BEGIN_CUT state. The frame
     * is already coded as I frame in BEGIN_CUT state; so skip it. */
    M4VSS3GPP_kEditVideoState_AFTER_CUT     = 14
}
M4VSS3GPP_EditVideoState;

@@ -611,6 +618,7 @@ typedef struct
    M4OSA_Bool               m_bClipExternalHasStarted;  /**< Flag to indicate that an
                                                              external effect is active */
    M4OSA_Int32              iInOutTimeOffset;
    M4OSA_Bool               bEncodeTillEoF;
} M4VSS3GPP_InternalEditContext;


+3 −1
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ M4OSA_ERR M4VSS3GPP_editInit( M4VSS3GPP_EditContext *pContext,
    pC->bIsMMS = M4OSA_FALSE;

    pC->iInOutTimeOffset = 0;
    pC->bEncodeTillEoF = M4OSA_FALSE;

    /**
    * Return with no error */
@@ -3291,8 +3292,9 @@ static M4OSA_ERR M4VSS3GPP_intSwitchToNextClip(
            }
        }
    }
    /* The flag is set to false at the beginning of every clip */
    /* The flags are set to false at the beginning of every clip */
    pC->m_bClipExternalHasStarted = M4OSA_FALSE;
    pC->bEncodeTillEoF = M4OSA_FALSE;

    /**
    * Return with no error */
+10 −5
Original line number Diff line number Diff line
@@ -729,12 +729,16 @@ static M4OSA_ERR M4VSS3GPP_intCheckVideoMode(
        to catch all P-frames after the cut) */
        else if( M4OSA_TRUE == pC->bClip1AtBeginCut )
        {
            if( ( M4VSS3GPP_kEditVideoState_BEGIN_CUT == previousVstate)
                || (M4VSS3GPP_kEditVideoState_AFTER_CUT == previousVstate) )
            if(pC->pC1->pSettings->ClipProperties.VideoStreamType == M4VIDEOEDITING_kH264) {
                pC->Vstate = M4VSS3GPP_kEditVideoState_DECODE_ENCODE;
                pC->bEncodeTillEoF = M4OSA_TRUE;
            } else if( ( M4VSS3GPP_kEditVideoState_BEGIN_CUT == previousVstate)
                || (M4VSS3GPP_kEditVideoState_AFTER_CUT == previousVstate) ) {
                pC->Vstate = M4VSS3GPP_kEditVideoState_AFTER_CUT;
            else
            } else {
                pC->Vstate = M4VSS3GPP_kEditVideoState_BEGIN_CUT;
            }
        }
        /* Else we are in default copy/paste mode */
        else
        {
@@ -777,7 +781,8 @@ static M4OSA_ERR M4VSS3GPP_intCheckVideoMode(
                }
            }
            else if(!((pC->m_bClipExternalHasStarted == M4OSA_TRUE) &&
                    (pC->Vstate == M4VSS3GPP_kEditVideoState_DECODE_ENCODE)))
                    (pC->Vstate == M4VSS3GPP_kEditVideoState_DECODE_ENCODE)) &&
                    pC->bEncodeTillEoF == M4OSA_FALSE)
            {
                /**
                 * Test if we go into copy/paste mode or into decode/encode mode
@@ -835,7 +840,7 @@ static M4OSA_ERR M4VSS3GPP_intCheckVideoMode(
        || (M4VSS3GPP_kEditVideoState_TRANSITION
        == previousVstate)) /**< encode mode */
        && (M4VSS3GPP_kEditVideoState_READ_WRITE == pC->Vstate) /**< read mode */
        )
        && (pC->bEncodeTillEoF == M4OSA_FALSE) )
    {
        pC->Vstate = M4VSS3GPP_kEditVideoState_BEGIN_CUT;
    }