| | 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 |
|---|