vlc_linux/vlc-3.0.16/modules/access/live555.cpp
/*****************************************************************************
 * ResumeTrack: setup or resume a silenced track
 *****************************************************************************/
setup or resume a silenced track
setup or resume a silenced track
static void ResumeTrack( demux_t *p_demux, live_track_t *tk )
{
    demux_sys_t    *p_sys = p_demux->p_sys;
    bool b_rtsp_tcp = var_GetBool( p_demux, "rtsp-tcp" ) ||
            var_GetBool( p_demux, "rtsp-http" );
    p_sys->rtsp->sendSetupCommand( *tk->sub, default_live555_callback, False,
                                   toBool( b_rtsp_tcp ),
                                   toBool( p_sys->b_force_mcast && !b_rtsp_tcp ) );
    if( !wait_Live555_response( p_demux ) )
    {
        msg_Err( p_demux, "SETUP of'%s/%s' failed %s",
                 tk->sub->mediumName(), tk->sub->codecName(),
                 p_sys->env->getResultMsg() );
    }
    else
    {
        p_sys->rtsp->sendPlayCommand( *tk->sub, default_live555_callback, -1, -1, p_sys->ms->scale() );
        if( !wait_Live555_response(p_demux) )
        {
            msg_Err( p_demux, "RTSP PLAY failed %s", p_sys->env->getResultMsg() );
            if( (p_sys->capabilities & CAP_SUBSESSION_TEARDOWN) ||
                !HasSharedSession( tk->sub ) )
            {
                tk->state = live_track_t::STATE_TEARDOWN;
                p_sys->rtsp->sendTeardownCommand( *tk->sub, NULL );
            }
        }
        else
            tk->state = live_track_t::STATE_SELECTED;
    }
}
static void ResumeTrack ( demux_t * p_demux , live_track_t * tk ) { demux_sys_t * p_sys = p_demux -> p_sys ; bool b_rtsp_tcp = var_GetBool ( p_demux , " " ) || var_GetBool ( p_demux , " " ) ; p_sys -> rtsp -> sendSetupCommand ( * tk -> sub , default_live555_callback , False , toBool ( b_rtsp_tcp ) , toBool ( p_sys -> b_force_mcast && ! b_rtsp_tcp ) ) ; if ( ! wait_Live555_response ( p_demux ) ) { msg_Err ( p_demux , " " , tk -> sub -> mediumName ( ) , tk -> sub -> codecName ( ) , p_sys -> env -> getResultMsg ( ) ) ; } else { p_sys -> rtsp -> sendPlayCommand ( * tk -> sub , default_live555_callback , -1 , -1 , p_sys -> ms -> scale ( ) ) ; if ( ! wait_Live555_response ( p_demux ) ) { msg_Err ( p_demux , " " , p_sys -> env -> getResultMsg ( ) ) ; if ( ( p_sys -> capabilities & CAP_SUBSESSION_TEARDOWN ) || ! HasSharedSession ( tk -> sub ) ) { tk -> state = live_track_t :: STATE_TEARDOWN ; p_sys -> rtsp -> sendTeardownCommand ( * tk -> sub , NULL ) ; } } else tk -> state = live_track_t :: STATE_SELECTED ; } }
ResumeTrack: setup or resume a silenced track
ResumeTrack : setup or resume a silenced track