Commit 675f5de6 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

ext/gio/gstgio.h: Add macro to check if a stream supports seeking.

Original commit message from CVS:
* ext/gio/gstgio.h:
Add macro to check if a stream supports seeking.
* ext/gio/Makefile.am:
* ext/gio/gstgiobasesink.c: (gst_gio_base_sink_base_init),
(gst_gio_base_sink_class_init), (gst_gio_base_sink_init),
(gst_gio_base_sink_finalize), (gst_gio_base_sink_start),
(gst_gio_base_sink_stop), (gst_gio_base_sink_unlock),
(gst_gio_base_sink_unlock_stop), (gst_gio_base_sink_event),
(gst_gio_base_sink_render), (gst_gio_base_sink_query),
(gst_gio_base_sink_set_stream):
* ext/gio/gstgiobasesink.h:
* ext/gio/gstgiobasesrc.c: (gst_gio_base_src_base_init),
(gst_gio_base_src_class_init), (gst_gio_base_src_init),
(gst_gio_base_src_finalize), (gst_gio_base_src_start),
(gst_gio_base_src_stop), (gst_gio_base_src_get_size),
(gst_gio_base_src_is_seekable), (gst_gio_base_src_unlock),
(gst_gio_base_src_unlock_stop), (gst_gio_base_src_check_get_range),
(gst_gio_base_src_create), (gst_gio_base_src_set_stream):
* ext/gio/gstgiobasesrc.h:
Refactor common GIO functions to GstGioBaseSink and GstGioBaseSrc
base classes that only require a GInputStream or GOutputStream to
work.
* ext/gio/gstgiosink.c: (gst_gio_sink_base_init),
(gst_gio_sink_class_init), (gst_gio_sink_init),
(gst_gio_sink_finalize), (gst_gio_sink_start):
* ext/gio/gstgiosink.h:
* ext/gio/gstgiosrc.c: (gst_gio_src_base_init),
(gst_gio_src_class_init), (gst_gio_src_init),
(gst_gio_src_finalize), (gst_gio_src_start):
* ext/gio/gstgiosrc.h:
Use the newly created base classes here.
* ext/gio/gstgio.c: (plugin_init):
* ext/gio/gstgiostreamsink.c: (gst_gio_stream_sink_base_init),
(gst_gio_stream_sink_class_init), (gst_gio_stream_sink_init),
(gst_gio_stream_sink_finalize), (gst_gio_stream_sink_set_property),
(gst_gio_stream_sink_get_property):
* ext/gio/gstgiostreamsink.h:
* ext/gio/gstgiostreamsrc.c: (gst_gio_stream_src_base_init),
(gst_gio_stream_src_class_init), (gst_gio_stream_src_init),
(gst_gio_stream_src_finalize), (gst_gio_stream_src_set_property),
(gst_gio_stream_src_get_property):
* ext/gio/gstgiostreamsrc.h:
Implement GstGioStreamSink and GstGioStreamSrc that have a property
to set the GInputStream/GOutputStream that should be used.
* tests/check/Makefile.am:
* tests/check/pipelines/.cvsignore:
* tests/check/pipelines/gio.c: (message_handler), (GST_START_TEST),
(gio_testsuite), (main):
Add unit test for giostreamsrc and giostreamsink.
parent cf7dfb86
......@@ -3,11 +3,26 @@
plugin_LTLIBRARIES = libgstgio.la
# sources used to compile this plug-in
libgstgio_la_SOURCES = gstgio.c gstgiosink.c gstgiosrc.c
libgstgio_la_SOURCES = \
gstgio.c \
gstgiobasesink.c \
gstgiobasesrc.c \
gstgiosink.c \
gstgiosrc.c \
gstgiostreamsink.c \
gstgiostreamsrc.c
libgstgio_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GIO_CFLAGS)
libgstgio_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(GIO_LIBS)
libgstgio_la_LDFLAGS = $(GST_GIO_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = gstgio.h gstgiosink.h gstgiosrc.h
noinst_HEADERS = \
gstgio.h \
gstgiobasesink.h \
gstgiobasesrc.h \
gstgiosink.h \
gstgiosrc.h \
gstgiostreamsink.h \
gstgiostreamsrc.h
/* GStreamer
*
* Copyright (C) 2007 Rene Stadler <mail@renestadler.de>
* Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -25,6 +26,8 @@
#include "gstgio.h"
#include "gstgiosink.h"
#include "gstgiosrc.h"
#include "gstgiostreamsink.h"
#include "gstgiostreamsrc.h"
#include <gio/gvfs.h>
......@@ -199,6 +202,12 @@ plugin_init (GstPlugin * plugin)
ret &= gst_element_register (plugin, "giosrc", GST_RANK_MARGINAL,
GST_TYPE_GIO_SRC);
ret &= gst_element_register (plugin, "giostreamsink", GST_RANK_NONE,
GST_TYPE_GIO_STREAM_SINK);
ret &= gst_element_register (plugin, "giostreamsrc", GST_RANK_NONE,
GST_TYPE_GIO_STREAM_SRC);
return ret;
}
......
/* GStreamer
*
* Copyright (C) 2007 Rene Stadler <mail@renestadler.de>
* Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -18,8 +19,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GSTGIO_H__
#define __GSTGIO_H__
#ifndef __GST_GIO_H__
#define __GST_GIO_H__
#include <gio/gioerror.h>
#include <gio/gseekable.h>
......@@ -29,6 +30,8 @@ G_BEGIN_DECLS
#define GST_GIO_ERROR_MATCHES(err, code) g_error_matches (err, G_IO_ERROR, G_IO_ERROR_##code)
#define GST_GIO_STREAM_IS_SEEKABLE(stream) (G_IS_SEEKABLE (stream) && g_seekable_can_seek (G_SEEKABLE (stream)))
gboolean gst_gio_error (gpointer element, const gchar *func_name,
GError **err, GstFlowReturn *ret);
GstFlowReturn gst_gio_seek (gpointer element, GSeekable *stream, guint64 offset,
......@@ -37,4 +40,4 @@ void gst_gio_uri_handler_do_init (GType type);
G_END_DECLS
#endif /* __GSTGIO_H__ */
#endif /* __GST_GIO_H__ */
/* GStreamer
*
* Copyright (C) 2007 Rene Stadler <mail@renestadler.de>
* Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "gstgiobasesink.h"
GST_DEBUG_CATEGORY_STATIC (gst_gio_base_sink_debug);
#define GST_CAT_DEFAULT gst_gio_base_sink_debug
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
GST_BOILERPLATE (GstGioBaseSink, gst_gio_base_sink, GstBaseSink,
GST_TYPE_BASE_SINK);
static void gst_gio_base_sink_finalize (GObject * object);
static gboolean gst_gio_base_sink_start (GstBaseSink * base_sink);
static gboolean gst_gio_base_sink_stop (GstBaseSink * base_sink);
static gboolean gst_gio_base_sink_unlock (GstBaseSink * base_sink);
static gboolean gst_gio_base_sink_unlock_stop (GstBaseSink * base_sink);
static gboolean gst_gio_base_sink_event (GstBaseSink * base_sink,
GstEvent * event);
static GstFlowReturn gst_gio_base_sink_render (GstBaseSink * base_sink,
GstBuffer * buffer);
static gboolean gst_gio_base_sink_query (GstPad * pad, GstQuery * query);
static void
gst_gio_base_sink_base_init (gpointer gclass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
GST_DEBUG_CATEGORY_INIT (gst_gio_base_sink_debug, "gio_base_sink", 0,
"GIO base sink");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sink_factory));
}
static void
gst_gio_base_sink_class_init (GstGioBaseSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
gobject_class->finalize = gst_gio_base_sink_finalize;
gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_gio_base_sink_start);
gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_gio_base_sink_stop);
gstbasesink_class->unlock = GST_DEBUG_FUNCPTR (gst_gio_base_sink_unlock);
gstbasesink_class->unlock_stop =
GST_DEBUG_FUNCPTR (gst_gio_base_sink_unlock_stop);
gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_gio_base_sink_event);
gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_gio_base_sink_render);
}
static void
gst_gio_base_sink_init (GstGioBaseSink * sink, GstGioBaseSinkClass * gclass)
{
gst_pad_set_query_function (GST_BASE_SINK_PAD (sink),
GST_DEBUG_FUNCPTR (gst_gio_base_sink_query));
gst_base_sink_set_sync (GST_BASE_SINK (sink), FALSE);
sink->cancel = g_cancellable_new ();
}
static void
gst_gio_base_sink_finalize (GObject * object)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (object);
if (sink->cancel) {
g_object_unref (sink->cancel);
sink->cancel = NULL;
}
if (sink->stream) {
g_object_unref (sink->stream);
sink->stream = NULL;
}
GST_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static gboolean
gst_gio_base_sink_start (GstBaseSink * base_sink)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (base_sink);
if (!G_IS_OUTPUT_STREAM (sink->stream)) {
GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, (NULL),
("No stream given yet"));
return FALSE;
}
sink->position = 0;
GST_DEBUG_OBJECT (sink, "started stream");
return TRUE;
}
static gboolean
gst_gio_base_sink_stop (GstBaseSink * base_sink)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (base_sink);
gboolean success = TRUE;
GError *err = NULL;
if (G_IS_OUTPUT_STREAM (sink->stream)) {
/* FIXME: In case that the call below would block, there is no one to
* trigger the cancellation! */
success = g_output_stream_close (sink->stream, sink->cancel, &err);
if (success) {
GST_DEBUG_OBJECT (sink, "closed stream");
} else if (!gst_gio_error (sink, "g_output_stream_close", &err, NULL)) {
GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE, (NULL),
("g_output_stream_close failed: %s", err->message));
g_clear_error (&err);
}
g_object_unref (sink->stream);
sink->stream = NULL;
}
return success;
}
static gboolean
gst_gio_base_sink_unlock (GstBaseSink * base_sink)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (base_sink);
GST_LOG_OBJECT (sink, "triggering cancellation");
g_cancellable_cancel (sink->cancel);
return TRUE;
}
static gboolean
gst_gio_base_sink_unlock_stop (GstBaseSink * base_sink)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (base_sink);
GST_LOG_OBJECT (sink, "resetting cancellable");
g_cancellable_reset (sink->cancel);
return TRUE;
}
static gboolean
gst_gio_base_sink_event (GstBaseSink * base_sink, GstEvent * event)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (base_sink);
GstFlowReturn ret = GST_FLOW_OK;
if (sink->stream == NULL)
return TRUE;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_NEWSEGMENT:
{
GstFormat format;
gint64 offset;
gst_event_parse_new_segment (event, NULL, NULL, &format, &offset, NULL,
NULL);
if (format != GST_FORMAT_BYTES) {
GST_WARNING_OBJECT (sink, "ignored NEWSEGMENT event in %s format",
gst_format_get_name (format));
break;
}
if (GST_GIO_STREAM_IS_SEEKABLE (sink->stream)) {
ret = gst_gio_seek (sink, G_SEEKABLE (sink->stream), offset,
sink->cancel);
if (ret == GST_FLOW_OK)
sink->position = offset;
} else {
ret = GST_FLOW_NOT_SUPPORTED;
}
}
break;
case GST_EVENT_EOS:
case GST_EVENT_FLUSH_START:
{
gboolean success;
GError *err = NULL;
success = g_output_stream_flush (sink->stream, sink->cancel, &err);
if (!success && !gst_gio_error (sink, "g_output_stream_flush", &err,
&ret)) {
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE, (NULL),
("flush failed: %s", err->message));
g_clear_error (&err);
}
}
break;
default:
break;
}
return (ret == GST_FLOW_OK);
}
static GstFlowReturn
gst_gio_base_sink_render (GstBaseSink * base_sink, GstBuffer * buffer)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (base_sink);
gssize written;
gboolean success;
GError *err = NULL;
GST_LOG_OBJECT (sink, "writing %u bytes to offset %" G_GUINT64_FORMAT,
GST_BUFFER_SIZE (buffer), sink->position);
written = g_output_stream_write (sink->stream,
GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer), sink->cancel, &err);
success = (written >= 0);
if (G_UNLIKELY (success && written < GST_BUFFER_SIZE (buffer))) {
/* FIXME: Can this happen? Should we handle it gracefully? gnomevfssink
* doesn't... */
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE, (NULL),
("Could not write to stream: (short write, only %"
G_GUINT64_FORMAT " bytes of %d bytes written)",
written, GST_BUFFER_SIZE (buffer)));
return GST_FLOW_ERROR;
}
if (success) {
sink->position += written;
return GST_FLOW_OK;
} else {
GstFlowReturn ret;
if (!gst_gio_error (sink, "g_output_stream_write", &err, &ret)) {
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE, (NULL),
("Could not write to stream: %s", err->message));
g_clear_error (&err);
}
return ret;
}
}
static gboolean
gst_gio_base_sink_query (GstPad * pad, GstQuery * query)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (GST_PAD_PARENT (pad));
GstFormat format;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
gst_query_parse_position (query, &format, NULL);
switch (format) {
case GST_FORMAT_BYTES:
case GST_FORMAT_DEFAULT:
gst_query_set_position (query, GST_FORMAT_BYTES, sink->position);
return TRUE;
default:
return FALSE;
}
case GST_QUERY_FORMATS:
gst_query_set_formats (query, 2, GST_FORMAT_DEFAULT, GST_FORMAT_BYTES);
return TRUE;
default:
return gst_pad_query_default (pad, query);
}
}
void
gst_gio_base_sink_set_stream (GstGioBaseSink * sink, GOutputStream * stream)
{
g_return_if_fail (G_IS_OUTPUT_STREAM (stream));
g_return_if_fail ((GST_STATE (sink) != GST_STATE_PLAYING &&
GST_STATE (sink) != GST_STATE_PAUSED));
if (sink->stream) {
GError *err = NULL;
gboolean success = g_output_stream_close (sink->stream, sink->cancel, &err);
if (success) {
GST_DEBUG_OBJECT (sink, "closed stream");
} else if (!gst_gio_error (sink, "g_output_stream_close", &err, NULL)) {
GST_WARNING_OBJECT (sink, "g_output_stream_close failed: %s",
err->message);
g_clear_error (&err);
}
g_object_unref (sink->stream);
sink->stream = NULL;
}
sink->stream = stream;
}
/* GStreamer
*
* Copyright (C) 2007 Rene Stadler <mail@renestadler.de>
* Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
*
* 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.
*/
#ifndef __GST_GIO_BASE_SINK_H__
#define __GST_GIO_BASE_SINK_H__
#include "gstgio.h"
#include <gio/gfile.h>
#include <gst/base/gstbasesink.h>
G_BEGIN_DECLS
#define GST_TYPE_GIO_BASE_SINK \
(gst_gio_base_sink_get_type())
#define GST_GIO_BASE_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GIO_BASE_SINK,GstGioBaseSink))
#define GST_GIO_BASE_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GIO_BASE_SINK,GstGioBaseSinkClass))
#define GST_IS_GIO_BASE_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GIO_BASE_SINK))
#define GST_IS_GIO_BASE_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GIO_BASE_SINK))
typedef struct _GstGioBaseSink GstGioBaseSink;
typedef struct _GstGioBaseSinkClass GstGioBaseSinkClass;
struct _GstGioBaseSink
{
GstBaseSink sink;
GCancellable *cancel;
guint64 position;
GOutputStream *stream;
};
struct _GstGioBaseSinkClass
{
GstBaseSinkClass parent_class;
};
GType gst_gio_base_sink_get_type (void);
void gst_gio_base_sink_set_stream (GstGioBaseSink *sink, GOutputStream *stream);
G_END_DECLS
#endif /* __GST_GIO_BASE_SINK_H__ */
/* GStreamer
*
* Copyright (C) 2007 Rene Stadler <mail@renestadler.de>
* Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "gstgiobasesrc.h"
GST_DEBUG_CATEGORY_STATIC (gst_gio_base_src_debug);
#define GST_CAT_DEFAULT gst_gio_base_src_debug
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
GST_BOILERPLATE (GstGioBaseSrc, gst_gio_base_src, GstBaseSrc,
GST_TYPE_BASE_SRC);
static void gst_gio_base_src_finalize (GObject * object);
static gboolean gst_gio_base_src_start (GstBaseSrc * base_src);
static gboolean gst_gio_base_src_stop (GstBaseSrc * base_src);
static gboolean gst_gio_base_src_get_size (GstBaseSrc * base_src,
guint64 * size);
static gboolean gst_gio_base_src_is_seekable (GstBaseSrc * base_src);
static gboolean gst_gio_base_src_unlock (GstBaseSrc * base_src);
static gboolean gst_gio_base_src_unlock_stop (GstBaseSrc * base_src);
static gboolean gst_gio_base_src_check_get_range (GstBaseSrc * base_src);
static GstFlowReturn gst_gio_base_src_create (GstBaseSrc * base_src,
guint64 offset, guint size, GstBuffer ** buf);
static void
gst_gio_base_src_base_init (gpointer gclass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
GST_DEBUG_CATEGORY_INIT (gst_gio_base_src_debug, "gio_base_src", 0,
"GIO base source");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_factory));
}
static void
gst_gio_base_src_class_init (GstGioBaseSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSrcClass *gstbasesrc_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasesrc_class = (GstBaseSrcClass *) klass;
gobject_class->finalize = gst_gio_base_src_finalize;
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_gio_base_src_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gio_base_src_stop);
gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_gio_base_src_get_size);
gstbasesrc_class->is_seekable =
GST_DEBUG_FUNCPTR (gst_gio_base_src_is_seekable);
gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_gio_base_src_unlock);
gstbasesrc_class->unlock_stop =
GST_DEBUG_FUNCPTR (gst_gio_base_src_unlock_stop);
gstbasesrc_class->check_get_range =
GST_DEBUG_FUNCPTR (gst_gio_base_src_check_get_range);
gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_gio_base_src_create);
}
static void
gst_gio_base_src_init (GstGioBaseSrc * src, GstGioBaseSrcClass * gclass)
{
src->cancel = g_cancellable_new ();
}
static void
gst_gio_base_src_finalize (GObject * object)
{
GstGioBaseSrc *src = GST_GIO_BASE_SRC (object);
if (src->cancel) {
g_object_unref (src->cancel);
src->cancel = NULL;
}
if (src->stream) {
g_object_unref (src->stream);
src->stream = NULL;
}
GST_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static gboolean
gst_gio_base_src_start (GstBaseSrc * base_src)
{
GstGioBaseSrc *src = GST_GIO_BASE_SRC (base_src);
if (!G_IS_INPUT_STREAM (src->stream)) {
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
("No stream given yet"));
return FALSE;
}
src->position = 0;
GST_DEBUG_OBJECT (src, "started stream");