From: Andy W. <wi...@us...> - 2003-09-30 13:11:58
|
CVS Root: /cvsroot/gstreamer Module: gstreamer Changes by: wingo Date: Tue Sep 30 2003 06:11:56 PDT Log message: make filesink handle events only in the chainfunction Modified files: gst/elements : gstfilesink.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gstfilesink.c.diff?r1=1.20&r2=1.21 ====Begin Diffs==== Index: gstfilesink.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/elements/gstfilesink.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- gstfilesink.c 16 Sep 2003 09:57:30 -0000 1.20 +++ gstfilesink.c 30 Sep 2003 13:11:44 -0000 1.21 @@ -80,9 +80,6 @@ static gboolean gst_filesink_open_file (GstFileSink *sink); static void gst_filesink_close_file (GstFileSink *sink); -static const GstEventMask * - gst_filesink_get_event_mask (GstPad *pad); - static gboolean gst_filesink_handle_event (GstPad *pad, GstEvent *event); static gboolean gst_filesink_pad_query (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value); @@ -150,8 +147,6 @@ gst_pad_set_chain_function (pad, gst_filesink_chain); GST_FLAG_SET (GST_ELEMENT(filesink), GST_ELEMENT_EVENT_AWARE); - gst_pad_set_event_function(pad, gst_filesink_handle_event); - gst_pad_set_event_mask_function(pad, gst_filesink_get_event_mask); gst_pad_set_query_function (pad, gst_filesink_pad_query); gst_pad_set_query_type_function (pad, gst_filesink_get_query_types); @@ -288,37 +283,6 @@ return TRUE; } -/* 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; -} - /* handle events (search) */ static gboolean gst_filesink_handle_event (GstPad *pad, GstEvent *event) @@ -356,7 +320,7 @@ fseek (filesink->file, GST_EVENT_SEEK_OFFSET (event), SEEK_END); break; default: - g_warning("unkown seek method!\n"); + g_warning ("unknown seek method!"); break; } break; |