[gst-devel] Re: [gst-cvs] wingo gstreamer: gstreamer/gst/elements/

Ronald Bultje rbultje at ronald.bitfreak.net
Tue Sep 30 06:55:04 CEST 2003


Hi,

On Tue, 2003-09-30 at 15:11, Andy Wingo wrote:
> make filesink handle events only in the chainfunction
[..]
> -/* supported events */
> -static const GstEventMask *
> -gst_filesink_get_event_mask (GstPad *pad)
> -{
> -  GstFileSink *filesink = GST_FILESINK (gst_pad_get_parent (pad));
> -  struct stat filestat;
> -  static const GstEventMask seek_masks[] = {
> -    { GST_EVENT_SEEK, GST_SEEK_METHOD_CUR |
> -                      GST_SEEK_METHOD_SET |
> -                      GST_SEEK_METHOD_END |
> -                      GST_SEEK_FLAG_FLUSH },
> -    { GST_EVENT_FLUSH, 0 },
> -    { GST_EVENT_DISCONTINUOUS, 0 },
> -    { 0, 0 }
> -  }, noseek_masks[] = {
> -    { GST_EVENT_FLUSH, 0 },
> -    { 0, 0 }
> -  }, *selected = seek_masks;
> -
> -  if (filesink->file != NULL) {
> -    if (fstat (fileno (filesink->file), &filestat) == 0) {
> -      if (S_ISFIFO (filestat.st_mode) ||
> -	  S_ISSOCK (filestat.st_mode)) {
> -        selected = noseek_masks;
> -      }
> -    }
> -  }
> -
> -  return selected;
> -}

I totally don't like this. I know someone added a g_return_val_if_fail()
for event functions on sink pads, but I think we shouldn't do that for
event_mask functions. How else am I supposed to query whether the sink
pad supports seeking or not?

Ronald

-- 
Ronald Bultje <rbultje at ronald.bitfreak.net>
Linux Video/Multimedia developer





More information about the gstreamer-devel mailing list