vlc_int64_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception_t *);
vlc_int64_t libvlc_input_get_time( libvlc_input_t *, libvlc_exception_t *);
float libvlc_input_get_position( libvlc_input_t *, libvlc_exception_t *);
+vlc_bool_t libvlc_input_will_play( libvlc_input_t *, libvlc_exception_t *);
+
/** @} */
*/
int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * );
+
+void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * );
+
+
/** @} */
/**
return val.f_float;
}
+
+vlc_bool_t libvlc_input_will_play( libvlc_input_t *p_input,
+ libvlc_exception_t *p_exception)
+{
+
+ input_thread_t *p_input_thread;
+ vlc_value_t val;
+
+ if( !p_input )
+ {
+ libvlc_exception_raise( p_exception, "Input is NULL" );
+ return VLC_FALSE;
+ }
+
+ p_input_thread = (input_thread_t*)vlc_object_get(
+ p_input->p_instance->p_vlc,
+ p_input->i_input_id );
+
+ if( !p_input_thread )
+ {
+ libvlc_exception_raise( p_exception, "Input does not exist" );
+ return VLC_FALSE;
+ }
+
+ if ( !p_input_thread->b_die && !p_input_thread->b_dead )
+ return VLC_TRUE;
+
+ return VLC_FALSE;
+}
libvlc_exception_raise( p_e,
"Unexpected error while setting fullscreen value" );
}
+
+void
+libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath,
+ libvlc_exception_t *p_e )
+{
+ vout_thread_t *p_vout = GetVout( p_input, p_e );
+ input_thread_t *p_input_thread;
+
+ char path[256];
+
+ /* GetVout will raise the exception for us */
+ if( !p_vout )
+ {
+ return;
+ }
+
+ p_input_thread = (input_thread_t*)vlc_object_get(
+ p_input->p_instance->p_vlc,
+ p_input->i_input_id );
+ if( !p_input_thread )
+ {
+ libvlc_exception_raise( p_e, "Input does not exist" );
+ return NULL;
+ }
+
+ snprintf( path, 255, "%s", filepath );
+ var_SetString( p_vout, "snapshot-path", path );
+ var_SetString( p_vout, "snapshot-format", "png" );
+
+ vout_Control( p_vout, VOUT_SNAPSHOT );
+ vlc_object_release( p_vout );
+
+ return;
+
+}