2001-12-23 16:42:33 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
|
|
|
* 2001 Bastien Nocera <hadess@hadess.net>
|
2002-09-10 18:38:22 +00:00
|
|
|
* 2002 Kristian Rietveld <kris@gtk.org>
|
2003-01-25 23:20:36 +00:00
|
|
|
* 2002,2003 Colin Walters <walters@gnu.org>
|
2001-12-23 16:42:33 +00:00
|
|
|
*
|
|
|
|
* gnomevfssrc.c:
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define BROKEN_SIG 1
|
|
|
|
/*#undef BROKEN_SIG */
|
|
|
|
|
2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2004-01-21 12:51:28 +00:00
|
|
|
#include "gst/gst-i18n-plugin.h"
|
2004-01-18 21:46:58 +00:00
|
|
|
|
2003-10-31 20:03:29 +00:00
|
|
|
#include "gstgnomevfs.h"
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
#include "gstgnomevfsuri.h"
|
2003-10-31 20:03:29 +00:00
|
|
|
|
2004-04-20 23:03:28 +00:00
|
|
|
#include <stdlib.h>
|
2001-12-23 16:42:33 +00:00
|
|
|
#include <sys/types.h>
|
2002-09-10 18:38:22 +00:00
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <netdb.h>
|
2001-12-23 16:42:33 +00:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/mman.h>
|
2001-12-26 23:56:00 +00:00
|
|
|
#include <errno.h>
|
|
|
|
#include <string.h>
|
2001-12-23 16:42:33 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
#include <gst/base/gstbasesrc.h>
|
2001-12-23 16:42:33 +00:00
|
|
|
#include <libgnomevfs/gnome-vfs.h>
|
2002-09-10 18:38:22 +00:00
|
|
|
/* gnome-vfs.h doesn't include the following header, which we need: */
|
|
|
|
#include <libgnomevfs/gnome-vfs-standard-callbacks.h>
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_CATEGORY (gnomevfssrc_debug);
|
|
|
|
#define GST_CAT_DEFAULT gnomevfssrc_debug
|
|
|
|
|
2001-12-23 16:42:33 +00:00
|
|
|
#define GST_TYPE_GNOMEVFSSRC \
|
|
|
|
(gst_gnomevfssrc_get_type())
|
|
|
|
#define GST_GNOMEVFSSRC(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GNOMEVFSSRC,GstGnomeVFSSrc))
|
|
|
|
#define GST_GNOMEVFSSRC_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GNOMEVFSSRC,GstGnomeVFSSrcClass))
|
|
|
|
#define GST_IS_GNOMEVFSSRC(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GNOMEVFSSRC))
|
|
|
|
#define GST_IS_GNOMEVFSSRC_CLASS(obj) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GNOMEVFSSRC))
|
|
|
|
|
2002-06-02 18:50:20 +00:00
|
|
|
static GStaticMutex count_lock = G_STATIC_MUTEX_INIT;
|
|
|
|
static gint ref_count = 0;
|
2002-09-15 11:28:41 +00:00
|
|
|
static gboolean vfs_owner = FALSE;
|
2002-06-02 18:50:20 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
typedef struct _GstGnomeVFSSrc
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
GstBaseSrc element;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* uri, file, ... */
|
2004-03-14 22:34:34 +00:00
|
|
|
GnomeVFSURI *uri;
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
gchar *uri_name;
|
2004-03-14 22:34:34 +00:00
|
|
|
GnomeVFSHandle *handle;
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
gboolean own_handle;
|
2005-03-31 09:43:49 +00:00
|
|
|
GnomeVFSFileSize size; /* -1 = unknown */
|
2004-03-15 19:32:28 +00:00
|
|
|
GnomeVFSFileOffset curoffset; /* current offset in file */
|
2005-03-31 09:43:49 +00:00
|
|
|
gboolean seekable;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
/* icecast/audiocast metadata extraction handling */
|
|
|
|
gboolean iradio_mode;
|
|
|
|
gboolean http_callbacks_pushed;
|
|
|
|
|
|
|
|
gint icy_metaint;
|
|
|
|
GnomeVFSFileSize icy_count;
|
|
|
|
|
|
|
|
gchar *iradio_name;
|
|
|
|
gchar *iradio_genre;
|
|
|
|
gchar *iradio_url;
|
|
|
|
gchar *iradio_title;
|
|
|
|
|
|
|
|
GThread *audiocast_thread;
|
|
|
|
GList *audiocast_notify_queue;
|
|
|
|
GMutex *audiocast_queue_mutex;
|
|
|
|
GMutex *audiocast_udpdata_mutex;
|
|
|
|
gint audiocast_thread_die_infd;
|
|
|
|
gint audiocast_thread_die_outfd;
|
|
|
|
gint audiocast_port;
|
|
|
|
gint audiocast_fd;
|
2005-03-31 09:43:49 +00:00
|
|
|
} GstGnomeVFSSrc;
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
typedef struct _GstGnomeVFSSrcClass
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
GstBaseSrcClass parent_class;
|
2005-03-31 09:43:49 +00:00
|
|
|
} GstGnomeVFSSrcClass;
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
2004-02-04 19:28:51 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ARG_0,
|
|
|
|
ARG_HANDLE,
|
|
|
|
ARG_LOCATION,
|
|
|
|
ARG_IRADIO_MODE,
|
|
|
|
ARG_IRADIO_NAME,
|
|
|
|
ARG_IRADIO_GENRE,
|
|
|
|
ARG_IRADIO_URL,
|
2005-03-31 09:43:49 +00:00
|
|
|
ARG_IRADIO_TITLE
|
2001-12-23 16:42:33 +00:00
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void gst_gnomevfssrc_base_init (gpointer g_class);
|
|
|
|
static void gst_gnomevfssrc_class_init (GstGnomeVFSSrcClass * klass);
|
|
|
|
static void gst_gnomevfssrc_init (GstGnomeVFSSrc * gnomevfssrc);
|
Fixes a bunch of problems with finalize and dispose functions, either assumptions that dispose is only called once, o...
Original commit message from CVS:
* ext/alsa/gstalsa.c: (gst_alsa_class_init), (gst_alsa_dispose),
(gst_alsa_finalize):
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_class_init),
(gst_cdaudio_finalize):
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_class_init),
(cdparanoia_finalize):
* ext/divx/gstdivxdec.c: (gst_divxdec_dispose):
* ext/divx/gstdivxenc.c: (gst_divxenc_dispose):
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_finalize):
* ext/flac/gstflacdec.c: (gst_flacdec_class_init),
(gst_flacdec_finalize):
* ext/flac/gstflacenc.c: (gst_flacenc_class_init),
(gst_flacenc_finalize):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_class_init),
(gst_gnomevfssink_finalize):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_class_init),
(gst_gnomevfssrc_finalize):
* ext/libfame/gstlibfame.c: (gst_fameenc_class_init),
(gst_fameenc_finalize):
* ext/nas/nassink.c: (gst_nassink_class_init),
(gst_nassink_finalize):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_finalize),
(gst_sdlvideosink_class_init):
* ext/sndfile/gstsf.c: (gst_sf_dispose):
* gst-libs/gst/mixer/mixertrack.c: (gst_mixer_track_dispose):
* gst-libs/gst/tuner/tunerchannel.c: (gst_tuner_channel_dispose):
* gst-libs/gst/tuner/tunernorm.c: (gst_tuner_norm_dispose):
* gst-libs/gst/xwindowlistener/xwindowlistener.c:
(gst_x_window_listener_dispose):
* gst/audioscale/gstaudioscale.c:
* gst/playondemand/gstplayondemand.c: (play_on_demand_class_init),
(play_on_demand_finalize):
* gst/videofilter/gstvideobalance.c: (gst_videobalance_dispose):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
* sys/cdrom/gstcdplayer.c: (cdplayer_class_init),
(cdplayer_finalize):
* sys/glsink/glimagesink.c: (gst_glimagesink_finalize),
(gst_glimagesink_class_init):
* sys/oss/gstosselement.c: (gst_osselement_class_init),
(gst_osselement_finalize):
* sys/oss/gstosssink.c: (gst_osssink_dispose):
* sys/oss/gstosssrc.c: (gst_osssrc_dispose):
* sys/v4l/gstv4lelement.c: (gst_v4lelement_dispose):
Fixes a bunch of problems with finalize and dispose functions,
either assumptions that dispose is only called once, or not calling
the parent class dispose/finalize function
2004-11-01 14:43:38 +00:00
|
|
|
static void gst_gnomevfssrc_finalize (GObject * object);
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
static void gst_gnomevfssrc_uri_handler_init (gpointer g_iface,
|
|
|
|
gpointer iface_data);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void gst_gnomevfssrc_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_gnomevfssrc_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2001-12-23 16:42:33 +00:00
|
|
|
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
static gboolean gst_gnomevfssrc_stop (GstBaseSrc * src);
|
|
|
|
static gboolean gst_gnomevfssrc_start (GstBaseSrc * src);
|
|
|
|
static gboolean gst_gnomevfssrc_is_seekable (GstBaseSrc * src);
|
|
|
|
static gboolean gst_gnomevfssrc_get_size (GstBaseSrc * src, guint64 * size);
|
|
|
|
static GstFlowReturn gst_gnomevfssrc_create (GstBaseSrc * basesrc,
|
2005-03-31 09:43:49 +00:00
|
|
|
guint64 offset, guint size, GstBuffer ** buffer);
|
2002-09-10 18:38:22 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static int audiocast_init (GstGnomeVFSSrc * src);
|
|
|
|
static int audiocast_register_listener (gint * port, gint * fd);
|
|
|
|
static void audiocast_do_notifications (GstGnomeVFSSrc * src);
|
|
|
|
static gpointer audiocast_thread_run (GstGnomeVFSSrc * src);
|
|
|
|
static void audiocast_thread_kill (GstGnomeVFSSrc * src);
|
2002-09-10 18:38:22 +00:00
|
|
|
|
2001-12-23 16:42:33 +00:00
|
|
|
static GstElementClass *parent_class = NULL;
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
GType
|
|
|
|
gst_gnomevfssrc_get_type (void)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
static GType gnomevfssrc_type = 0;
|
|
|
|
|
|
|
|
if (!gnomevfssrc_type) {
|
|
|
|
static const GTypeInfo gnomevfssrc_info = {
|
|
|
|
sizeof (GstGnomeVFSSrcClass),
|
|
|
|
gst_gnomevfssrc_base_init,
|
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_gnomevfssrc_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstGnomeVFSSrc),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_gnomevfssrc_init,
|
|
|
|
};
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
static const GInterfaceInfo urihandler_info = {
|
|
|
|
gst_gnomevfssrc_uri_handler_init,
|
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
};
|
2004-03-15 19:32:28 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
gnomevfssrc_type =
|
2005-07-05 16:43:02 +00:00
|
|
|
g_type_register_static (GST_TYPE_BASE_SRC,
|
2004-03-15 19:32:28 +00:00
|
|
|
"GstGnomeVFSSrc", &gnomevfssrc_info, 0);
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
g_type_add_interface_static (gnomevfssrc_type, GST_TYPE_URI_HANDLER,
|
|
|
|
&urihandler_info);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
return gnomevfssrc_type;
|
2001-12-23 16:42:33 +00:00
|
|
|
}
|
|
|
|
|
2003-10-31 20:03:29 +00:00
|
|
|
static void
|
|
|
|
gst_gnomevfssrc_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
2005-03-31 09:43:49 +00:00
|
|
|
static GstElementDetails gst_gnomevfssrc_details =
|
|
|
|
GST_ELEMENT_DETAILS ("GnomeVFS Source",
|
|
|
|
"Source/File",
|
|
|
|
"Read from any GnomeVFS-supported file",
|
|
|
|
"Bastien Nocera <hadess@hadess.net>\n"
|
|
|
|
"Ronald S. Bultje <rbultje@ronald.bitfreak.net>");
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&srctemplate));
|
2003-10-31 20:03:29 +00:00
|
|
|
gst_element_class_set_details (element_class, &gst_gnomevfssrc_details);
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void
|
|
|
|
gst_gnomevfssrc_class_init (GstGnomeVFSSrcClass * klass)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
GstBaseSrcClass *gstbasesrc_class;
|
|
|
|
|
|
|
|
gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
gstelement_class = GST_ELEMENT_CLASS (klass);
|
2005-07-05 16:43:02 +00:00
|
|
|
gstbasesrc_class = GST_BASE_SRC_CLASS (klass);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gobject_class->finalize = gst_gnomevfssrc_finalize;
|
|
|
|
gobject_class->set_property = gst_gnomevfssrc_set_property;
|
|
|
|
gobject_class->get_property = gst_gnomevfssrc_get_property;
|
|
|
|
|
|
|
|
/* properties */
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_element_class_install_std_props (GST_ELEMENT_CLASS (klass),
|
|
|
|
"location", ARG_LOCATION, G_PARAM_READWRITE, NULL);
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
ARG_HANDLE,
|
|
|
|
g_param_spec_pointer ("handle",
|
2004-03-15 19:32:28 +00:00
|
|
|
"GnomeVFSHandle", "Handle for GnomeVFS", G_PARAM_READWRITE));
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
/* icecast stuff */
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
ARG_IRADIO_MODE,
|
|
|
|
g_param_spec_boolean ("iradio-mode",
|
2004-03-15 19:32:28 +00:00
|
|
|
"iradio-mode",
|
|
|
|
"Enable internet radio mode (extraction of icecast/audiocast metadata)",
|
|
|
|
FALSE, G_PARAM_READWRITE));
|
2004-03-14 22:34:34 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
ARG_IRADIO_NAME,
|
|
|
|
g_param_spec_string ("iradio-name",
|
2004-03-15 19:32:28 +00:00
|
|
|
"iradio-name", "Name of the stream", NULL, G_PARAM_READABLE));
|
2004-03-14 22:34:34 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
ARG_IRADIO_GENRE,
|
|
|
|
g_param_spec_string ("iradio-genre",
|
2004-03-15 19:32:28 +00:00
|
|
|
"iradio-genre", "Genre of the stream", NULL, G_PARAM_READABLE));
|
2004-03-14 22:34:34 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
ARG_IRADIO_URL,
|
|
|
|
g_param_spec_string ("iradio-url",
|
2004-03-15 19:32:28 +00:00
|
|
|
"iradio-url",
|
|
|
|
"Homepage URL for radio stream", NULL, G_PARAM_READABLE));
|
2004-03-14 22:34:34 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
ARG_IRADIO_TITLE,
|
|
|
|
g_param_spec_string ("iradio-title",
|
2004-03-15 19:32:28 +00:00
|
|
|
"iradio-title",
|
|
|
|
"Name of currently playing song", NULL, G_PARAM_READABLE));
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
|
|
|
|
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_gnomevfssrc_start);
|
|
|
|
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gnomevfssrc_stop);
|
|
|
|
gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_gnomevfssrc_get_size);
|
|
|
|
gstbasesrc_class->is_seekable =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_gnomevfssrc_is_seekable);
|
|
|
|
gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_gnomevfssrc_create);
|
2001-12-23 16:42:33 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void
|
|
|
|
gst_gnomevfssrc_init (GstGnomeVFSSrc * gnomevfssrc)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
gnomevfssrc->uri = NULL;
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
gnomevfssrc->uri_name = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
gnomevfssrc->handle = NULL;
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
gnomevfssrc->curoffset = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
gnomevfssrc->seekable = FALSE;
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
gnomevfssrc->icy_metaint = 0;
|
2004-03-14 22:34:34 +00:00
|
|
|
gnomevfssrc->iradio_mode = FALSE;
|
|
|
|
gnomevfssrc->http_callbacks_pushed = FALSE;
|
|
|
|
gnomevfssrc->icy_count = 0;
|
|
|
|
gnomevfssrc->iradio_name = NULL;
|
|
|
|
gnomevfssrc->iradio_genre = NULL;
|
|
|
|
gnomevfssrc->iradio_url = NULL;
|
|
|
|
gnomevfssrc->iradio_title = NULL;
|
|
|
|
|
|
|
|
gnomevfssrc->audiocast_udpdata_mutex = g_mutex_new ();
|
|
|
|
gnomevfssrc->audiocast_queue_mutex = g_mutex_new ();
|
|
|
|
gnomevfssrc->audiocast_notify_queue = NULL;
|
|
|
|
gnomevfssrc->audiocast_thread = NULL;
|
|
|
|
|
|
|
|
g_static_mutex_lock (&count_lock);
|
|
|
|
if (ref_count == 0) {
|
|
|
|
/* gnome vfs engine init */
|
|
|
|
if (gnome_vfs_initialized () == FALSE) {
|
|
|
|
gnome_vfs_init ();
|
|
|
|
vfs_owner = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ref_count++;
|
|
|
|
g_static_mutex_unlock (&count_lock);
|
2002-06-02 18:50:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Fixes a bunch of problems with finalize and dispose functions, either assumptions that dispose is only called once, o...
Original commit message from CVS:
* ext/alsa/gstalsa.c: (gst_alsa_class_init), (gst_alsa_dispose),
(gst_alsa_finalize):
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_class_init),
(gst_cdaudio_finalize):
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_class_init),
(cdparanoia_finalize):
* ext/divx/gstdivxdec.c: (gst_divxdec_dispose):
* ext/divx/gstdivxenc.c: (gst_divxenc_dispose):
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_finalize):
* ext/flac/gstflacdec.c: (gst_flacdec_class_init),
(gst_flacdec_finalize):
* ext/flac/gstflacenc.c: (gst_flacenc_class_init),
(gst_flacenc_finalize):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_class_init),
(gst_gnomevfssink_finalize):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_class_init),
(gst_gnomevfssrc_finalize):
* ext/libfame/gstlibfame.c: (gst_fameenc_class_init),
(gst_fameenc_finalize):
* ext/nas/nassink.c: (gst_nassink_class_init),
(gst_nassink_finalize):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_finalize),
(gst_sdlvideosink_class_init):
* ext/sndfile/gstsf.c: (gst_sf_dispose):
* gst-libs/gst/mixer/mixertrack.c: (gst_mixer_track_dispose):
* gst-libs/gst/tuner/tunerchannel.c: (gst_tuner_channel_dispose):
* gst-libs/gst/tuner/tunernorm.c: (gst_tuner_norm_dispose):
* gst-libs/gst/xwindowlistener/xwindowlistener.c:
(gst_x_window_listener_dispose):
* gst/audioscale/gstaudioscale.c:
* gst/playondemand/gstplayondemand.c: (play_on_demand_class_init),
(play_on_demand_finalize):
* gst/videofilter/gstvideobalance.c: (gst_videobalance_dispose):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
* sys/cdrom/gstcdplayer.c: (cdplayer_class_init),
(cdplayer_finalize):
* sys/glsink/glimagesink.c: (gst_glimagesink_finalize),
(gst_glimagesink_class_init):
* sys/oss/gstosselement.c: (gst_osselement_class_init),
(gst_osselement_finalize):
* sys/oss/gstosssink.c: (gst_osssink_dispose):
* sys/oss/gstosssrc.c: (gst_osssrc_dispose):
* sys/v4l/gstv4lelement.c: (gst_v4lelement_dispose):
Fixes a bunch of problems with finalize and dispose functions,
either assumptions that dispose is only called once, or not calling
the parent class dispose/finalize function
2004-11-01 14:43:38 +00:00
|
|
|
gst_gnomevfssrc_finalize (GObject * object)
|
2002-06-02 18:50:20 +00:00
|
|
|
{
|
2004-04-06 23:46:00 +00:00
|
|
|
GstGnomeVFSSrc *src = GST_GNOMEVFSSRC (object);
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
g_static_mutex_lock (&count_lock);
|
|
|
|
ref_count--;
|
|
|
|
if (ref_count == 0 && vfs_owner) {
|
|
|
|
if (gnome_vfs_initialized () == TRUE) {
|
|
|
|
gnome_vfs_shutdown ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_static_mutex_unlock (&count_lock);
|
|
|
|
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
if (src->uri) {
|
|
|
|
gnome_vfs_uri_unref (src->uri);
|
|
|
|
src->uri = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (src->uri_name) {
|
|
|
|
g_free (src->uri_name);
|
|
|
|
src->uri_name = NULL;
|
|
|
|
}
|
|
|
|
|
2004-04-07 00:42:10 +00:00
|
|
|
g_mutex_free (src->audiocast_udpdata_mutex);
|
|
|
|
g_mutex_free (src->audiocast_queue_mutex);
|
2004-04-06 23:46:00 +00:00
|
|
|
|
Fixes a bunch of problems with finalize and dispose functions, either assumptions that dispose is only called once, o...
Original commit message from CVS:
* ext/alsa/gstalsa.c: (gst_alsa_class_init), (gst_alsa_dispose),
(gst_alsa_finalize):
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_class_init),
(gst_cdaudio_finalize):
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_class_init),
(cdparanoia_finalize):
* ext/divx/gstdivxdec.c: (gst_divxdec_dispose):
* ext/divx/gstdivxenc.c: (gst_divxenc_dispose):
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_finalize):
* ext/flac/gstflacdec.c: (gst_flacdec_class_init),
(gst_flacdec_finalize):
* ext/flac/gstflacenc.c: (gst_flacenc_class_init),
(gst_flacenc_finalize):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_class_init),
(gst_gnomevfssink_finalize):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_class_init),
(gst_gnomevfssrc_finalize):
* ext/libfame/gstlibfame.c: (gst_fameenc_class_init),
(gst_fameenc_finalize):
* ext/nas/nassink.c: (gst_nassink_class_init),
(gst_nassink_finalize):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_finalize),
(gst_sdlvideosink_class_init):
* ext/sndfile/gstsf.c: (gst_sf_dispose):
* gst-libs/gst/mixer/mixertrack.c: (gst_mixer_track_dispose):
* gst-libs/gst/tuner/tunerchannel.c: (gst_tuner_channel_dispose):
* gst-libs/gst/tuner/tunernorm.c: (gst_tuner_norm_dispose):
* gst-libs/gst/xwindowlistener/xwindowlistener.c:
(gst_x_window_listener_dispose):
* gst/audioscale/gstaudioscale.c:
* gst/playondemand/gstplayondemand.c: (play_on_demand_class_init),
(play_on_demand_finalize):
* gst/videofilter/gstvideobalance.c: (gst_videobalance_dispose):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
* sys/cdrom/gstcdplayer.c: (cdplayer_class_init),
(cdplayer_finalize):
* sys/glsink/glimagesink.c: (gst_glimagesink_finalize),
(gst_glimagesink_class_init):
* sys/oss/gstosselement.c: (gst_osselement_class_init),
(gst_osselement_finalize):
* sys/oss/gstosssink.c: (gst_osssink_dispose):
* sys/oss/gstosssrc.c: (gst_osssrc_dispose):
* sys/v4l/gstv4lelement.c: (gst_v4lelement_dispose):
Fixes a bunch of problems with finalize and dispose functions,
either assumptions that dispose is only called once, or not calling
the parent class dispose/finalize function
2004-11-01 14:43:38 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-12-23 16:42:33 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/*
|
|
|
|
* URI interface support.
|
|
|
|
*/
|
|
|
|
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
static guint
|
|
|
|
gst_gnomevfssrc_uri_get_type (void)
|
|
|
|
{
|
|
|
|
return GST_URI_SRC;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar **
|
|
|
|
gst_gnomevfssrc_uri_get_protocols (void)
|
|
|
|
{
|
|
|
|
static gchar **protocols = NULL;
|
|
|
|
|
2005-10-03 04:25:54 +00:00
|
|
|
if (!protocols)
|
2004-09-15 06:33:44 +00:00
|
|
|
protocols = gst_gnomevfs_get_supported_uris ();
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
|
|
|
|
return protocols;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const gchar *
|
|
|
|
gst_gnomevfssrc_uri_get_uri (GstURIHandler * handler)
|
|
|
|
{
|
|
|
|
GstGnomeVFSSrc *src = GST_GNOMEVFSSRC (handler);
|
|
|
|
|
|
|
|
return src->uri_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_gnomevfssrc_uri_set_uri (GstURIHandler * handler, const gchar * uri)
|
|
|
|
{
|
|
|
|
GstGnomeVFSSrc *src = GST_GNOMEVFSSRC (handler);
|
|
|
|
|
|
|
|
if (GST_STATE (src) == GST_STATE_PLAYING ||
|
|
|
|
GST_STATE (src) == GST_STATE_PAUSED)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
g_object_set (G_OBJECT (src), "location", uri, NULL);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_gnomevfssrc_uri_handler_init (gpointer g_iface, gpointer iface_data)
|
|
|
|
{
|
|
|
|
GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
|
|
|
|
|
|
|
|
iface->get_type = gst_gnomevfssrc_uri_get_type;
|
|
|
|
iface->get_protocols = gst_gnomevfssrc_uri_get_protocols;
|
|
|
|
iface->get_uri = gst_gnomevfssrc_uri_get_uri;
|
|
|
|
iface->set_uri = gst_gnomevfssrc_uri_set_uri;
|
|
|
|
}
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void
|
|
|
|
gst_gnomevfssrc_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
GstGnomeVFSSrc *src;
|
|
|
|
gchar cwd[PATH_MAX];
|
|
|
|
|
|
|
|
src = GST_GNOMEVFSSRC (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_LOCATION:
|
|
|
|
/* the element must be stopped or paused in order to do this */
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
if (GST_STATE (src) == GST_STATE_PLAYING ||
|
|
|
|
GST_STATE (src) == GST_STATE_PAUSED)
|
2004-03-24 14:44:08 +00:00
|
|
|
break;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
if (src->uri) {
|
|
|
|
gnome_vfs_uri_unref (src->uri);
|
|
|
|
src->uri = NULL;
|
|
|
|
}
|
|
|
|
if (src->uri_name) {
|
|
|
|
g_free (src->uri_name);
|
|
|
|
src->uri_name = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (g_value_get_string (value)) {
|
|
|
|
const gchar *location = g_value_get_string (value);
|
|
|
|
|
2004-03-15 19:32:28 +00:00
|
|
|
if (!strchr (location, ':')) {
|
|
|
|
gchar *newloc = gnome_vfs_escape_path_string (location);
|
|
|
|
|
|
|
|
if (*newloc == '/')
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
src->uri_name = g_strdup_printf ("file://%s", newloc);
|
2004-03-15 19:32:28 +00:00
|
|
|
else
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
src->uri_name =
|
2004-03-15 19:32:28 +00:00
|
|
|
g_strdup_printf ("file://%s/%s", getcwd (cwd, PATH_MAX),
|
|
|
|
newloc);
|
|
|
|
g_free (newloc);
|
|
|
|
} else
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
src->uri_name = g_strdup (location);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
src->uri = gnome_vfs_uri_new (src->uri_name);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ARG_HANDLE:
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
if (GST_STATE (src) == GST_STATE_NULL ||
|
|
|
|
GST_STATE (src) == GST_STATE_READY) {
|
|
|
|
if (src->uri) {
|
|
|
|
gnome_vfs_uri_unref (src->uri);
|
|
|
|
src->uri = NULL;
|
|
|
|
}
|
|
|
|
if (src->uri_name) {
|
|
|
|
g_free (src->uri_name);
|
|
|
|
src->uri_name = NULL;
|
|
|
|
}
|
|
|
|
src->handle = g_value_get_pointer (value);
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
|
|
|
case ARG_IRADIO_MODE:
|
|
|
|
src->iradio_mode = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
2001-12-23 16:42:33 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void
|
|
|
|
gst_gnomevfssrc_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
GstGnomeVFSSrc *src;
|
|
|
|
|
|
|
|
src = GST_GNOMEVFSSRC (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_LOCATION:
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
g_value_set_string (value, src->uri_name);
|
2004-03-14 22:34:34 +00:00
|
|
|
break;
|
|
|
|
case ARG_HANDLE:
|
|
|
|
g_value_set_pointer (value, src->handle);
|
|
|
|
break;
|
|
|
|
case ARG_IRADIO_MODE:
|
|
|
|
g_value_set_boolean (value, src->iradio_mode);
|
|
|
|
break;
|
|
|
|
case ARG_IRADIO_NAME:
|
|
|
|
g_value_set_string (value, src->iradio_name);
|
|
|
|
break;
|
|
|
|
case ARG_IRADIO_GENRE:
|
|
|
|
g_value_set_string (value, src->iradio_genre);
|
|
|
|
break;
|
|
|
|
case ARG_IRADIO_URL:
|
|
|
|
g_value_set_string (value, src->iradio_url);
|
|
|
|
break;
|
|
|
|
case ARG_IRADIO_TITLE:
|
|
|
|
g_mutex_lock (src->audiocast_udpdata_mutex);
|
|
|
|
g_value_set_string (value, src->iradio_title);
|
|
|
|
g_mutex_unlock (src->audiocast_udpdata_mutex);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
2001-12-23 16:42:33 +00:00
|
|
|
}
|
|
|
|
|
2003-02-15 04:55:04 +00:00
|
|
|
static char *
|
|
|
|
unicodify (const char *str, int len, ...)
|
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
char *ret = NULL, *cset;
|
|
|
|
va_list args;
|
|
|
|
gsize bytes_read, bytes_written;
|
|
|
|
|
|
|
|
if (g_utf8_validate (str, len, NULL))
|
|
|
|
return g_strndup (str, len >= 0 ? len : strlen (str));
|
|
|
|
|
|
|
|
va_start (args, len);
|
|
|
|
while ((cset = va_arg (args, char *)) != NULL)
|
|
|
|
{
|
|
|
|
if (!strcmp (cset, "locale"))
|
|
|
|
ret = g_locale_to_utf8 (str, len, &bytes_read, &bytes_written, NULL);
|
|
|
|
else
|
|
|
|
ret = g_convert (str, len, "UTF-8", cset,
|
2004-03-15 19:32:28 +00:00
|
|
|
&bytes_read, &bytes_written, NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
if (ret)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
va_end (args);
|
|
|
|
|
|
|
|
return ret;
|
2003-02-15 04:55:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
|
|
|
gst_gnomevfssrc_unicodify (const char *str)
|
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
return unicodify (str, -1, "locale", "ISO-8859-1", NULL);
|
2003-02-15 04:55:04 +00:00
|
|
|
}
|
|
|
|
|
2002-09-10 18:38:22 +00:00
|
|
|
/*
|
|
|
|
* icecast/audiocast metadata extraction support code
|
|
|
|
*/
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static int
|
|
|
|
audiocast_init (GstGnomeVFSSrc * src)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
int pipefds[2];
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
if (!src->iradio_mode)
|
|
|
|
return TRUE;
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "audiocast: registering listener");
|
2004-03-14 22:34:34 +00:00
|
|
|
if (audiocast_register_listener (&src->audiocast_port,
|
2004-03-15 19:32:28 +00:00
|
|
|
&src->audiocast_fd) < 0) {
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
|
2004-03-15 19:32:28 +00:00
|
|
|
("Unable to listen on UDP port %d", src->audiocast_port));
|
2004-03-14 22:34:34 +00:00
|
|
|
close (src->audiocast_fd);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "audiocast: creating pipe");
|
2004-03-14 22:34:34 +00:00
|
|
|
src->audiocast_notify_queue = NULL;
|
|
|
|
if (pipe (pipefds) < 0) {
|
|
|
|
close (src->audiocast_fd);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
src->audiocast_thread_die_infd = pipefds[0];
|
|
|
|
src->audiocast_thread_die_outfd = pipefds[1];
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "audiocast: creating audiocast thread");
|
2004-03-14 22:34:34 +00:00
|
|
|
src->audiocast_thread =
|
|
|
|
g_thread_create ((GThreadFunc) audiocast_thread_run, src, TRUE, &error);
|
|
|
|
if (error != NULL) {
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, TOO_LAZY, (NULL),
|
2004-03-15 19:32:28 +00:00
|
|
|
("Unable to create thread: %s", error->message));
|
2004-03-14 22:34:34 +00:00
|
|
|
close (src->audiocast_fd);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static int
|
|
|
|
audiocast_register_listener (gint * port, gint * fd)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
struct sockaddr_in sin;
|
|
|
|
int sock;
|
|
|
|
socklen_t sinlen = sizeof (struct sockaddr_in);
|
2002-09-10 18:38:22 +00:00
|
|
|
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG ("audiocast: establishing UDP listener");
|
2002-09-10 18:38:22 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if ((sock = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
|
|
|
|
goto lose;
|
2002-09-10 18:38:22 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
memset (&sin, 0, sinlen);
|
|
|
|
sin.sin_family = AF_INET;
|
|
|
|
sin.sin_addr.s_addr = g_htonl (INADDR_ANY);
|
2002-09-10 18:38:22 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
if (bind (sock, (struct sockaddr *) &sin, sinlen) < 0)
|
|
|
|
goto lose_and_close;
|
2002-09-10 18:38:22 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
memset (&sin, 0, sinlen);
|
|
|
|
if (getsockname (sock, (struct sockaddr *) &sin, &sinlen) < 0)
|
|
|
|
goto lose_and_close;
|
2002-09-10 18:38:22 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
GST_DEBUG ("audiocast: listening on local %s:%d", inet_ntoa (sin.sin_addr),
|
|
|
|
g_ntohs (sin.sin_port));
|
|
|
|
|
|
|
|
*port = g_ntohs (sin.sin_port);
|
|
|
|
*fd = sock;
|
|
|
|
|
|
|
|
return 0;
|
2002-09-10 18:38:22 +00:00
|
|
|
lose_and_close:
|
2004-03-14 22:34:34 +00:00
|
|
|
close (sock);
|
2002-09-10 18:38:22 +00:00
|
|
|
lose:
|
2004-03-14 22:34:34 +00:00
|
|
|
return -1;
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void
|
|
|
|
audiocast_do_notifications (GstGnomeVFSSrc * src)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
/* Send any pending notifications we got from the UDP thread. */
|
|
|
|
if (src->iradio_mode) {
|
|
|
|
GList *entry;
|
|
|
|
|
|
|
|
g_mutex_lock (src->audiocast_queue_mutex);
|
|
|
|
for (entry = src->audiocast_notify_queue; entry; entry = entry->next)
|
|
|
|
g_object_notify (G_OBJECT (src), (const gchar *) entry->data);
|
|
|
|
g_list_free (src->audiocast_notify_queue);
|
|
|
|
src->audiocast_notify_queue = NULL;
|
|
|
|
g_mutex_unlock (src->audiocast_queue_mutex);
|
|
|
|
}
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static gpointer
|
|
|
|
audiocast_thread_run (GstGnomeVFSSrc * src)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
char buf[1025], **lines;
|
|
|
|
gsize len;
|
|
|
|
fd_set fdset, readset;
|
|
|
|
struct sockaddr_in from;
|
|
|
|
socklen_t fromlen = sizeof (struct sockaddr_in);
|
|
|
|
|
|
|
|
FD_ZERO (&fdset);
|
|
|
|
|
|
|
|
FD_SET (src->audiocast_fd, &fdset);
|
|
|
|
FD_SET (src->audiocast_thread_die_infd, &fdset);
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
GST_DEBUG ("audiocast thread: dropping into select");
|
|
|
|
readset = fdset;
|
|
|
|
if (select (FD_SETSIZE, &readset, NULL, NULL, NULL) < 0) {
|
|
|
|
perror ("select");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (FD_ISSET (src->audiocast_thread_die_infd, &readset)) {
|
|
|
|
char buf[1];
|
|
|
|
|
|
|
|
GST_DEBUG ("audiocast thread: got die character");
|
2005-07-04 14:12:41 +00:00
|
|
|
if (read (src->audiocast_thread_die_infd, buf, 1) != 1)
|
|
|
|
g_warning ("gnomevfssrc: could not read from audiocast fd");
|
2004-03-14 22:34:34 +00:00
|
|
|
close (src->audiocast_thread_die_infd);
|
|
|
|
close (src->audiocast_fd);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
GST_DEBUG ("audiocast thread: reading data");
|
|
|
|
len =
|
2004-03-15 19:32:28 +00:00
|
|
|
recvfrom (src->audiocast_fd, buf, sizeof (buf) - 1, 0,
|
|
|
|
(struct sockaddr *) &from, &fromlen);
|
2004-03-14 22:34:34 +00:00
|
|
|
if (len < 0 && errno == EAGAIN)
|
|
|
|
continue;
|
|
|
|
else if (len >= 0) {
|
|
|
|
int i;
|
|
|
|
char *valptr, *value;
|
|
|
|
|
|
|
|
buf[len] = '\0';
|
|
|
|
lines = g_strsplit (buf, "\n", 0);
|
|
|
|
if (!lines)
|
2004-03-15 19:32:28 +00:00
|
|
|
continue;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
for (i = 0; lines[i]; i++) {
|
2004-03-15 19:32:28 +00:00
|
|
|
while ((lines[i][strlen (lines[i]) - 1] == '\n') ||
|
|
|
|
(lines[i][strlen (lines[i]) - 1] == '\r'))
|
|
|
|
lines[i][strlen (lines[i]) - 1] = '\0';
|
|
|
|
|
|
|
|
valptr = strchr (lines[i], ':');
|
|
|
|
|
|
|
|
if (!valptr)
|
|
|
|
continue;
|
|
|
|
else
|
|
|
|
valptr++;
|
|
|
|
|
|
|
|
g_strstrip (valptr);
|
|
|
|
if (!strlen (valptr))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
value = gst_gnomevfssrc_unicodify (valptr);
|
|
|
|
if (!value) {
|
|
|
|
g_print ("Unable to convert \"%s\" to UTF-8!\n", valptr);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!strncmp (lines[i], "x-audiocast-streamtitle", 23)) {
|
|
|
|
g_mutex_lock (src->audiocast_udpdata_mutex);
|
|
|
|
g_free (src->iradio_title);
|
|
|
|
src->iradio_title = value;
|
|
|
|
g_mutex_unlock (src->audiocast_udpdata_mutex);
|
|
|
|
|
|
|
|
g_mutex_lock (src->audiocast_queue_mutex);
|
|
|
|
src->audiocast_notify_queue =
|
|
|
|
g_list_append (src->audiocast_notify_queue, "iradio-title");
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "audiocast title: %s\n", src->iradio_title);
|
2004-03-15 19:32:28 +00:00
|
|
|
g_mutex_unlock (src->audiocast_queue_mutex);
|
|
|
|
} else if (!strncmp (lines[i], "x-audiocast-streamurl", 21)) {
|
|
|
|
g_mutex_lock (src->audiocast_udpdata_mutex);
|
|
|
|
g_free (src->iradio_url);
|
|
|
|
src->iradio_url = value;
|
|
|
|
g_mutex_unlock (src->audiocast_udpdata_mutex);
|
|
|
|
|
|
|
|
g_mutex_lock (src->audiocast_queue_mutex);
|
|
|
|
src->audiocast_notify_queue =
|
|
|
|
g_list_append (src->audiocast_notify_queue, "iradio-url");
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "audiocast url: %s\n", src->iradio_title);
|
2004-03-15 19:32:28 +00:00
|
|
|
g_mutex_unlock (src->audiocast_queue_mutex);
|
|
|
|
} else if (!strncmp (lines[i], "x-audiocast-udpseqnr", 20)) {
|
|
|
|
gchar outbuf[120];
|
|
|
|
|
|
|
|
sprintf (outbuf, "x-audiocast-ack: %ld \r\n", atol (value));
|
|
|
|
g_free (value);
|
|
|
|
|
|
|
|
if (sendto (src->audiocast_fd, outbuf, strlen (outbuf), 0,
|
|
|
|
(struct sockaddr *) &from, fromlen) <= 0) {
|
|
|
|
g_print ("Error sending response to server: %s\n",
|
|
|
|
strerror (errno));
|
|
|
|
continue;
|
|
|
|
}
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "sent audiocast ack: %s\n", outbuf);
|
2004-03-15 19:32:28 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
g_strfreev (lines);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
static void
|
|
|
|
audiocast_thread_kill (GstGnomeVFSSrc * src)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
if (!src->audiocast_thread)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
We rely on this hack to kill the
|
|
|
|
audiocast thread. If we get icecast
|
|
|
|
metadata, then we don't need the
|
|
|
|
audiocast metadata too.
|
|
|
|
*/
|
|
|
|
GST_DEBUG ("audiocast: writing die character");
|
2005-07-04 14:12:41 +00:00
|
|
|
if (write (src->audiocast_thread_die_outfd, "q", 1) != 1)
|
|
|
|
g_critical ("gnomevfssrc: could not write to audiocast thread fd");
|
2004-03-14 22:34:34 +00:00
|
|
|
close (src->audiocast_thread_die_outfd);
|
|
|
|
GST_DEBUG ("audiocast: joining thread");
|
|
|
|
g_thread_join (src->audiocast_thread);
|
|
|
|
src->audiocast_thread = NULL;
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_gnomevfssrc_send_additional_headers_callback (gconstpointer in,
|
2004-03-14 22:34:34 +00:00
|
|
|
gsize in_size, gpointer out, gsize out_size, gpointer callback_data)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
GstGnomeVFSSrc *src = GST_GNOMEVFSSRC (callback_data);
|
|
|
|
GnomeVFSModuleCallbackAdditionalHeadersOut *out_args =
|
|
|
|
(GnomeVFSModuleCallbackAdditionalHeadersOut *) out;
|
|
|
|
|
|
|
|
if (!src->iradio_mode)
|
|
|
|
return;
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "sending headers\n");
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
out_args->headers = g_list_append (out_args->headers,
|
|
|
|
g_strdup ("icy-metadata:1\r\n"));
|
|
|
|
out_args->headers = g_list_append (out_args->headers,
|
|
|
|
g_strdup_printf ("x-audiocast-udpport: %d\r\n", src->audiocast_port));
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_gnomevfssrc_received_headers_callback (gconstpointer in,
|
2004-03-14 22:34:34 +00:00
|
|
|
gsize in_size, gpointer out, gsize out_size, gpointer callback_data)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
GList *i;
|
|
|
|
gint icy_metaint;
|
|
|
|
GstGnomeVFSSrc *src = GST_GNOMEVFSSRC (callback_data);
|
|
|
|
GnomeVFSModuleCallbackReceivedHeadersIn *in_args =
|
|
|
|
(GnomeVFSModuleCallbackReceivedHeadersIn *) in;
|
|
|
|
|
|
|
|
/* This is only used for internet radio stuff right now */
|
|
|
|
if (!src->iradio_mode)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = in_args->headers; i; i = i->next) {
|
|
|
|
char *data = (char *) i->data;
|
|
|
|
char *key = data;
|
|
|
|
char *value = strchr (data, ':');
|
|
|
|
|
|
|
|
if (!value)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
value++;
|
|
|
|
g_strstrip (value);
|
|
|
|
if (!strlen (value))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Icecast stuff */
|
2005-07-04 14:12:41 +00:00
|
|
|
if (strncmp (data, "icy-metaint:", 12) == 0) { /* ugh */
|
|
|
|
if (sscanf (data + 12, "%d", &icy_metaint) == 1) {
|
|
|
|
src->icy_metaint = icy_metaint;
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "got icy-metaint %d, killing audiocast thread",
|
2005-07-04 14:12:41 +00:00
|
|
|
src->icy_metaint);
|
|
|
|
audiocast_thread_kill (src);
|
|
|
|
continue;
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!strncmp (data, "icy-", 4))
|
|
|
|
key = data + 4;
|
|
|
|
else if (!strncmp (data, "x-audiocast-", 12))
|
|
|
|
key = data + 12;
|
|
|
|
else
|
|
|
|
continue;
|
|
|
|
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "key: %s", key);
|
2004-03-14 22:34:34 +00:00
|
|
|
if (!strncmp (key, "name", 4)) {
|
|
|
|
g_free (src->iradio_name);
|
|
|
|
src->iradio_name = gst_gnomevfssrc_unicodify (value);
|
|
|
|
if (src->iradio_name)
|
2004-03-15 19:32:28 +00:00
|
|
|
g_object_notify (G_OBJECT (src), "iradio-name");
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (!strncmp (key, "genre", 5)) {
|
|
|
|
g_free (src->iradio_genre);
|
|
|
|
src->iradio_genre = gst_gnomevfssrc_unicodify (value);
|
|
|
|
if (src->iradio_genre)
|
2004-03-15 19:32:28 +00:00
|
|
|
g_object_notify (G_OBJECT (src), "iradio-genre");
|
2004-03-14 22:34:34 +00:00
|
|
|
} else if (!strncmp (key, "url", 3)) {
|
|
|
|
g_free (src->iradio_url);
|
|
|
|
src->iradio_url = gst_gnomevfssrc_unicodify (value);
|
|
|
|
if (src->iradio_url)
|
2004-03-15 19:32:28 +00:00
|
|
|
g_object_notify (G_OBJECT (src), "iradio-url");
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
}
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-07-08 10:59:36 +00:00
|
|
|
gst_gnomevfssrc_push_callbacks (GstGnomeVFSSrc * src)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2005-07-08 10:59:36 +00:00
|
|
|
if (src->http_callbacks_pushed)
|
2004-03-14 22:34:34 +00:00
|
|
|
return;
|
|
|
|
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "pushing callbacks");
|
2004-03-14 22:34:34 +00:00
|
|
|
gnome_vfs_module_callback_push
|
|
|
|
(GNOME_VFS_MODULE_CALLBACK_HTTP_SEND_ADDITIONAL_HEADERS,
|
2005-07-08 10:59:36 +00:00
|
|
|
gst_gnomevfssrc_send_additional_headers_callback, src, NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
gnome_vfs_module_callback_push
|
|
|
|
(GNOME_VFS_MODULE_CALLBACK_HTTP_RECEIVED_HEADERS,
|
2005-07-08 10:59:36 +00:00
|
|
|
gst_gnomevfssrc_received_headers_callback, src, NULL);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-07-08 10:59:36 +00:00
|
|
|
src->http_callbacks_pushed = TRUE;
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-07-08 10:59:36 +00:00
|
|
|
gst_gnomevfssrc_pop_callbacks (GstGnomeVFSSrc * src)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2005-07-08 10:59:36 +00:00
|
|
|
if (!src->http_callbacks_pushed)
|
2004-03-14 22:34:34 +00:00
|
|
|
return;
|
|
|
|
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "popping callbacks");
|
2004-03-14 22:34:34 +00:00
|
|
|
gnome_vfs_module_callback_pop
|
|
|
|
(GNOME_VFS_MODULE_CALLBACK_HTTP_SEND_ADDITIONAL_HEADERS);
|
|
|
|
gnome_vfs_module_callback_pop
|
|
|
|
(GNOME_VFS_MODULE_CALLBACK_HTTP_RECEIVED_HEADERS);
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_gnomevfssrc_get_icy_metadata (GstGnomeVFSSrc * src)
|
2002-09-10 18:38:22 +00:00
|
|
|
{
|
2004-03-14 22:34:34 +00:00
|
|
|
GnomeVFSFileSize length = 0;
|
|
|
|
GnomeVFSResult res;
|
|
|
|
gint metadata_length;
|
|
|
|
guchar foobyte;
|
|
|
|
guchar *data;
|
|
|
|
guchar *pos;
|
|
|
|
gchar **tags;
|
|
|
|
int i;
|
|
|
|
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "reading icecast metadata");
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
while (length == 0) {
|
|
|
|
res = gnome_vfs_read (src->handle, &foobyte, 1, &length);
|
|
|
|
if (res != GNOME_VFS_OK)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
metadata_length = foobyte * 16;
|
|
|
|
|
|
|
|
if (metadata_length == 0)
|
|
|
|
return;
|
|
|
|
|
ext/: ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek) (gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain) ext...
Original commit message from CVS:
2005-05-09 Andy Wingo <wingo@pobox.com>
* ext/alsa/gstalsasink.h:
* ext/gnomevfs/gstgnomevfssrc.c:
(gst_gnomevfssrc_get_icy_metadata):
* ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek)
(gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain)
* ext/theora/theoradec.c (theora_dec_src_query)
(theora_dec_src_event, theora_dec_sink_event)
(theora_handle_comment_packet, theora_handle_data_packet):
* ext/theora/theoraenc.c (theora_enc_chain):
* ext/vorbis/vorbisdec.c (vorbis_dec_src_event)
(vorbis_dec_sink_event, vorbis_handle_comment_packet):
* gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps):
* gst/typefind/gsttypefindfunctions.c (mp3_type_find)
(qt_type_find):
* gst/videotestsrc/videotestsrc.c (paint_setup_I420)
(paint_setup_YV12, paint_setup_YUY2, paint_setup_UYVY)
(paint_setup_YVYU, paint_setup_IYU2, paint_setup_Y41B)
(paint_setup_Y42B, paint_setup_Y800, paint_setup_IMC1)
(paint_setup_IMC2, paint_setup_IMC3, paint_setup_IMC4)
(paint_setup_YVU9, paint_setup_YUV9, paint_setup_xRGB8888)
(paint_setup_xBGR8888, paint_setup_RGBx8888)
(paint_setup_BGRx8888, paint_setup_RGB888, paint_setup_BGR888)
(paint_setup_RGB565, paint_setup_xRGB1555):
* gst/videotestsrc/videotestsrc.h:
* sys/ximage/ximagesink.c (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c (gst_xvimagesink_get_xv_support)
(gst_xvimagesink_setcaps, gst_xvimagesink_buffer_alloc):
GCC4 fixes.
* ext/ogg/gstoggdemux.c (gst_ogg_demux_find_chains): Use the new
gst_pad_query_position. Fixes oggdemux.
2005-05-09 07:03:13 +00:00
|
|
|
data = g_new (guchar, metadata_length + 1);
|
2004-03-14 22:34:34 +00:00
|
|
|
pos = data;
|
|
|
|
|
|
|
|
while (pos - data < metadata_length) {
|
|
|
|
res = gnome_vfs_read (src->handle, pos,
|
2004-03-15 19:32:28 +00:00
|
|
|
metadata_length - (pos - data), &length);
|
2004-03-14 22:34:34 +00:00
|
|
|
/* FIXME: better error handling here? */
|
|
|
|
if (res != GNOME_VFS_OK) {
|
|
|
|
g_free (data);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
pos += length;
|
|
|
|
}
|
|
|
|
|
|
|
|
data[metadata_length] = 0;
|
ext/: ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek) (gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain) ext...
Original commit message from CVS:
2005-05-09 Andy Wingo <wingo@pobox.com>
* ext/alsa/gstalsasink.h:
* ext/gnomevfs/gstgnomevfssrc.c:
(gst_gnomevfssrc_get_icy_metadata):
* ext/ogg/gstoggdemux.c (gst_ogg_demux_perform_seek)
(gst_ogg_demux_read_chain, gst_ogg_demux_read_end_chain)
* ext/theora/theoradec.c (theora_dec_src_query)
(theora_dec_src_event, theora_dec_sink_event)
(theora_handle_comment_packet, theora_handle_data_packet):
* ext/theora/theoraenc.c (theora_enc_chain):
* ext/vorbis/vorbisdec.c (vorbis_dec_src_event)
(vorbis_dec_sink_event, vorbis_handle_comment_packet):
* gst/audioconvert/gstaudioconvert.c (gst_audio_convert_getcaps):
* gst/typefind/gsttypefindfunctions.c (mp3_type_find)
(qt_type_find):
* gst/videotestsrc/videotestsrc.c (paint_setup_I420)
(paint_setup_YV12, paint_setup_YUY2, paint_setup_UYVY)
(paint_setup_YVYU, paint_setup_IYU2, paint_setup_Y41B)
(paint_setup_Y42B, paint_setup_Y800, paint_setup_IMC1)
(paint_setup_IMC2, paint_setup_IMC3, paint_setup_IMC4)
(paint_setup_YVU9, paint_setup_YUV9, paint_setup_xRGB8888)
(paint_setup_xBGR8888, paint_setup_RGBx8888)
(paint_setup_BGRx8888, paint_setup_RGB888, paint_setup_BGR888)
(paint_setup_RGB565, paint_setup_xRGB1555):
* gst/videotestsrc/videotestsrc.h:
* sys/ximage/ximagesink.c (gst_ximagesink_buffer_alloc):
* sys/xvimage/xvimagesink.c (gst_xvimagesink_get_xv_support)
(gst_xvimagesink_setcaps, gst_xvimagesink_buffer_alloc):
GCC4 fixes.
* ext/ogg/gstoggdemux.c (gst_ogg_demux_find_chains): Use the new
gst_pad_query_position. Fixes oggdemux.
2005-05-09 07:03:13 +00:00
|
|
|
tags = g_strsplit ((gchar *) data, "';", 0);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
for (i = 0; tags[i]; i++) {
|
|
|
|
if (!g_ascii_strncasecmp (tags[i], "StreamTitle=", 12)) {
|
|
|
|
g_free (src->iradio_title);
|
|
|
|
src->iradio_title = gst_gnomevfssrc_unicodify (tags[i] + 13);
|
|
|
|
if (src->iradio_title) {
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "sending notification on icecast title");
|
2004-03-15 19:32:28 +00:00
|
|
|
g_object_notify (G_OBJECT (src), "iradio-title");
|
2004-03-14 22:34:34 +00:00
|
|
|
} else
|
2004-03-15 19:32:28 +00:00
|
|
|
g_print ("Unable to convert icecast title \"%s\" to UTF-8!\n",
|
|
|
|
tags[i] + 13);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
if (!g_ascii_strncasecmp (tags[i], "StreamUrl=", 10)) {
|
|
|
|
g_free (src->iradio_url);
|
|
|
|
src->iradio_url = gst_gnomevfssrc_unicodify (tags[i] + 11);
|
|
|
|
if (src->iradio_url) {
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "sending notification on icecast url");
|
2004-03-15 19:32:28 +00:00
|
|
|
g_object_notify (G_OBJECT (src), "iradio-url");
|
2004-03-14 22:34:34 +00:00
|
|
|
} else
|
2004-03-15 19:32:28 +00:00
|
|
|
g_print ("Unable to convert icecast url \"%s\" to UTF-8!\n",
|
|
|
|
tags[i] + 11);
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_strfreev (tags);
|
2002-09-10 18:38:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* end of icecast/audiocast metadata extraction support code */
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/*
|
|
|
|
* Read a new buffer from src->reqoffset, takes care of events
|
|
|
|
* and seeking and such.
|
2001-12-23 16:42:33 +00:00
|
|
|
*/
|
2005-03-31 09:43:49 +00:00
|
|
|
static GstFlowReturn
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
gst_gnomevfssrc_create (GstBaseSrc * basesrc, guint64 offset, guint size,
|
|
|
|
GstBuffer ** buffer)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GnomeVFSResult res;
|
2004-03-14 22:34:34 +00:00
|
|
|
GstBuffer *buf;
|
|
|
|
GnomeVFSFileSize readbytes;
|
|
|
|
guint8 *data;
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
GstGnomeVFSSrc *src;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
src = GST_GNOMEVFSSRC (basesrc);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-07-19 11:59:43 +00:00
|
|
|
GST_DEBUG ("now at %llu, reading %lld, size %u", src->curoffset, offset,
|
|
|
|
size);
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* seek if required */
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
if (src->curoffset != offset) {
|
2005-07-19 11:59:43 +00:00
|
|
|
GST_DEBUG ("need to seek");
|
2005-03-31 09:43:49 +00:00
|
|
|
if (src->seekable) {
|
2005-07-19 11:59:43 +00:00
|
|
|
GST_DEBUG ("seeking to %lld", offset);
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
res = gnome_vfs_seek (src->handle, GNOME_VFS_SEEK_START, offset);
|
2005-07-19 11:59:43 +00:00
|
|
|
if (res != GNOME_VFS_OK)
|
|
|
|
goto seek_failed;
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
src->curoffset = offset;
|
2005-03-31 09:43:49 +00:00
|
|
|
} else {
|
2005-07-19 11:59:43 +00:00
|
|
|
goto cannot_seek;
|
2005-03-31 09:43:49 +00:00
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
audiocast_do_notifications (src);
|
|
|
|
|
|
|
|
if (src->iradio_mode && src->icy_metaint > 0) {
|
2005-05-25 11:59:39 +00:00
|
|
|
buf = gst_buffer_new_and_alloc (src->icy_metaint);
|
|
|
|
|
|
|
|
data = GST_BUFFER_DATA (buf);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
/* try to read */
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "doing read: icy_count: %" G_GINT64_FORMAT,
|
|
|
|
src->icy_count);
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
|
|
|
|
res = gnome_vfs_read (src->handle, data,
|
|
|
|
src->icy_metaint - src->icy_count, &readbytes);
|
|
|
|
|
|
|
|
if (res != GNOME_VFS_OK)
|
|
|
|
goto read_failed;
|
|
|
|
|
|
|
|
if (readbytes == 0)
|
|
|
|
goto eos;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
src->icy_count += readbytes;
|
|
|
|
GST_BUFFER_OFFSET (buf) = src->curoffset;
|
2005-05-25 11:59:39 +00:00
|
|
|
GST_BUFFER_SIZE (buf) = readbytes;
|
2004-03-14 22:34:34 +00:00
|
|
|
src->curoffset += readbytes;
|
|
|
|
|
|
|
|
if (src->icy_count == src->icy_metaint) {
|
|
|
|
gst_gnomevfssrc_get_icy_metadata (src);
|
|
|
|
src->icy_count = 0;
|
|
|
|
}
|
|
|
|
} else {
|
2005-05-25 11:59:39 +00:00
|
|
|
buf = gst_buffer_new_and_alloc (size);
|
|
|
|
|
|
|
|
data = GST_BUFFER_DATA (buf);
|
|
|
|
GST_BUFFER_OFFSET (buf) = src->curoffset;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
res = gnome_vfs_read (src->handle, data, size, &readbytes);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-05-25 11:59:39 +00:00
|
|
|
GST_BUFFER_SIZE (buf) = readbytes;
|
|
|
|
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
if (res != GNOME_VFS_OK)
|
|
|
|
goto read_failed;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
if (readbytes == 0)
|
|
|
|
goto eos;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
src->curoffset += readbytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we're done, return the buffer */
|
2005-03-31 09:43:49 +00:00
|
|
|
*buffer = buf;
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
|
2005-07-19 11:59:43 +00:00
|
|
|
seek_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (src,
|
|
|
|
"Failed to seek to requested position %lld: %s",
|
|
|
|
offset, gnome_vfs_result_to_string (res));
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
cannot_seek:
|
|
|
|
{
|
|
|
|
GST_ERROR_OBJECT (src,
|
|
|
|
"Requested seek from %lld to %lld on non-seekable stream",
|
|
|
|
src->curoffset, offset);
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
read_failed:
|
|
|
|
{
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
GST_ERROR_OBJECT (src, "Failed to read data: %s",
|
|
|
|
gnome_vfs_result_to_string (res));
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
eos:
|
|
|
|
{
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
GST_LOG_OBJECT (src, "Reading data gave EOS");
|
|
|
|
return GST_FLOW_WRONG_STATE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_gnomevfssrc_is_seekable (GstBaseSrc * basesrc)
|
|
|
|
{
|
|
|
|
GstGnomeVFSSrc *src;
|
|
|
|
|
|
|
|
src = GST_GNOMEVFSSRC (basesrc);
|
|
|
|
|
|
|
|
return src->seekable;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_gnomevfssrc_get_size (GstBaseSrc * basesrc, guint64 * size)
|
|
|
|
{
|
|
|
|
GstGnomeVFSSrc *src;
|
|
|
|
|
|
|
|
src = GST_GNOMEVFSSRC (basesrc);
|
|
|
|
|
2005-07-08 10:59:36 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "size %" G_GUINT64_FORMAT, src->size);
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
|
|
|
|
if (src->size == (GnomeVFSFileSize) - 1)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
*size = src->size;
|
|
|
|
|
|
|
|
return TRUE;
|
2001-12-23 16:42:33 +00:00
|
|
|
}
|
|
|
|
|
2003-02-07 01:47:58 +00:00
|
|
|
/* open the file, do stuff necessary to go to READY state */
|
2004-03-14 22:34:34 +00:00
|
|
|
static gboolean
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
gst_gnomevfssrc_start (GstBaseSrc * basesrc)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2005-03-31 09:43:49 +00:00
|
|
|
GnomeVFSResult res;
|
2004-03-14 22:34:34 +00:00
|
|
|
GnomeVFSFileInfo *info;
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
GstGnomeVFSSrc *src;
|
2004-03-14 22:34:34 +00:00
|
|
|
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
src = GST_GNOMEVFSSRC (basesrc);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
|
|
|
if (!audiocast_init (src))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gst_gnomevfssrc_push_callbacks (src);
|
|
|
|
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
if (src->uri != NULL) {
|
2005-03-31 09:43:49 +00:00
|
|
|
if ((res = gnome_vfs_open_uri (&src->handle, src->uri,
|
|
|
|
GNOME_VFS_OPEN_READ)) != GNOME_VFS_OK) {
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
gchar *filename = gnome_vfs_uri_to_string (src->uri,
|
|
|
|
GNOME_VFS_URI_HIDE_PASSWORD);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
gst_gnomevfssrc_pop_callbacks (src);
|
|
|
|
audiocast_thread_kill (src);
|
2004-03-14 22:34:34 +00:00
|
|
|
|
2005-08-07 14:21:06 +00:00
|
|
|
if (res == GNOME_VFS_ERROR_NOT_FOUND) {
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
|
|
|
|
("Could not open vfs file \"%s\" for reading: %s",
|
|
|
|
filename, gnome_vfs_result_to_string (res)));
|
|
|
|
} else {
|
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
|
|
|
|
("Could not open vfs file \"%s\" for reading: %s",
|
|
|
|
filename, gnome_vfs_result_to_string (res)));
|
|
|
|
}
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
g_free (filename);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
src->own_handle = TRUE;
|
|
|
|
} else if (!src->handle) {
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), ("No filename given"));
|
2004-03-14 22:34:34 +00:00
|
|
|
return FALSE;
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
} else {
|
|
|
|
src->own_handle = FALSE;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
|
|
|
|
2005-03-31 09:43:49 +00:00
|
|
|
src->size = (GnomeVFSFileSize) - 1;
|
2004-03-14 22:34:34 +00:00
|
|
|
info = gnome_vfs_file_info_new ();
|
2005-03-31 09:43:49 +00:00
|
|
|
if ((res = gnome_vfs_get_file_info_from_handle (src->handle,
|
|
|
|
info, GNOME_VFS_FILE_INFO_DEFAULT)) == GNOME_VFS_OK) {
|
|
|
|
if (info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) {
|
2004-03-14 22:34:34 +00:00
|
|
|
src->size = info->size;
|
2005-03-31 09:43:49 +00:00
|
|
|
GST_DEBUG_OBJECT (src, "size: %llu bytes", src->size);
|
|
|
|
} else
|
|
|
|
GST_LOG_OBJECT (src, "filesize not known");
|
|
|
|
} else {
|
|
|
|
GST_WARNING_OBJECT (src, "getting info failed: %s",
|
|
|
|
gnome_vfs_result_to_string (res));
|
|
|
|
}
|
2004-03-14 22:34:34 +00:00
|
|
|
gnome_vfs_file_info_unref (info);
|
|
|
|
|
|
|
|
audiocast_do_notifications (src);
|
|
|
|
|
|
|
|
if (gnome_vfs_seek (src->handle, GNOME_VFS_SEEK_CURRENT, 0)
|
|
|
|
== GNOME_VFS_OK) {
|
|
|
|
src->seekable = TRUE;
|
|
|
|
} else {
|
|
|
|
src->seekable = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2004-01-18 21:46:58 +00:00
|
|
|
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
static gboolean
|
|
|
|
gst_gnomevfssrc_stop (GstBaseSrc * basesrc)
|
2004-03-14 22:34:34 +00:00
|
|
|
{
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
GstGnomeVFSSrc *src;
|
|
|
|
|
|
|
|
src = GST_GNOMEVFSSRC (basesrc);
|
2003-07-29 07:18:06 +00:00
|
|
|
|
2004-03-14 22:34:34 +00:00
|
|
|
gst_gnomevfssrc_pop_callbacks (src);
|
|
|
|
audiocast_thread_kill (src);
|
2001-12-23 16:42:33 +00:00
|
|
|
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
if (src->own_handle) {
|
2004-03-14 22:34:34 +00:00
|
|
|
gnome_vfs_close (src->handle);
|
ext/gnomevfs/: Add URI support to Gnome-VFS plugins. Tries to load a fixed list of fake URIs to see which this versio...
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfs.c: (plugin_init):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_get_type),
(gst_gnomevfssink_dispose), (gst_gnomevfssink_init),
(gst_gnomevfssink_uri_get_type),
(gst_gnomevfssink_uri_get_protocols),
(gst_gnomevfssink_uri_get_uri), (gst_gnomevfssink_uri_set_uri),
(gst_gnomevfssink_uri_handler_init),
(gst_gnomevfssink_set_property), (gst_gnomevfssink_get_property),
(gst_gnomevfssink_open_file), (gst_gnomevfssink_close_file):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_init), (gst_gnomevfssrc_dispose),
(gst_gnomevfssrc_uri_get_type),
(gst_gnomevfssrc_uri_get_protocols), (gst_gnomevfssrc_uri_get_uri),
(gst_gnomevfssrc_uri_set_uri), (gst_gnomevfssrc_uri_handler_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_open_file), (gst_gnomevfssrc_close_file):
* ext/gnomevfs/gstgnomevfsuri.c: (gst_gnomevfs_get_supported_uris):
* ext/gnomevfs/gstgnomevfsuri.h:
Add URI support to Gnome-VFS plugins. Tries to load a fixed list
of fake URIs to see which this version of Gnome-VFS likes, and
uses that for the Gst-URI interface. Makes playbin support http://
streams. Also fix up some stupid behaviour in gnomevfssrc.
2004-09-13 17:33:19 +00:00
|
|
|
src->handle = NULL;
|
2004-03-14 22:34:34 +00:00
|
|
|
}
|
2005-03-31 09:43:49 +00:00
|
|
|
src->size = (GnomeVFSFileSize) - 1;
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
src->curoffset = 0;
|
2005-03-31 09:43:49 +00:00
|
|
|
|
Make gnomevfssrc extend the source base class.
Original commit message from CVS:
* ext/gnomevfs/Makefile.am:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_get_type),
(gst_gnomevfssrc_class_init), (gst_gnomevfssrc_init),
(gst_gnomevfssrc_set_property), (gst_gnomevfssrc_get_property),
(gst_gnomevfssrc_create), (gst_gnomevfssrc_is_seekable),
(gst_gnomevfssrc_get_size), (gst_gnomevfssrc_start),
(gst_gnomevfssrc_stop):
* ext/ogg/Makefile.am:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_get_data),
(gst_ogg_demux_find_chains), (gst_ogg_demux_sink_activate):
* ext/theora/Makefile.am:
* ext/theora/theoradec.c: (_inc_granulepos),
(theora_dec_sink_event), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_sink_event), (vorbis_dec_chain):
* gst-libs/gst/audio/Makefile.am:
* sys/xvimage/Makefile.am:
Make gnomevfssrc extend the source base class.
Fix linking against libs in various plugins.
2005-04-06 17:33:07 +00:00
|
|
|
return TRUE;
|
2002-03-21 19:30:11 +00:00
|
|
|
}
|