Re: gst-player error handling



On Tue, 2002-09-24 at 05:32, Thomas Vander Stichele wrote:

> The problem is, I don't know if it's a sane idea to change
> gst_media_play_new
> to
> GstMediaPlay* gst_media_play_new (GError **error) ;)
> 
> I've looked at some gnome modules.  Some seemed to put a GError in the
> object's private struct and then provide either an accessor function to
> get at it or through property inspection, but that looks like a 
> hackish workaround.

I think the accessor function was mostly to maintain some sort of API
compatibility, since we can't have functions with the same name and a
different signature.

If API compatibility isn't a major issue for libgstplayer, I'd say to
definitely go for the GError approach.  It's a lot cleaner, IMO, to do:

        play = gst_media_play_new (&error);
        if (error)
        	pop up dialog

rather than an errno-like option:

        play = gst_media_play_new ();
        if (gst_media_play_get_error ())
        	pop up dialog
        
Joe



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]