Commit d8d5156e authored by Ripinder Singh's avatar Ripinder Singh
Browse files

Apply Head Orientation PI metadata to Decoder



* In SR, head tracking metadata is reported by downstream device and this
  must be applied to the decoder.

Signed-off-by: default avatarRipinder Singh <ripinder.singh@dolby.com>
parent 5f1f6305
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -448,9 +448,16 @@ int main(
    asked_frame_size = arg.renderFramesize;
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;

#ifdef IVAS_RTPDUMP
    bool enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled,
                                       enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled,
                                       arg.non_diegetic_pan_gain, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled,
                                       arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled,
                                       arg.non_diegetic_pan_gain, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
+18 −0
Original line number Diff line number Diff line
@@ -5654,6 +5654,24 @@ ivas_error IVAS_RTP_ApplyPiData( IVAS_DEC_HANDLE hIvasDec, PIDATA_TS *piData, ui
                IVAS_DEC_setDiegeticInputPI( hIvasDec, piData->data.digeticIndicator.isDiegetic );
            }
            break;

            case IVAS_PI_HEAD_ORIENTATION:
            {
                int16_t i, num_subframes = 1;
                IVAS_VECTOR3 pos = { 0.0f, 0.0f, 0.0f };
                if ( ( error = IVAS_DEC_GetNumOrientationSubframes( hIvasDec, &num_subframes ) ) == IVAS_ERR_OK )
                {
                    for ( i = 0; i < num_subframes; i++ )
                    {
                        if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, piData->data.headOrientation.orientation, pos, i, DEFAULT_AXIS ) ) != IVAS_ERR_OK )
                        {
                            fprintf( stderr, "Failed to Feed PI Head Orientation data : %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                            continue;
                        }
                    }
                }
            }
            break;
#endif

            default: