<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi </span>Ilkka<span>,</span></div><div><br><span></span></div><div><span>Thank you for your help.</span></div><div><br><span></span></div><div><span>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?</span></div><div><br><span></span></div><div><span>For example, </span>here is the "Open" callback method of my stream module:</div><div><br></div><div>vlc_module_begin ()<br>    set_subcategory (SUBCAT_INPUT_STREAM_FILTER)<br>    set_callbacks (Open, Close)</div><div>    ...<br>vlc_module_end ()<br><br></div><div><span>static int Open(vlc_object_t *obj)<br>{<br>    stream_t      *stream = (stream_t
 *)obj;</span></div><div><span>    ...</span></div><div><span>}</span></div><div><br><span></span></div><div>The "Open" callback method for the video filter module expects a filter_t type of object and not a stream_t type of object.</div><div><br></div>static int CreateFilter( vlc_object_t *p_this )<br>{<br>    filter_t *p_filter = (filter_t *)p_this;<br>    ...<br>}<br><br>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?<br><br>Perhaps I need to call a method that is even higher than module_need().<br><br>Thank you once again for your help.<br><br>Regards,<br>Peter<br><br><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> 
 <b><span style="font-weight:bold;">From:</span></b> Ilkka Ollakka <ileoo@videolan.org><br> <b><span style="font-weight: bold;">To:</span></b> vlc-devel@videolan.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, March 15, 2012 12:10 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [vlc-devel] How to trigger one module based on another module?<br> </font> </div> <br>
On Wed, Mar 14, 2012 at 11:57:46PM -0700, Peter Tap wrote:<br><br>Hi,<br><br>> I guess I can do a module_find to locate my module and call<br>> module_start and module_stop to dynamically manage them. Is this the<br>> right approach?<br><br>I think right way would be use module_need() and module_unneed()<br>(include/vlc_module.h).<br><br>-- <br>Ilkka Ollakka<br>"It is easier for a camel to pass through the eye of a needle if it is<br>lightly greased."<br>        -- Kehlog Albran, "The Profit"<br><br>_______________________________________________<br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="http://mailman.videolan.org/listinfo/vlc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlc-devel</a><br><br><br> </div> </div>  </div></body></html>