vlc modules

This forum is about all development around libVLC.
pedja1
New Cone
New Cone
Posts: 1
Joined: 04 Apr 2016 19:02

vlc modules

Postby pedja1 » 04 Apr 2016 19:06

I am creating android application that uses libvlc to play a video.
Since vlc/libvlc doesnt have any kind of event/callback for subtitles i have created my own text renderer module in modules/text_rendere/spucallback

Module compiles, but i have two problems.:

1. I dont see any log messages from this module
2. How can i use this module from libvlc

callback.h

Code: Select all

typedef void (*spu_cb_t)(text_segment_t *p_segment); struct spu_cb_t { spu_cb_t cb; }; struct spu_cb_t *callback;
callback.c

Code: Select all

#ifdef HAVE_CONFIG_H # include "config.h" #endif #include <stdlib.h> /* VLC core API headers */ #include <vlc_common.h> #include <vlc_plugin.h> #include <vlc_interface.h> #include <vlc_filter.h> #include "callback.h" static int Open(vlc_object_t *); static void Close(vlc_object_t *); static int RenderText(filter_t *, subpicture_region_t *p_region_out, subpicture_region_t *p_region_in, const vlc_fourcc_t *p_chroma_list); /* Module descriptor */ vlc_module_begin() set_shortname(N_("SPU Callback ")) set_description(N_("SPU Callback module")) set_capability("text renderer", 0) set_callbacks(Open, Close) set_category(CAT_VIDEO) vlc_module_end () static int Open(vlc_object_t *p_this) { filter_t *p_filter = (filter_t *)p_this; p_filter->pf_render = RenderText; printf("spucallback:Open"); callback = (spu_cb_t*) malloc(sizeof(spu_cb_t)); if (!callback) goto error; return VLC_SUCCESS; error: free(callback); return VLC_EGENERIC; } static void Close(vlc_object_t *p_this) { printf("spucallback:Close"); free(callback->cb); free(callback); } static int RenderText(filter_t *p_filter, subpicture_region_t *p_region_out, subpicture_region_t *p_region_in, const vlc_fourcc_t *p_chroma_list) { text_segment_t *p_segment = p_region_in->p_text; callback->cb(p_segment); printf("spucallback:RenderText"); return VLC_SUCCESS; }
Code is not yet finished obviously

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: vlc modules

Postby Jean-Baptiste Kempf » 28 Jun 2016 10:00

What kind of callback? one everytime a subtitles is shown?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 24 guests