Commit 728f91d6 authored by sbsarac's avatar sbsarac
Browse files

Add functions

parent ba14c725
Loading
Loading
Loading
Loading
+80 −0
Original line number Diff line number Diff line
@@ -2500,6 +2500,86 @@ static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_
#undef WMC_TOOL_SKIP
}

#ifdef NONBE_FIX_1100_OUTPUT_ORIENT
/*-------------------------------------------------------------------*
 * IVAS_DEC_GetMainOrientation()
 *
 *
 *-------------------------------------------------------------------*/
ivas_error IVAS_DEC_GetMainOrientation(
    IVAS_DEC_HANDLE hIvasDec,     /* i/o: IVAS decoder handle                            */
    IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer for main orientation   */
)
{
    ivas_error error;

    if ( hIvasDec == NULL || pOrientation == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    if ( ( error = ivas_orient_trk_GetMainOrientation( hIvasDec->st_ivas->hHeadTrackData->OrientationTracker, pOrientation ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    return IVAS_ERR_OK;
}


/*-------------------------------------------------------------------*
 * IVAS_DEC_GetTrackedRotation()
 *
 *
 *-------------------------------------------------------------------*/
ivas_error IVAS_DEC_GetTrackedRotation(
    IVAS_DEC_HANDLE hIvasDec,  /* i/o: IVAS decoder handle                          */
    IVAS_QUATERNION *pRotation /* i/o: Quaternion pointer processed rotation       */
)
{
    ivas_error error;

    if ( hIvasDec == NULL || pRotation == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    if ( ( error = ivas_orient_trk_GetTrackedRotation( hIvasDec->st_ivas->hHeadTrackData->OrientationTracker, pRotation ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    return IVAS_ERR_OK;
}

/*---------------------------------------------------------------------*
 * IVAS_DEC_GetCombinedOrientation()
 *
 *
 *---------------------------------------------------------------------*/
ivas_error IVAS_DEC_GetCombinedOrientation(
    IVAS_DEC_HANDLE hIvasDec,     /* i/o: IVAS decoder handle                               */
    IVAS_QUATERNION *pOrientation /* i/o: Quaternion pointer processed orientation       */
)
{
    int16_t i;

    if ( hIvasDec == NULL || pOrientation == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    if ( hIvasDec->st_ivas->hCombinedOrientationData != NULL )
    {
        for ( i = 0; i < hIvasDec->st_ivas->hCombinedOrientationData->num_subframes; ++i )
        {
            pOrientation[i] = hIvasDec->st_ivas->hCombinedOrientationData->Quaternions[i];
        }
    }

    return IVAS_ERR_OK;
}
#endif

/*---------------------------------------------------------------------*
 * IVAS_DEC_VoIP_FeedFrame( )
+20 −0
Original line number Diff line number Diff line
@@ -482,6 +482,26 @@ ivas_error IVAS_DEC_GetPcmFrameSize(
    int32_t *pcmFrameSize                       /* o  : total size of the PCM output frame. This takes into account the number of output channels */
);

#ifdef NONBE_FIX_1100_OUTPUT_ORIENT
/*! r: error code */
ivas_error IVAS_DEC_GetMainOrientation(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                            */
    IVAS_QUATERNION *pOrientation               /* i/o: Quaternion pointer for main orientation   */
);

/*! r: error code */
ivas_error IVAS_DEC_GetTrackedRotation(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                          */
    IVAS_QUATERNION *pRotation                  /* i/o: Quaternion pointer processed rotation       */
);

/*! r: error code */
ivas_error IVAS_DEC_GetCombinedOrientation(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                               */
    IVAS_QUATERNION *pOrientation               /* i/o: Quaternion pointer processed orientation       */
);
#endif

/*! r: true if decoder has no data in VoIP jitter buffer */
bool IVAS_DEC_VoIP_IsEmpty(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */