#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
+#include <vlc_vout.h>
#include "filter_common.h"
#include <vlc_image.h>
#include "filter_event_info.h"
//create the VIDEO_FILTER_EVENT_VARIABLE
vlc_value_t val;
if (var_Create( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_ADDRESS | VLC_VAR_DOINHERIT ) != VLC_SUCCESS)
- msg_Err( p_filter, "Could not create %s\n", VIDEO_FILTER_EVENT_VARIABLE);
+ msg_Err( p_filter, "Could not create %s", VIDEO_FILTER_EVENT_VARIABLE);
val.p_address = &(p_sys->event_info);
if (var_Set( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE, val )!=VLC_SUCCESS)
- msg_Err( p_filter, "Could not set %s\n", VIDEO_FILTER_EVENT_VARIABLE);
+ msg_Err( p_filter, "Could not set %s", VIDEO_FILTER_EVENT_VARIABLE);
//OpenCV init specific to this example
char* filename = config_GetPsz( p_filter, "opencv-haarcascade-file" );
if( p_filter->p_sys->p_storage )
cvReleaseMemStorage( &p_filter->p_sys->p_storage );
- if (NULL != p_filter->p_sys->event_info.p_region)
- free(p_filter->p_sys->event_info.p_region);
-
+ free( p_filter->p_sys->event_info.p_region );
free( p_sys );
var_Destroy( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE);
msg_Err( p_filter, "no image" );
return NULL;
}
- if ((p_pic->format.i_chroma != VLC_FOURCC('I','4','2','0')))
+ if ((p_pic->format.i_chroma != VLC_CODEC_I420))
{
msg_Err( p_filter, "wrong chroma - use I420" );
return NULL;
CvRect* r;
if (faces && (faces->total > 0))
{
- //msg_Dbg( p_filter, "Found %d face(s)\n", faces->total );
- if (NULL != p_filter->p_sys->event_info.p_region)
- {
- free(p_filter->p_sys->event_info.p_region);
- p_filter->p_sys->event_info.p_region = NULL;
- }
+ //msg_Dbg( p_filter, "Found %d face(s)", faces->total );
+ free( p_filter->p_sys->event_info.p_region );
+ p_filter->p_sys->event_info.p_region = NULL;
if( NULL == ( p_filter->p_sys->event_info.p_region =
(video_filter_region_info_t *)malloc(faces->total*sizeof(video_filter_region_info_t))))
{
}
if (faces && (faces->total > 0)) //raise the video filter event
- var_Change( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE, VLC_VAR_TRIGGER_CALLBACKS, NULL, NULL );
+ var_TriggerCallback( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE );
}
else
msg_Err( p_filter, "No cascade - is opencv-haarcascade-file valid?" );