[gst-devel] event system

Thomas Nyberg thomas at codefactory.se
Fri Jun 15 08:21:24 CEST 2001


On Thu, Jun 14, 2001 at 05:31:41PM -0400, David I. Lehn wrote:
> > A little example of a possible API to send events:
> > 
> >   GstEvent *ev = gst_event_new (GST_EVENT_SEEK);
> >   GST_EVENT_SEEK_TYPE (ev) = GST_EVENT_SEEK_OFFSET; 
> >   GST_EVENT_SEEK_POSITION (ev) = 1000; 
> > 
> 
> Is there some reason for this ugly spelling?  GstBuffer has it too and I
> still don't know why.  It's more uniform and exactly the same to write
> it functional like everything else:
> 
> gst_event_set_seek_type(ev, GST_EVENT_SEEK_OFFSET);
> gst_event_set_seek_position(ev, 1000);
> 
> and associated:
> 
> aType = gst_event_seek_type(ev);
> aPostion = gst_event_seek_position(ev);
> 
> I think all the GST_BUFFER_* macros should change to look like this too.
> Any reason not to do this?
>

Since they are macros, i.e. #define MY_MACRO - it is common to denote
them by capital letters. Then it is easier to tell them apart from real
functions. Changing all of these would be really bad, IMO.

/Thomas <thomas at codefactory.se>

-- 
Thomas Nyberg                    thomas.nyberg at codefactory.se
CodeFactory AB                   http://www.codefactory.se/
Office: +46 (0)90 71 86 10       Cell: +46 (0)70 335 61 64





More information about the gstreamer-devel mailing list