+2005-07-14 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * docs/gst/gstreamer-sections.txt:
+ * docs/gst/gstreamer.types:
+ * docs/gst/tmpl/gst.sgml:
+ * docs/gst/tmpl/gstbasesink.sgml:
+ * docs/gst/tmpl/gstbasesrc.sgml:
+ * docs/gst/tmpl/gstbasetransform.sgml:
+ * docs/gst/tmpl/gstbin.sgml:
+ * docs/gst/tmpl/gstbuffer.sgml:
+ * docs/gst/tmpl/gstcaps.sgml:
+ * docs/gst/tmpl/gstclock.sgml:
+ * docs/gst/tmpl/gstcompat.sgml:
+ * docs/gst/tmpl/gstconfig.sgml:
+ * docs/gst/tmpl/gstelement.sgml:
+ * docs/gst/tmpl/gstelementdetails.sgml:
+ * docs/gst/tmpl/gstelementfactory.sgml:
+ * docs/gst/tmpl/gstenumtypes.sgml:
+ * docs/gst/tmpl/gsterror.sgml:
+ * docs/gst/tmpl/gstevent.sgml:
+ * docs/gst/tmpl/gstfakesink.sgml:
+ * docs/gst/tmpl/gstfakesrc.sgml:
+ * docs/gst/tmpl/gstfilesink.sgml:
+ * docs/gst/tmpl/gstfilesrc.sgml:
+ * docs/gst/tmpl/gstfilter.sgml:
+ * docs/gst/tmpl/gstformat.sgml:
+ * docs/gst/tmpl/gstghostpad.sgml:
+ * docs/gst/tmpl/gstimplementsinterface.sgml:
+ * docs/gst/tmpl/gstindex.sgml:
+ * docs/gst/tmpl/gstindexfactory.sgml:
+ * docs/gst/tmpl/gstinfo.sgml:
+ * docs/gst/tmpl/gstiterator.sgml:
+ * docs/gst/tmpl/gstmacros.sgml:
+ * docs/gst/tmpl/gstmemchunk.sgml:
+ * docs/gst/tmpl/gstminiobject.sgml:
+ * docs/gst/tmpl/gstobject.sgml:
+ * docs/gst/tmpl/gstpad.sgml:
+ * docs/gst/tmpl/gstpadtemplate.sgml:
+ * docs/gst/tmpl/gstparse.sgml:
+ * docs/gst/tmpl/gstpipeline.sgml:
+ * docs/gst/tmpl/gstplugin.sgml:
+ * docs/gst/tmpl/gstpluginfeature.sgml:
+ * docs/gst/tmpl/gstquery.sgml:
+ * docs/gst/tmpl/gstqueue.sgml:
+ * docs/gst/tmpl/gstregistry.sgml:
+ * docs/gst/tmpl/gstregistrypool.sgml:
+ * docs/gst/tmpl/gstscheduler.sgml:
+ * docs/gst/tmpl/gstschedulerfactory.sgml:
+ * docs/gst/tmpl/gststructure.sgml:
+ * docs/gst/tmpl/gstsystemclock.sgml:
+ * docs/gst/tmpl/gsttaglist.sgml:
+ * docs/gst/tmpl/gsttagsetter.sgml:
+ * docs/gst/tmpl/gsttrace.sgml:
+ * docs/gst/tmpl/gsttrashstack.sgml:
+ * docs/gst/tmpl/gsttypefind.sgml:
+ * docs/gst/tmpl/gsttypefindfactory.sgml:
+ * docs/gst/tmpl/gsttypes.sgml:
+ * docs/gst/tmpl/gsturihandler.sgml:
+ * docs/gst/tmpl/gsturitype.sgml:
+ * docs/gst/tmpl/gstutils.sgml:
+ * docs/gst/tmpl/gstvalue.sgml:
+ * docs/gst/tmpl/gstversion.sgml:
+ * docs/gst/tmpl/gstxml.sgml:
+ * docs/libs/tmpl/gstcontrol.sgml:
+ * docs/libs/tmpl/gstdataprotocol.sgml:
+ * docs/libs/tmpl/gstdparam.sgml:
+ * docs/libs/tmpl/gstdplinint.sgml:
+ * docs/libs/tmpl/gstdpman.sgml:
+ * docs/libs/tmpl/gstdpsmooth.sgml:
+ * docs/libs/tmpl/gstgetbits.sgml:
+ * docs/libs/tmpl/gstunitconvert.sgml:
+ * gst/base/gstpushsrc.c: (gst_push_src_get_type),
+ (gst_push_src_base_init), (gst_push_src_class_init),
+ (gst_push_src_init), (gst_push_src_create):
+ * gst/base/gstpushsrc.h:
+ * gst/elements/gstelements.c:
+ * gst/elements/gstfakesink.c: (gst_fake_sink_state_error_get_type),
+ (gst_fake_sink_base_init), (gst_fake_sink_class_init),
+ (gst_fake_sink_init), (gst_fake_sink_set_property),
+ (gst_fake_sink_get_property), (gst_fake_sink_get_times),
+ (gst_fake_sink_event), (gst_fake_sink_preroll),
+ (gst_fake_sink_render), (gst_fake_sink_change_state):
+ * gst/elements/gstfakesink.h:
+ * gst/elements/gstfakesrc.c: (gst_fake_src_data_get_type),
+ (gst_fake_src_sizetype_get_type), (gst_fake_src_filltype_get_type),
+ (gst_fake_src_base_init), (gst_fake_src_class_init),
+ (gst_fake_src_init), (gst_fake_src_event_handler),
+ (gst_fake_src_alloc_parent), (gst_fake_src_set_property),
+ (gst_fake_src_get_property), (gst_fake_src_prepare_buffer),
+ (gst_fake_src_alloc_buffer), (gst_fake_src_get_size),
+ (gst_fake_src_create_buffer), (gst_fake_src_create),
+ (gst_fake_src_start), (gst_fake_src_stop):
+ * gst/elements/gstfakesrc.h:
+ * gst/elements/gstfilesink.c: (_do_init),
+ (gst_file_sink_base_init), (gst_file_sink_class_init),
+ (gst_file_sink_init), (gst_file_sink_dispose),
+ (gst_file_sink_set_location), (gst_file_sink_set_property),
+ (gst_file_sink_get_property), (gst_file_sink_open_file),
+ (gst_file_sink_close_file), (gst_file_sink_query),
+ (gst_file_sink_event), (gst_file_sink_render),
+ (gst_file_sink_change_state), (gst_file_sink_uri_get_type),
+ (gst_file_sink_uri_get_protocols), (gst_file_sink_uri_get_uri),
+ (gst_file_sink_uri_set_uri), (gst_file_sink_uri_handler_init):
+ * gst/elements/gstfilesink.h:
+ * gst/elements/gstfilesrc.c: (_do_init), (gst_file_src_base_init),
+ (gst_file_src_class_init), (gst_file_src_init),
+ (gst_file_src_finalize), (gst_file_src_set_location),
+ (gst_file_src_set_property), (gst_file_src_get_property),
+ (gst_file_src_map_region), (gst_file_src_map_small_region),
+ (gst_file_src_create_mmap), (gst_file_src_create_read),
+ (gst_file_src_create), (gst_file_src_is_seekable),
+ (gst_file_src_get_size), (gst_file_src_start), (gst_file_src_stop),
+ (gst_file_src_uri_get_type), (gst_file_src_uri_get_protocols),
+ (gst_file_src_uri_get_uri), (gst_file_src_uri_set_uri),
+ (gst_file_src_uri_handler_init):
+ * gst/elements/gstfilesrc.h:
+ more autistic cleanliness in functions/names/defines
+
2005-07-13 Andy Wingo <wingo@pobox.com>
* gst/base/gstbasesrc.c (gst_base_src_start): Post an error if the
GST_FAKESRC_CLASS
GST_IS_FAKESRC_CLASS
<SUBSECTION Private>
-gst_fakesrc_get_type
+gst_fake_src_get_type
</SECTION>
<SECTION>
GST_FAKESINK_CLASS
GST_IS_FAKESINK_CLASS
<SUBSECTION Private>
-gst_fakesink_get_type
+gst_fake_sink_get_type
</SECTION>
<SECTION>
GstFileSrc
<SUBSECTION Standard>
GstFileSrcClass
-GST_FILESRC
+GST_FILE_SRC
GST_IS_FILESRC
GST_TYPE_FILESRC
-GST_FILESRC_CLASS
+GST_FILE_SRC_CLASS
GST_IS_FILESRC_CLASS
<SUBSECTION Private>
-gst_filesrc_get_type
+gst_file_src_get_type
</SECTION>
<SECTION>
<SUBSECTION Standard>
GstFileSinkClass
-GST_FILESINK
+GST_FILE_SINK
GST_IS_FILESINK
GST_TYPE_FILESINK
-GST_FILESINK_CLASS
+GST_FILE_SINK_CLASS
GST_IS_FILESINK_CLASS
<SUBSECTION Private>
-gst_filesink_get_type
+gst_file_sink_get_type
</SECTION>
<SECTION>
#include <gst/elements/gstfilesrc.h>
#include <gst/elements/gstfilesink.h>
-gst_fakesrc_get_type
-gst_fakesink_get_type
-gst_filesrc_get_type
-gst_filesink_get_type
+gst_fake_src_get_type
+gst_fake_sink_get_type
+gst_file_src_get_type
+gst_file_sink_get_type
pipeline</ulink> and Microsoft's DirectShow for some background.
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### FUNCTION gst_init ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstBaseSink ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstBaseSrc ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstBaseTransform ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstBin ##### -->
<para>
#GstPad, #GstMiniObject
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstBuffer ##### -->
<para>
The basic structure of a buffer.
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstCaps ##### -->
<para>
#GstSystemClock
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstClock ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### MACRO GST_DISABLE_LOADSAVE_REGISTRY ##### -->
<para>
<!-- basic object functions -->
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstElement ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstElementDetails ##### -->
<para>
This struct is used to define public information about the element. It
#GstElement, #GstPlugin, #GstPluginFeature, #GstPadTemplate.
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstElementFactory ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### ENUM GstCoreError ##### -->
<para>
#GstPad, #GstElement
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstEvent ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstFakeSink ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstFakeSrc ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstFileSink ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstFileSrc ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### USER_FUNCTION GstFilterFunc ##### -->
<para>
#GstPad, #GstElement
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### ENUM GstFormat ##### -->
<para>
Standard predefined formats
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstGhostPad ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstImplementsInterface ##### -->
<para>
#GstIndexFactory
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstIndex ##### -->
<para>
#GstIndex
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstIndexFactory ##### -->
<para>
The GstIndexFactory object
and environment variables that affect the debugging output.
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### ENUM GstDebugLevel ##### -->
<para>
The level defines the importance of a debugging message. The more important a
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstIterator ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
#GstBuffer, #GstEvent, #GstData
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstMemChunk ##### -->
<para>
The memchunk structure
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstMiniObject ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstObject ##### -->
<para>
#GstPadTemplate, #GstElement, #GstEvent
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstPad ##### -->
<para>
#GstPad, #GstElementFactory
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstPadTemplate ##### -->
<para>
The padtemplate object.
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### FUNCTION gst_parse_error_quark ##### -->
<para>
#GstBin
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstPipeline ##### -->
<para>
#GstPluginFeature, #GstType, #GstAutoplug, #GstElementFactory
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### FUNCTION gst_plugin_error_quark ##### -->
<para>
Get the error quark
#GstPlugin
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstPluginFeature ##### -->
<para>
#GstPad, #GstElement
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### ENUM GstQueryType ##### -->
<para>
Standard predefined Query types
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstQueue ##### -->
<para>
#GstPlugin, #GstPluginFeature
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
GstRegistry
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### FUNCTION gst_registry_pool_list ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstScheduler ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstSchedulerFactory ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstStructure ##### -->
<para>
#GstClock
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstSystemClock ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### TYPEDEF GstTagList ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstTagSetter ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstTrace ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstTrashStack ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstTypeFind ##### -->
<para>
<link linkend="gstreamer-Writing-typefind-functions">Writing typefind functions</link>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstTypeFindFactory ##### -->
<para>
Object that stores information about a typefind function
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### ENUM GstElementState ##### -->
<para>
These contants describe the state a #GstElement is in and transition scheduled for the #GstElement (the pending state).
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstURIHandler ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### ENUM GstURIType ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### FUNCTION gst_util_set_value_from_string ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### MACRO GST_MAKE_FOURCC ##### -->
<para>
will transform four characters into a host-endiannness guint32 fourcc:
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### MACRO GST_VERSION_MAJOR ##### -->
<para>
The major version of GStreamer at compile time
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstXML ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### FUNCTION gst_control_init ##### -->
<para>
#GstBuffer, #GstCaps, #GstEvent
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### ENUM GstDPHeaderFlag ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstDParam ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstDParamLinInterp ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstDParamManager ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstDParamSmooth ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT gst_getbits_t ##### -->
<para>
</para>
-<!-- ##### SECTION Stability_Level ##### -->
-
-
<!-- ##### STRUCT GstUnitConvert ##### -->
<para>
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000,2005 Wim Taymans <wim@fluendo.com>
*
- * gstpushsrc.c:
+ * gstpushsrc.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
#include "gsttypefindhelper.h"
#include <gst/gstmarshal.h>
-GST_DEBUG_CATEGORY_STATIC (gst_pushsrc_debug);
-#define GST_CAT_DEFAULT gst_pushsrc_debug
+GST_DEBUG_CATEGORY_STATIC (gst_push_src_debug);
+#define GST_CAT_DEFAULT gst_push_src_debug
/* PushSrc signals and args */
enum
static GstElementClass *parent_class = NULL;
-static void gst_pushsrc_base_init (gpointer g_class);
-static void gst_pushsrc_class_init (GstPushSrcClass * klass);
-static void gst_pushsrc_init (GstPushSrc * src, gpointer g_class);
+static void gst_push_src_base_init (gpointer g_class);
+static void gst_push_src_class_init (GstPushSrcClass * klass);
+static void gst_push_src_init (GstPushSrc * src, gpointer g_class);
GType
-gst_pushsrc_get_type (void)
+gst_push_src_get_type (void)
{
- static GType pushsrc_type = 0;
+ static GType push_src_type = 0;
- if (!pushsrc_type) {
- static const GTypeInfo pushsrc_info = {
+ if (!push_src_type) {
+ static const GTypeInfo push_src_info = {
sizeof (GstPushSrcClass),
- (GBaseInitFunc) gst_pushsrc_base_init,
+ (GBaseInitFunc) gst_push_src_base_init,
NULL,
- (GClassInitFunc) gst_pushsrc_class_init,
+ (GClassInitFunc) gst_push_src_class_init,
NULL,
NULL,
sizeof (GstPushSrc),
0,
- (GInstanceInitFunc) gst_pushsrc_init,
+ (GInstanceInitFunc) gst_push_src_init,
};
- pushsrc_type = g_type_register_static (GST_TYPE_BASE_SRC,
- "GstPushSrc", &pushsrc_info, G_TYPE_FLAG_ABSTRACT);
+ push_src_type = g_type_register_static (GST_TYPE_BASE_SRC,
+ "GstPushSrc", &push_src_info, G_TYPE_FLAG_ABSTRACT);
}
- return pushsrc_type;
+ return push_src_type;
}
#if 0
-static const GstEventMask *gst_pushsrc_get_event_mask (GstPad * pad);
+static const GstEventMask *gst_push_src_get_event_mask (GstPad * pad);
#endif
-static GstFlowReturn gst_pushsrc_create (GstBaseSrc * bsrc, guint64 offset,
+static GstFlowReturn gst_push_src_create (GstBaseSrc * bsrc, guint64 offset,
guint length, GstBuffer ** ret);
static void
-gst_pushsrc_base_init (gpointer g_class)
+gst_push_src_base_init (gpointer g_class)
{
- GST_DEBUG_CATEGORY_INIT (gst_pushsrc_debug, "pushsrc", 0, "pushsrc element");
+ GST_DEBUG_CATEGORY_INIT (gst_push_src_debug, "pushsrc", 0, "pushsrc element");
}
static void
-gst_pushsrc_class_init (GstPushSrcClass * klass)
+gst_push_src_class_init (GstPushSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
parent_class = g_type_class_ref (GST_TYPE_BASE_SRC);
- gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_pushsrc_create);
+ gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_push_src_create);
}
static void
-gst_pushsrc_init (GstPushSrc * pushsrc, gpointer g_class)
+gst_push_src_init (GstPushSrc * pushsrc, gpointer g_class)
{
}
static GstFlowReturn
-gst_pushsrc_create (GstBaseSrc * bsrc, guint64 offset, guint length,
+gst_push_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
GstBuffer ** ret)
{
GstFlowReturn fret;
GstPushSrc *src;
GstPushSrcClass *pclass;
- src = GST_PUSHSRC (bsrc);
- pclass = GST_PUSHSRC_GET_CLASS (src);
+ src = GST_PUSH_SRC (bsrc);
+ pclass = GST_PUSH_SRC_GET_CLASS (src);
if (pclass->create)
fret = pclass->create (src, ret);
else
* Boston, MA 02111-1307, USA.
*/
-#ifndef __GST_PUSHSRC_H__
-#define __GST_PUSHSRC_H__
+#ifndef __GST_PUSH_SRC_H__
+#define __GST_PUSH_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstbasesrc.h>
G_BEGIN_DECLS
-#define GST_TYPE_PUSHSRC (gst_pushsrc_get_type())
-#define GST_PUSHSRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PUSHSRC,GstPushSrc))
-#define GST_PUSHSRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PUSHSRC,GstPushSrcClass))
-#define GST_PUSHSRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PUSHSRC, GstPushSrcClass))
-#define GST_IS_PUSHSRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PUSHSRC))
-#define GST_IS_PUSHSRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PUSHSRC))
+#define GST_TYPE_PUSH_SRC (gst_push_src_get_type())
+#define GST_PUSH_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PUSH_SRC,GstPushSrc))
+#define GST_PUSH_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PUSH_SRC,GstPushSrcClass))
+#define GST_PUSH_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PUSH_SRC, GstPushSrcClass))
+#define GST_IS_PUSH_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PUSH_SRC))
+#define GST_IS_PUSH_SRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PUSH_SRC))
/* base class for block based sources
*
GstFlowReturn (*create) (GstPushSrc *src, GstBuffer **buf);
};
-GType gst_pushsrc_get_type(void);
+GType gst_push_src_get_type(void);
G_END_DECLS
-#endif /* __GST_PUSHSRC_H__ */
+#endif /* __GST_PUSH_SRC_H__ */
};
+/* this declaration is here because there's no gstcapsfilter.h */
extern GType gst_capsfilter_get_type (void);
-extern GType gst_filesrc_get_type (void);
-extern GstElementDetails gst_filesrc_details;
static struct _elements_entry _elements[] = {
{"capsfilter", GST_RANK_NONE, gst_capsfilter_get_type},
- {"fakesrc", GST_RANK_NONE, gst_fakesrc_get_type},
- {"fakesink", GST_RANK_NONE, gst_fakesink_get_type},
- {"filesrc", GST_RANK_NONE, gst_filesrc_get_type},
+ {"fakesrc", GST_RANK_NONE, gst_fake_src_get_type},
+ {"fakesink", GST_RANK_NONE, gst_fake_sink_get_type},
+ {"filesrc", GST_RANK_NONE, gst_file_src_get_type},
{"identity", GST_RANK_NONE, gst_identity_get_type},
- {"filesink", GST_RANK_NONE, gst_filesink_get_type},
+ {"filesink", GST_RANK_NONE, gst_file_sink_get_type},
{"tee", GST_RANK_NONE, gst_tee_get_type},
{"typefind", GST_RANK_NONE, gst_type_find_element_get_type},
{NULL, 0},
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
-GST_DEBUG_CATEGORY_STATIC (gst_fakesink_debug);
-#define GST_CAT_DEFAULT gst_fakesink_debug
+GST_DEBUG_CATEGORY_STATIC (gst_fake_sink_debug);
+#define GST_CAT_DEFAULT gst_fake_sink_debug
-GstElementDetails gst_fakesink_details = GST_ELEMENT_DETAILS ("Fake Sink",
+GstElementDetails gst_fake_sink_details = GST_ELEMENT_DETAILS ("Fake Sink",
"Sink",
"Black hole for data",
"Erik Walthinsen <omega@cse.ogi.edu>, "
LAST_SIGNAL
};
-#define DEFAULT_STATE_ERROR FAKESINK_STATE_ERROR_NONE
+#define DEFAULT_STATE_ERROR FAKE_SINK_STATE_ERROR_NONE
#define DEFAULT_SILENT FALSE
#define DEFAULT_DUMP FALSE
#define DEFAULT_SYNC FALSE
ARG_LAST_MESSAGE,
};
-#define GST_TYPE_FAKESINK_STATE_ERROR (gst_fakesink_state_error_get_type())
+#define GST_TYPE_FAKE_SINK_STATE_ERROR (gst_fake_sink_state_error_get_type())
static GType
-gst_fakesink_state_error_get_type (void)
+gst_fake_sink_state_error_get_type (void)
{
static GType fakesink_state_error_type = 0;
static GEnumValue fakesink_state_error[] = {
- {FAKESINK_STATE_ERROR_NONE, "0", "No state change errors"},
- {FAKESINK_STATE_ERROR_NULL_READY, "1",
+ {FAKE_SINK_STATE_ERROR_NONE, "0", "No state change errors"},
+ {FAKE_SINK_STATE_ERROR_NULL_READY, "1",
"Fail state change from NULL to READY"},
- {FAKESINK_STATE_ERROR_READY_PAUSED, "2",
+ {FAKE_SINK_STATE_ERROR_READY_PAUSED, "2",
"Fail state change from READY to PAUSED"},
- {FAKESINK_STATE_ERROR_PAUSED_PLAYING, "3",
+ {FAKE_SINK_STATE_ERROR_PAUSED_PLAYING, "3",
"Fail state change from PAUSED to PLAYING"},
- {FAKESINK_STATE_ERROR_PLAYING_PAUSED, "4",
+ {FAKE_SINK_STATE_ERROR_PLAYING_PAUSED, "4",
"Fail state change from PLAYING to PAUSED"},
- {FAKESINK_STATE_ERROR_PAUSED_READY, "5",
+ {FAKE_SINK_STATE_ERROR_PAUSED_READY, "5",
"Fail state change from PAUSED to READY"},
- {FAKESINK_STATE_ERROR_READY_NULL, "6",
+ {FAKE_SINK_STATE_ERROR_READY_NULL, "6",
"Fail state change from READY to NULL"},
{0, NULL, NULL},
};
}
#define _do_init(bla) \
- GST_DEBUG_CATEGORY_INIT (gst_fakesink_debug, "fakesink", 0, "fakesink element");
+ GST_DEBUG_CATEGORY_INIT (gst_fake_sink_debug, "fakesink", 0, "fakesink element");
-GST_BOILERPLATE_FULL (GstFakeSink, gst_fakesink, GstBaseSink,
+GST_BOILERPLATE_FULL (GstFakeSink, gst_fake_sink, GstBaseSink,
GST_TYPE_BASE_SINK, _do_init);
-static void gst_fakesink_set_property (GObject * object, guint prop_id,
+static void gst_fake_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_fakesink_get_property (GObject * object, guint prop_id,
+static void gst_fake_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstElementStateReturn gst_fakesink_change_state (GstElement * element);
+static GstElementStateReturn gst_fake_sink_change_state (GstElement * element);
-static GstFlowReturn gst_fakesink_preroll (GstBaseSink * bsink,
+static GstFlowReturn gst_fake_sink_preroll (GstBaseSink * bsink,
GstBuffer * buffer);
-static GstFlowReturn gst_fakesink_render (GstBaseSink * bsink,
+static GstFlowReturn gst_fake_sink_render (GstBaseSink * bsink,
GstBuffer * buffer);
-static gboolean gst_fakesink_event (GstBaseSink * bsink, GstEvent * event);
-static void gst_fakesink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
+static gboolean gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event);
+static void gst_fake_sink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end);
-static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
+static guint gst_fake_sink_signals[LAST_SIGNAL] = { 0 };
static void
-gst_fakesink_base_init (gpointer g_class)
+gst_fake_sink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
- gst_element_class_set_details (gstelement_class, &gst_fakesink_details);
+ gst_element_class_set_details (gstelement_class, &gst_fake_sink_details);
}
static void
-gst_fakesink_class_init (GstFakeSinkClass * klass)
+gst_fake_sink_class_init (GstFakeSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstelement_class = (GstElementClass *) klass;
gstbase_sink_class = (GstBaseSinkClass *) klass;
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesink_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesink_get_property);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fake_sink_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fake_sink_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STATE_ERROR,
g_param_spec_enum ("state_error", "State Error",
- "Generate a state change error", GST_TYPE_FAKESINK_STATE_ERROR,
+ "Generate a state change error", GST_TYPE_FAKE_SINK_STATE_ERROR,
DEFAULT_STATE_ERROR, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LAST_MESSAGE,
g_param_spec_string ("last_message", "Last Message",
g_param_spec_boolean ("dump", "Dump", "Dump received bytes to stdout",
DEFAULT_DUMP, G_PARAM_READWRITE));
- gst_fakesink_signals[SIGNAL_HANDOFF] =
+ gst_fake_sink_signals[SIGNAL_HANDOFF] =
g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstFakeSinkClass, handoff), NULL, NULL,
gst_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2,
GST_TYPE_BUFFER, GST_TYPE_PAD);
gstelement_class->change_state =
- GST_DEBUG_FUNCPTR (gst_fakesink_change_state);
+ GST_DEBUG_FUNCPTR (gst_fake_sink_change_state);
- gstbase_sink_class->event = GST_DEBUG_FUNCPTR (gst_fakesink_event);
- gstbase_sink_class->preroll = GST_DEBUG_FUNCPTR (gst_fakesink_preroll);
- gstbase_sink_class->render = GST_DEBUG_FUNCPTR (gst_fakesink_render);
- gstbase_sink_class->get_times = GST_DEBUG_FUNCPTR (gst_fakesink_get_times);
+ gstbase_sink_class->event = GST_DEBUG_FUNCPTR (gst_fake_sink_event);
+ gstbase_sink_class->preroll = GST_DEBUG_FUNCPTR (gst_fake_sink_preroll);
+ gstbase_sink_class->render = GST_DEBUG_FUNCPTR (gst_fake_sink_render);
+ gstbase_sink_class->get_times = GST_DEBUG_FUNCPTR (gst_fake_sink_get_times);
}
static void
-gst_fakesink_init (GstFakeSink * fakesink)
+gst_fake_sink_init (GstFakeSink * fakesink)
{
fakesink->silent = DEFAULT_SILENT;
fakesink->dump = DEFAULT_DUMP;
}
static void
-gst_fakesink_set_property (GObject * object, guint prop_id,
+gst_fake_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstFakeSink *sink;
- sink = GST_FAKESINK (object);
+ sink = GST_FAKE_SINK (object);
switch (prop_id) {
case ARG_SILENT:
}
static void
-gst_fakesink_get_property (GObject * object, guint prop_id, GValue * value,
+gst_fake_sink_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFakeSink *sink;
- sink = GST_FAKESINK (object);
+ sink = GST_FAKE_SINK (object);
switch (prop_id) {
case ARG_STATE_ERROR:
}
static void
-gst_fakesink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
+gst_fake_sink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end)
{
- GstFakeSink *sink = GST_FAKESINK (bsink);
+ GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (sink->sync) {
GST_BASE_SINK_CLASS (parent_class)->get_times (bsink, buffer, start, end);
}
static gboolean
-gst_fakesink_event (GstBaseSink * bsink, GstEvent * event)
+gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event)
{
- GstFakeSink *sink = GST_FAKESINK (bsink);
+ GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (!sink->silent) {
g_free (sink->last_message);
}
static GstFlowReturn
-gst_fakesink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
+gst_fake_sink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
{
- GstFakeSink *sink = GST_FAKESINK (bsink);
+ GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (!sink->silent) {
g_free (sink->last_message);
}
static GstFlowReturn
-gst_fakesink_render (GstBaseSink * bsink, GstBuffer * buf)
+gst_fake_sink_render (GstBaseSink * bsink, GstBuffer * buf)
{
- GstFakeSink *sink = GST_FAKESINK (bsink);
+ GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (!sink->silent) {
g_free (sink->last_message);
g_object_notify (G_OBJECT (sink), "last_message");
}
if (sink->signal_handoffs)
- g_signal_emit (G_OBJECT (sink), gst_fakesink_signals[SIGNAL_HANDOFF], 0,
+ g_signal_emit (G_OBJECT (sink), gst_fake_sink_signals[SIGNAL_HANDOFF], 0,
buf, bsink->sinkpad);
if (sink->dump) {
}
static GstElementStateReturn
-gst_fakesink_change_state (GstElement * element)
+gst_fake_sink_change_state (GstElement * element)
{
GstElementStateReturn ret = GST_STATE_SUCCESS;
- GstFakeSink *fakesink = GST_FAKESINK (element);
+ GstFakeSink *fakesink = GST_FAKE_SINK (element);
GstElementState transition = GST_STATE_TRANSITION (element);
switch (transition) {
case GST_STATE_NULL_TO_READY:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_NULL_READY)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_NULL_READY)
goto error;
break;
case GST_STATE_READY_TO_PAUSED:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_READY_PAUSED)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_READY_PAUSED)
goto error;
break;
case GST_STATE_PAUSED_TO_PLAYING:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_PAUSED_PLAYING)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PAUSED_PLAYING)
goto error;
break;
case GST_STATE_PLAYING_TO_PAUSED:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_PLAYING_PAUSED)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PLAYING_PAUSED)
goto error;
break;
case GST_STATE_PAUSED_TO_READY:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_PAUSED_READY)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PAUSED_READY)
goto error;
break;
case GST_STATE_READY_TO_NULL:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_READY_NULL)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_READY_NULL)
goto error;
g_free (fakesink->last_message);
fakesink->last_message = NULL;
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfakesink.h:
+ * gstfakesink.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*/
-#ifndef __GST_FAKESINK_H__
-#define __GST_FAKESINK_H__
+#ifndef __GST_FAKE_SINK_H__
+#define __GST_FAKE_SINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
G_BEGIN_DECLS
-#define GST_TYPE_FAKESINK \
- (gst_fakesink_get_type())
-#define GST_FAKESINK(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESINK,GstFakeSink))
-#define GST_FAKESINK_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESINK,GstFakeSinkClass))
-#define GST_IS_FAKESINK(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESINK))
-#define GST_IS_FAKESINK_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK))
+#define GST_TYPE_FAKE_SINK \
+ (gst_fake_sink_get_type())
+#define GST_FAKE_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKE_SINK,GstFakeSink))
+#define GST_FAKE_SINK_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKE_SINK,GstFakeSinkClass))
+#define GST_IS_FAKE_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKE_SINK))
+#define GST_IS_FAKE_SINK_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKE_SINK))
typedef enum {
- FAKESINK_STATE_ERROR_NONE = 0,
- FAKESINK_STATE_ERROR_NULL_READY,
- FAKESINK_STATE_ERROR_READY_PAUSED,
- FAKESINK_STATE_ERROR_PAUSED_PLAYING,
- FAKESINK_STATE_ERROR_PLAYING_PAUSED,
- FAKESINK_STATE_ERROR_PAUSED_READY,
- FAKESINK_STATE_ERROR_READY_NULL
+ FAKE_SINK_STATE_ERROR_NONE = 0,
+ FAKE_SINK_STATE_ERROR_NULL_READY,
+ FAKE_SINK_STATE_ERROR_READY_PAUSED,
+ FAKE_SINK_STATE_ERROR_PAUSED_PLAYING,
+ FAKE_SINK_STATE_ERROR_PLAYING_PAUSED,
+ FAKE_SINK_STATE_ERROR_PAUSED_READY,
+ FAKE_SINK_STATE_ERROR_READY_NULL
} GstFakeSinkStateError;
typedef struct _GstFakeSink GstFakeSink;
typedef struct _GstFakeSinkClass GstFakeSinkClass;
struct _GstFakeSink {
- GstBaseSink element;
+ GstBaseSink element;
- gboolean silent;
- gboolean dump;
- gboolean sync;
- gboolean signal_handoffs;
+ gboolean silent;
+ gboolean dump;
+ gboolean sync;
+ gboolean signal_handoffs;
GstFakeSinkStateError state_error;
- gchar *last_message;
+ gchar *last_message;
};
struct _GstFakeSinkClass {
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
-GType gst_fakesink_get_type(void);
+GType gst_fake_sink_get_type (void);
G_END_DECLS
-#endif /* __GST_FAKESINK_H__ */
+#endif /* __GST_FAKE_SINK_H__ */
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfakesrc.c:
+ * gstfakesrc.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
-GST_DEBUG_CATEGORY_STATIC (gst_fakesrc_debug);
-#define GST_CAT_DEFAULT gst_fakesrc_debug
+GST_DEBUG_CATEGORY_STATIC (gst_fake_src_debug);
+#define GST_CAT_DEFAULT gst_fake_src_debug
-GstElementDetails gst_fakesrc_details = GST_ELEMENT_DETAILS ("Fake Source",
+GstElementDetails gst_fake_src_details = GST_ELEMENT_DETAILS ("Fake Source",
"Source",
"Push empty (no data) buffers around",
"Erik Walthinsen <omega@cse.ogi.edu>, "
LAST_SIGNAL
};
-#define DEFAULT_OUTPUT FAKESRC_FIRST_LAST_LOOP
-#define DEFAULT_DATA FAKESRC_DATA_ALLOCATE
-#define DEFAULT_SIZETYPE FAKESRC_SIZETYPE_NULL
+#define DEFAULT_OUTPUT FAKE_SRC_FIRST_LAST_LOOP
+#define DEFAULT_DATA FAKE_SRC_DATA_ALLOCATE
+#define DEFAULT_SIZETYPE FAKE_SRC_SIZETYPE_NULL
#define DEFAULT_SIZEMIN 0
#define DEFAULT_SIZEMAX 4096
-#define DEFAULT_FILLTYPE FAKESRC_FILLTYPE_NULL
+#define DEFAULT_FILLTYPE FAKE_SRC_FILLTYPE_NULL
#define DEFAULT_DATARATE 0
#define DEFAULT_SYNC FALSE
#define DEFAULT_PATTERN NULL
};
/* not implemented
-#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
+#define GST_TYPE_FAKE_SRC_OUTPUT (gst_fake_src_output_get_type())
static GType
-gst_fakesrc_output_get_type (void)
+gst_fake_src_output_get_type (void)
{
static GType fakesrc_output_type = 0;
static GEnumValue fakesrc_output[] = {
- {FAKESRC_FIRST_LAST_LOOP, "1", "First-Last loop"},
- {FAKESRC_LAST_FIRST_LOOP, "2", "Last-First loop"},
- {FAKESRC_PING_PONG, "3", "Ping-Pong"},
- {FAKESRC_ORDERED_RANDOM, "4", "Ordered Random"},
- {FAKESRC_RANDOM, "5", "Random"},
- {FAKESRC_PATTERN_LOOP, "6", "Patttern loop"},
- {FAKESRC_PING_PONG_PATTERN, "7", "Ping-Pong Pattern"},
- {FAKESRC_GET_ALWAYS_SUCEEDS, "8", "'_get' Always succeeds"},
+ {FAKE_SRC_FIRST_LAST_LOOP, "1", "First-Last loop"},
+ {FAKE_SRC_LAST_FIRST_LOOP, "2", "Last-First loop"},
+ {FAKE_SRC_PING_PONG, "3", "Ping-Pong"},
+ {FAKE_SRC_ORDERED_RANDOM, "4", "Ordered Random"},
+ {FAKE_SRC_RANDOM, "5", "Random"},
+ {FAKE_SRC_PATTERN_LOOP, "6", "Patttern loop"},
+ {FAKE_SRC_PING_PONG_PATTERN, "7", "Ping-Pong Pattern"},
+ {FAKE_SRC_GET_ALWAYS_SUCEEDS, "8", "'_get' Always succeeds"},
{0, NULL, NULL},
};
}
*/
-#define GST_TYPE_FAKESRC_DATA (gst_fakesrc_data_get_type())
+#define GST_TYPE_FAKE_SRC_DATA (gst_fake_src_data_get_type())
static GType
-gst_fakesrc_data_get_type (void)
+gst_fake_src_data_get_type (void)
{
static GType fakesrc_data_type = 0;
static GEnumValue fakesrc_data[] = {
- {FAKESRC_DATA_ALLOCATE, "1", "Allocate data"},
- {FAKESRC_DATA_SUBBUFFER, "2", "Subbuffer data"},
+ {FAKE_SRC_DATA_ALLOCATE, "1", "Allocate data"},
+ {FAKE_SRC_DATA_SUBBUFFER, "2", "Subbuffer data"},
{0, NULL, NULL},
};
return fakesrc_data_type;
}
-#define GST_TYPE_FAKESRC_SIZETYPE (gst_fakesrc_sizetype_get_type())
+#define GST_TYPE_FAKE_SRC_SIZETYPE (gst_fake_src_sizetype_get_type())
static GType
-gst_fakesrc_sizetype_get_type (void)
+gst_fake_src_sizetype_get_type (void)
{
static GType fakesrc_sizetype_type = 0;
static GEnumValue fakesrc_sizetype[] = {
- {FAKESRC_SIZETYPE_NULL, "1", "Send empty buffers"},
- {FAKESRC_SIZETYPE_FIXED, "2", "Fixed size buffers (sizemax sized)"},
- {FAKESRC_SIZETYPE_RANDOM, "3",
+ {FAKE_SRC_SIZETYPE_NULL, "1", "Send empty buffers"},
+ {FAKE_SRC_SIZETYPE_FIXED, "2", "Fixed size buffers (sizemax sized)"},
+ {FAKE_SRC_SIZETYPE_RANDOM, "3",
"Random sized buffers (sizemin <= size <= sizemax)"},
{0, NULL, NULL},
};
return fakesrc_sizetype_type;
}
-#define GST_TYPE_FAKESRC_FILLTYPE (gst_fakesrc_filltype_get_type())
+#define GST_TYPE_FAKE_SRC_FILLTYPE (gst_fake_src_filltype_get_type())
static GType
-gst_fakesrc_filltype_get_type (void)
+gst_fake_src_filltype_get_type (void)
{
static GType fakesrc_filltype_type = 0;
static GEnumValue fakesrc_filltype[] = {
- {FAKESRC_FILLTYPE_NOTHING, "1", "Leave data as malloced"},
- {FAKESRC_FILLTYPE_NULL, "2", "Fill buffers with zeros"},
- {FAKESRC_FILLTYPE_RANDOM, "3", "Fill buffers with random crap"},
- {FAKESRC_FILLTYPE_PATTERN, "4", "Fill buffers with pattern 0x00 -> 0xff"},
- {FAKESRC_FILLTYPE_PATTERN_CONT, "5",
+ {FAKE_SRC_FILLTYPE_NOTHING, "1", "Leave data as malloced"},
+ {FAKE_SRC_FILLTYPE_NULL, "2", "Fill buffers with zeros"},
+ {FAKE_SRC_FILLTYPE_RANDOM, "3", "Fill buffers with random crap"},
+ {FAKE_SRC_FILLTYPE_PATTERN, "4", "Fill buffers with pattern 0x00 -> 0xff"},
+ {FAKE_SRC_FILLTYPE_PATTERN_CONT, "5",
"Fill buffers with pattern 0x00 -> 0xff that spans buffers"},
{0, NULL, NULL},
};
}
#define _do_init(bla) \
- GST_DEBUG_CATEGORY_INIT (gst_fakesrc_debug, "fakesrc", 0, "fakesrc element");
+ GST_DEBUG_CATEGORY_INIT (gst_fake_src_debug, "fakesrc", 0, "fakesrc element");
-GST_BOILERPLATE_FULL (GstFakeSrc, gst_fakesrc, GstBaseSrc, GST_TYPE_BASE_SRC,
+GST_BOILERPLATE_FULL (GstFakeSrc, gst_fake_src, GstBaseSrc, GST_TYPE_BASE_SRC,
_do_init);
-static void gst_fakesrc_set_property (GObject * object, guint prop_id,
+static void gst_fake_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_fakesrc_get_property (GObject * object, guint prop_id,
+static void gst_fake_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static gboolean gst_fakesrc_start (GstBaseSrc * basesrc);
-static gboolean gst_fakesrc_stop (GstBaseSrc * basesrc);
+static gboolean gst_fake_src_start (GstBaseSrc * basesrc);
+static gboolean gst_fake_src_stop (GstBaseSrc * basesrc);
-static gboolean gst_fakesrc_event_handler (GstBaseSrc * src, GstEvent * event);
-static GstFlowReturn gst_fakesrc_create (GstBaseSrc * src, guint64 offset,
+static gboolean gst_fake_src_event_handler (GstBaseSrc * src, GstEvent * event);
+static GstFlowReturn gst_fake_src_create (GstBaseSrc * src, guint64 offset,
guint length, GstBuffer ** buf);
-static guint gst_fakesrc_signals[LAST_SIGNAL] = { 0 };
+static guint gst_fake_src_signals[LAST_SIGNAL] = { 0 };
static void
-gst_fakesrc_base_init (gpointer g_class)
+gst_fake_src_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
- gst_element_class_set_details (gstelement_class, &gst_fakesrc_details);
+ gst_element_class_set_details (gstelement_class, &gst_fake_src_details);
}
static void
-gst_fakesrc_class_init (GstFakeSrcClass * klass)
+gst_fake_src_class_init (GstFakeSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstelement_class = (GstElementClass *) klass;
gstbase_src_class = (GstBaseSrcClass *) klass;
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesrc_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesrc_get_property);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fake_src_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fake_src_get_property);
/*
FIXME: this is not implemented; would make sense once basesrc and fakesrc
support multiple pads
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_OUTPUT,
g_param_spec_enum ("output", "output", "Output method (currently unused)",
- GST_TYPE_FAKESRC_OUTPUT, DEFAULT_OUTPUT, G_PARAM_READWRITE));
+ GST_TYPE_FAKE_SRC_OUTPUT, DEFAULT_OUTPUT, G_PARAM_READWRITE));
*/
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DATA,
g_param_spec_enum ("data", "data", "Data allocation method",
- GST_TYPE_FAKESRC_DATA, DEFAULT_DATA, G_PARAM_READWRITE));
+ GST_TYPE_FAKE_SRC_DATA, DEFAULT_DATA, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SIZETYPE,
g_param_spec_enum ("sizetype", "sizetype",
- "How to determine buffer sizes", GST_TYPE_FAKESRC_SIZETYPE,
+ "How to determine buffer sizes", GST_TYPE_FAKE_SRC_SIZETYPE,
DEFAULT_SIZETYPE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SIZEMIN,
g_param_spec_int ("sizemin", "sizemin", "Minimum buffer size", 0,
DEFAULT_PARENTSIZE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FILLTYPE,
g_param_spec_enum ("filltype", "filltype",
- "How to fill the buffer, if at all", GST_TYPE_FAKESRC_FILLTYPE,
+ "How to fill the buffer, if at all", GST_TYPE_FAKE_SRC_FILLTYPE,
DEFAULT_FILLTYPE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DATARATE,
g_param_spec_int ("datarate", "Datarate",
"True if the element cannot produce data in PAUSED", FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
- gst_fakesrc_signals[SIGNAL_HANDOFF] =
+ gst_fake_src_signals[SIGNAL_HANDOFF] =
g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstFakeSrcClass, handoff), NULL, NULL,
gst_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT);
- /*gstbase_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_fakesrc_is_seekable); */
- gstbase_src_class->start = GST_DEBUG_FUNCPTR (gst_fakesrc_start);
- gstbase_src_class->stop = GST_DEBUG_FUNCPTR (gst_fakesrc_stop);
- gstbase_src_class->event = GST_DEBUG_FUNCPTR (gst_fakesrc_event_handler);
- gstbase_src_class->create = GST_DEBUG_FUNCPTR (gst_fakesrc_create);
+ /*gstbase_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_fake_src_is_seekable); */
+ gstbase_src_class->start = GST_DEBUG_FUNCPTR (gst_fake_src_start);
+ gstbase_src_class->stop = GST_DEBUG_FUNCPTR (gst_fake_src_stop);
+ gstbase_src_class->event = GST_DEBUG_FUNCPTR (gst_fake_src_event_handler);
+ gstbase_src_class->create = GST_DEBUG_FUNCPTR (gst_fake_src_create);
}
static void
-gst_fakesrc_init (GstFakeSrc * fakesrc)
+gst_fake_src_init (GstFakeSrc * fakesrc)
{
- fakesrc->output = FAKESRC_FIRST_LAST_LOOP;
+ fakesrc->output = FAKE_SRC_FIRST_LAST_LOOP;
fakesrc->segment_start = -1;
fakesrc->segment_end = -1;
fakesrc->buffer_count = 0;
fakesrc->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
fakesrc->dump = DEFAULT_DUMP;
fakesrc->pattern_byte = 0x00;
- fakesrc->data = FAKESRC_DATA_ALLOCATE;
- fakesrc->sizetype = FAKESRC_SIZETYPE_NULL;
- fakesrc->filltype = FAKESRC_FILLTYPE_NOTHING;
+ fakesrc->data = FAKE_SRC_DATA_ALLOCATE;
+ fakesrc->sizetype = FAKE_SRC_SIZETYPE_NULL;
+ fakesrc->filltype = FAKE_SRC_FILLTYPE_NOTHING;
fakesrc->sizemin = DEFAULT_SIZEMIN;
fakesrc->sizemax = DEFAULT_SIZEMAX;
fakesrc->parent = NULL;
}
static gboolean
-gst_fakesrc_event_handler (GstBaseSrc * basesrc, GstEvent * event)
+gst_fake_src_event_handler (GstBaseSrc * basesrc, GstEvent * event)
{
GstFakeSrc *src;
- src = GST_FAKESRC (basesrc);
+ src = GST_FAKE_SRC (basesrc);
if (!src->silent) {
g_free (src->last_message);
}
static void
-gst_fakesrc_alloc_parent (GstFakeSrc * src)
+gst_fake_src_alloc_parent (GstFakeSrc * src)
{
GstBuffer *buf;
}
static void
-gst_fakesrc_set_property (GObject * object, guint prop_id, const GValue * value,
- GParamSpec * pspec)
+gst_fake_src_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
{
GstFakeSrc *src;
GstBaseSrc *basesrc;
- src = GST_FAKESRC (object);
+ src = GST_FAKE_SRC (object);
basesrc = GST_BASE_SRC (object);
switch (prop_id) {
case PROP_DATA:
src->data = g_value_get_enum (value);
- if (src->data == FAKESRC_DATA_SUBBUFFER) {
+ if (src->data == FAKE_SRC_DATA_SUBBUFFER) {
if (!src->parent)
- gst_fakesrc_alloc_parent (src);
+ gst_fake_src_alloc_parent (src);
} else {
if (src->parent) {
gst_buffer_unref (src->parent);
}
static void
-gst_fakesrc_get_property (GObject * object, guint prop_id, GValue * value,
+gst_fake_src_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFakeSrc *src;
GstBaseSrc *basesrc;
- g_return_if_fail (GST_IS_FAKESRC (object));
+ g_return_if_fail (GST_IS_FAKE_SRC (object));
- src = GST_FAKESRC (object);
+ src = GST_FAKE_SRC (object);
basesrc = GST_BASE_SRC (object);
switch (prop_id) {
}
static void
-gst_fakesrc_prepare_buffer (GstFakeSrc * src, GstBuffer * buf)
+gst_fake_src_prepare_buffer (GstFakeSrc * src, GstBuffer * buf)
{
if (GST_BUFFER_SIZE (buf) == 0)
return;
switch (src->filltype) {
- case FAKESRC_FILLTYPE_NULL:
+ case FAKE_SRC_FILLTYPE_NULL:
memset (GST_BUFFER_DATA (buf), 0, GST_BUFFER_SIZE (buf));
break;
- case FAKESRC_FILLTYPE_RANDOM:
+ case FAKE_SRC_FILLTYPE_RANDOM:
{
gint i;
guint8 *ptr = GST_BUFFER_DATA (buf);
}
break;
}
- case FAKESRC_FILLTYPE_PATTERN:
+ case FAKE_SRC_FILLTYPE_PATTERN:
src->pattern_byte = 0x00;
- case FAKESRC_FILLTYPE_PATTERN_CONT:
+ case FAKE_SRC_FILLTYPE_PATTERN_CONT:
{
gint i;
guint8 *ptr = GST_BUFFER_DATA (buf);
}
break;
}
- case FAKESRC_FILLTYPE_NOTHING:
+ case FAKE_SRC_FILLTYPE_NOTHING:
default:
break;
}
}
static GstBuffer *
-gst_fakesrc_alloc_buffer (GstFakeSrc * src, guint size)
+gst_fake_src_alloc_buffer (GstFakeSrc * src, guint size)
{
GstBuffer *buf;
if (size != 0) {
switch (src->filltype) {
- case FAKESRC_FILLTYPE_NOTHING:
+ case FAKE_SRC_FILLTYPE_NOTHING:
GST_BUFFER_DATA (buf) = g_malloc (size);
break;
- case FAKESRC_FILLTYPE_NULL:
+ case FAKE_SRC_FILLTYPE_NULL:
GST_BUFFER_DATA (buf) = g_malloc0 (size);
break;
- case FAKESRC_FILLTYPE_RANDOM:
- case FAKESRC_FILLTYPE_PATTERN:
- case FAKESRC_FILLTYPE_PATTERN_CONT:
+ case FAKE_SRC_FILLTYPE_RANDOM:
+ case FAKE_SRC_FILLTYPE_PATTERN:
+ case FAKE_SRC_FILLTYPE_PATTERN_CONT:
default:
GST_BUFFER_DATA (buf) = g_malloc (size);
- gst_fakesrc_prepare_buffer (src, buf);
+ gst_fake_src_prepare_buffer (src, buf);
break;
}
}
}
static guint
-gst_fakesrc_get_size (GstFakeSrc * src)
+gst_fake_src_get_size (GstFakeSrc * src)
{
guint size;
switch (src->sizetype) {
- case FAKESRC_SIZETYPE_FIXED:
+ case FAKE_SRC_SIZETYPE_FIXED:
size = src->sizemax;
break;
- case FAKESRC_SIZETYPE_RANDOM:
+ case FAKE_SRC_SIZETYPE_RANDOM:
size =
src->sizemin +
(guint8) (((gfloat) src->sizemax) * rand () / (RAND_MAX +
(gfloat) src->sizemin));
break;
- case FAKESRC_SIZETYPE_NULL:
+ case FAKE_SRC_SIZETYPE_NULL:
default:
size = 0;
break;
}
static GstBuffer *
-gst_fakesrc_create_buffer (GstFakeSrc * src)
+gst_fake_src_create_buffer (GstFakeSrc * src)
{
GstBuffer *buf;
guint size;
gboolean dump = src->dump;
- size = gst_fakesrc_get_size (src);
+ size = gst_fake_src_get_size (src);
if (size == 0)
return gst_buffer_new ();
switch (src->data) {
- case FAKESRC_DATA_ALLOCATE:
- buf = gst_fakesrc_alloc_buffer (src, size);
+ case FAKE_SRC_DATA_ALLOCATE:
+ buf = gst_fake_src_alloc_buffer (src, size);
break;
- case FAKESRC_DATA_SUBBUFFER:
+ case FAKE_SRC_DATA_SUBBUFFER:
/* see if we have a parent to subbuffer */
if (!src->parent) {
- gst_fakesrc_alloc_parent (src);
+ gst_fake_src_alloc_parent (src);
g_assert (src->parent);
}
/* see if it's large enough */
gst_buffer_unref (src->parent);
src->parent = NULL;
/* try again (this will allocate a new parent) */
- return gst_fakesrc_create_buffer (src);
+ return gst_fake_src_create_buffer (src);
}
- gst_fakesrc_prepare_buffer (src, buf);
+ gst_fake_src_prepare_buffer (src, buf);
break;
default:
g_warning ("fakesrc: dunno how to allocate buffers !");
}
static GstFlowReturn
-gst_fakesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
+gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
GstBuffer ** ret)
{
GstFakeSrc *src;
GstBuffer *buf;
GstClockTime time;
- src = GST_FAKESRC (basesrc);
+ src = GST_FAKE_SRC (basesrc);
if (src->buffer_count == src->segment_end) {
GST_INFO ("buffer_count reaches segment_end %d %d", src->buffer_count,
return GST_FLOW_UNEXPECTED;
}
- buf = gst_fakesrc_create_buffer (src);
+ buf = gst_fake_src_create_buffer (src);
GST_BUFFER_OFFSET (buf) = src->buffer_count++;
time = GST_CLOCK_TIME_NONE;
if (src->signal_handoffs) {
GST_LOG_OBJECT (src, "pre handoff emit");
- g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0, buf);
+ g_signal_emit (G_OBJECT (src), gst_fake_src_signals[SIGNAL_HANDOFF], 0,
+ buf);
GST_LOG_OBJECT (src, "post handoff emit");
}
}
static gboolean
-gst_fakesrc_start (GstBaseSrc * basesrc)
+gst_fake_src_start (GstBaseSrc * basesrc)
{
GstFakeSrc *src;
- src = GST_FAKESRC (basesrc);
+ src = GST_FAKE_SRC (basesrc);
src->buffer_count = 0;
src->pattern_byte = 0x00;
}
static gboolean
-gst_fakesrc_stop (GstBaseSrc * basesrc)
+gst_fake_src_stop (GstBaseSrc * basesrc)
{
GstFakeSrc *src;
- src = GST_FAKESRC (basesrc);
+ src = GST_FAKE_SRC (basesrc);
if (src->parent) {
gst_buffer_unref (src->parent);
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfakesrc.h:
+ * gstfakesrc.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*/
-#ifndef __GST_FAKESRC_H__
-#define __GST_FAKESRC_H__
+#ifndef __GST_FAKE_SRC_H__
+#define __GST_FAKE_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstbasesrc.h>
G_BEGIN_DECLS
typedef enum {
- FAKESRC_FIRST_LAST_LOOP = 1,
- FAKESRC_LAST_FIRST_LOOP,
- FAKESRC_PING_PONG,
- FAKESRC_ORDERED_RANDOM,
- FAKESRC_RANDOM,
- FAKESRC_PATTERN_LOOP,
- FAKESRC_PING_PONG_PATTERN,
- FAKESRC_GET_ALWAYS_SUCEEDS
+ FAKE_SRC_FIRST_LAST_LOOP = 1,
+ FAKE_SRC_LAST_FIRST_LOOP,
+ FAKE_SRC_PING_PONG,
+ FAKE_SRC_ORDERED_RANDOM,
+ FAKE_SRC_RANDOM,
+ FAKE_SRC_PATTERN_LOOP,
+ FAKE_SRC_PING_PONG_PATTERN,
+ FAKE_SRC_GET_ALWAYS_SUCEEDS
} GstFakeSrcOutputType;
typedef enum {
- FAKESRC_DATA_ALLOCATE = 1,
- FAKESRC_DATA_SUBBUFFER
+ FAKE_SRC_DATA_ALLOCATE = 1,
+ FAKE_SRC_DATA_SUBBUFFER
} GstFakeSrcDataType;
typedef enum {
- FAKESRC_SIZETYPE_NULL = 1,
- FAKESRC_SIZETYPE_FIXED,
- FAKESRC_SIZETYPE_RANDOM
+ FAKE_SRC_SIZETYPE_NULL = 1,
+ FAKE_SRC_SIZETYPE_FIXED,
+ FAKE_SRC_SIZETYPE_RANDOM
} GstFakeSrcSizeType;
typedef enum {
- FAKESRC_FILLTYPE_NOTHING = 1,
- FAKESRC_FILLTYPE_NULL,
- FAKESRC_FILLTYPE_RANDOM,
- FAKESRC_FILLTYPE_PATTERN,
- FAKESRC_FILLTYPE_PATTERN_CONT
+ FAKE_SRC_FILLTYPE_NOTHING = 1,
+ FAKE_SRC_FILLTYPE_NULL,
+ FAKE_SRC_FILLTYPE_RANDOM,
+ FAKE_SRC_FILLTYPE_PATTERN,
+ FAKE_SRC_FILLTYPE_PATTERN_CONT
} GstFakeSrcFillType;
-#define GST_TYPE_FAKESRC \
- (gst_fakesrc_get_type())
-#define GST_FAKESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESRC,GstFakeSrc))
-#define GST_FAKESRC_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESRC,GstFakeSrcClass))
-#define GST_IS_FAKESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESRC))
-#define GST_IS_FAKESRC_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC))
+#define GST_TYPE_FAKE_SRC \
+ (gst_fake_src_get_type())
+#define GST_FAKE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKE_SRC,GstFakeSrc))
+#define GST_FAKE_SRC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKE_SRC,GstFakeSrcClass))
+#define GST_IS_FAKE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKE_SRC))
+#define GST_IS_FAKE_SRC_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKE_SRC))
typedef struct _GstFakeSrc GstFakeSrc;
typedef struct _GstFakeSrcClass GstFakeSrcClass;
GstBaseSrc element;
/*< private >*/
- gboolean has_loop;
- gboolean has_getrange;
+ gboolean has_loop;
+ gboolean has_getrange;
GstFakeSrcOutputType output;
GstFakeSrcDataType data;
GstFakeSrcSizeType sizetype;
GstFakeSrcFillType filltype;
- guint sizemin;
- guint sizemax;
- GstBuffer *parent;
- guint parentsize;
- guint parentoffset;
- guint8 pattern_byte;
- gchar *pattern;
- GList *patternlist;
+ guint sizemin;
+ guint sizemax;
+ GstBuffer *parent;
+ guint parentsize;
+ guint parentoffset;
+ guint8 pattern_byte;
+ gchar *pattern;
+ GList *patternlist;
gint datarate;
gboolean sync;
GstClock *clock;
gint64 segment_start;
gint64 segment_end;
gboolean segment_loop;
- gint num_buffers;
- gint rt_num_buffers; /* we are going to change this at runtime */
- guint64 buffer_count;
- gboolean silent;
- gboolean signal_handoffs;
- gboolean dump;
+ gint num_buffers;
+ gint rt_num_buffers; /* we are going to change this at runtime */
+ guint64 buffer_count;
+ gboolean silent;
+ gboolean signal_handoffs;
+ gboolean dump;
guint64 bytes_sent;
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
-GType gst_fakesrc_get_type(void);
+GType gst_fake_src_get_type (void);
G_END_DECLS
-#endif /* __GST_FAKESRC_H__ */
+#endif /* __GST_FAKE_SRC_H__ */
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfilesink.c:
+ * gstfilesink.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
-GST_DEBUG_CATEGORY_STATIC (gst_filesink_debug);
-#define GST_CAT_DEFAULT gst_filesink_debug
+GST_DEBUG_CATEGORY_STATIC (gst_file_sink_debug);
+#define GST_CAT_DEFAULT gst_file_sink_debug
-GstElementDetails gst_filesink_details = GST_ELEMENT_DETAILS ("File Sink",
+GstElementDetails gst_file_sink_details = GST_ELEMENT_DETAILS ("File Sink",
"Sink/File",
"Write stream to a file",
"Thomas <thomas@apestaart.org>");
ARG_LOCATION
};
-static void gst_filesink_dispose (GObject * object);
+static void gst_file_sink_dispose (GObject * object);
-static void gst_filesink_set_property (GObject * object, guint prop_id,
+static void gst_file_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_filesink_get_property (GObject * object, guint prop_id,
+static void gst_file_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static gboolean gst_filesink_open_file (GstFileSink * sink);
-static void gst_filesink_close_file (GstFileSink * sink);
+static gboolean gst_file_sink_open_file (GstFileSink * sink);
+static void gst_file_sink_close_file (GstFileSink * sink);
-static gboolean gst_filesink_event (GstBaseSink * sink, GstEvent * event);
-static GstFlowReturn gst_filesink_render (GstBaseSink * sink,
+static gboolean gst_file_sink_event (GstBaseSink * sink, GstEvent * event);
+static GstFlowReturn gst_file_sink_render (GstBaseSink * sink,
GstBuffer * buffer);
-static gboolean gst_filesink_query (GstPad * pad, GstQuery * query);
+static gboolean gst_file_sink_query (GstPad * pad, GstQuery * query);
-static void gst_filesink_uri_handler_init (gpointer g_iface,
+static void gst_file_sink_uri_handler_init (gpointer g_iface,
gpointer iface_data);
-static GstElementStateReturn gst_filesink_change_state (GstElement * element);
+static GstElementStateReturn gst_file_sink_change_state (GstElement * element);
-//static guint gst_filesink_signals[LAST_SIGNAL] = { 0 };
+//static guint gst_file_sink_signals[LAST_SIGNAL] = { 0 };
static void
_do_init (GType filesink_type)
{
static const GInterfaceInfo urihandler_info = {
- gst_filesink_uri_handler_init,
+ gst_file_sink_uri_handler_init,
NULL,
NULL
};
g_type_add_interface_static (filesink_type, GST_TYPE_URI_HANDLER,
&urihandler_info);
- GST_DEBUG_CATEGORY_INIT (gst_filesink_debug, "filesink", 0,
+ GST_DEBUG_CATEGORY_INIT (gst_file_sink_debug, "filesink", 0,
"filesink element");
}
-GST_BOILERPLATE_FULL (GstFileSink, gst_filesink, GstBaseSink,
+GST_BOILERPLATE_FULL (GstFileSink, gst_file_sink, GstBaseSink,
GST_TYPE_BASE_SINK, _do_init);
static void
-gst_filesink_base_init (gpointer g_class)
+gst_file_sink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gstelement_class->change_state = gst_filesink_change_state;
+ gstelement_class->change_state = gst_file_sink_change_state;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
- gst_element_class_set_details (gstelement_class, &gst_filesink_details);
+ gst_element_class_set_details (gstelement_class, &gst_file_sink_details);
}
static void
-gst_filesink_class_init (GstFileSinkClass * klass)
+gst_file_sink_class_init (GstFileSinkClass * klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstBaseSinkClass *gstbasesink_class = GST_BASE_SINK_CLASS (klass);
- gobject_class->set_property = gst_filesink_set_property;
- gobject_class->get_property = gst_filesink_get_property;
+ gobject_class->set_property = gst_file_sink_set_property;
+ gobject_class->get_property = gst_file_sink_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION,
g_param_spec_string ("location", "File Location",
"Location of the file to write", NULL, G_PARAM_READWRITE));
- gobject_class->dispose = gst_filesink_dispose;
+ gobject_class->dispose = gst_file_sink_dispose;
- gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_filesink_render);
- gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_filesink_event);
+ gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_file_sink_render);
+ gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_file_sink_event);
}
static void
-gst_filesink_init (GstFileSink * filesink)
+gst_file_sink_init (GstFileSink * filesink)
{
GstPad *pad;
pad = GST_BASE_SINK_PAD (filesink);
- gst_pad_set_query_function (pad, gst_filesink_query);
+ gst_pad_set_query_function (pad, gst_file_sink_query);
filesink->filename = NULL;
filesink->file = NULL;
}
static void
-gst_filesink_dispose (GObject * object)
+gst_file_sink_dispose (GObject * object)
{
- GstFileSink *sink = GST_FILESINK (object);
+ GstFileSink *sink = GST_FILE_SINK (object);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static gboolean
-gst_filesink_set_location (GstFileSink * sink, const gchar * location)
+gst_file_sink_set_location (GstFileSink * sink, const gchar * location)
{
/* the element must be stopped or paused in order to do this */
if (GST_STATE (sink) >= GST_STATE_PAUSED)
return TRUE;
}
static void
-gst_filesink_set_property (GObject * object, guint prop_id,
+gst_file_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstFileSink *sink;
- sink = GST_FILESINK (object);
+ sink = GST_FILE_SINK (object);
switch (prop_id) {
case ARG_LOCATION:
- gst_filesink_set_location (sink, g_value_get_string (value));
+ gst_file_sink_set_location (sink, g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
static void
-gst_filesink_get_property (GObject * object, guint prop_id, GValue * value,
+gst_file_sink_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFileSink *sink;
- g_return_if_fail (GST_IS_FILESINK (object));
+ g_return_if_fail (GST_IS_FILE_SINK (object));
- sink = GST_FILESINK (object);
+ sink = GST_FILE_SINK (object);
switch (prop_id) {
case ARG_LOCATION:
}
static gboolean
-gst_filesink_open_file (GstFileSink * sink)
+gst_file_sink_open_file (GstFileSink * sink)
{
/* open the file */
if (sink->filename == NULL || sink->filename[0] == '\0') {
}
static void
-gst_filesink_close_file (GstFileSink * sink)
+gst_file_sink_close_file (GstFileSink * sink)
{
if (fclose (sink->file) != 0) {
GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE,
}
static gboolean
-gst_filesink_query (GstPad * pad, GstQuery * query)
+gst_file_sink_query (GstPad * pad, GstQuery * query)
{
GstFileSink *self;
GstFormat format;
- self = GST_FILESINK (GST_PAD_PARENT (pad));
+ self = GST_FILE_SINK (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
/* handle events (search) */
static gboolean
-gst_filesink_event (GstBaseSink * sink, GstEvent * event)
+gst_file_sink_event (GstBaseSink * sink, GstEvent * event)
{
GstEventType type;
GstFileSink *filesink;
- filesink = GST_FILESINK (sink);
+ filesink = GST_FILE_SINK (sink);
type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
}
/**
- * gst_filesink_chain:
+ * gst_file_sink_chain:
* @pad: the pad this filesink is connected to
* @buf: the buffer that has to be absorbed
*
* take the buffer from the pad and write to file if it's open
*/
static GstFlowReturn
-gst_filesink_render (GstBaseSink * sink, GstBuffer * buffer)
+gst_file_sink_render (GstBaseSink * sink, GstBuffer * buffer)
{
GstFileSink *filesink;
guint size, back_pending = 0;
size = GST_BUFFER_SIZE (buffer);
- filesink = GST_FILESINK (sink);
+ filesink = GST_FILE_SINK (sink);
if (ftell (filesink->file) < filesink->data_written)
back_pending = filesink->data_written - ftell (filesink->file);
}
static GstElementStateReturn
-gst_filesink_change_state (GstElement * element)
+gst_file_sink_change_state (GstElement * element)
{
GstElementStateReturn ret;
gint transition;
case GST_STATE_NULL_TO_READY:
break;
case GST_STATE_READY_TO_PAUSED:
- if (!gst_filesink_open_file (GST_FILESINK (element)))
+ if (!gst_file_sink_open_file (GST_FILE_SINK (element)))
goto open_error;
break;
case GST_STATE_PAUSED_TO_PLAYING:
case GST_STATE_PLAYING_TO_PAUSED:
break;
case GST_STATE_PAUSED_TO_READY:
- gst_filesink_close_file (GST_FILESINK (element));
+ gst_file_sink_close_file (GST_FILE_SINK (element));
break;
case GST_STATE_READY_TO_NULL:
break;
/*** GSTURIHANDLER INTERFACE *************************************************/
static guint
-gst_filesink_uri_get_type (void)
+gst_file_sink_uri_get_type (void)
{
return GST_URI_SINK;
}
static gchar **
-gst_filesink_uri_get_protocols (void)
+gst_file_sink_uri_get_protocols (void)
{
static gchar *protocols[] = { "file", NULL };
return protocols;
}
static const gchar *
-gst_filesink_uri_get_uri (GstURIHandler * handler)
+gst_file_sink_uri_get_uri (GstURIHandler * handler)
{
- GstFileSink *sink = GST_FILESINK (handler);
+ GstFileSink *sink = GST_FILE_SINK (handler);
return sink->uri;
}
static gboolean
-gst_filesink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
+gst_file_sink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
{
gchar *protocol, *location;
gboolean ret;
- GstFileSink *sink = GST_FILESINK (handler);
+ GstFileSink *sink = GST_FILE_SINK (handler);
protocol = gst_uri_get_protocol (uri);
if (strcmp (protocol, "file") != 0) {
}
g_free (protocol);
location = gst_uri_get_location (uri);
- ret = gst_filesink_set_location (sink, location);
+ ret = gst_file_sink_set_location (sink, location);
g_free (location);
return ret;
}
static void
-gst_filesink_uri_handler_init (gpointer g_iface, gpointer iface_data)
+gst_file_sink_uri_handler_init (gpointer g_iface, gpointer iface_data)
{
GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
- iface->get_type = gst_filesink_uri_get_type;
- iface->get_protocols = gst_filesink_uri_get_protocols;
- iface->get_uri = gst_filesink_uri_get_uri;
- iface->set_uri = gst_filesink_uri_set_uri;
+ iface->get_type = gst_file_sink_uri_get_type;
+ iface->get_protocols = gst_file_sink_uri_get_protocols;
+ iface->get_uri = gst_file_sink_uri_get_uri;
+ iface->set_uri = gst_file_sink_uri_set_uri;
}
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfilesink.h:
+ * gstfilesink.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*/
-#ifndef __GST_FILESINK_H__
-#define __GST_FILESINK_H__
+#ifndef __GST_FILE_SINK_H__
+#define __GST_FILE_SINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
G_BEGIN_DECLS
-#define GST_TYPE_FILESINK \
- (gst_filesink_get_type())
-#define GST_FILESINK(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILESINK,GstFileSink))
-#define GST_FILESINK_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILESINK,GstFileSinkClass))
-#define GST_IS_FILESINK(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILESINK))
-#define GST_IS_FILESINK_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILESINK))
+#define GST_TYPE_FILE_SINK \
+ (gst_file_sink_get_type())
+#define GST_FILE_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILE_SINK,GstFileSink))
+#define GST_FILE_SINK_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILE_SINK,GstFileSinkClass))
+#define GST_IS_FILE_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILE_SINK))
+#define GST_IS_FILE_SINK_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILE_SINK))
typedef struct _GstFileSink GstFileSink;
typedef struct _GstFileSinkClass GstFileSinkClass;
GstBaseSinkClass parent_class;
};
-GType gst_filesink_get_type(void);
+GType gst_file_sink_get_type(void);
G_END_DECLS
-#endif /* __GST_FILESINK_H__ */
+#endif /* __GST_FILE_SINK_H__ */
*
* To handle refcounting so that the mmap can be freed at the appropriate
* time, a buffer will be created for each mmap'd region, and all new
- * buffers will be sub-buffers of this top-level buffer. As they are
+ * buffers will be sub-buffers of this top-level buffer. As they are
* freed, the refcount goes down on the mmap'd buffer and its free()
* function is called, which will call munmap(2) on itself.
*
*/
-GST_DEBUG_CATEGORY_STATIC (gst_filesrc_debug);
-#define GST_CAT_DEFAULT gst_filesrc_debug
+GST_DEBUG_CATEGORY_STATIC (gst_file_src_debug);
+#define GST_CAT_DEFAULT gst_file_src_debug
-GstElementDetails gst_filesrc_details = GST_ELEMENT_DETAILS ("File Source",
+GstElementDetails gst_file_src_details = GST_ELEMENT_DETAILS ("File Source",
"Source/File",
"Read from arbitrary point in a file",
"Erik Walthinsen <omega@cse.ogi.edu>");
LAST_SIGNAL
};
-#define DEFAULT_BLOCKSIZE 4*1024
-#define DEFAULT_MMAPSIZE 4*1024*1024
-#define DEFAULT_TOUCH FALSE
+#define DEFAULT_BLOCKSIZE 4*1024
+#define DEFAULT_MMAPSIZE 4*1024*1024
+#define DEFAULT_TOUCH FALSE
enum
{
ARG_TOUCH
};
-static void gst_filesrc_finalize (GObject * object);
+static void gst_file_src_finalize (GObject * object);
-static void gst_filesrc_set_property (GObject * object, guint prop_id,
+static void gst_file_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_filesrc_get_property (GObject * object, guint prop_id,
+static void gst_file_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static gboolean gst_filesrc_start (GstBaseSrc * basesrc);
-static gboolean gst_filesrc_stop (GstBaseSrc * basesrc);
+static gboolean gst_file_src_start (GstBaseSrc * basesrc);
+static gboolean gst_file_src_stop (GstBaseSrc * basesrc);
-static gboolean gst_filesrc_is_seekable (GstBaseSrc * src);
-static gboolean gst_filesrc_get_size (GstBaseSrc * src, guint64 * size);
-static GstFlowReturn gst_filesrc_create (GstBaseSrc * src, guint64 offset,
+static gboolean gst_file_src_is_seekable (GstBaseSrc * src);
+static gboolean gst_file_src_get_size (GstBaseSrc * src, guint64 * size);
+static GstFlowReturn gst_file_src_create (GstBaseSrc * src, guint64 offset,
guint length, GstBuffer ** buffer);
-static void gst_filesrc_uri_handler_init (gpointer g_iface,
+static void gst_file_src_uri_handler_init (gpointer g_iface,
gpointer iface_data);
static void
_do_init (GType filesrc_type)
{
static const GInterfaceInfo urihandler_info = {
- gst_filesrc_uri_handler_init,
+ gst_file_src_uri_handler_init,
NULL,
NULL
};
g_type_add_interface_static (filesrc_type, GST_TYPE_URI_HANDLER,
&urihandler_info);
- GST_DEBUG_CATEGORY_INIT (gst_filesrc_debug, "filesrc", 0, "filesrc element");
+ GST_DEBUG_CATEGORY_INIT (gst_file_src_debug, "filesrc", 0, "filesrc element");
}
-GST_BOILERPLATE_FULL (GstFileSrc, gst_filesrc, GstBaseSrc, GST_TYPE_BASE_SRC,
+GST_BOILERPLATE_FULL (GstFileSrc, gst_file_src, GstBaseSrc, GST_TYPE_BASE_SRC,
_do_init);
static void
-gst_filesrc_base_init (gpointer g_class)
+gst_file_src_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
- gst_element_class_set_details (gstelement_class, &gst_filesrc_details);
+ gst_element_class_set_details (gstelement_class, &gst_file_src_details);
}
static void
-gst_filesrc_class_init (GstFileSrcClass * klass)
+gst_file_src_class_init (GstFileSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstelement_class = (GstElementClass *) klass;
gstbasesrc_class = (GstBaseSrcClass *) klass;
- gobject_class->set_property = gst_filesrc_set_property;
- gobject_class->get_property = gst_filesrc_get_property;
+ gobject_class->set_property = gst_file_src_set_property;
+ gobject_class->get_property = gst_file_src_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "File-descriptor",
g_param_spec_boolean ("touch", "Touch read data",
"Touch data to force disk read", DEFAULT_TOUCH, G_PARAM_READWRITE));
- gobject_class->finalize = gst_filesrc_finalize;
+ gobject_class->finalize = gst_file_src_finalize;
- gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_filesrc_start);
- gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_filesrc_stop);
- gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_filesrc_is_seekable);
- gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_filesrc_get_size);
- gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_filesrc_create);
+ gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_file_src_start);
+ gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_file_src_stop);
+ gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_file_src_is_seekable);
+ gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_file_src_get_size);
+ gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_file_src_create);
}
static void
-gst_filesrc_init (GstFileSrc * src)
+gst_file_src_init (GstFileSrc * src)
{
#ifdef HAVE_MMAP
src->pagesize = getpagesize ();
}
static void
-gst_filesrc_finalize (GObject * object)
+gst_file_src_finalize (GObject * object)
{
GstFileSrc *src;
- src = GST_FILESRC (object);
+ src = GST_FILE_SRC (object);
g_free (src->filename);
g_free (src->uri);
}
static gboolean
-gst_filesrc_set_location (GstFileSrc * src, const gchar * location)
+gst_file_src_set_location (GstFileSrc * src, const gchar * location)
{
/* the element must be stopped in order to do this */
GST_STATE_LOCK (src);
}
static void
-gst_filesrc_set_property (GObject * object, guint prop_id, const GValue * value,
- GParamSpec * pspec)
+gst_file_src_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
{
GstFileSrc *src;
- g_return_if_fail (GST_IS_FILESRC (object));
+ g_return_if_fail (GST_IS_FILE_SRC (object));
- src = GST_FILESRC (object);
+ src = GST_FILE_SRC (object);
switch (prop_id) {
case ARG_LOCATION:
- gst_filesrc_set_location (src, g_value_get_string (value));
+ gst_file_src_set_location (src, g_value_get_string (value));
break;
case ARG_MMAPSIZE:
if ((src->mapsize % src->pagesize) == 0) {
}
static void
-gst_filesrc_get_property (GObject * object, guint prop_id, GValue * value,
+gst_file_src_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFileSrc *src;
- g_return_if_fail (GST_IS_FILESRC (object));
+ g_return_if_fail (GST_IS_FILE_SRC (object));
- src = GST_FILESRC (object);
+ src = GST_FILE_SRC (object);
switch (prop_id) {
case ARG_LOCATION:
}
static GstBuffer *
-gst_filesrc_map_region (GstFileSrc * src, off_t offset, size_t size)
+gst_file_src_map_region (GstFileSrc * src, off_t offset, size_t size)
{
GstBuffer *buf;
void *mmapregion;
}
static GstBuffer *
-gst_filesrc_map_small_region (GstFileSrc * src, off_t offset, size_t size)
+gst_file_src_map_small_region (GstFileSrc * src, off_t offset, size_t size)
{
GstBuffer *ret;
off_t mod;
"not on page boundaries, resizing to map to %llu+%d",
(unsigned long long) mapbase, (gint) mapsize);
- map = gst_filesrc_map_region (src, mapbase, mapsize);
+ map = gst_file_src_map_region (src, mapbase, mapsize);
if (map == NULL)
return NULL;
gst_buffer_unref (map);
} else {
- ret = gst_filesrc_map_region (src, offset, size);
+ ret = gst_file_src_map_region (src, offset, size);
}
return ret;
}
static GstFlowReturn
-gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
+gst_file_src_create_mmap (GstFileSrc * src, guint64 offset, guint length,
GstBuffer ** buffer)
{
GstBuffer *buf = NULL;
"read buf %llu+%d starts in mapbuf %d+%d but ends outside, creating new mmap",
(unsigned long long) offset, (gint) readsize, (gint) mapstart,
(gint) mapsize);
- buf = gst_filesrc_map_small_region (src, offset, readsize);
+ buf = gst_file_src_map_small_region (src, offset, readsize);
if (buf == NULL)
goto could_not_mmap;
}
"read buf %llu+%d starts before mapbuf %d+%d, but overlaps it",
(unsigned long long) offset, (gint) readsize, (gint) mapstart,
(gint) mapsize);
- buf = gst_filesrc_map_small_region (src, offset, readsize);
+ buf = gst_file_src_map_small_region (src, offset, readsize);
if (buf == NULL)
goto could_not_mmap;
}
GST_LOG_OBJECT (src,
"read buf %llu+%d crosses a %d-byte boundary, creating a one-off",
offset, (int) readsize, (int) src->mapsize);
- buf = gst_filesrc_map_small_region (src, offset, readsize);
+ buf = gst_file_src_map_small_region (src, offset, readsize);
if (buf == NULL)
goto could_not_mmap;
mapsize <<= 1;
}
/* create a new one */
- src->mapbuf = gst_filesrc_map_region (src, nextmap, mapsize);
+ src->mapbuf = gst_file_src_map_region (src, nextmap, mapsize);
if (src->mapbuf == NULL)
goto could_not_mmap;
#endif
/***
- * read code below
+ * read code below
+ * that is to say, you shouldn't read the code below, but the code that reads
+ * stuff is below. Well, you shouldn't not read the code below, feel free
+ * to read it of course. It's just that "read code below" is a pretty crappy
+ * documentation string because it sounds like we're expecting you to read
+ * the code to understand what it does, which, while true, is really not
+ * the sort of attitude we want to be advertising. No sir.
*
*/
static GstFlowReturn
-gst_filesrc_create_read (GstFileSrc * src, guint64 offset, guint length,
+gst_file_src_create_read (GstFileSrc * src, guint64 offset, guint length,
GstBuffer ** buffer)
{
int ret;
}
static GstFlowReturn
-gst_filesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
+gst_file_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
GstBuffer ** buffer)
{
GstFileSrc *src;
GstFlowReturn ret;
- src = GST_FILESRC (basesrc);
+ src = GST_FILE_SRC (basesrc);
#ifdef HAVE_MMAP
if (src->using_mmap) {
- ret = gst_filesrc_create_mmap (src, offset, length, buffer);
+ ret = gst_file_src_create_mmap (src, offset, length, buffer);
} else {
- ret = gst_filesrc_create_read (src, offset, length, buffer);
+ ret = gst_file_src_create_read (src, offset, length, buffer);
}
#else
- ret = gst_filesrc_create_read (src, offset, length, buffer);
+ ret = gst_file_src_create_read (src, offset, length, buffer);
#endif
return ret;
}
static gboolean
-gst_filesrc_is_seekable (GstBaseSrc * src)
+gst_file_src_is_seekable (GstBaseSrc * src)
{
return TRUE;
}
static gboolean
-gst_filesrc_get_size (GstBaseSrc * basesrc, guint64 * size)
+gst_file_src_get_size (GstBaseSrc * basesrc, guint64 * size)
{
struct stat stat_results;
GstFileSrc *src;
- src = GST_FILESRC (basesrc);
+ src = GST_FILE_SRC (basesrc);
if (fstat (src->fd, &stat_results) < 0)
goto could_not_stat;
/* open the file and mmap it, necessary to go to READY state */
static gboolean
-gst_filesrc_start (GstBaseSrc * basesrc)
+gst_file_src_start (GstBaseSrc * basesrc)
{
- GstFileSrc *src = GST_FILESRC (basesrc);
+ GstFileSrc *src = GST_FILE_SRC (basesrc);
struct stat stat_results;
if (src->filename == NULL || src->filename[0] == '\0')
#ifdef HAVE_MMAP
/* FIXME: maybe we should only try to mmap if it's a regular file */
/* allocate the first mmap'd region if it's a regular file ? */
- src->mapbuf = gst_filesrc_map_region (src, 0, src->mapsize);
+ src->mapbuf = gst_file_src_map_region (src, 0, src->mapsize);
if (src->mapbuf != NULL) {
GST_DEBUG_OBJECT (src, "using mmap for file");
src->using_mmap = TRUE;
/* unmap and close the file */
static gboolean
-gst_filesrc_stop (GstBaseSrc * basesrc)
+gst_file_src_stop (GstBaseSrc * basesrc)
{
- GstFileSrc *src = GST_FILESRC (basesrc);
+ GstFileSrc *src = GST_FILE_SRC (basesrc);
/* close the file */
close (src->fd);
/*** GSTURIHANDLER INTERFACE *************************************************/
static guint
-gst_filesrc_uri_get_type (void)
+gst_file_src_uri_get_type (void)
{
return GST_URI_SRC;
}
static gchar **
-gst_filesrc_uri_get_protocols (void)
+gst_file_src_uri_get_protocols (void)
{
static gchar *protocols[] = { "file", NULL };
return protocols;
}
static const gchar *
-gst_filesrc_uri_get_uri (GstURIHandler * handler)
+gst_file_src_uri_get_uri (GstURIHandler * handler)
{
- GstFileSrc *src = GST_FILESRC (handler);
+ GstFileSrc *src = GST_FILE_SRC (handler);
return src->uri;
}
static gboolean
-gst_filesrc_uri_set_uri (GstURIHandler * handler, const gchar * uri)
+gst_file_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
{
gchar *protocol, *location;
gboolean ret;
- GstFileSrc *src = GST_FILESRC (handler);
+ GstFileSrc *src = GST_FILE_SRC (handler);
protocol = gst_uri_get_protocol (uri);
if (strcmp (protocol, "file") != 0) {
}
g_free (protocol);
location = gst_uri_get_location (uri);
- ret = gst_filesrc_set_location (src, location);
+ ret = gst_file_src_set_location (src, location);
g_free (location);
return ret;
}
static void
-gst_filesrc_uri_handler_init (gpointer g_iface, gpointer iface_data)
+gst_file_src_uri_handler_init (gpointer g_iface, gpointer iface_data)
{
GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
- iface->get_type = gst_filesrc_uri_get_type;
- iface->get_protocols = gst_filesrc_uri_get_protocols;
- iface->get_uri = gst_filesrc_uri_get_uri;
- iface->set_uri = gst_filesrc_uri_set_uri;
+ iface->get_type = gst_file_src_uri_get_type;
+ iface->get_protocols = gst_file_src_uri_get_protocols;
+ iface->get_uri = gst_file_src_uri_get_uri;
+ iface->set_uri = gst_file_src_uri_set_uri;
}
* 2000 Wim Taymans <wtay@chello.be>
* 2005 Wim Taymans <wim@fluendo.com>
*
- * gstfilesrc.h:
+ * gstfilesrc.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* Boston, MA 02111-1307, USA.
*/
-#ifndef __GST_FILESRC_H__
-#define __GST_FILESRC_H__
+#ifndef __GST_FILE_SRC_H__
+#define __GST_FILE_SRC_H__
#include <sys/types.h>
G_BEGIN_DECLS
-#define GST_TYPE_FILESRC \
- (gst_filesrc_get_type())
-#define GST_FILESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILESRC,GstFileSrc))
-#define GST_FILESRC_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILESRC,GstFileSrcClass))
-#define GST_IS_FILESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILESRC))
-#define GST_IS_FILESRC_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILESRC))
+#define GST_TYPE_FILE_SRC \
+ (gst_file_src_get_type())
+#define GST_FILE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILE_SRC,GstFileSrc))
+#define GST_FILE_SRC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILE_SRC,GstFileSrcClass))
+#define GST_IS_FILE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILE_SRC))
+#define GST_IS_FILE_SRC_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILE_SRC))
typedef struct _GstFileSrc GstFileSrc;
typedef struct _GstFileSrcClass GstFileSrcClass;
struct _GstFileSrc {
GstBaseSrc element;
- guint pagesize; /* system page size*/
-
+ guint pagesize; /* system page size */
+
gchar *filename; /* filename */
gchar *uri; /* caching the URI */
- gint fd; /* open file descriptor*/
+ gint fd; /* open file descriptor */
guint64 read_position; /* position of fd */
gboolean touch; /* whether to touch every page */
gboolean using_mmap; /* whether we opened it with mmap */
- gboolean is_regular; /* whether it's (symlink to)
- a regular file */
+ gboolean is_regular; /* whether it's a (symlink to a)
+ regular file */
GstBuffer *mapbuf;
size_t mapsize;
};
GstBaseSrcClass parent_class;
};
-GType gst_filesrc_get_type(void);
+GType gst_file_src_get_type (void);
G_END_DECLS
-#endif /* __GST_FILESRC_H__ */
+#endif /* __GST_FILE_SRC_H__ */
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000,2005 Wim Taymans <wim@fluendo.com>
*
- * gstpushsrc.c:
+ * gstpushsrc.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
#include "gsttypefindhelper.h"
#include <gst/gstmarshal.h>
-GST_DEBUG_CATEGORY_STATIC (gst_pushsrc_debug);
-#define GST_CAT_DEFAULT gst_pushsrc_debug
+GST_DEBUG_CATEGORY_STATIC (gst_push_src_debug);
+#define GST_CAT_DEFAULT gst_push_src_debug
/* PushSrc signals and args */
enum
static GstElementClass *parent_class = NULL;
-static void gst_pushsrc_base_init (gpointer g_class);
-static void gst_pushsrc_class_init (GstPushSrcClass * klass);
-static void gst_pushsrc_init (GstPushSrc * src, gpointer g_class);
+static void gst_push_src_base_init (gpointer g_class);
+static void gst_push_src_class_init (GstPushSrcClass * klass);
+static void gst_push_src_init (GstPushSrc * src, gpointer g_class);
GType
-gst_pushsrc_get_type (void)
+gst_push_src_get_type (void)
{
- static GType pushsrc_type = 0;
+ static GType push_src_type = 0;
- if (!pushsrc_type) {
- static const GTypeInfo pushsrc_info = {
+ if (!push_src_type) {
+ static const GTypeInfo push_src_info = {
sizeof (GstPushSrcClass),
- (GBaseInitFunc) gst_pushsrc_base_init,
+ (GBaseInitFunc) gst_push_src_base_init,
NULL,
- (GClassInitFunc) gst_pushsrc_class_init,
+ (GClassInitFunc) gst_push_src_class_init,
NULL,
NULL,
sizeof (GstPushSrc),
0,
- (GInstanceInitFunc) gst_pushsrc_init,
+ (GInstanceInitFunc) gst_push_src_init,
};
- pushsrc_type = g_type_register_static (GST_TYPE_BASE_SRC,
- "GstPushSrc", &pushsrc_info, G_TYPE_FLAG_ABSTRACT);
+ push_src_type = g_type_register_static (GST_TYPE_BASE_SRC,
+ "GstPushSrc", &push_src_info, G_TYPE_FLAG_ABSTRACT);
}
- return pushsrc_type;
+ return push_src_type;
}
#if 0
-static const GstEventMask *gst_pushsrc_get_event_mask (GstPad * pad);
+static const GstEventMask *gst_push_src_get_event_mask (GstPad * pad);
#endif
-static GstFlowReturn gst_pushsrc_create (GstBaseSrc * bsrc, guint64 offset,
+static GstFlowReturn gst_push_src_create (GstBaseSrc * bsrc, guint64 offset,
guint length, GstBuffer ** ret);
static void
-gst_pushsrc_base_init (gpointer g_class)
+gst_push_src_base_init (gpointer g_class)
{
- GST_DEBUG_CATEGORY_INIT (gst_pushsrc_debug, "pushsrc", 0, "pushsrc element");
+ GST_DEBUG_CATEGORY_INIT (gst_push_src_debug, "pushsrc", 0, "pushsrc element");
}
static void
-gst_pushsrc_class_init (GstPushSrcClass * klass)
+gst_push_src_class_init (GstPushSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
parent_class = g_type_class_ref (GST_TYPE_BASE_SRC);
- gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_pushsrc_create);
+ gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_push_src_create);
}
static void
-gst_pushsrc_init (GstPushSrc * pushsrc, gpointer g_class)
+gst_push_src_init (GstPushSrc * pushsrc, gpointer g_class)
{
}
static GstFlowReturn
-gst_pushsrc_create (GstBaseSrc * bsrc, guint64 offset, guint length,
+gst_push_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
GstBuffer ** ret)
{
GstFlowReturn fret;
GstPushSrc *src;
GstPushSrcClass *pclass;
- src = GST_PUSHSRC (bsrc);
- pclass = GST_PUSHSRC_GET_CLASS (src);
+ src = GST_PUSH_SRC (bsrc);
+ pclass = GST_PUSH_SRC_GET_CLASS (src);
if (pclass->create)
fret = pclass->create (src, ret);
else
* Boston, MA 02111-1307, USA.
*/
-#ifndef __GST_PUSHSRC_H__
-#define __GST_PUSHSRC_H__
+#ifndef __GST_PUSH_SRC_H__
+#define __GST_PUSH_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstbasesrc.h>
G_BEGIN_DECLS
-#define GST_TYPE_PUSHSRC (gst_pushsrc_get_type())
-#define GST_PUSHSRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PUSHSRC,GstPushSrc))
-#define GST_PUSHSRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PUSHSRC,GstPushSrcClass))
-#define GST_PUSHSRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PUSHSRC, GstPushSrcClass))
-#define GST_IS_PUSHSRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PUSHSRC))
-#define GST_IS_PUSHSRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PUSHSRC))
+#define GST_TYPE_PUSH_SRC (gst_push_src_get_type())
+#define GST_PUSH_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PUSH_SRC,GstPushSrc))
+#define GST_PUSH_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PUSH_SRC,GstPushSrcClass))
+#define GST_PUSH_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PUSH_SRC, GstPushSrcClass))
+#define GST_IS_PUSH_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PUSH_SRC))
+#define GST_IS_PUSH_SRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PUSH_SRC))
/* base class for block based sources
*
GstFlowReturn (*create) (GstPushSrc *src, GstBuffer **buf);
};
-GType gst_pushsrc_get_type(void);
+GType gst_push_src_get_type(void);
G_END_DECLS
-#endif /* __GST_PUSHSRC_H__ */
+#endif /* __GST_PUSH_SRC_H__ */
};
+/* this declaration is here because there's no gstcapsfilter.h */
extern GType gst_capsfilter_get_type (void);
-extern GType gst_filesrc_get_type (void);
-extern GstElementDetails gst_filesrc_details;
static struct _elements_entry _elements[] = {
{"capsfilter", GST_RANK_NONE, gst_capsfilter_get_type},
- {"fakesrc", GST_RANK_NONE, gst_fakesrc_get_type},
- {"fakesink", GST_RANK_NONE, gst_fakesink_get_type},
- {"filesrc", GST_RANK_NONE, gst_filesrc_get_type},
+ {"fakesrc", GST_RANK_NONE, gst_fake_src_get_type},
+ {"fakesink", GST_RANK_NONE, gst_fake_sink_get_type},
+ {"filesrc", GST_RANK_NONE, gst_file_src_get_type},
{"identity", GST_RANK_NONE, gst_identity_get_type},
- {"filesink", GST_RANK_NONE, gst_filesink_get_type},
+ {"filesink", GST_RANK_NONE, gst_file_sink_get_type},
{"tee", GST_RANK_NONE, gst_tee_get_type},
{"typefind", GST_RANK_NONE, gst_type_find_element_get_type},
{NULL, 0},
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
-GST_DEBUG_CATEGORY_STATIC (gst_fakesink_debug);
-#define GST_CAT_DEFAULT gst_fakesink_debug
+GST_DEBUG_CATEGORY_STATIC (gst_fake_sink_debug);
+#define GST_CAT_DEFAULT gst_fake_sink_debug
-GstElementDetails gst_fakesink_details = GST_ELEMENT_DETAILS ("Fake Sink",
+GstElementDetails gst_fake_sink_details = GST_ELEMENT_DETAILS ("Fake Sink",
"Sink",
"Black hole for data",
"Erik Walthinsen <omega@cse.ogi.edu>, "
LAST_SIGNAL
};
-#define DEFAULT_STATE_ERROR FAKESINK_STATE_ERROR_NONE
+#define DEFAULT_STATE_ERROR FAKE_SINK_STATE_ERROR_NONE
#define DEFAULT_SILENT FALSE
#define DEFAULT_DUMP FALSE
#define DEFAULT_SYNC FALSE
ARG_LAST_MESSAGE,
};
-#define GST_TYPE_FAKESINK_STATE_ERROR (gst_fakesink_state_error_get_type())
+#define GST_TYPE_FAKE_SINK_STATE_ERROR (gst_fake_sink_state_error_get_type())
static GType
-gst_fakesink_state_error_get_type (void)
+gst_fake_sink_state_error_get_type (void)
{
static GType fakesink_state_error_type = 0;
static GEnumValue fakesink_state_error[] = {
- {FAKESINK_STATE_ERROR_NONE, "0", "No state change errors"},
- {FAKESINK_STATE_ERROR_NULL_READY, "1",
+ {FAKE_SINK_STATE_ERROR_NONE, "0", "No state change errors"},
+ {FAKE_SINK_STATE_ERROR_NULL_READY, "1",
"Fail state change from NULL to READY"},
- {FAKESINK_STATE_ERROR_READY_PAUSED, "2",
+ {FAKE_SINK_STATE_ERROR_READY_PAUSED, "2",
"Fail state change from READY to PAUSED"},
- {FAKESINK_STATE_ERROR_PAUSED_PLAYING, "3",
+ {FAKE_SINK_STATE_ERROR_PAUSED_PLAYING, "3",
"Fail state change from PAUSED to PLAYING"},
- {FAKESINK_STATE_ERROR_PLAYING_PAUSED, "4",
+ {FAKE_SINK_STATE_ERROR_PLAYING_PAUSED, "4",
"Fail state change from PLAYING to PAUSED"},
- {FAKESINK_STATE_ERROR_PAUSED_READY, "5",
+ {FAKE_SINK_STATE_ERROR_PAUSED_READY, "5",
"Fail state change from PAUSED to READY"},
- {FAKESINK_STATE_ERROR_READY_NULL, "6",
+ {FAKE_SINK_STATE_ERROR_READY_NULL, "6",
"Fail state change from READY to NULL"},
{0, NULL, NULL},
};
}
#define _do_init(bla) \
- GST_DEBUG_CATEGORY_INIT (gst_fakesink_debug, "fakesink", 0, "fakesink element");
+ GST_DEBUG_CATEGORY_INIT (gst_fake_sink_debug, "fakesink", 0, "fakesink element");
-GST_BOILERPLATE_FULL (GstFakeSink, gst_fakesink, GstBaseSink,
+GST_BOILERPLATE_FULL (GstFakeSink, gst_fake_sink, GstBaseSink,
GST_TYPE_BASE_SINK, _do_init);
-static void gst_fakesink_set_property (GObject * object, guint prop_id,
+static void gst_fake_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_fakesink_get_property (GObject * object, guint prop_id,
+static void gst_fake_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstElementStateReturn gst_fakesink_change_state (GstElement * element);
+static GstElementStateReturn gst_fake_sink_change_state (GstElement * element);
-static GstFlowReturn gst_fakesink_preroll (GstBaseSink * bsink,
+static GstFlowReturn gst_fake_sink_preroll (GstBaseSink * bsink,
GstBuffer * buffer);
-static GstFlowReturn gst_fakesink_render (GstBaseSink * bsink,
+static GstFlowReturn gst_fake_sink_render (GstBaseSink * bsink,
GstBuffer * buffer);
-static gboolean gst_fakesink_event (GstBaseSink * bsink, GstEvent * event);
-static void gst_fakesink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
+static gboolean gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event);
+static void gst_fake_sink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end);
-static guint gst_fakesink_signals[LAST_SIGNAL] = { 0 };
+static guint gst_fake_sink_signals[LAST_SIGNAL] = { 0 };
static void
-gst_fakesink_base_init (gpointer g_class)
+gst_fake_sink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
- gst_element_class_set_details (gstelement_class, &gst_fakesink_details);
+ gst_element_class_set_details (gstelement_class, &gst_fake_sink_details);
}
static void
-gst_fakesink_class_init (GstFakeSinkClass * klass)
+gst_fake_sink_class_init (GstFakeSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstelement_class = (GstElementClass *) klass;
gstbase_sink_class = (GstBaseSinkClass *) klass;
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesink_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesink_get_property);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fake_sink_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fake_sink_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STATE_ERROR,
g_param_spec_enum ("state_error", "State Error",
- "Generate a state change error", GST_TYPE_FAKESINK_STATE_ERROR,
+ "Generate a state change error", GST_TYPE_FAKE_SINK_STATE_ERROR,
DEFAULT_STATE_ERROR, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LAST_MESSAGE,
g_param_spec_string ("last_message", "Last Message",
g_param_spec_boolean ("dump", "Dump", "Dump received bytes to stdout",
DEFAULT_DUMP, G_PARAM_READWRITE));
- gst_fakesink_signals[SIGNAL_HANDOFF] =
+ gst_fake_sink_signals[SIGNAL_HANDOFF] =
g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstFakeSinkClass, handoff), NULL, NULL,
gst_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2,
GST_TYPE_BUFFER, GST_TYPE_PAD);
gstelement_class->change_state =
- GST_DEBUG_FUNCPTR (gst_fakesink_change_state);
+ GST_DEBUG_FUNCPTR (gst_fake_sink_change_state);
- gstbase_sink_class->event = GST_DEBUG_FUNCPTR (gst_fakesink_event);
- gstbase_sink_class->preroll = GST_DEBUG_FUNCPTR (gst_fakesink_preroll);
- gstbase_sink_class->render = GST_DEBUG_FUNCPTR (gst_fakesink_render);
- gstbase_sink_class->get_times = GST_DEBUG_FUNCPTR (gst_fakesink_get_times);
+ gstbase_sink_class->event = GST_DEBUG_FUNCPTR (gst_fake_sink_event);
+ gstbase_sink_class->preroll = GST_DEBUG_FUNCPTR (gst_fake_sink_preroll);
+ gstbase_sink_class->render = GST_DEBUG_FUNCPTR (gst_fake_sink_render);
+ gstbase_sink_class->get_times = GST_DEBUG_FUNCPTR (gst_fake_sink_get_times);
}
static void
-gst_fakesink_init (GstFakeSink * fakesink)
+gst_fake_sink_init (GstFakeSink * fakesink)
{
fakesink->silent = DEFAULT_SILENT;
fakesink->dump = DEFAULT_DUMP;
}
static void
-gst_fakesink_set_property (GObject * object, guint prop_id,
+gst_fake_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstFakeSink *sink;
- sink = GST_FAKESINK (object);
+ sink = GST_FAKE_SINK (object);
switch (prop_id) {
case ARG_SILENT:
}
static void
-gst_fakesink_get_property (GObject * object, guint prop_id, GValue * value,
+gst_fake_sink_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFakeSink *sink;
- sink = GST_FAKESINK (object);
+ sink = GST_FAKE_SINK (object);
switch (prop_id) {
case ARG_STATE_ERROR:
}
static void
-gst_fakesink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
+gst_fake_sink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end)
{
- GstFakeSink *sink = GST_FAKESINK (bsink);
+ GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (sink->sync) {
GST_BASE_SINK_CLASS (parent_class)->get_times (bsink, buffer, start, end);
}
static gboolean
-gst_fakesink_event (GstBaseSink * bsink, GstEvent * event)
+gst_fake_sink_event (GstBaseSink * bsink, GstEvent * event)
{
- GstFakeSink *sink = GST_FAKESINK (bsink);
+ GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (!sink->silent) {
g_free (sink->last_message);
}
static GstFlowReturn
-gst_fakesink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
+gst_fake_sink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
{
- GstFakeSink *sink = GST_FAKESINK (bsink);
+ GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (!sink->silent) {
g_free (sink->last_message);
}
static GstFlowReturn
-gst_fakesink_render (GstBaseSink * bsink, GstBuffer * buf)
+gst_fake_sink_render (GstBaseSink * bsink, GstBuffer * buf)
{
- GstFakeSink *sink = GST_FAKESINK (bsink);
+ GstFakeSink *sink = GST_FAKE_SINK (bsink);
if (!sink->silent) {
g_free (sink->last_message);
g_object_notify (G_OBJECT (sink), "last_message");
}
if (sink->signal_handoffs)
- g_signal_emit (G_OBJECT (sink), gst_fakesink_signals[SIGNAL_HANDOFF], 0,
+ g_signal_emit (G_OBJECT (sink), gst_fake_sink_signals[SIGNAL_HANDOFF], 0,
buf, bsink->sinkpad);
if (sink->dump) {
}
static GstElementStateReturn
-gst_fakesink_change_state (GstElement * element)
+gst_fake_sink_change_state (GstElement * element)
{
GstElementStateReturn ret = GST_STATE_SUCCESS;
- GstFakeSink *fakesink = GST_FAKESINK (element);
+ GstFakeSink *fakesink = GST_FAKE_SINK (element);
GstElementState transition = GST_STATE_TRANSITION (element);
switch (transition) {
case GST_STATE_NULL_TO_READY:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_NULL_READY)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_NULL_READY)
goto error;
break;
case GST_STATE_READY_TO_PAUSED:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_READY_PAUSED)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_READY_PAUSED)
goto error;
break;
case GST_STATE_PAUSED_TO_PLAYING:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_PAUSED_PLAYING)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PAUSED_PLAYING)
goto error;
break;
case GST_STATE_PLAYING_TO_PAUSED:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_PLAYING_PAUSED)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PLAYING_PAUSED)
goto error;
break;
case GST_STATE_PAUSED_TO_READY:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_PAUSED_READY)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PAUSED_READY)
goto error;
break;
case GST_STATE_READY_TO_NULL:
- if (fakesink->state_error == FAKESINK_STATE_ERROR_READY_NULL)
+ if (fakesink->state_error == FAKE_SINK_STATE_ERROR_READY_NULL)
goto error;
g_free (fakesink->last_message);
fakesink->last_message = NULL;
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfakesink.h:
+ * gstfakesink.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*/
-#ifndef __GST_FAKESINK_H__
-#define __GST_FAKESINK_H__
+#ifndef __GST_FAKE_SINK_H__
+#define __GST_FAKE_SINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
G_BEGIN_DECLS
-#define GST_TYPE_FAKESINK \
- (gst_fakesink_get_type())
-#define GST_FAKESINK(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESINK,GstFakeSink))
-#define GST_FAKESINK_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESINK,GstFakeSinkClass))
-#define GST_IS_FAKESINK(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESINK))
-#define GST_IS_FAKESINK_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK))
+#define GST_TYPE_FAKE_SINK \
+ (gst_fake_sink_get_type())
+#define GST_FAKE_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKE_SINK,GstFakeSink))
+#define GST_FAKE_SINK_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKE_SINK,GstFakeSinkClass))
+#define GST_IS_FAKE_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKE_SINK))
+#define GST_IS_FAKE_SINK_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKE_SINK))
typedef enum {
- FAKESINK_STATE_ERROR_NONE = 0,
- FAKESINK_STATE_ERROR_NULL_READY,
- FAKESINK_STATE_ERROR_READY_PAUSED,
- FAKESINK_STATE_ERROR_PAUSED_PLAYING,
- FAKESINK_STATE_ERROR_PLAYING_PAUSED,
- FAKESINK_STATE_ERROR_PAUSED_READY,
- FAKESINK_STATE_ERROR_READY_NULL
+ FAKE_SINK_STATE_ERROR_NONE = 0,
+ FAKE_SINK_STATE_ERROR_NULL_READY,
+ FAKE_SINK_STATE_ERROR_READY_PAUSED,
+ FAKE_SINK_STATE_ERROR_PAUSED_PLAYING,
+ FAKE_SINK_STATE_ERROR_PLAYING_PAUSED,
+ FAKE_SINK_STATE_ERROR_PAUSED_READY,
+ FAKE_SINK_STATE_ERROR_READY_NULL
} GstFakeSinkStateError;
typedef struct _GstFakeSink GstFakeSink;
typedef struct _GstFakeSinkClass GstFakeSinkClass;
struct _GstFakeSink {
- GstBaseSink element;
+ GstBaseSink element;
- gboolean silent;
- gboolean dump;
- gboolean sync;
- gboolean signal_handoffs;
+ gboolean silent;
+ gboolean dump;
+ gboolean sync;
+ gboolean signal_handoffs;
GstFakeSinkStateError state_error;
- gchar *last_message;
+ gchar *last_message;
};
struct _GstFakeSinkClass {
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
-GType gst_fakesink_get_type(void);
+GType gst_fake_sink_get_type (void);
G_END_DECLS
-#endif /* __GST_FAKESINK_H__ */
+#endif /* __GST_FAKE_SINK_H__ */
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfakesrc.c:
+ * gstfakesrc.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
-GST_DEBUG_CATEGORY_STATIC (gst_fakesrc_debug);
-#define GST_CAT_DEFAULT gst_fakesrc_debug
+GST_DEBUG_CATEGORY_STATIC (gst_fake_src_debug);
+#define GST_CAT_DEFAULT gst_fake_src_debug
-GstElementDetails gst_fakesrc_details = GST_ELEMENT_DETAILS ("Fake Source",
+GstElementDetails gst_fake_src_details = GST_ELEMENT_DETAILS ("Fake Source",
"Source",
"Push empty (no data) buffers around",
"Erik Walthinsen <omega@cse.ogi.edu>, "
LAST_SIGNAL
};
-#define DEFAULT_OUTPUT FAKESRC_FIRST_LAST_LOOP
-#define DEFAULT_DATA FAKESRC_DATA_ALLOCATE
-#define DEFAULT_SIZETYPE FAKESRC_SIZETYPE_NULL
+#define DEFAULT_OUTPUT FAKE_SRC_FIRST_LAST_LOOP
+#define DEFAULT_DATA FAKE_SRC_DATA_ALLOCATE
+#define DEFAULT_SIZETYPE FAKE_SRC_SIZETYPE_NULL
#define DEFAULT_SIZEMIN 0
#define DEFAULT_SIZEMAX 4096
-#define DEFAULT_FILLTYPE FAKESRC_FILLTYPE_NULL
+#define DEFAULT_FILLTYPE FAKE_SRC_FILLTYPE_NULL
#define DEFAULT_DATARATE 0
#define DEFAULT_SYNC FALSE
#define DEFAULT_PATTERN NULL
};
/* not implemented
-#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
+#define GST_TYPE_FAKE_SRC_OUTPUT (gst_fake_src_output_get_type())
static GType
-gst_fakesrc_output_get_type (void)
+gst_fake_src_output_get_type (void)
{
static GType fakesrc_output_type = 0;
static GEnumValue fakesrc_output[] = {
- {FAKESRC_FIRST_LAST_LOOP, "1", "First-Last loop"},
- {FAKESRC_LAST_FIRST_LOOP, "2", "Last-First loop"},
- {FAKESRC_PING_PONG, "3", "Ping-Pong"},
- {FAKESRC_ORDERED_RANDOM, "4", "Ordered Random"},
- {FAKESRC_RANDOM, "5", "Random"},
- {FAKESRC_PATTERN_LOOP, "6", "Patttern loop"},
- {FAKESRC_PING_PONG_PATTERN, "7", "Ping-Pong Pattern"},
- {FAKESRC_GET_ALWAYS_SUCEEDS, "8", "'_get' Always succeeds"},
+ {FAKE_SRC_FIRST_LAST_LOOP, "1", "First-Last loop"},
+ {FAKE_SRC_LAST_FIRST_LOOP, "2", "Last-First loop"},
+ {FAKE_SRC_PING_PONG, "3", "Ping-Pong"},
+ {FAKE_SRC_ORDERED_RANDOM, "4", "Ordered Random"},
+ {FAKE_SRC_RANDOM, "5", "Random"},
+ {FAKE_SRC_PATTERN_LOOP, "6", "Patttern loop"},
+ {FAKE_SRC_PING_PONG_PATTERN, "7", "Ping-Pong Pattern"},
+ {FAKE_SRC_GET_ALWAYS_SUCEEDS, "8", "'_get' Always succeeds"},
{0, NULL, NULL},
};
}
*/
-#define GST_TYPE_FAKESRC_DATA (gst_fakesrc_data_get_type())
+#define GST_TYPE_FAKE_SRC_DATA (gst_fake_src_data_get_type())
static GType
-gst_fakesrc_data_get_type (void)
+gst_fake_src_data_get_type (void)
{
static GType fakesrc_data_type = 0;
static GEnumValue fakesrc_data[] = {
- {FAKESRC_DATA_ALLOCATE, "1", "Allocate data"},
- {FAKESRC_DATA_SUBBUFFER, "2", "Subbuffer data"},
+ {FAKE_SRC_DATA_ALLOCATE, "1", "Allocate data"},
+ {FAKE_SRC_DATA_SUBBUFFER, "2", "Subbuffer data"},
{0, NULL, NULL},
};
return fakesrc_data_type;
}
-#define GST_TYPE_FAKESRC_SIZETYPE (gst_fakesrc_sizetype_get_type())
+#define GST_TYPE_FAKE_SRC_SIZETYPE (gst_fake_src_sizetype_get_type())
static GType
-gst_fakesrc_sizetype_get_type (void)
+gst_fake_src_sizetype_get_type (void)
{
static GType fakesrc_sizetype_type = 0;
static GEnumValue fakesrc_sizetype[] = {
- {FAKESRC_SIZETYPE_NULL, "1", "Send empty buffers"},
- {FAKESRC_SIZETYPE_FIXED, "2", "Fixed size buffers (sizemax sized)"},
- {FAKESRC_SIZETYPE_RANDOM, "3",
+ {FAKE_SRC_SIZETYPE_NULL, "1", "Send empty buffers"},
+ {FAKE_SRC_SIZETYPE_FIXED, "2", "Fixed size buffers (sizemax sized)"},
+ {FAKE_SRC_SIZETYPE_RANDOM, "3",
"Random sized buffers (sizemin <= size <= sizemax)"},
{0, NULL, NULL},
};
return fakesrc_sizetype_type;
}
-#define GST_TYPE_FAKESRC_FILLTYPE (gst_fakesrc_filltype_get_type())
+#define GST_TYPE_FAKE_SRC_FILLTYPE (gst_fake_src_filltype_get_type())
static GType
-gst_fakesrc_filltype_get_type (void)
+gst_fake_src_filltype_get_type (void)
{
static GType fakesrc_filltype_type = 0;
static GEnumValue fakesrc_filltype[] = {
- {FAKESRC_FILLTYPE_NOTHING, "1", "Leave data as malloced"},
- {FAKESRC_FILLTYPE_NULL, "2", "Fill buffers with zeros"},
- {FAKESRC_FILLTYPE_RANDOM, "3", "Fill buffers with random crap"},
- {FAKESRC_FILLTYPE_PATTERN, "4", "Fill buffers with pattern 0x00 -> 0xff"},
- {FAKESRC_FILLTYPE_PATTERN_CONT, "5",
+ {FAKE_SRC_FILLTYPE_NOTHING, "1", "Leave data as malloced"},
+ {FAKE_SRC_FILLTYPE_NULL, "2", "Fill buffers with zeros"},
+ {FAKE_SRC_FILLTYPE_RANDOM, "3", "Fill buffers with random crap"},
+ {FAKE_SRC_FILLTYPE_PATTERN, "4", "Fill buffers with pattern 0x00 -> 0xff"},
+ {FAKE_SRC_FILLTYPE_PATTERN_CONT, "5",
"Fill buffers with pattern 0x00 -> 0xff that spans buffers"},
{0, NULL, NULL},
};
}
#define _do_init(bla) \
- GST_DEBUG_CATEGORY_INIT (gst_fakesrc_debug, "fakesrc", 0, "fakesrc element");
+ GST_DEBUG_CATEGORY_INIT (gst_fake_src_debug, "fakesrc", 0, "fakesrc element");
-GST_BOILERPLATE_FULL (GstFakeSrc, gst_fakesrc, GstBaseSrc, GST_TYPE_BASE_SRC,
+GST_BOILERPLATE_FULL (GstFakeSrc, gst_fake_src, GstBaseSrc, GST_TYPE_BASE_SRC,
_do_init);
-static void gst_fakesrc_set_property (GObject * object, guint prop_id,
+static void gst_fake_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_fakesrc_get_property (GObject * object, guint prop_id,
+static void gst_fake_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static gboolean gst_fakesrc_start (GstBaseSrc * basesrc);
-static gboolean gst_fakesrc_stop (GstBaseSrc * basesrc);
+static gboolean gst_fake_src_start (GstBaseSrc * basesrc);
+static gboolean gst_fake_src_stop (GstBaseSrc * basesrc);
-static gboolean gst_fakesrc_event_handler (GstBaseSrc * src, GstEvent * event);
-static GstFlowReturn gst_fakesrc_create (GstBaseSrc * src, guint64 offset,
+static gboolean gst_fake_src_event_handler (GstBaseSrc * src, GstEvent * event);
+static GstFlowReturn gst_fake_src_create (GstBaseSrc * src, guint64 offset,
guint length, GstBuffer ** buf);
-static guint gst_fakesrc_signals[LAST_SIGNAL] = { 0 };
+static guint gst_fake_src_signals[LAST_SIGNAL] = { 0 };
static void
-gst_fakesrc_base_init (gpointer g_class)
+gst_fake_src_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
- gst_element_class_set_details (gstelement_class, &gst_fakesrc_details);
+ gst_element_class_set_details (gstelement_class, &gst_fake_src_details);
}
static void
-gst_fakesrc_class_init (GstFakeSrcClass * klass)
+gst_fake_src_class_init (GstFakeSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstelement_class = (GstElementClass *) klass;
gstbase_src_class = (GstBaseSrcClass *) klass;
- gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fakesrc_set_property);
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fakesrc_get_property);
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_fake_src_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_fake_src_get_property);
/*
FIXME: this is not implemented; would make sense once basesrc and fakesrc
support multiple pads
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_OUTPUT,
g_param_spec_enum ("output", "output", "Output method (currently unused)",
- GST_TYPE_FAKESRC_OUTPUT, DEFAULT_OUTPUT, G_PARAM_READWRITE));
+ GST_TYPE_FAKE_SRC_OUTPUT, DEFAULT_OUTPUT, G_PARAM_READWRITE));
*/
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DATA,
g_param_spec_enum ("data", "data", "Data allocation method",
- GST_TYPE_FAKESRC_DATA, DEFAULT_DATA, G_PARAM_READWRITE));
+ GST_TYPE_FAKE_SRC_DATA, DEFAULT_DATA, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SIZETYPE,
g_param_spec_enum ("sizetype", "sizetype",
- "How to determine buffer sizes", GST_TYPE_FAKESRC_SIZETYPE,
+ "How to determine buffer sizes", GST_TYPE_FAKE_SRC_SIZETYPE,
DEFAULT_SIZETYPE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SIZEMIN,
g_param_spec_int ("sizemin", "sizemin", "Minimum buffer size", 0,
DEFAULT_PARENTSIZE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FILLTYPE,
g_param_spec_enum ("filltype", "filltype",
- "How to fill the buffer, if at all", GST_TYPE_FAKESRC_FILLTYPE,
+ "How to fill the buffer, if at all", GST_TYPE_FAKE_SRC_FILLTYPE,
DEFAULT_FILLTYPE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DATARATE,
g_param_spec_int ("datarate", "Datarate",
"True if the element cannot produce data in PAUSED", FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
- gst_fakesrc_signals[SIGNAL_HANDOFF] =
+ gst_fake_src_signals[SIGNAL_HANDOFF] =
g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstFakeSrcClass, handoff), NULL, NULL,
gst_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT);
- /*gstbase_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_fakesrc_is_seekable); */
- gstbase_src_class->start = GST_DEBUG_FUNCPTR (gst_fakesrc_start);
- gstbase_src_class->stop = GST_DEBUG_FUNCPTR (gst_fakesrc_stop);
- gstbase_src_class->event = GST_DEBUG_FUNCPTR (gst_fakesrc_event_handler);
- gstbase_src_class->create = GST_DEBUG_FUNCPTR (gst_fakesrc_create);
+ /*gstbase_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_fake_src_is_seekable); */
+ gstbase_src_class->start = GST_DEBUG_FUNCPTR (gst_fake_src_start);
+ gstbase_src_class->stop = GST_DEBUG_FUNCPTR (gst_fake_src_stop);
+ gstbase_src_class->event = GST_DEBUG_FUNCPTR (gst_fake_src_event_handler);
+ gstbase_src_class->create = GST_DEBUG_FUNCPTR (gst_fake_src_create);
}
static void
-gst_fakesrc_init (GstFakeSrc * fakesrc)
+gst_fake_src_init (GstFakeSrc * fakesrc)
{
- fakesrc->output = FAKESRC_FIRST_LAST_LOOP;
+ fakesrc->output = FAKE_SRC_FIRST_LAST_LOOP;
fakesrc->segment_start = -1;
fakesrc->segment_end = -1;
fakesrc->buffer_count = 0;
fakesrc->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
fakesrc->dump = DEFAULT_DUMP;
fakesrc->pattern_byte = 0x00;
- fakesrc->data = FAKESRC_DATA_ALLOCATE;
- fakesrc->sizetype = FAKESRC_SIZETYPE_NULL;
- fakesrc->filltype = FAKESRC_FILLTYPE_NOTHING;
+ fakesrc->data = FAKE_SRC_DATA_ALLOCATE;
+ fakesrc->sizetype = FAKE_SRC_SIZETYPE_NULL;
+ fakesrc->filltype = FAKE_SRC_FILLTYPE_NOTHING;
fakesrc->sizemin = DEFAULT_SIZEMIN;
fakesrc->sizemax = DEFAULT_SIZEMAX;
fakesrc->parent = NULL;
}
static gboolean
-gst_fakesrc_event_handler (GstBaseSrc * basesrc, GstEvent * event)
+gst_fake_src_event_handler (GstBaseSrc * basesrc, GstEvent * event)
{
GstFakeSrc *src;
- src = GST_FAKESRC (basesrc);
+ src = GST_FAKE_SRC (basesrc);
if (!src->silent) {
g_free (src->last_message);
}
static void
-gst_fakesrc_alloc_parent (GstFakeSrc * src)
+gst_fake_src_alloc_parent (GstFakeSrc * src)
{
GstBuffer *buf;
}
static void
-gst_fakesrc_set_property (GObject * object, guint prop_id, const GValue * value,
- GParamSpec * pspec)
+gst_fake_src_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
{
GstFakeSrc *src;
GstBaseSrc *basesrc;
- src = GST_FAKESRC (object);
+ src = GST_FAKE_SRC (object);
basesrc = GST_BASE_SRC (object);
switch (prop_id) {
case PROP_DATA:
src->data = g_value_get_enum (value);
- if (src->data == FAKESRC_DATA_SUBBUFFER) {
+ if (src->data == FAKE_SRC_DATA_SUBBUFFER) {
if (!src->parent)
- gst_fakesrc_alloc_parent (src);
+ gst_fake_src_alloc_parent (src);
} else {
if (src->parent) {
gst_buffer_unref (src->parent);
}
static void
-gst_fakesrc_get_property (GObject * object, guint prop_id, GValue * value,
+gst_fake_src_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFakeSrc *src;
GstBaseSrc *basesrc;
- g_return_if_fail (GST_IS_FAKESRC (object));
+ g_return_if_fail (GST_IS_FAKE_SRC (object));
- src = GST_FAKESRC (object);
+ src = GST_FAKE_SRC (object);
basesrc = GST_BASE_SRC (object);
switch (prop_id) {
}
static void
-gst_fakesrc_prepare_buffer (GstFakeSrc * src, GstBuffer * buf)
+gst_fake_src_prepare_buffer (GstFakeSrc * src, GstBuffer * buf)
{
if (GST_BUFFER_SIZE (buf) == 0)
return;
switch (src->filltype) {
- case FAKESRC_FILLTYPE_NULL:
+ case FAKE_SRC_FILLTYPE_NULL:
memset (GST_BUFFER_DATA (buf), 0, GST_BUFFER_SIZE (buf));
break;
- case FAKESRC_FILLTYPE_RANDOM:
+ case FAKE_SRC_FILLTYPE_RANDOM:
{
gint i;
guint8 *ptr = GST_BUFFER_DATA (buf);
}
break;
}
- case FAKESRC_FILLTYPE_PATTERN:
+ case FAKE_SRC_FILLTYPE_PATTERN:
src->pattern_byte = 0x00;
- case FAKESRC_FILLTYPE_PATTERN_CONT:
+ case FAKE_SRC_FILLTYPE_PATTERN_CONT:
{
gint i;
guint8 *ptr = GST_BUFFER_DATA (buf);
}
break;
}
- case FAKESRC_FILLTYPE_NOTHING:
+ case FAKE_SRC_FILLTYPE_NOTHING:
default:
break;
}
}
static GstBuffer *
-gst_fakesrc_alloc_buffer (GstFakeSrc * src, guint size)
+gst_fake_src_alloc_buffer (GstFakeSrc * src, guint size)
{
GstBuffer *buf;
if (size != 0) {
switch (src->filltype) {
- case FAKESRC_FILLTYPE_NOTHING:
+ case FAKE_SRC_FILLTYPE_NOTHING:
GST_BUFFER_DATA (buf) = g_malloc (size);
break;
- case FAKESRC_FILLTYPE_NULL:
+ case FAKE_SRC_FILLTYPE_NULL:
GST_BUFFER_DATA (buf) = g_malloc0 (size);
break;
- case FAKESRC_FILLTYPE_RANDOM:
- case FAKESRC_FILLTYPE_PATTERN:
- case FAKESRC_FILLTYPE_PATTERN_CONT:
+ case FAKE_SRC_FILLTYPE_RANDOM:
+ case FAKE_SRC_FILLTYPE_PATTERN:
+ case FAKE_SRC_FILLTYPE_PATTERN_CONT:
default:
GST_BUFFER_DATA (buf) = g_malloc (size);
- gst_fakesrc_prepare_buffer (src, buf);
+ gst_fake_src_prepare_buffer (src, buf);
break;
}
}
}
static guint
-gst_fakesrc_get_size (GstFakeSrc * src)
+gst_fake_src_get_size (GstFakeSrc * src)
{
guint size;
switch (src->sizetype) {
- case FAKESRC_SIZETYPE_FIXED:
+ case FAKE_SRC_SIZETYPE_FIXED:
size = src->sizemax;
break;
- case FAKESRC_SIZETYPE_RANDOM:
+ case FAKE_SRC_SIZETYPE_RANDOM:
size =
src->sizemin +
(guint8) (((gfloat) src->sizemax) * rand () / (RAND_MAX +
(gfloat) src->sizemin));
break;
- case FAKESRC_SIZETYPE_NULL:
+ case FAKE_SRC_SIZETYPE_NULL:
default:
size = 0;
break;
}
static GstBuffer *
-gst_fakesrc_create_buffer (GstFakeSrc * src)
+gst_fake_src_create_buffer (GstFakeSrc * src)
{
GstBuffer *buf;
guint size;
gboolean dump = src->dump;
- size = gst_fakesrc_get_size (src);
+ size = gst_fake_src_get_size (src);
if (size == 0)
return gst_buffer_new ();
switch (src->data) {
- case FAKESRC_DATA_ALLOCATE:
- buf = gst_fakesrc_alloc_buffer (src, size);
+ case FAKE_SRC_DATA_ALLOCATE:
+ buf = gst_fake_src_alloc_buffer (src, size);
break;
- case FAKESRC_DATA_SUBBUFFER:
+ case FAKE_SRC_DATA_SUBBUFFER:
/* see if we have a parent to subbuffer */
if (!src->parent) {
- gst_fakesrc_alloc_parent (src);
+ gst_fake_src_alloc_parent (src);
g_assert (src->parent);
}
/* see if it's large enough */
gst_buffer_unref (src->parent);
src->parent = NULL;
/* try again (this will allocate a new parent) */
- return gst_fakesrc_create_buffer (src);
+ return gst_fake_src_create_buffer (src);
}
- gst_fakesrc_prepare_buffer (src, buf);
+ gst_fake_src_prepare_buffer (src, buf);
break;
default:
g_warning ("fakesrc: dunno how to allocate buffers !");
}
static GstFlowReturn
-gst_fakesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
+gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
GstBuffer ** ret)
{
GstFakeSrc *src;
GstBuffer *buf;
GstClockTime time;
- src = GST_FAKESRC (basesrc);
+ src = GST_FAKE_SRC (basesrc);
if (src->buffer_count == src->segment_end) {
GST_INFO ("buffer_count reaches segment_end %d %d", src->buffer_count,
return GST_FLOW_UNEXPECTED;
}
- buf = gst_fakesrc_create_buffer (src);
+ buf = gst_fake_src_create_buffer (src);
GST_BUFFER_OFFSET (buf) = src->buffer_count++;
time = GST_CLOCK_TIME_NONE;
if (src->signal_handoffs) {
GST_LOG_OBJECT (src, "pre handoff emit");
- g_signal_emit (G_OBJECT (src), gst_fakesrc_signals[SIGNAL_HANDOFF], 0, buf);
+ g_signal_emit (G_OBJECT (src), gst_fake_src_signals[SIGNAL_HANDOFF], 0,
+ buf);
GST_LOG_OBJECT (src, "post handoff emit");
}
}
static gboolean
-gst_fakesrc_start (GstBaseSrc * basesrc)
+gst_fake_src_start (GstBaseSrc * basesrc)
{
GstFakeSrc *src;
- src = GST_FAKESRC (basesrc);
+ src = GST_FAKE_SRC (basesrc);
src->buffer_count = 0;
src->pattern_byte = 0x00;
}
static gboolean
-gst_fakesrc_stop (GstBaseSrc * basesrc)
+gst_fake_src_stop (GstBaseSrc * basesrc)
{
GstFakeSrc *src;
- src = GST_FAKESRC (basesrc);
+ src = GST_FAKE_SRC (basesrc);
if (src->parent) {
gst_buffer_unref (src->parent);
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfakesrc.h:
+ * gstfakesrc.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*/
-#ifndef __GST_FAKESRC_H__
-#define __GST_FAKESRC_H__
+#ifndef __GST_FAKE_SRC_H__
+#define __GST_FAKE_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstbasesrc.h>
G_BEGIN_DECLS
typedef enum {
- FAKESRC_FIRST_LAST_LOOP = 1,
- FAKESRC_LAST_FIRST_LOOP,
- FAKESRC_PING_PONG,
- FAKESRC_ORDERED_RANDOM,
- FAKESRC_RANDOM,
- FAKESRC_PATTERN_LOOP,
- FAKESRC_PING_PONG_PATTERN,
- FAKESRC_GET_ALWAYS_SUCEEDS
+ FAKE_SRC_FIRST_LAST_LOOP = 1,
+ FAKE_SRC_LAST_FIRST_LOOP,
+ FAKE_SRC_PING_PONG,
+ FAKE_SRC_ORDERED_RANDOM,
+ FAKE_SRC_RANDOM,
+ FAKE_SRC_PATTERN_LOOP,
+ FAKE_SRC_PING_PONG_PATTERN,
+ FAKE_SRC_GET_ALWAYS_SUCEEDS
} GstFakeSrcOutputType;
typedef enum {
- FAKESRC_DATA_ALLOCATE = 1,
- FAKESRC_DATA_SUBBUFFER
+ FAKE_SRC_DATA_ALLOCATE = 1,
+ FAKE_SRC_DATA_SUBBUFFER
} GstFakeSrcDataType;
typedef enum {
- FAKESRC_SIZETYPE_NULL = 1,
- FAKESRC_SIZETYPE_FIXED,
- FAKESRC_SIZETYPE_RANDOM
+ FAKE_SRC_SIZETYPE_NULL = 1,
+ FAKE_SRC_SIZETYPE_FIXED,
+ FAKE_SRC_SIZETYPE_RANDOM
} GstFakeSrcSizeType;
typedef enum {
- FAKESRC_FILLTYPE_NOTHING = 1,
- FAKESRC_FILLTYPE_NULL,
- FAKESRC_FILLTYPE_RANDOM,
- FAKESRC_FILLTYPE_PATTERN,
- FAKESRC_FILLTYPE_PATTERN_CONT
+ FAKE_SRC_FILLTYPE_NOTHING = 1,
+ FAKE_SRC_FILLTYPE_NULL,
+ FAKE_SRC_FILLTYPE_RANDOM,
+ FAKE_SRC_FILLTYPE_PATTERN,
+ FAKE_SRC_FILLTYPE_PATTERN_CONT
} GstFakeSrcFillType;
-#define GST_TYPE_FAKESRC \
- (gst_fakesrc_get_type())
-#define GST_FAKESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKESRC,GstFakeSrc))
-#define GST_FAKESRC_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKESRC,GstFakeSrcClass))
-#define GST_IS_FAKESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESRC))
-#define GST_IS_FAKESRC_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESRC))
+#define GST_TYPE_FAKE_SRC \
+ (gst_fake_src_get_type())
+#define GST_FAKE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FAKE_SRC,GstFakeSrc))
+#define GST_FAKE_SRC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FAKE_SRC,GstFakeSrcClass))
+#define GST_IS_FAKE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKE_SRC))
+#define GST_IS_FAKE_SRC_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKE_SRC))
typedef struct _GstFakeSrc GstFakeSrc;
typedef struct _GstFakeSrcClass GstFakeSrcClass;
GstBaseSrc element;
/*< private >*/
- gboolean has_loop;
- gboolean has_getrange;
+ gboolean has_loop;
+ gboolean has_getrange;
GstFakeSrcOutputType output;
GstFakeSrcDataType data;
GstFakeSrcSizeType sizetype;
GstFakeSrcFillType filltype;
- guint sizemin;
- guint sizemax;
- GstBuffer *parent;
- guint parentsize;
- guint parentoffset;
- guint8 pattern_byte;
- gchar *pattern;
- GList *patternlist;
+ guint sizemin;
+ guint sizemax;
+ GstBuffer *parent;
+ guint parentsize;
+ guint parentoffset;
+ guint8 pattern_byte;
+ gchar *pattern;
+ GList *patternlist;
gint datarate;
gboolean sync;
GstClock *clock;
gint64 segment_start;
gint64 segment_end;
gboolean segment_loop;
- gint num_buffers;
- gint rt_num_buffers; /* we are going to change this at runtime */
- guint64 buffer_count;
- gboolean silent;
- gboolean signal_handoffs;
- gboolean dump;
+ gint num_buffers;
+ gint rt_num_buffers; /* we are going to change this at runtime */
+ guint64 buffer_count;
+ gboolean silent;
+ gboolean signal_handoffs;
+ gboolean dump;
guint64 bytes_sent;
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
-GType gst_fakesrc_get_type(void);
+GType gst_fake_src_get_type (void);
G_END_DECLS
-#endif /* __GST_FAKESRC_H__ */
+#endif /* __GST_FAKE_SRC_H__ */
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfilesink.c:
+ * gstfilesink.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
-GST_DEBUG_CATEGORY_STATIC (gst_filesink_debug);
-#define GST_CAT_DEFAULT gst_filesink_debug
+GST_DEBUG_CATEGORY_STATIC (gst_file_sink_debug);
+#define GST_CAT_DEFAULT gst_file_sink_debug
-GstElementDetails gst_filesink_details = GST_ELEMENT_DETAILS ("File Sink",
+GstElementDetails gst_file_sink_details = GST_ELEMENT_DETAILS ("File Sink",
"Sink/File",
"Write stream to a file",
"Thomas <thomas@apestaart.org>");
ARG_LOCATION
};
-static void gst_filesink_dispose (GObject * object);
+static void gst_file_sink_dispose (GObject * object);
-static void gst_filesink_set_property (GObject * object, guint prop_id,
+static void gst_file_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_filesink_get_property (GObject * object, guint prop_id,
+static void gst_file_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static gboolean gst_filesink_open_file (GstFileSink * sink);
-static void gst_filesink_close_file (GstFileSink * sink);
+static gboolean gst_file_sink_open_file (GstFileSink * sink);
+static void gst_file_sink_close_file (GstFileSink * sink);
-static gboolean gst_filesink_event (GstBaseSink * sink, GstEvent * event);
-static GstFlowReturn gst_filesink_render (GstBaseSink * sink,
+static gboolean gst_file_sink_event (GstBaseSink * sink, GstEvent * event);
+static GstFlowReturn gst_file_sink_render (GstBaseSink * sink,
GstBuffer * buffer);
-static gboolean gst_filesink_query (GstPad * pad, GstQuery * query);
+static gboolean gst_file_sink_query (GstPad * pad, GstQuery * query);
-static void gst_filesink_uri_handler_init (gpointer g_iface,
+static void gst_file_sink_uri_handler_init (gpointer g_iface,
gpointer iface_data);
-static GstElementStateReturn gst_filesink_change_state (GstElement * element);
+static GstElementStateReturn gst_file_sink_change_state (GstElement * element);
-//static guint gst_filesink_signals[LAST_SIGNAL] = { 0 };
+//static guint gst_file_sink_signals[LAST_SIGNAL] = { 0 };
static void
_do_init (GType filesink_type)
{
static const GInterfaceInfo urihandler_info = {
- gst_filesink_uri_handler_init,
+ gst_file_sink_uri_handler_init,
NULL,
NULL
};
g_type_add_interface_static (filesink_type, GST_TYPE_URI_HANDLER,
&urihandler_info);
- GST_DEBUG_CATEGORY_INIT (gst_filesink_debug, "filesink", 0,
+ GST_DEBUG_CATEGORY_INIT (gst_file_sink_debug, "filesink", 0,
"filesink element");
}
-GST_BOILERPLATE_FULL (GstFileSink, gst_filesink, GstBaseSink,
+GST_BOILERPLATE_FULL (GstFileSink, gst_file_sink, GstBaseSink,
GST_TYPE_BASE_SINK, _do_init);
static void
-gst_filesink_base_init (gpointer g_class)
+gst_file_sink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gstelement_class->change_state = gst_filesink_change_state;
+ gstelement_class->change_state = gst_file_sink_change_state;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
- gst_element_class_set_details (gstelement_class, &gst_filesink_details);
+ gst_element_class_set_details (gstelement_class, &gst_file_sink_details);
}
static void
-gst_filesink_class_init (GstFileSinkClass * klass)
+gst_file_sink_class_init (GstFileSinkClass * klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstBaseSinkClass *gstbasesink_class = GST_BASE_SINK_CLASS (klass);
- gobject_class->set_property = gst_filesink_set_property;
- gobject_class->get_property = gst_filesink_get_property;
+ gobject_class->set_property = gst_file_sink_set_property;
+ gobject_class->get_property = gst_file_sink_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION,
g_param_spec_string ("location", "File Location",
"Location of the file to write", NULL, G_PARAM_READWRITE));
- gobject_class->dispose = gst_filesink_dispose;
+ gobject_class->dispose = gst_file_sink_dispose;
- gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_filesink_render);
- gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_filesink_event);
+ gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_file_sink_render);
+ gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_file_sink_event);
}
static void
-gst_filesink_init (GstFileSink * filesink)
+gst_file_sink_init (GstFileSink * filesink)
{
GstPad *pad;
pad = GST_BASE_SINK_PAD (filesink);
- gst_pad_set_query_function (pad, gst_filesink_query);
+ gst_pad_set_query_function (pad, gst_file_sink_query);
filesink->filename = NULL;
filesink->file = NULL;
}
static void
-gst_filesink_dispose (GObject * object)
+gst_file_sink_dispose (GObject * object)
{
- GstFileSink *sink = GST_FILESINK (object);
+ GstFileSink *sink = GST_FILE_SINK (object);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static gboolean
-gst_filesink_set_location (GstFileSink * sink, const gchar * location)
+gst_file_sink_set_location (GstFileSink * sink, const gchar * location)
{
/* the element must be stopped or paused in order to do this */
if (GST_STATE (sink) >= GST_STATE_PAUSED)
return TRUE;
}
static void
-gst_filesink_set_property (GObject * object, guint prop_id,
+gst_file_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstFileSink *sink;
- sink = GST_FILESINK (object);
+ sink = GST_FILE_SINK (object);
switch (prop_id) {
case ARG_LOCATION:
- gst_filesink_set_location (sink, g_value_get_string (value));
+ gst_file_sink_set_location (sink, g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
static void
-gst_filesink_get_property (GObject * object, guint prop_id, GValue * value,
+gst_file_sink_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFileSink *sink;
- g_return_if_fail (GST_IS_FILESINK (object));
+ g_return_if_fail (GST_IS_FILE_SINK (object));
- sink = GST_FILESINK (object);
+ sink = GST_FILE_SINK (object);
switch (prop_id) {
case ARG_LOCATION:
}
static gboolean
-gst_filesink_open_file (GstFileSink * sink)
+gst_file_sink_open_file (GstFileSink * sink)
{
/* open the file */
if (sink->filename == NULL || sink->filename[0] == '\0') {
}
static void
-gst_filesink_close_file (GstFileSink * sink)
+gst_file_sink_close_file (GstFileSink * sink)
{
if (fclose (sink->file) != 0) {
GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE,
}
static gboolean
-gst_filesink_query (GstPad * pad, GstQuery * query)
+gst_file_sink_query (GstPad * pad, GstQuery * query)
{
GstFileSink *self;
GstFormat format;
- self = GST_FILESINK (GST_PAD_PARENT (pad));
+ self = GST_FILE_SINK (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
/* handle events (search) */
static gboolean
-gst_filesink_event (GstBaseSink * sink, GstEvent * event)
+gst_file_sink_event (GstBaseSink * sink, GstEvent * event)
{
GstEventType type;
GstFileSink *filesink;
- filesink = GST_FILESINK (sink);
+ filesink = GST_FILE_SINK (sink);
type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
}
/**
- * gst_filesink_chain:
+ * gst_file_sink_chain:
* @pad: the pad this filesink is connected to
* @buf: the buffer that has to be absorbed
*
* take the buffer from the pad and write to file if it's open
*/
static GstFlowReturn
-gst_filesink_render (GstBaseSink * sink, GstBuffer * buffer)
+gst_file_sink_render (GstBaseSink * sink, GstBuffer * buffer)
{
GstFileSink *filesink;
guint size, back_pending = 0;
size = GST_BUFFER_SIZE (buffer);
- filesink = GST_FILESINK (sink);
+ filesink = GST_FILE_SINK (sink);
if (ftell (filesink->file) < filesink->data_written)
back_pending = filesink->data_written - ftell (filesink->file);
}
static GstElementStateReturn
-gst_filesink_change_state (GstElement * element)
+gst_file_sink_change_state (GstElement * element)
{
GstElementStateReturn ret;
gint transition;
case GST_STATE_NULL_TO_READY:
break;
case GST_STATE_READY_TO_PAUSED:
- if (!gst_filesink_open_file (GST_FILESINK (element)))
+ if (!gst_file_sink_open_file (GST_FILE_SINK (element)))
goto open_error;
break;
case GST_STATE_PAUSED_TO_PLAYING:
case GST_STATE_PLAYING_TO_PAUSED:
break;
case GST_STATE_PAUSED_TO_READY:
- gst_filesink_close_file (GST_FILESINK (element));
+ gst_file_sink_close_file (GST_FILE_SINK (element));
break;
case GST_STATE_READY_TO_NULL:
break;
/*** GSTURIHANDLER INTERFACE *************************************************/
static guint
-gst_filesink_uri_get_type (void)
+gst_file_sink_uri_get_type (void)
{
return GST_URI_SINK;
}
static gchar **
-gst_filesink_uri_get_protocols (void)
+gst_file_sink_uri_get_protocols (void)
{
static gchar *protocols[] = { "file", NULL };
return protocols;
}
static const gchar *
-gst_filesink_uri_get_uri (GstURIHandler * handler)
+gst_file_sink_uri_get_uri (GstURIHandler * handler)
{
- GstFileSink *sink = GST_FILESINK (handler);
+ GstFileSink *sink = GST_FILE_SINK (handler);
return sink->uri;
}
static gboolean
-gst_filesink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
+gst_file_sink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
{
gchar *protocol, *location;
gboolean ret;
- GstFileSink *sink = GST_FILESINK (handler);
+ GstFileSink *sink = GST_FILE_SINK (handler);
protocol = gst_uri_get_protocol (uri);
if (strcmp (protocol, "file") != 0) {
}
g_free (protocol);
location = gst_uri_get_location (uri);
- ret = gst_filesink_set_location (sink, location);
+ ret = gst_file_sink_set_location (sink, location);
g_free (location);
return ret;
}
static void
-gst_filesink_uri_handler_init (gpointer g_iface, gpointer iface_data)
+gst_file_sink_uri_handler_init (gpointer g_iface, gpointer iface_data)
{
GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
- iface->get_type = gst_filesink_uri_get_type;
- iface->get_protocols = gst_filesink_uri_get_protocols;
- iface->get_uri = gst_filesink_uri_get_uri;
- iface->set_uri = gst_filesink_uri_set_uri;
+ iface->get_type = gst_file_sink_uri_get_type;
+ iface->get_protocols = gst_file_sink_uri_get_protocols;
+ iface->get_uri = gst_file_sink_uri_get_uri;
+ iface->set_uri = gst_file_sink_uri_set_uri;
}
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * gstfilesink.h:
+ * gstfilesink.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
*/
-#ifndef __GST_FILESINK_H__
-#define __GST_FILESINK_H__
+#ifndef __GST_FILE_SINK_H__
+#define __GST_FILE_SINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
G_BEGIN_DECLS
-#define GST_TYPE_FILESINK \
- (gst_filesink_get_type())
-#define GST_FILESINK(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILESINK,GstFileSink))
-#define GST_FILESINK_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILESINK,GstFileSinkClass))
-#define GST_IS_FILESINK(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILESINK))
-#define GST_IS_FILESINK_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILESINK))
+#define GST_TYPE_FILE_SINK \
+ (gst_file_sink_get_type())
+#define GST_FILE_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILE_SINK,GstFileSink))
+#define GST_FILE_SINK_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILE_SINK,GstFileSinkClass))
+#define GST_IS_FILE_SINK(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILE_SINK))
+#define GST_IS_FILE_SINK_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILE_SINK))
typedef struct _GstFileSink GstFileSink;
typedef struct _GstFileSinkClass GstFileSinkClass;
GstBaseSinkClass parent_class;
};
-GType gst_filesink_get_type(void);
+GType gst_file_sink_get_type(void);
G_END_DECLS
-#endif /* __GST_FILESINK_H__ */
+#endif /* __GST_FILE_SINK_H__ */
*
* To handle refcounting so that the mmap can be freed at the appropriate
* time, a buffer will be created for each mmap'd region, and all new
- * buffers will be sub-buffers of this top-level buffer. As they are
+ * buffers will be sub-buffers of this top-level buffer. As they are
* freed, the refcount goes down on the mmap'd buffer and its free()
* function is called, which will call munmap(2) on itself.
*
*/
-GST_DEBUG_CATEGORY_STATIC (gst_filesrc_debug);
-#define GST_CAT_DEFAULT gst_filesrc_debug
+GST_DEBUG_CATEGORY_STATIC (gst_file_src_debug);
+#define GST_CAT_DEFAULT gst_file_src_debug
-GstElementDetails gst_filesrc_details = GST_ELEMENT_DETAILS ("File Source",
+GstElementDetails gst_file_src_details = GST_ELEMENT_DETAILS ("File Source",
"Source/File",
"Read from arbitrary point in a file",
"Erik Walthinsen <omega@cse.ogi.edu>");
LAST_SIGNAL
};
-#define DEFAULT_BLOCKSIZE 4*1024
-#define DEFAULT_MMAPSIZE 4*1024*1024
-#define DEFAULT_TOUCH FALSE
+#define DEFAULT_BLOCKSIZE 4*1024
+#define DEFAULT_MMAPSIZE 4*1024*1024
+#define DEFAULT_TOUCH FALSE
enum
{
ARG_TOUCH
};
-static void gst_filesrc_finalize (GObject * object);
+static void gst_file_src_finalize (GObject * object);
-static void gst_filesrc_set_property (GObject * object, guint prop_id,
+static void gst_file_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
-static void gst_filesrc_get_property (GObject * object, guint prop_id,
+static void gst_file_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static gboolean gst_filesrc_start (GstBaseSrc * basesrc);
-static gboolean gst_filesrc_stop (GstBaseSrc * basesrc);
+static gboolean gst_file_src_start (GstBaseSrc * basesrc);
+static gboolean gst_file_src_stop (GstBaseSrc * basesrc);
-static gboolean gst_filesrc_is_seekable (GstBaseSrc * src);
-static gboolean gst_filesrc_get_size (GstBaseSrc * src, guint64 * size);
-static GstFlowReturn gst_filesrc_create (GstBaseSrc * src, guint64 offset,
+static gboolean gst_file_src_is_seekable (GstBaseSrc * src);
+static gboolean gst_file_src_get_size (GstBaseSrc * src, guint64 * size);
+static GstFlowReturn gst_file_src_create (GstBaseSrc * src, guint64 offset,
guint length, GstBuffer ** buffer);
-static void gst_filesrc_uri_handler_init (gpointer g_iface,
+static void gst_file_src_uri_handler_init (gpointer g_iface,
gpointer iface_data);
static void
_do_init (GType filesrc_type)
{
static const GInterfaceInfo urihandler_info = {
- gst_filesrc_uri_handler_init,
+ gst_file_src_uri_handler_init,
NULL,
NULL
};
g_type_add_interface_static (filesrc_type, GST_TYPE_URI_HANDLER,
&urihandler_info);
- GST_DEBUG_CATEGORY_INIT (gst_filesrc_debug, "filesrc", 0, "filesrc element");
+ GST_DEBUG_CATEGORY_INIT (gst_file_src_debug, "filesrc", 0, "filesrc element");
}
-GST_BOILERPLATE_FULL (GstFileSrc, gst_filesrc, GstBaseSrc, GST_TYPE_BASE_SRC,
+GST_BOILERPLATE_FULL (GstFileSrc, gst_file_src, GstBaseSrc, GST_TYPE_BASE_SRC,
_do_init);
static void
-gst_filesrc_base_init (gpointer g_class)
+gst_file_src_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
- gst_element_class_set_details (gstelement_class, &gst_filesrc_details);
+ gst_element_class_set_details (gstelement_class, &gst_file_src_details);
}
static void
-gst_filesrc_class_init (GstFileSrcClass * klass)
+gst_file_src_class_init (GstFileSrcClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gstelement_class = (GstElementClass *) klass;
gstbasesrc_class = (GstBaseSrcClass *) klass;
- gobject_class->set_property = gst_filesrc_set_property;
- gobject_class->get_property = gst_filesrc_get_property;
+ gobject_class->set_property = gst_file_src_set_property;
+ gobject_class->get_property = gst_file_src_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "File-descriptor",
g_param_spec_boolean ("touch", "Touch read data",
"Touch data to force disk read", DEFAULT_TOUCH, G_PARAM_READWRITE));
- gobject_class->finalize = gst_filesrc_finalize;
+ gobject_class->finalize = gst_file_src_finalize;
- gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_filesrc_start);
- gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_filesrc_stop);
- gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_filesrc_is_seekable);
- gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_filesrc_get_size);
- gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_filesrc_create);
+ gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_file_src_start);
+ gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_file_src_stop);
+ gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_file_src_is_seekable);
+ gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_file_src_get_size);
+ gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_file_src_create);
}
static void
-gst_filesrc_init (GstFileSrc * src)
+gst_file_src_init (GstFileSrc * src)
{
#ifdef HAVE_MMAP
src->pagesize = getpagesize ();
}
static void
-gst_filesrc_finalize (GObject * object)
+gst_file_src_finalize (GObject * object)
{
GstFileSrc *src;
- src = GST_FILESRC (object);
+ src = GST_FILE_SRC (object);
g_free (src->filename);
g_free (src->uri);
}
static gboolean
-gst_filesrc_set_location (GstFileSrc * src, const gchar * location)
+gst_file_src_set_location (GstFileSrc * src, const gchar * location)
{
/* the element must be stopped in order to do this */
GST_STATE_LOCK (src);
}
static void
-gst_filesrc_set_property (GObject * object, guint prop_id, const GValue * value,
- GParamSpec * pspec)
+gst_file_src_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
{
GstFileSrc *src;
- g_return_if_fail (GST_IS_FILESRC (object));
+ g_return_if_fail (GST_IS_FILE_SRC (object));
- src = GST_FILESRC (object);
+ src = GST_FILE_SRC (object);
switch (prop_id) {
case ARG_LOCATION:
- gst_filesrc_set_location (src, g_value_get_string (value));
+ gst_file_src_set_location (src, g_value_get_string (value));
break;
case ARG_MMAPSIZE:
if ((src->mapsize % src->pagesize) == 0) {
}
static void
-gst_filesrc_get_property (GObject * object, guint prop_id, GValue * value,
+gst_file_src_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFileSrc *src;
- g_return_if_fail (GST_IS_FILESRC (object));
+ g_return_if_fail (GST_IS_FILE_SRC (object));
- src = GST_FILESRC (object);
+ src = GST_FILE_SRC (object);
switch (prop_id) {
case ARG_LOCATION:
}
static GstBuffer *
-gst_filesrc_map_region (GstFileSrc * src, off_t offset, size_t size)
+gst_file_src_map_region (GstFileSrc * src, off_t offset, size_t size)
{
GstBuffer *buf;
void *mmapregion;
}
static GstBuffer *
-gst_filesrc_map_small_region (GstFileSrc * src, off_t offset, size_t size)
+gst_file_src_map_small_region (GstFileSrc * src, off_t offset, size_t size)
{
GstBuffer *ret;
off_t mod;
"not on page boundaries, resizing to map to %llu+%d",
(unsigned long long) mapbase, (gint) mapsize);
- map = gst_filesrc_map_region (src, mapbase, mapsize);
+ map = gst_file_src_map_region (src, mapbase, mapsize);
if (map == NULL)
return NULL;
gst_buffer_unref (map);
} else {
- ret = gst_filesrc_map_region (src, offset, size);
+ ret = gst_file_src_map_region (src, offset, size);
}
return ret;
}
static GstFlowReturn
-gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
+gst_file_src_create_mmap (GstFileSrc * src, guint64 offset, guint length,
GstBuffer ** buffer)
{
GstBuffer *buf = NULL;
"read buf %llu+%d starts in mapbuf %d+%d but ends outside, creating new mmap",
(unsigned long long) offset, (gint) readsize, (gint) mapstart,
(gint) mapsize);
- buf = gst_filesrc_map_small_region (src, offset, readsize);
+ buf = gst_file_src_map_small_region (src, offset, readsize);
if (buf == NULL)
goto could_not_mmap;
}
"read buf %llu+%d starts before mapbuf %d+%d, but overlaps it",
(unsigned long long) offset, (gint) readsize, (gint) mapstart,
(gint) mapsize);
- buf = gst_filesrc_map_small_region (src, offset, readsize);
+ buf = gst_file_src_map_small_region (src, offset, readsize);
if (buf == NULL)
goto could_not_mmap;
}
GST_LOG_OBJECT (src,
"read buf %llu+%d crosses a %d-byte boundary, creating a one-off",
offset, (int) readsize, (int) src->mapsize);
- buf = gst_filesrc_map_small_region (src, offset, readsize);
+ buf = gst_file_src_map_small_region (src, offset, readsize);
if (buf == NULL)
goto could_not_mmap;
mapsize <<= 1;
}
/* create a new one */
- src->mapbuf = gst_filesrc_map_region (src, nextmap, mapsize);
+ src->mapbuf = gst_file_src_map_region (src, nextmap, mapsize);
if (src->mapbuf == NULL)
goto could_not_mmap;
#endif
/***
- * read code below
+ * read code below
+ * that is to say, you shouldn't read the code below, but the code that reads
+ * stuff is below. Well, you shouldn't not read the code below, feel free
+ * to read it of course. It's just that "read code below" is a pretty crappy
+ * documentation string because it sounds like we're expecting you to read
+ * the code to understand what it does, which, while true, is really not
+ * the sort of attitude we want to be advertising. No sir.
*
*/
static GstFlowReturn
-gst_filesrc_create_read (GstFileSrc * src, guint64 offset, guint length,
+gst_file_src_create_read (GstFileSrc * src, guint64 offset, guint length,
GstBuffer ** buffer)
{
int ret;
}
static GstFlowReturn
-gst_filesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
+gst_file_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
GstBuffer ** buffer)
{
GstFileSrc *src;
GstFlowReturn ret;
- src = GST_FILESRC (basesrc);
+ src = GST_FILE_SRC (basesrc);
#ifdef HAVE_MMAP
if (src->using_mmap) {
- ret = gst_filesrc_create_mmap (src, offset, length, buffer);
+ ret = gst_file_src_create_mmap (src, offset, length, buffer);
} else {
- ret = gst_filesrc_create_read (src, offset, length, buffer);
+ ret = gst_file_src_create_read (src, offset, length, buffer);
}
#else
- ret = gst_filesrc_create_read (src, offset, length, buffer);
+ ret = gst_file_src_create_read (src, offset, length, buffer);
#endif
return ret;
}
static gboolean
-gst_filesrc_is_seekable (GstBaseSrc * src)
+gst_file_src_is_seekable (GstBaseSrc * src)
{
return TRUE;
}
static gboolean
-gst_filesrc_get_size (GstBaseSrc * basesrc, guint64 * size)
+gst_file_src_get_size (GstBaseSrc * basesrc, guint64 * size)
{
struct stat stat_results;
GstFileSrc *src;
- src = GST_FILESRC (basesrc);
+ src = GST_FILE_SRC (basesrc);
if (fstat (src->fd, &stat_results) < 0)
goto could_not_stat;
/* open the file and mmap it, necessary to go to READY state */
static gboolean
-gst_filesrc_start (GstBaseSrc * basesrc)
+gst_file_src_start (GstBaseSrc * basesrc)
{
- GstFileSrc *src = GST_FILESRC (basesrc);
+ GstFileSrc *src = GST_FILE_SRC (basesrc);
struct stat stat_results;
if (src->filename == NULL || src->filename[0] == '\0')
#ifdef HAVE_MMAP
/* FIXME: maybe we should only try to mmap if it's a regular file */
/* allocate the first mmap'd region if it's a regular file ? */
- src->mapbuf = gst_filesrc_map_region (src, 0, src->mapsize);
+ src->mapbuf = gst_file_src_map_region (src, 0, src->mapsize);
if (src->mapbuf != NULL) {
GST_DEBUG_OBJECT (src, "using mmap for file");
src->using_mmap = TRUE;
/* unmap and close the file */
static gboolean
-gst_filesrc_stop (GstBaseSrc * basesrc)
+gst_file_src_stop (GstBaseSrc * basesrc)
{
- GstFileSrc *src = GST_FILESRC (basesrc);
+ GstFileSrc *src = GST_FILE_SRC (basesrc);
/* close the file */
close (src->fd);
/*** GSTURIHANDLER INTERFACE *************************************************/
static guint
-gst_filesrc_uri_get_type (void)
+gst_file_src_uri_get_type (void)
{
return GST_URI_SRC;
}
static gchar **
-gst_filesrc_uri_get_protocols (void)
+gst_file_src_uri_get_protocols (void)
{
static gchar *protocols[] = { "file", NULL };
return protocols;
}
static const gchar *
-gst_filesrc_uri_get_uri (GstURIHandler * handler)
+gst_file_src_uri_get_uri (GstURIHandler * handler)
{
- GstFileSrc *src = GST_FILESRC (handler);
+ GstFileSrc *src = GST_FILE_SRC (handler);
return src->uri;
}
static gboolean
-gst_filesrc_uri_set_uri (GstURIHandler * handler, const gchar * uri)
+gst_file_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
{
gchar *protocol, *location;
gboolean ret;
- GstFileSrc *src = GST_FILESRC (handler);
+ GstFileSrc *src = GST_FILE_SRC (handler);
protocol = gst_uri_get_protocol (uri);
if (strcmp (protocol, "file") != 0) {
}
g_free (protocol);
location = gst_uri_get_location (uri);
- ret = gst_filesrc_set_location (src, location);
+ ret = gst_file_src_set_location (src, location);
g_free (location);
return ret;
}
static void
-gst_filesrc_uri_handler_init (gpointer g_iface, gpointer iface_data)
+gst_file_src_uri_handler_init (gpointer g_iface, gpointer iface_data)
{
GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
- iface->get_type = gst_filesrc_uri_get_type;
- iface->get_protocols = gst_filesrc_uri_get_protocols;
- iface->get_uri = gst_filesrc_uri_get_uri;
- iface->set_uri = gst_filesrc_uri_set_uri;
+ iface->get_type = gst_file_src_uri_get_type;
+ iface->get_protocols = gst_file_src_uri_get_protocols;
+ iface->get_uri = gst_file_src_uri_get_uri;
+ iface->set_uri = gst_file_src_uri_set_uri;
}
* 2000 Wim Taymans <wtay@chello.be>
* 2005 Wim Taymans <wim@fluendo.com>
*
- * gstfilesrc.h:
+ * gstfilesrc.h:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* Boston, MA 02111-1307, USA.
*/
-#ifndef __GST_FILESRC_H__
-#define __GST_FILESRC_H__
+#ifndef __GST_FILE_SRC_H__
+#define __GST_FILE_SRC_H__
#include <sys/types.h>
G_BEGIN_DECLS
-#define GST_TYPE_FILESRC \
- (gst_filesrc_get_type())
-#define GST_FILESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILESRC,GstFileSrc))
-#define GST_FILESRC_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILESRC,GstFileSrcClass))
-#define GST_IS_FILESRC(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILESRC))
-#define GST_IS_FILESRC_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILESRC))
+#define GST_TYPE_FILE_SRC \
+ (gst_file_src_get_type())
+#define GST_FILE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FILE_SRC,GstFileSrc))
+#define GST_FILE_SRC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FILE_SRC,GstFileSrcClass))
+#define GST_IS_FILE_SRC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILE_SRC))
+#define GST_IS_FILE_SRC_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILE_SRC))
typedef struct _GstFileSrc GstFileSrc;
typedef struct _GstFileSrcClass GstFileSrcClass;
struct _GstFileSrc {
GstBaseSrc element;
- guint pagesize; /* system page size*/
-
+ guint pagesize; /* system page size */
+
gchar *filename; /* filename */
gchar *uri; /* caching the URI */
- gint fd; /* open file descriptor*/
+ gint fd; /* open file descriptor */
guint64 read_position; /* position of fd */
gboolean touch; /* whether to touch every page */
gboolean using_mmap; /* whether we opened it with mmap */
- gboolean is_regular; /* whether it's (symlink to)
- a regular file */
+ gboolean is_regular; /* whether it's a (symlink to a)
+ regular file */
GstBuffer *mapbuf;
size_t mapsize;
};
GstBaseSrcClass parent_class;
};
-GType gst_filesrc_get_type(void);
+GType gst_file_src_get_type (void);
G_END_DECLS
-#endif /* __GST_FILESRC_H__ */
+#endif /* __GST_FILE_SRC_H__ */