/***************************************************************************** * OpenIntf: initialise interface *****************************************************************************/ static int Open ( vlc_object_t *p_this ) { intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_sys_t *p_sys = malloc( sizeof( *p_sys ) ); if( unlikely(p_sys == NULL) ) return VLC_ENOMEM; p_sys->p_motion = motion_create( VLC_OBJECT( p_intf ) ); if( p_sys->p_motion == NULL ) { error: free( p_sys ); return VLC_EGENERIC; } p_intf->p_sys = p_sys; if( vlc_clone( &p_sys->thread, RunIntf, p_intf, VLC_THREAD_PRIORITY_LOW ) ) { motion_destroy( p_sys->p_motion ); goto error; } return VLC_SUCCESS; }
/***************************************************************************** * CloseIntf: destroy interface *****************************************************************************/ static void Close ( vlc_object_t *p_this ) { intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_sys_t *p_sys = p_intf->p_sys; vlc_cancel( p_sys->thread ); vlc_join( p_sys->thread, NULL ); motion_destroy( p_sys->p_motion ); free( p_sys ); }
/***************************************************************************** * Destroy: destroy Distort filter *****************************************************************************/ static void Destroy( vlc_object_t *p_this ) { filter_t *p_filter = (filter_t *)p_this; filter_sys_t *p_sys = p_filter->p_sys; if( p_sys->p_motion != NULL ) motion_destroy( p_sys->p_motion ); else { var_DelCallback( p_filter, FILTER_PREFIX "angle", RotateCallback, p_sys ); } free( p_sys ); }