Changeset 328b47a8955037be12efcac4d063af6c67875df8

Show
Ignore:
Timestamp:
11/12/07 22:12:25 (1 year ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1197407545 +0000
git-parent:

[2e313885abf8c8487421a2215b0c61c170f23317]

git-author:
Laurent Aimar <fenrir@videolan.org> 1197407545 +0000
Message:

Added DEMUX_CAN_CONTROL_RATE and DEMUX_SET_RATE implementation based
on Glen Gray patch.
(The code is commented until it is confirmed to compil/work.)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/live555.cpp

    rb3c57df r328b47a  
    11531153    int64_t *pi64; 
    11541154    double  *pf, f; 
    1155     vlc_bool_t *pb, b_bool; 
     1155    vlc_bool_t *pb, *pb2, b_bool; 
     1156    int *pi_int; 
    11561157 
    11571158    switch( i_query ) 
     
    12601261#endif 
    12611262            return VLC_SUCCESS; 
     1263 
     1264#if 0 
     1265        case DEMUX_CAN_CONTROL_RATE: 
     1266            pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * ); 
     1267            pb2 = (vlc_bool_t*)va_arg( args, vlc_bool_t * ); 
     1268 
     1269            *pb = p_sys->rtsp != NULL && p_sys->i_npt_length > 0 && !var_GetBool( p_demux, "rtsp-kasenna" ); 
     1270            *pb2 = VLC_FALSE; 
     1271            return VLC_SUCCESS; 
     1272 
     1273        case DEMUX_SET_RATE: 
     1274        { 
     1275            double f_scale; 
     1276 
     1277            if( !p_sys->rtsp || p_sys->i_npt_length <= 0 || var_GetBool( p_demux, "rtsp-kasenna" ) ) 
     1278                return VLC_EGENERIC; 
     1279 
     1280            /* TODO we might want to ensure that the new rate is different from 
     1281             * old rate after playMediaSession... 
     1282             * I have no idea how the server map the requested rate to the 
     1283             * ones it supports. 
     1284             * ex: 
     1285             *  current is x2 we request x1.5 if the server return x2 we will 
     1286             *  never succeed to return to x1. 
     1287             *  In this case we should retry with a lower rate until we have 
     1288             *  one (even x1). 
     1289             */ 
     1290 
     1291            pi_int = (int*)va_arg( args, int * ); 
     1292            f_scale = (double)INPUT_RATE_DEFAULT / (*p_int); 
     1293 
     1294            /* Passing -1 for the start and end time will mean liveMedia won't 
     1295            * create a Range: section for the RTSP message. The server should 
     1296            * pick up from the current position */ 
     1297            if( !p_sys->rtsp->playMediaSession( *p_sys->ms, -1, -1, f_scale ) ) 
     1298            { 
     1299                msg_Err( p_demux, "PLAY with Scale %0.2f failed %s", f_scale, 
     1300                        p_sys->env->getResultMsg() ); 
     1301                return VLC_EGENERIC; 
     1302            } 
     1303            /* ReSync the stream */ 
     1304            p_sys->i_npt_start = 0; 
     1305            p_sys->i_pcr = 0; 
     1306            es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); 
     1307 
     1308            *pi_int = (int)( INPUT_RATE_DEFAULT / p_sys->ms->scale() + 0.5 ); 
     1309            return VLC_SUCCESS; 
     1310        } 
     1311#endif 
    12621312 
    12631313        case DEMUX_SET_PAUSE_STATE: