Original patch by Jean-Paul Saman.
/* Set global meta data (The vlc_meta_t is not modified nor released) */
ES_OUT_SET_META, /* arg1=const vlc_meta_t * */
+ /* PCR system clock manipulation for external clock synchronization */
+ ES_OUT_GET_PCR_SYSTEM, /* arg1=mtime_t * res=can fail */
+
/* First value usable for private control */
ES_OUT_PRIVATE_START = 0x10000,
};
return es_out_Control( out, ES_OUT_SET_META, p_meta );
}
+static inline int es_out_ControlGetPcrSystem( es_out_t *out, mtime_t *pi_system )
+{
+ return es_out_Control( out, ES_OUT_GET_PCR_SYSTEM, pi_system );
+}
+
/**
* @}
*/
vlc_mutex_unlock( &cl->lock );
}
+mtime_t input_clock_GetSystemOrigin( input_clock_t *cl )
+{
+ vlc_mutex_lock( &cl->lock );
+
+ assert( cl->b_has_reference );
+
+ const mtime_t i_system = cl->ref.i_system;
+
+ vlc_mutex_unlock( &cl->lock );
+
+ return i_system;
+}
+
#warning "input_clock_SetJitter needs more work"
void input_clock_SetJitter( input_clock_t *cl,
mtime_t i_pts_delay, int i_cr_average )
*/
void input_clock_ChangePause( input_clock_t *, bool b_paused, mtime_t i_date );
+/**
+ * This function returns the original system value date for the current
+ * reference point (a valid reference point must have been set).
+ */
+mtime_t input_clock_GetSystemOrigin( input_clock_t * );
+
/**
* This function allows to rebase the original system value date.
* It can be called only imediatly after a input_clock_Update call.
return VLC_SUCCESS;
}
+ case ES_OUT_GET_PCR_SYSTEM:
+ {
+ if( p_sys->b_buffering )
+ return VLC_EGENERIC;
+
+ es_out_pgrm_t *p_pgrm = p_sys->p_pgrm;
+ if( !p_pgrm )
+ return VLC_EGENERIC;
+
+ mtime_t *pi_system = va_arg( args, mtime_t *);
+ *pi_system = input_clock_GetSystemOrigin( p_pgrm->p_clock );
+ return VLC_SUCCESS;
+ }
+
default:
msg_Err( p_sys->p_input, "unknown query in es_out_Control" );
return VLC_EGENERIC;
{
return ControlLockedSetFrameNext( p_out );
}
+ case ES_OUT_GET_PCR_SYSTEM:
+ {
+ if( p_sys->b_delayed )
+ return VLC_EGENERIC;
+ mtime_t *pi_system = (mtime_t*)va_arg( args, mtime_t * );
+ return es_out_ControlGetPcrSystem( p_sys->p_out, pi_system );
+ }
default:
msg_Err( p_sys->p_input, "Unknown es_out_Control query !" );
assert(0);