mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
more autistic cleanliness in functions/names/defines
Original commit message from CVS: more autistic cleanliness in functions/names/defines
This commit is contained in:
parent
2ad8bc5a02
commit
259dec97fd
92 changed files with 1058 additions and 1129 deletions
118
ChangeLog
118
ChangeLog
|
@ -1,3 +1,121 @@
|
|||
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
|
||||
|
|
|
@ -1695,7 +1695,7 @@ GST_TYPE_FAKESRC
|
|||
GST_FAKESRC_CLASS
|
||||
GST_IS_FAKESRC_CLASS
|
||||
<SUBSECTION Private>
|
||||
gst_fakesrc_get_type
|
||||
gst_fake_src_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -1711,7 +1711,7 @@ GST_TYPE_FAKESINK
|
|||
GST_FAKESINK_CLASS
|
||||
GST_IS_FAKESINK_CLASS
|
||||
<SUBSECTION Private>
|
||||
gst_fakesink_get_type
|
||||
gst_fake_sink_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -1720,13 +1720,13 @@ gst_fakesink_get_type
|
|||
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>
|
||||
|
@ -1736,13 +1736,13 @@ GstFileSink
|
|||
|
||||
<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>
|
||||
|
|
|
@ -50,7 +50,7 @@ gst_base_transform_get_type
|
|||
#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
|
||||
|
|
|
@ -87,9 +87,6 @@ Check out both <ulink url="http://www.cse.ogi.edu/sysl/">OGI's
|
|||
pipeline</ulink> and Microsoft's DirectShow for some background.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_init ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GstBaseSink
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstBaseSink ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GstBaseSrc
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstBaseSrc ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GstBaseTransform
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstBaseTransform ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -55,9 +55,6 @@ clock providers in the bin.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstBin ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -85,9 +85,6 @@ Last reviewed on August 12th, 2004 (0.8.5)
|
|||
#GstPad, #GstMiniObject
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstBuffer ##### -->
|
||||
<para>
|
||||
The basic structure of a buffer.
|
||||
|
|
|
@ -14,9 +14,6 @@ Structure describing sets of media formats
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstCaps ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -22,9 +22,6 @@ a good measure of the current playback time in the pipeline.
|
|||
#GstSystemClock
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstClock ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -16,6 +16,3 @@ This can be done in CFLAGS for compiling old code.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
|
|
|
@ -37,9 +37,6 @@ If a subsystem is disabled in GStreamer, a value is defined in
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_DISABLE_LOADSAVE_REGISTRY ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -65,9 +65,6 @@ and gst_element_set_clock(). You can wait for the clock to reach a given
|
|||
|
||||
<!-- basic object functions -->
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstElement ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ Defines public information about a #GstElement
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstElementDetails ##### -->
|
||||
<para>
|
||||
This struct is used to define public information about the element. It
|
||||
|
|
|
@ -54,9 +54,6 @@ so that the autopluggers can select a plugin more appropriatly
|
|||
#GstElement, #GstPlugin, #GstPluginFeature, #GstPadTemplate.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstElementFactory ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,6 +14,3 @@ all gstreamer core related enumerations
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ Categorized error messages
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### ENUM GstCoreError ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -27,9 +27,6 @@ gst_event_new_flush() creates a new flush event.
|
|||
#GstPad, #GstElement
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstEvent ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GstFakeSink
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstFakeSink ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GstFakeSrc
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstFakeSrc ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GstFileSink
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstFileSink ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GstFileSrc
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstFileSrc ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -17,9 +17,6 @@ on its own.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GstFilterFunc ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ formats can be used to perform seeking or conversions/query operations.
|
|||
#GstPad, #GstElement
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### ENUM GstFormat ##### -->
|
||||
<para>
|
||||
Standard predefined formats
|
||||
|
|
|
@ -14,9 +14,6 @@ Pseudo link pads
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstGhostPad ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ Core interface implemented by #GstElements that allows runtime querying of inter
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstImplementsInterface ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ in a pipeline.
|
|||
#GstIndexFactory
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstIndex ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GstIndexFactory is used to dynamically create GstIndex implementations.
|
|||
#GstIndex
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstIndexFactory ##### -->
|
||||
<para>
|
||||
The GstIndexFactory object
|
||||
|
|
|
@ -68,9 +68,6 @@ categories. These are explained at GST_DEBUG_CATEGORY_INIT().
|
|||
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
|
||||
|
|
|
@ -14,9 +14,6 @@ GstIterator
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstIterator ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,6 +14,3 @@ various portabillity helper macros
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
|
|
|
@ -21,9 +21,6 @@ The GstMemChunk is used to allocate critical resources for #GstBuffer and
|
|||
#GstBuffer, #GstEvent, #GstData
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstMemChunk ##### -->
|
||||
<para>
|
||||
The memchunk structure
|
||||
|
|
|
@ -14,9 +14,6 @@ GstMiniObject
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstMiniObject ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -67,9 +67,6 @@ object.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstObject ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -57,9 +57,6 @@ Last reviewed on December 13th, 2002 (0.5.0.1)
|
|||
#GstPadTemplate, #GstElement, #GstEvent
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstPad ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -73,9 +73,6 @@ The following example shows you how to add the padtemplate to an elementfactory:
|
|||
#GstPad, #GstElementFactory
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstPadTemplate ##### -->
|
||||
<para>
|
||||
The padtemplate object.
|
||||
|
|
|
@ -14,9 +14,6 @@ get a pipeline from a text pipeline description
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_parse_error_quark ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -21,9 +21,6 @@ the pipeline, use gst_object_unref() to free its resources.
|
|||
#GstBin
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstPipeline ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -35,9 +35,6 @@ to bring the plugin into memory.
|
|||
#GstPluginFeature, #GstType, #GstAutoplug, #GstElementFactory
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_plugin_error_quark ##### -->
|
||||
<para>
|
||||
Get the error quark
|
||||
|
|
|
@ -14,9 +14,6 @@ This is a base class for anything that can be added to a #GstPlugin.
|
|||
#GstPlugin
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstPluginFeature ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ Query types can be used to perform queries on pads and elements.
|
|||
#GstPad, #GstElement
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### ENUM GstQueryType ##### -->
|
||||
<para>
|
||||
Standard predefined Query types
|
||||
|
|
|
@ -25,9 +25,6 @@ The queue blocks by default.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstQueue ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -15,6 +15,3 @@ All registries build the #GstRegistryPool.
|
|||
#GstPlugin, #GstPluginFeature
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ the system.
|
|||
GstRegistry
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_registry_pool_list ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ This is a base class for custom schedulers.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstScheduler ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -31,9 +31,6 @@ Use gst_scheduler_factory_destroy() to remove the factory from the global list.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstSchedulerFactory ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ Generic structure containing fields of names and values
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstStructure ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ system time.
|
|||
#GstClock
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstSystemClock ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ List of tags and values used to describe media metadata
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### TYPEDEF GstTagList ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ Element interface that allows setting and retrieval of media metadata
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstTagSetter ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ Tracing functionality
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstTrace ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ gsttrashstack
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstTrashStack ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ typefinding subsystem
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstTypeFind ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -67,9 +67,6 @@ the given data. You can get quite a bit more complicated than that though.
|
|||
<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
|
||||
|
|
|
@ -14,9 +14,6 @@ various global enums and constants
|
|||
|
||||
</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).
|
||||
|
|
|
@ -15,9 +15,6 @@ and the element property that can handle a given URI.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstURIHandler ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ describes URI types
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### ENUM GstURIType ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ various utility functions
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_util_set_value_from_string ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ GValue implementations specific to GStreamer
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_MAKE_FOURCC ##### -->
|
||||
<para>
|
||||
will transform four characters into a host-endiannness guint32 fourcc:
|
||||
|
|
|
@ -15,9 +15,6 @@ The version macros get defined by including "gst/gst.h".
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### MACRO GST_VERSION_MAJOR ##### -->
|
||||
<para>
|
||||
The major version of GStreamer at compile time
|
||||
|
|
|
@ -14,9 +14,6 @@ XML save/restore operations of pipelines
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstXML ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -73,9 +73,6 @@ This allows the manager to interupt processing to apply new control values.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gst_control_init ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -27,9 +27,6 @@ network connections also need a protocol to do this.
|
|||
#GstBuffer, #GstCaps, #GstEvent
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### ENUM GstDPHeaderFlag ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ Subclasses of this do more advanced updates like smoothing parameter changes.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstDParam ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ linear interpolation dynamic parameter
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstDParamLinInterp ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -20,9 +20,6 @@ are for applications that use elements with dparams.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstDParamManager ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ realtime smoothed dynamic parameter
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstDParamSmooth ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ accelerated routines for getting bits from a data stream.
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT gst_getbits_t ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ conversion between units of measurement
|
|||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GstUnitConvert ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -32,8 +32,8 @@
|
|||
#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
|
||||
|
@ -49,49 +49,49 @@ 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;
|
||||
|
@ -103,24 +103,24 @@ gst_pushsrc_class_init (GstPushSrcClass * klass)
|
|||
|
||||
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
|
||||
|
|
|
@ -21,20 +21,20 @@
|
|||
* 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
|
||||
*
|
||||
|
@ -67,8 +67,8 @@ struct _GstPushSrcClass {
|
|||
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__ */
|
||||
|
|
|
@ -43,17 +43,16 @@ struct _elements_entry
|
|||
};
|
||||
|
||||
|
||||
/* 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},
|
||||
|
|
|
@ -33,10 +33,10 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
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>, "
|
||||
|
@ -52,7 +52,7 @@ enum
|
|||
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
|
||||
|
@ -70,24 +70,24 @@ enum
|
|||
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},
|
||||
};
|
||||
|
@ -100,40 +100,40 @@ gst_fakesink_state_error_get_type (void)
|
|||
}
|
||||
|
||||
#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;
|
||||
|
@ -143,12 +143,12 @@ gst_fakesink_class_init (GstFakeSinkClass * klass)
|
|||
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",
|
||||
|
@ -169,23 +169,23 @@ gst_fakesink_class_init (GstFakeSinkClass * klass)
|
|||
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;
|
||||
|
@ -196,12 +196,12 @@ gst_fakesink_init (GstFakeSink * fakesink)
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -226,12 +226,12 @@ gst_fakesink_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -259,10 +259,10 @@ gst_fakesink_get_property (GObject * object, guint prop_id, GValue * value,
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -270,9 +270,9 @@ gst_fakesink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -288,9 +288,9 @@ gst_fakesink_event (GstBaseSink * bsink, GstEvent * event)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -303,9 +303,9 @@ gst_fakesink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -322,7 +322,7 @@ gst_fakesink_render (GstBaseSink * bsink, GstBuffer * buf)
|
|||
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) {
|
||||
|
@ -333,35 +333,35 @@ gst_fakesink_render (GstBaseSink * bsink, GstBuffer * buf)
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -21,8 +21,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#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>
|
||||
|
@ -30,39 +30,39 @@
|
|||
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 {
|
||||
|
@ -72,8 +72,8 @@ 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__ */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -36,10 +36,10 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
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>, "
|
||||
|
@ -54,12 +54,12 @@ enum
|
|||
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
|
||||
|
@ -93,20 +93,20 @@ enum
|
|||
};
|
||||
|
||||
/* 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},
|
||||
};
|
||||
|
||||
|
@ -118,14 +118,14 @@ gst_fakesrc_output_get_type (void)
|
|||
}
|
||||
*/
|
||||
|
||||
#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},
|
||||
};
|
||||
|
||||
|
@ -135,15 +135,15 @@ gst_fakesrc_data_get_type (void)
|
|||
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},
|
||||
};
|
||||
|
@ -155,17 +155,17 @@ gst_fakesrc_sizetype_get_type (void)
|
|||
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},
|
||||
};
|
||||
|
@ -178,38 +178,38 @@ gst_fakesrc_filltype_get_type (void)
|
|||
}
|
||||
|
||||
#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;
|
||||
|
@ -219,22 +219,22 @@ gst_fakesrc_class_init (GstFakeSrcClass * klass)
|
|||
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,
|
||||
|
@ -248,7 +248,7 @@ gst_fakesrc_class_init (GstFakeSrcClass * klass)
|
|||
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",
|
||||
|
@ -287,22 +287,22 @@ gst_fakesrc_class_init (GstFakeSrcClass * klass)
|
|||
"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;
|
||||
|
@ -310,9 +310,9 @@ gst_fakesrc_init (GstFakeSrc * fakesrc)
|
|||
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;
|
||||
|
@ -323,11 +323,11 @@ gst_fakesrc_init (GstFakeSrc * fakesrc)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -344,7 +344,7 @@ gst_fakesrc_event_handler (GstBaseSrc * basesrc, GstEvent * event)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_fakesrc_alloc_parent (GstFakeSrc * src)
|
||||
gst_fake_src_alloc_parent (GstFakeSrc * src)
|
||||
{
|
||||
GstBuffer *buf;
|
||||
|
||||
|
@ -357,13 +357,13 @@ gst_fakesrc_alloc_parent (GstFakeSrc * src)
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -373,9 +373,9 @@ gst_fakesrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
|||
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);
|
||||
|
@ -433,15 +433,15 @@ gst_fakesrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -503,16 +503,16 @@ gst_fakesrc_get_property (GObject * object, guint prop_id, GValue * value,
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -522,9 +522,9 @@ gst_fakesrc_prepare_buffer (GstFakeSrc * src, GstBuffer * 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);
|
||||
|
@ -534,14 +534,14 @@ gst_fakesrc_prepare_buffer (GstFakeSrc * src, GstBuffer * 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;
|
||||
|
||||
|
@ -550,18 +550,18 @@ gst_fakesrc_alloc_buffer (GstFakeSrc * src, guint size)
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -570,21 +570,21 @@ gst_fakesrc_alloc_buffer (GstFakeSrc * src, guint size)
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -594,24 +594,24 @@ gst_fakesrc_get_size (GstFakeSrc * src)
|
|||
}
|
||||
|
||||
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 */
|
||||
|
@ -623,9 +623,9 @@ gst_fakesrc_create_buffer (GstFakeSrc * src)
|
|||
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 !");
|
||||
|
@ -640,14 +640,14 @@ gst_fakesrc_create_buffer (GstFakeSrc * src)
|
|||
}
|
||||
|
||||
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,
|
||||
|
@ -655,7 +655,7 @@ gst_fakesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
|
|||
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;
|
||||
|
@ -688,7 +688,8 @@ gst_fakesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
|
|||
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -699,11 +700,11 @@ gst_fakesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -713,11 +714,11 @@ gst_fakesrc_start (GstBaseSrc * basesrc)
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -21,8 +21,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#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>
|
||||
|
@ -30,45 +30,45 @@
|
|||
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;
|
||||
|
@ -77,34 +77,34 @@ struct _GstFakeSrc {
|
|||
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;
|
||||
|
||||
|
@ -119,8 +119,8 @@ struct _GstFakeSrcClass {
|
|||
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__ */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -43,10 +43,10 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
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>");
|
||||
|
@ -66,94 +66,94 @@ enum
|
|||
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);
|
||||
|
||||
|
@ -164,7 +164,7 @@ gst_filesink_dispose (GObject * 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)
|
||||
|
@ -183,16 +183,16 @@ gst_filesink_set_location (GstFileSink * sink, const gchar * location)
|
|||
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);
|
||||
|
@ -201,14 +201,14 @@ gst_filesink_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -221,7 +221,7 @@ gst_filesink_get_property (GObject * object, guint prop_id, GValue * value,
|
|||
}
|
||||
|
||||
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') {
|
||||
|
@ -244,7 +244,7 @@ gst_filesink_open_file (GstFileSink * sink)
|
|||
}
|
||||
|
||||
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,
|
||||
|
@ -253,12 +253,12 @@ gst_filesink_close_file (GstFileSink * sink)
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -284,12 +284,12 @@ gst_filesink_query (GstPad * pad, GstQuery * query)
|
|||
|
||||
/* 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;
|
||||
|
||||
|
@ -347,21 +347,21 @@ gst_filesink_event (GstBaseSink * sink, GstEvent * event)
|
|||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
@ -379,7 +379,7 @@ gst_filesink_render (GstBaseSink * sink, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
static GstElementStateReturn
|
||||
gst_filesink_change_state (GstElement * element)
|
||||
gst_file_sink_change_state (GstElement * element)
|
||||
{
|
||||
GstElementStateReturn ret;
|
||||
gint transition;
|
||||
|
@ -390,7 +390,7 @@ gst_filesink_change_state (GstElement * element)
|
|||
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:
|
||||
|
@ -405,7 +405,7 @@ gst_filesink_change_state (GstElement * element)
|
|||
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;
|
||||
|
@ -424,31 +424,31 @@ open_error:
|
|||
/*** 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) {
|
||||
|
@ -457,19 +457,19 @@ gst_filesink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -21,24 +21,24 @@
|
|||
*/
|
||||
|
||||
|
||||
#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;
|
||||
|
@ -57,8 +57,8 @@ struct _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__ */
|
||||
|
|
|
@ -73,7 +73,7 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
*
|
||||
* 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.
|
||||
*
|
||||
|
@ -97,10 +97,10 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
*/
|
||||
|
||||
|
||||
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>");
|
||||
|
@ -112,9 +112,9 @@ enum
|
|||
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
|
||||
{
|
||||
|
@ -125,54 +125,54 @@ 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;
|
||||
|
@ -182,8 +182,8 @@ gst_filesrc_class_init (GstFileSrcClass * klass)
|
|||
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",
|
||||
|
@ -200,17 +200,17 @@ gst_filesrc_class_init (GstFileSrcClass * klass)
|
|||
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 ();
|
||||
|
@ -229,11 +229,11 @@ gst_filesrc_init (GstFileSrc * src)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -242,7 +242,7 @@ gst_filesrc_finalize (GObject * object)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -281,18 +281,18 @@ wrong_state:
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -315,14 +315,14 @@ gst_filesrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -456,7 +456,7 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer)
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -509,7 +509,7 @@ mmap_failed:
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -536,7 +536,7 @@ gst_filesrc_map_small_region (GstFileSrc * src, off_t offset, size_t size)
|
|||
"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;
|
||||
|
||||
|
@ -545,14 +545,14 @@ gst_filesrc_map_small_region (GstFileSrc * src, off_t offset, size_t size)
|
|||
|
||||
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;
|
||||
|
@ -589,7 +589,7 @@ gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
|
|||
"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;
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
|
|||
"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;
|
||||
}
|
||||
|
@ -622,7 +622,7 @@ gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
|
|||
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;
|
||||
|
||||
|
@ -646,7 +646,7 @@ gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
|
|||
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;
|
||||
|
||||
|
@ -680,12 +680,18 @@ 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;
|
||||
|
@ -750,40 +756,40 @@ unexpected_eos:
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -801,9 +807,9 @@ 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')
|
||||
|
@ -836,7 +842,7 @@ gst_filesrc_start (GstBaseSrc * basesrc)
|
|||
#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;
|
||||
|
@ -892,9 +898,9 @@ was_socket:
|
|||
|
||||
/* 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);
|
||||
|
@ -914,31 +920,31 @@ gst_filesrc_stop (GstBaseSrc * basesrc)
|
|||
/*** 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) {
|
||||
|
@ -947,19 +953,19 @@ gst_filesrc_uri_set_uri (GstURIHandler * handler, const gchar * uri)
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* 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
|
||||
|
@ -21,8 +21,8 @@
|
|||
* 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>
|
||||
|
||||
|
@ -31,16 +31,16 @@
|
|||
|
||||
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;
|
||||
|
@ -48,17 +48,17 @@ 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;
|
||||
};
|
||||
|
@ -67,8 +67,8 @@ struct _GstFileSrcClass {
|
|||
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__ */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -32,8 +32,8 @@
|
|||
#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
|
||||
|
@ -49,49 +49,49 @@ 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;
|
||||
|
@ -103,24 +103,24 @@ gst_pushsrc_class_init (GstPushSrcClass * klass)
|
|||
|
||||
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
|
||||
|
|
|
@ -21,20 +21,20 @@
|
|||
* 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
|
||||
*
|
||||
|
@ -67,8 +67,8 @@ struct _GstPushSrcClass {
|
|||
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__ */
|
||||
|
|
|
@ -43,17 +43,16 @@ struct _elements_entry
|
|||
};
|
||||
|
||||
|
||||
/* 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},
|
||||
|
|
|
@ -33,10 +33,10 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
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>, "
|
||||
|
@ -52,7 +52,7 @@ enum
|
|||
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
|
||||
|
@ -70,24 +70,24 @@ enum
|
|||
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},
|
||||
};
|
||||
|
@ -100,40 +100,40 @@ gst_fakesink_state_error_get_type (void)
|
|||
}
|
||||
|
||||
#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;
|
||||
|
@ -143,12 +143,12 @@ gst_fakesink_class_init (GstFakeSinkClass * klass)
|
|||
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",
|
||||
|
@ -169,23 +169,23 @@ gst_fakesink_class_init (GstFakeSinkClass * klass)
|
|||
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;
|
||||
|
@ -196,12 +196,12 @@ gst_fakesink_init (GstFakeSink * fakesink)
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -226,12 +226,12 @@ gst_fakesink_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -259,10 +259,10 @@ gst_fakesink_get_property (GObject * object, guint prop_id, GValue * value,
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -270,9 +270,9 @@ gst_fakesink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -288,9 +288,9 @@ gst_fakesink_event (GstBaseSink * bsink, GstEvent * event)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -303,9 +303,9 @@ gst_fakesink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -322,7 +322,7 @@ gst_fakesink_render (GstBaseSink * bsink, GstBuffer * buf)
|
|||
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) {
|
||||
|
@ -333,35 +333,35 @@ gst_fakesink_render (GstBaseSink * bsink, GstBuffer * buf)
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -21,8 +21,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#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>
|
||||
|
@ -30,39 +30,39 @@
|
|||
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 {
|
||||
|
@ -72,8 +72,8 @@ 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__ */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -36,10 +36,10 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
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>, "
|
||||
|
@ -54,12 +54,12 @@ enum
|
|||
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
|
||||
|
@ -93,20 +93,20 @@ enum
|
|||
};
|
||||
|
||||
/* 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},
|
||||
};
|
||||
|
||||
|
@ -118,14 +118,14 @@ gst_fakesrc_output_get_type (void)
|
|||
}
|
||||
*/
|
||||
|
||||
#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},
|
||||
};
|
||||
|
||||
|
@ -135,15 +135,15 @@ gst_fakesrc_data_get_type (void)
|
|||
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},
|
||||
};
|
||||
|
@ -155,17 +155,17 @@ gst_fakesrc_sizetype_get_type (void)
|
|||
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},
|
||||
};
|
||||
|
@ -178,38 +178,38 @@ gst_fakesrc_filltype_get_type (void)
|
|||
}
|
||||
|
||||
#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;
|
||||
|
@ -219,22 +219,22 @@ gst_fakesrc_class_init (GstFakeSrcClass * klass)
|
|||
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,
|
||||
|
@ -248,7 +248,7 @@ gst_fakesrc_class_init (GstFakeSrcClass * klass)
|
|||
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",
|
||||
|
@ -287,22 +287,22 @@ gst_fakesrc_class_init (GstFakeSrcClass * klass)
|
|||
"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;
|
||||
|
@ -310,9 +310,9 @@ gst_fakesrc_init (GstFakeSrc * fakesrc)
|
|||
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;
|
||||
|
@ -323,11 +323,11 @@ gst_fakesrc_init (GstFakeSrc * fakesrc)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -344,7 +344,7 @@ gst_fakesrc_event_handler (GstBaseSrc * basesrc, GstEvent * event)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_fakesrc_alloc_parent (GstFakeSrc * src)
|
||||
gst_fake_src_alloc_parent (GstFakeSrc * src)
|
||||
{
|
||||
GstBuffer *buf;
|
||||
|
||||
|
@ -357,13 +357,13 @@ gst_fakesrc_alloc_parent (GstFakeSrc * src)
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -373,9 +373,9 @@ gst_fakesrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
|||
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);
|
||||
|
@ -433,15 +433,15 @@ gst_fakesrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -503,16 +503,16 @@ gst_fakesrc_get_property (GObject * object, guint prop_id, GValue * value,
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -522,9 +522,9 @@ gst_fakesrc_prepare_buffer (GstFakeSrc * src, GstBuffer * 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);
|
||||
|
@ -534,14 +534,14 @@ gst_fakesrc_prepare_buffer (GstFakeSrc * src, GstBuffer * 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;
|
||||
|
||||
|
@ -550,18 +550,18 @@ gst_fakesrc_alloc_buffer (GstFakeSrc * src, guint size)
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -570,21 +570,21 @@ gst_fakesrc_alloc_buffer (GstFakeSrc * src, guint size)
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -594,24 +594,24 @@ gst_fakesrc_get_size (GstFakeSrc * src)
|
|||
}
|
||||
|
||||
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 */
|
||||
|
@ -623,9 +623,9 @@ gst_fakesrc_create_buffer (GstFakeSrc * src)
|
|||
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 !");
|
||||
|
@ -640,14 +640,14 @@ gst_fakesrc_create_buffer (GstFakeSrc * src)
|
|||
}
|
||||
|
||||
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,
|
||||
|
@ -655,7 +655,7 @@ gst_fakesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
|
|||
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;
|
||||
|
@ -688,7 +688,8 @@ gst_fakesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
|
|||
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -699,11 +700,11 @@ gst_fakesrc_create (GstBaseSrc * basesrc, guint64 offset, guint length,
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -713,11 +714,11 @@ gst_fakesrc_start (GstBaseSrc * basesrc)
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -21,8 +21,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#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>
|
||||
|
@ -30,45 +30,45 @@
|
|||
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;
|
||||
|
@ -77,34 +77,34 @@ struct _GstFakeSrc {
|
|||
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;
|
||||
|
||||
|
@ -119,8 +119,8 @@ struct _GstFakeSrcClass {
|
|||
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__ */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -43,10 +43,10 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
|||
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>");
|
||||
|
@ -66,94 +66,94 @@ enum
|
|||
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);
|
||||
|
||||
|
@ -164,7 +164,7 @@ gst_filesink_dispose (GObject * 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)
|
||||
|
@ -183,16 +183,16 @@ gst_filesink_set_location (GstFileSink * sink, const gchar * location)
|
|||
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);
|
||||
|
@ -201,14 +201,14 @@ gst_filesink_set_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -221,7 +221,7 @@ gst_filesink_get_property (GObject * object, guint prop_id, GValue * value,
|
|||
}
|
||||
|
||||
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') {
|
||||
|
@ -244,7 +244,7 @@ gst_filesink_open_file (GstFileSink * sink)
|
|||
}
|
||||
|
||||
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,
|
||||
|
@ -253,12 +253,12 @@ gst_filesink_close_file (GstFileSink * sink)
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -284,12 +284,12 @@ gst_filesink_query (GstPad * pad, GstQuery * query)
|
|||
|
||||
/* 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;
|
||||
|
||||
|
@ -347,21 +347,21 @@ gst_filesink_event (GstBaseSink * sink, GstEvent * event)
|
|||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
@ -379,7 +379,7 @@ gst_filesink_render (GstBaseSink * sink, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
static GstElementStateReturn
|
||||
gst_filesink_change_state (GstElement * element)
|
||||
gst_file_sink_change_state (GstElement * element)
|
||||
{
|
||||
GstElementStateReturn ret;
|
||||
gint transition;
|
||||
|
@ -390,7 +390,7 @@ gst_filesink_change_state (GstElement * element)
|
|||
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:
|
||||
|
@ -405,7 +405,7 @@ gst_filesink_change_state (GstElement * element)
|
|||
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;
|
||||
|
@ -424,31 +424,31 @@ open_error:
|
|||
/*** 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) {
|
||||
|
@ -457,19 +457,19 @@ gst_filesink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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
|
||||
|
@ -21,24 +21,24 @@
|
|||
*/
|
||||
|
||||
|
||||
#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;
|
||||
|
@ -57,8 +57,8 @@ struct _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__ */
|
||||
|
|
|
@ -73,7 +73,7 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
*
|
||||
* 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.
|
||||
*
|
||||
|
@ -97,10 +97,10 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
*/
|
||||
|
||||
|
||||
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>");
|
||||
|
@ -112,9 +112,9 @@ enum
|
|||
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
|
||||
{
|
||||
|
@ -125,54 +125,54 @@ 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;
|
||||
|
@ -182,8 +182,8 @@ gst_filesrc_class_init (GstFileSrcClass * klass)
|
|||
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",
|
||||
|
@ -200,17 +200,17 @@ gst_filesrc_class_init (GstFileSrcClass * klass)
|
|||
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 ();
|
||||
|
@ -229,11 +229,11 @@ gst_filesrc_init (GstFileSrc * src)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -242,7 +242,7 @@ gst_filesrc_finalize (GObject * object)
|
|||
}
|
||||
|
||||
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);
|
||||
|
@ -281,18 +281,18 @@ wrong_state:
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -315,14 +315,14 @@ gst_filesrc_set_property (GObject * object, guint prop_id, const GValue * value,
|
|||
}
|
||||
|
||||
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:
|
||||
|
@ -456,7 +456,7 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer)
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -509,7 +509,7 @@ mmap_failed:
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -536,7 +536,7 @@ gst_filesrc_map_small_region (GstFileSrc * src, off_t offset, size_t size)
|
|||
"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;
|
||||
|
||||
|
@ -545,14 +545,14 @@ gst_filesrc_map_small_region (GstFileSrc * src, off_t offset, size_t size)
|
|||
|
||||
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;
|
||||
|
@ -589,7 +589,7 @@ gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
|
|||
"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;
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
|
|||
"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;
|
||||
}
|
||||
|
@ -622,7 +622,7 @@ gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
|
|||
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;
|
||||
|
||||
|
@ -646,7 +646,7 @@ gst_filesrc_create_mmap (GstFileSrc * src, guint64 offset, guint length,
|
|||
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;
|
||||
|
||||
|
@ -680,12 +680,18 @@ 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;
|
||||
|
@ -750,40 +756,40 @@ unexpected_eos:
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -801,9 +807,9 @@ 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')
|
||||
|
@ -836,7 +842,7 @@ gst_filesrc_start (GstBaseSrc * basesrc)
|
|||
#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;
|
||||
|
@ -892,9 +898,9 @@ was_socket:
|
|||
|
||||
/* 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);
|
||||
|
@ -914,31 +920,31 @@ gst_filesrc_stop (GstBaseSrc * basesrc)
|
|||
/*** 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) {
|
||||
|
@ -947,19 +953,19 @@ gst_filesrc_uri_set_uri (GstURIHandler * handler, const gchar * uri)
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* 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
|
||||
|
@ -21,8 +21,8 @@
|
|||
* 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>
|
||||
|
||||
|
@ -31,16 +31,16 @@
|
|||
|
||||
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;
|
||||
|
@ -48,17 +48,17 @@ 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;
|
||||
};
|
||||
|
@ -67,8 +67,8 @@ struct _GstFileSrcClass {
|
|||
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__ */
|
||||
|
|
Loading…
Reference in a new issue