[vlc-devel] How to trigger one module based on another module?

Peter Tap ptrtap at yahoo.com
Thu Mar 15 23:16:20 CET 2012


Hi Ilkka,

Thank you for your help.

Ok. I could use module_need. However, there is still one more thing I am not clear on. How do I get hold of the proper vlc_object_t that is required?

For example, here is the "Open" callback method of my stream module:

vlc_module_begin ()
    set_subcategory (SUBCAT_INPUT_STREAM_FILTER)
    set_callbacks (Open, Close)
    ...
vlc_module_end ()


static int Open(vlc_object_t *obj)
{
    stream_t      *stream = (stream_t *)obj;
    ...
}

The "Open" callback method for the video filter module expects a filter_t type of object and not a stream_t type of object.
static int CreateFilter( vlc_object_t *p_this )
{
    filter_t *p_filter = (filter_t *)p_this;
    ...
}

If I call module_need from my stream filter's Open method, I would first need to obtain a proper filter_t tpe of vlc_object. How do I do that?

Perhaps I need to call a method that is even higher than module_need().

Thank you once again for your help.

Regards,
Peter




________________________________
 From: Ilkka Ollakka <ileoo at videolan.org>
To: vlc-devel at videolan.org 
Sent: Thursday, March 15, 2012 12:10 AM
Subject: Re: [vlc-devel] How to trigger one module based on another module?
 
On Wed, Mar 14, 2012 at 11:57:46PM -0700, Peter Tap wrote:

Hi,

> I guess I can do a module_find to locate my module and call
> module_start and module_stop to dynamically manage them. Is this the
> right approach?

I think right way would be use module_need() and module_unneed()
(include/vlc_module.h).

-- 
Ilkka Ollakka
"It is easier for a camel to pass through the eye of a needle if it is
lightly greased."
        -- Kehlog Albran, "The Profit"

_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120315/529f8075/attachment.html>


More information about the vlc-devel mailing list