[DVDnav-discuss] dvdnav log function callback

John Stebbins stebbins at jetheaddev.com
Sat Feb 25 04:36:27 CET 2012


On 02/24/2012 12:25 AM, Ilkka Ollakka wrote:
> Hi,
> 
> I started looking if it is possible to implement log callback in
> dvd-nav, mostly to get rid of those printf(stderr.. ) calls when it is
> used in vlc. Similar functionality exists in libav/ffmpeg/libx264 and
> implementation is pretty straighforward in that part and I can provide
> patch for it.
> 
> Only thing that I was wondering, is the way to tell dvdnav to use
> callback. Dvdnav does not have init()-function and assumes that
> open() initializes dvdnav_t structure to given pointer.
> 
> So should I introduce init() function that actually initializes the
> structure and allows to change that log-callback, or extend open to take
> callback pointer as parameter or some other way?
> 
> Also pointers to archives is great if this issue is talked in some point
> allready (did not find anything when quickly googled).
> 

I wouldn't do it as part of init at all. How about separate registration registration functions. e.g.
dvdread_log_register(dvd_reader_t *reader, dvdread_log_callback_t callback_func);
dvdnav_log_register(dvdnav_t *nav, dvdnav_log_callback_t callback_func);

If the registration functions are not called, default logger sends to stderr.

-- 
John      GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01  83F0 49F1 D7B2 60D4 D0F7

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/attachments/20120224/54ca64ea/attachment.asc>


More information about the DVDnav-discuss mailing list