[vlc-devel] [PATCH] - Libvlc (new functions)
brezhoneg1
brezhoneg1 at yahoo.fr
Wed Oct 29 20:01:20 CET 2008
Hello,
Libvlc API allows to pass options like ":video-filter=adjust at adjust1"
or ":sub-filter=marq at marq1:marq at marq2" together with parameters to tune
these filters (e.g ":hue=..", ":saturation=..", ...) at creation of an
instance or a media item.
Yet, at run time, once the media is played through a media_player,
there is no means to change these parameters.
To solve this problem, I coded the two following functions that allow
changing any parameter for a named filter (filter at name) whatever their
type (float, int, char*).
Their prototype is the following:
/**
* Get value from the parameter of a named entity
*
* \param p_mi the Media Player
* \param psz_named_entity the named entity passed as option (e.g
"name_entity" from :sub-filter=marq at named_entity)
* \param psz_param the parameter to be targeted for this entity ( e.g
"marq-marquee")
* \param p_value pointer to the value to be retrieved (can be of type
char**, float*, int* depending on the param)
* valid value set by function if returned code 0
(success), otherwise undefined
* In case of char**, string must be freed by caller
* \return 0 (success) or -1 (failure)
*/
VLC_PUBLIC_API int libvlc_media_player_get_param_named_entity (
libvlc_media_player_t *p_mi, char *psz_named_entity, char *psz_param,
void *p_value, libvlc_exception_t *p_e );
/**
* Set value from the parameter of a named entity
*
* \param p_mi the Media Player
* \param psz_named_entity the named entity passed as option (e.g
"name_entity" from :sub-filter=marq at named_entity)
* \param psz_param the parameter to be targeted for this entity ( e.g
"marq-marquee")
* \param p_value pointer to the value to be set (can be of type char**,
float*, int* depending on the param)
* \return 0 (success) or -1 (failure)
*/
VLC_PUBLIC_API int libvlc_media_player_set_param_named_entity (
libvlc_media_player_t *p_mi, char *p_named_entity, char *p_param, void
*p_value, libvlc_exception_t *p_e );
If you feel these functions can be of interest to enhance the libvlc
api, patches are attached to the email.
Three files have been modified (based on
vlc-snapshot-20081028.tar.bz2).
- include/vlc/libvlc.h
- src/control/media_player.c
- src/libvlc.sym
Any comments welcomed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: media_player.c.diff
Type: application/octet-stream
Size: 4463 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081029/34c490b4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvlc.h.diff
Type: application/octet-stream
Size: 1779 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081029/34c490b4/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvlc.sym.diff
Type: application/octet-stream
Size: 402 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20081029/34c490b4/attachment-0002.obj>
More information about the vlc-devel
mailing list