[vlc-devel] [PATCH] libvlc_MediaPlayerSnapshotTaken Event creation

Rémi Denis-Courmont rem at videolan.org
Thu Dec 11 16:59:56 CET 2008


More comments...

Le jeudi 11 décembre 2008 16:20:59 basos g, vous avez écrit :
> diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h
> index 1aa0f2f..4c9c1d9 100644
> --- a/include/vlc/libvlc_events.h
> +++ b/include/vlc/libvlc_events.h
> @@ -66,6 +66,7 @@ typedef enum libvlc_event_type_t {
>      libvlc_MediaPlayerPositionChanged,
>      libvlc_MediaPlayerSeekableChanged,
>      libvlc_MediaPlayerPausableChanged,
> +	libvlc_MediaPlayerSnapshotTaken,
>      libvlc_MediaListItemAdded,
>      libvlc_MediaListWillAddItem,

Always add event types at the BOTTOM of the list to preserve the ABI.

> @@ -197,6 +198,12 @@ typedef struct libvlc_event_t
>              void * unused;
>          } media_media_discoverer_ended;
>
> +		/* snapshot taken */
> +		struct
> +		{
> +			char* psz_filename ;
> +		} media_player_snapshot_taken ;
> +

Please be more careful with indentation.

> +	/* Snapshot initialization */
> +	libvlc_event_manager_register_event_type( p_mi->p_event_manager,
> +			libvlc_MediaPlayerSnapshotTaken, p_e );
> +	/* Attach a var callback to the global object to provide the glue between
> +		vout_thread that generates the event and media_player that re-emits it
> +		with its own event manager
> +	*/
> +	var_Create( p_libvlc_instance->p_libvlc_int, "vout-snapshottaken",
> VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
> +    var_AddCallback( p_libvlc_instance->p_libvlc_int,
> "vout-snapshottaken", SnapshotTakenCallback, p_mi );

Any callback that is never deleted makes me very suspicious.

-- 
Rémi Denis-Courmont
http://git.remlab.net/cgi-bin/gitweb.cgi?p=vlc-courmisch.git;a=summary



More information about the vlc-devel mailing list