From: <wt...@ke...> - 2006-04-13 16:23:08
|
CVS Root: /cvs/gstreamer Module: gst-ffmpeg Changes by: wtay Date: Thu Apr 13 2006 16:23:05 UTC Log message: * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_base_init), (gst_ffmpegdemux_class_init), (gst_ffmpegdemux_init), (gst_ffmpegdemux_close), (gst_ffmpegdemux_push_event), (gst_ffmpegdemux_set_flags), (gst_ffmpegdemux_is_eos), (gst_ffmpegdemux_do_seek), (gst_ffmpegdemux_perform_seek), (gst_ffmpegdemux_src_event), (gst_ffmpegdemux_send_event), (gst_ffmpegdemux_src_query), (gst_ffmpegdemux_src_convert), (gst_ffmpegdemux_get_stream), (my_safe_copy), (gst_ffmpegdemux_read_tags), (gst_ffmpegdemux_open), (gst_ffmpegdemux_loop), (gst_ffmpegdemux_sink_activate), (gst_ffmpegdemux_sink_activate_pull), (gst_ffmpegdemux_change_state), (gst_ffmpegdemux_register): Rework the demuxer, implement all seeking stuff including seek in ready. * ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_peek), (gst_ffmpegdata_close): Handle some more cases. Modified files: . : ChangeLog ext/ffmpeg : gstffmpegdemux.c gstffmpegprotocol.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ChangeLog.diff?r1=1.286&r2=1.287 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdemux.c.diff?r1=1.58&r2=1.59 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegprotocol.c.diff?r1=1.28&r2=1.29 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-ffmpeg/ChangeLog,v retrieving revision 1.286 retrieving revision 1.287 diff -u -d -r1.286 -r1.287 --- ChangeLog 11 Apr 2006 17:55:33 -0000 1.286 +++ ChangeLog 13 Apr 2006 16:22:53 -0000 1.287 @@ -1,3 +1,24 @@ +2006-04-13 Wim Taymans <wi...@fl...> + + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_base_init), + (gst_ffmpegdemux_class_init), (gst_ffmpegdemux_init), + (gst_ffmpegdemux_close), (gst_ffmpegdemux_push_event), + (gst_ffmpegdemux_set_flags), (gst_ffmpegdemux_is_eos), + (gst_ffmpegdemux_do_seek), (gst_ffmpegdemux_perform_seek), + (gst_ffmpegdemux_src_event), (gst_ffmpegdemux_send_event), + (gst_ffmpegdemux_src_query), (gst_ffmpegdemux_src_convert), + (gst_ffmpegdemux_get_stream), (my_safe_copy), + (gst_ffmpegdemux_read_tags), (gst_ffmpegdemux_open), + (gst_ffmpegdemux_loop), (gst_ffmpegdemux_sink_activate), + (gst_ffmpegdemux_sink_activate_pull), + (gst_ffmpegdemux_change_state), (gst_ffmpegdemux_register): + Rework the demuxer, implement all seeking stuff including + seek in ready. + * ext/ffmpeg/gstffmpegprotocol.c: (gst_ffmpegdata_peek), + (gst_ffmpegdata_close): + Handle some more cases. 2006-04-11 Wim Taymans <wi...@fl...> * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_sink_event): Index: gstffmpegdemux.c RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdemux.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- gstffmpegdemux.c 8 Apr 2006 21:55:22 -0000 1.58 +++ gstffmpegdemux.c 13 Apr 2006 16:22:53 -0000 1.59 @@ -1,6 +1,7 @@ /* GStreamer * Copyright (C) <1999> Erik Walthinsen <om...@cs...>, * <2006> Edward Hervey <bi...@bi...> + * <2006> Wim Taymans <wi...@fl...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -37,6 +38,19 @@ #include "gstffmpegcodecmap.h" typedef struct _GstFFMpegDemux GstFFMpegDemux; [...1573 lines suppressed...] !strcmp (in_plugin->name, "wav") || !strcmp (in_plugin->name, "au") || - !strcmp (in_plugin->name, "tta") || - !strcmp (in_plugin->name, "rm")) + !strcmp (in_plugin->name, "tta") || !strcmp (in_plugin->name, "rm")) register_typefind_func = FALSE; p = name = g_strdup (in_plugin->name); @@ -1135,8 +1444,9 @@ if (!gst_element_register (plugin, type_name, rank, type) || (register_typefind_func == TRUE && - !gst_type_find_register (plugin, typefind_name, rank, - gst_ffmpegdemux_type_find, extensions, sinkcaps, params, NULL))) { + !gst_type_find_register (plugin, typefind_name, rank, + gst_ffmpegdemux_type_find, extensions, sinkcaps, params, + NULL))) { g_warning ("Register of type ffdemux_%s failed", name); g_free (type_name); g_free (typefind_name); Index: gstffmpegprotocol.c RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegprotocol.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- gstffmpegprotocol.c 31 Mar 2006 22:26:12 -0000 1.28 +++ gstffmpegprotocol.c 13 Apr 2006 16:22:53 -0000 1.29 @@ -103,18 +103,30 @@ g_return_val_if_fail (h->flags == URL_RDONLY, AVERROR_IO); info = (GstProtocolInfo *) h->priv_data; + GST_DEBUG ("Pulling %d bytes at position %lld", size, info->offset); ret = gst_pad_pull_range(info->pad, info->offset, (guint) size, &inbuf); - if ((ret == GST_FLOW_OK) || (ret == GST_FLOW_UNEXPECTED)) { - if (inbuf) { + switch (ret) { + case GST_FLOW_OK: total = (gint) GST_BUFFER_SIZE (inbuf); memcpy (buf, GST_BUFFER_DATA (inbuf), total); gst_buffer_unref (inbuf); - } - } else { - return -1; + break; + case GST_FLOW_UNEXPECTED: + total = 0; + case GST_FLOW_WRONG_STATE: + total = -1; + default: + case GST_FLOW_ERROR: + total = -2; } + GST_DEBUG ("Got %d (%s) return result %d", ret, gst_flow_get_name (ret), total); return total; } @@ -227,21 +239,25 @@ GstProtocolInfo *info; + if (info == NULL) + return 0; GST_LOG ("Closing file"); switch (h->flags) { - case URL_WRONLY:{ - /* send EOS - that closes down the stream */ - gst_pad_push_event (info->pad, gst_event_new_eos()); - } - break; - default: + case URL_WRONLY: + { + /* send EOS - that closes down the stream */ + gst_pad_push_event (info->pad, gst_event_new_eos()); + } /* clean up data */ g_free (info); + h->priv_data = NULL; return 0; |