[vlc-devel] Help needed developing libvlc marquee API

jboileau jboileau at gmail.com
Wed Jun 4 22:55:49 CEST 2008


Hi,

Can someone please take a glance at the attached code and tell me if I
am going in the right direction with this? I am trying to add a small
API to access the marquee filter to libvlc. But this code does not
work properly and I can't figure out why. Certanly the first reason
that comes to mind is my lack of experience doing VLC dev, but that
doesn't help. :-) This code would reside in video.c.

What happens here is that the marquee do not get displayed properly. I
set up 4 marquee at different position on the screen and send text to
them individually. But the text either does not show or its in the
wrong location or its size is very large etc.

The only way I can get to display properly is if I use
libvlc_media_add_option to add  the marquees before calling my API.
Then evrything shows up fine. (see second test below)

Here is the code I use to test my API:

libvlc_video_new_marq(aLibVLCMediaPlayer, "marq1", &lLibVLCException);
libvlc_video_set_marq_settings(aLibVLCMediaPlayer, "marq1",
OSD_ALIGN_TOP | OSD_ALIGN_LEFT, 0, 0, 255, 0xFFFFFF, -1, 0,
&lLibVLCException);

libvlc_video_new_marq(aLibVLCMediaPlayer, "marq2", &lLibVLCException);
libvlc_video_set_marq_settings(aLibVLCMediaPlayer, "marq2",
OSD_ALIGN_TOP | OSD_ALIGN_LEFT, 0, 20, 255, 0xFFFFFF, -1, 0,
&lLibVLCException);

libvlc_video_new_marq(aLibVLCMediaPlayer, "marq3", &lLibVLCException);
libvlc_video_set_marq_settings(aLibVLCMediaPlayer, "marq3",
OSD_ALIGN_BOTTOM | OSD_ALIGN_LEFT, 0, 0, 255, 0xFFFFFF, -1, 0,
&lLibVLCException);

libvlc_video_new_marq(aLibVLCMediaPlayer, "marq4", &lLibVLCException);
libvlc_video_set_marq_settings(aLibVLCMediaPlayer, "marq4",
OSD_ALIGN_BOTTOM | OSD_ALIGN_RIGHT, 0, 0, 255, 0xFFFFFF, -1, 0,
&lLibVLCException);

libvlc_video_set_marq_marquee(aLibVLCMediaPlayer, "marq1", "Marquee
1", &lLibVLCException);
libvlc_video_set_marq_marquee(aLibVLCMediaPlayer, "marq2", "Marquee
2", &lLibVLCException);
libvlc_video_set_marq_marquee(aLibVLCMediaPlayer, "marq3", "Marquee
3", &lLibVLCException);
libvlc_video_set_marq_marquee(aLibVLCMediaPlayer, "marq4", "Marquee
4", &lLibVLCException);

but if instead I do:

libvlc_media_add_option(aLibVLCMedia,
":sub-filter=marq at marq1{marquee=\"
\",position=5}:marq at marq2{marquee=\"
\",position=5,y=20}:marq at marq3{marquee=\"
\",position=9}:marq at marq4{marquee=\" \",position=10}",
&lLibVLCException);
libvlc_video_set_marq_marquee(aLibVLCMediaPlayer, "marq1", "Marquee
1", &lLibVLCException);
libvlc_video_set_marq_marquee(aLibVLCMediaPlayer, "marq2", "Marquee
2", &lLibVLCException);
libvlc_video_set_marq_marquee(aLibVLCMediaPlayer, "marq3", "Marquee
3", &lLibVLCException);
libvlc_video_set_marq_marquee(aLibVLCMediaPlayer, "marq4", "Marquee
4", &lLibVLCException);

That works great. But this not a good API in my opinion. We should be
able to add and remove filters as we see fit.

I guess the ChangeFilterString function could be replaced with calls
to the new filter chain API developed by Antoine, although after this
API works I will create one for the magnify vout filter which is not
supported by Antoine's API. So I will still need my filter changing
function, which I got from extrapanel.

-- 
Jacques Boileau
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MarqueeApi.txt
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080604/80dc8e33/attachment.txt>


More information about the vlc-devel mailing list