mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
Merge branch 'master' into 0.11
Conflicts: configure.ac gst/gstelement.c gst/gstelement.h gst/gstpad.c gst/gstutils.c libs/gst/base/Makefile.am libs/gst/check/Makefile.am libs/gst/controller/Makefile.am libs/gst/dataprotocol/Makefile.am libs/gst/net/Makefile.am win32/common/libgstreamer.def
This commit is contained in:
commit
238b9a57cc
203 changed files with 12536 additions and 1842 deletions
66
NEWS
66
NEWS
|
@ -1,4 +1,68 @@
|
|||
This is GStreamer 0.10.31 "Safety Pins"
|
||||
This is GStreamer 0.10.32 "Take Me to the Bonus Level"
|
||||
|
||||
Changes since 0.10.31:
|
||||
|
||||
* GLib requirement is now >= 2.22
|
||||
* New core element: valve (moved from -bad)
|
||||
* New core element: input-selector (N.B. without "select-all" property,
|
||||
use fsfunnel instead) (moved from -bad)
|
||||
* New core element: output-selector (N.B. with different negotiation
|
||||
behaviour by default, set pad-negotiation-mode=active for previous
|
||||
behaviour) (moved from -bad)
|
||||
* Performance improvements for many heavily-used code paths: GstPad,
|
||||
GstPoll, GstClock, GstTask, basesink, basesrc, queue2, multiqueue
|
||||
* gobject-introspection: add annotations for most core API
|
||||
* clock: make sync clock wait lockfree
|
||||
* fdsrc/fdsink: reenable on MSVC
|
||||
* registry: fix GStatBuf definition for win32 when building against older
|
||||
glib (fixes unnecessary rescanning of plugins at start-up)
|
||||
* element: add a more flexible way to get request pads from elements
|
||||
* multiqueue: return upon input when already eos
|
||||
* object: fix creation of default name (when creating more than 100000 elements)
|
||||
* pluginloader: fix hangs on OSX
|
||||
* poll: fixes for (p)select backend (used e.g. on OSX)
|
||||
* poll: refactor and make more lockfree; fixes for win32 and OSX (pselect backend)
|
||||
* registry: don't replace valid existing plugins by blacklisted ones
|
||||
* tags: don't produce duplicated entries when merging same value twice
|
||||
* basesink: preroll fixes for async=false case
|
||||
* basesink: rework position reporting code
|
||||
* basetransform: handle downstream giving a buffer with new caps but invalid size
|
||||
|
||||
Bugs fixed since 0.10.31:
|
||||
|
||||
* 635785 : basesrc: fix deadlock
|
||||
* 638599 : GST_PTR_FORMAT causes crashes if GLib-internal printf is used but system provides register_printf_specifier
|
||||
* 503592 : gstpad.c does many ref/unref of peer pad in dataflow
|
||||
* 564056 : Protect against umask(0177)
|
||||
* 607513 : input-selector segfaults in g_object_notify()
|
||||
* 632168 : [gsttask] MSVC thread names for task debugging
|
||||
* 632447 : reduce static memory allocated by the registry
|
||||
* 632557 : [macros] Define restrict keyword if not available
|
||||
* 632778 : Optimisations to GstBaseSink
|
||||
* 632779 : gstdataqueue: Only emit g_cond_signal when needed
|
||||
* 632780 : queue: Remove useless checks from e406f7
|
||||
* 633918 : [fakesink] [PATCH] print sink-message events like a message and its structure
|
||||
* 634965 : sinks render buffers in state PAUSED when async is FALSE
|
||||
* 635001 : basesink: fix position reporting in PAUSED
|
||||
* 636268 : configure test fails on FreeBSD
|
||||
* 636455 : basesrc: Avoid taking object locks for just checking tag presence
|
||||
* 637057 : [plugin-scanner] gstpoll fails with select backend
|
||||
* 637300 : [API] request pad based on caps
|
||||
* 637549 : build fails: ./.libs/libgstbase-0.10.so: undefined reference to `gst_clock_single_shot_id_reinit'
|
||||
* 637776 : merging the same tag values again produces lists containing duplicates
|
||||
* 638381 : {input,output}-selector: double-check API before release
|
||||
* 638399 : a few typos in GStreamer
|
||||
* 638900 : [GstPoll] Doesn't compile with MinGW
|
||||
* 638941 : registry scan/loading race and inconsistency
|
||||
|
||||
API additions since 0.10.31:
|
||||
|
||||
* gst_clock_single_shot_id_reinit()
|
||||
* gst_element_request_pad()
|
||||
* GstElementClass::request_new_pad_full()
|
||||
* gst_poll_get_read_gpollfd()
|
||||
* gst_value_list_merge()
|
||||
* GST_CLOCK_DONE
|
||||
|
||||
Changes since 0.10.30:
|
||||
|
||||
|
|
317
RELEASE
317
RELEASE
|
@ -1,5 +1,5 @@
|
|||
|
||||
Release notes for GStreamer 0.10.31 "Safety Pins"
|
||||
Release notes for GStreamer 0.10.32 "Take Me to the Bonus Level"
|
||||
|
||||
|
||||
|
||||
|
@ -9,12 +9,6 @@ core of the GStreamer streaming media framework.
|
|||
|
||||
|
||||
The 0.10.x series is a stable series targeted at end users.
|
||||
It is not API or ABI compatible with the stable 0.8.x series.
|
||||
It is, however, parallel installable with the 0.8.x series.
|
||||
|
||||
|
||||
The 0.10.x series has been reworked for threadsafety. It also features
|
||||
various feature additions and enhancements.
|
||||
|
||||
|
||||
This module, gstreamer, only contains core functionality.
|
||||
|
@ -37,233 +31,64 @@ contains a set of less supported plug-ins that haven't passed the
|
|||
|
||||
Features of this release
|
||||
|
||||
* bin: add "message-forward" property to force forwarding of messages that would usually be filtered such as ASYNC_DONE or EOS
|
||||
* bin: improve tracking of source elements for more efficient event dispatch
|
||||
* bufferlist: add function to add a list of buffers
|
||||
* clock: fix racy shutdown clock id leak
|
||||
* element: add support for arbitrary element class / factory details
|
||||
* element: link_many should activate pads if needed
|
||||
* gst: add math-compat.h header
|
||||
* datetime: add GstDateTime API
|
||||
* elementfactory: add utility functions to filter features by type
|
||||
* plugin: load the gst-python plugin loader with G_MODULE_BIND_LAZY
|
||||
* query: add buffering ranges API to retrieve informations about the areas of the stream currently buffered
|
||||
* value: add int64 range type
|
||||
* info: write debugging output to file if GST_DEBUG_FILE environment variable is set
|
||||
* pad: use more efficient g_object_notify_by_pspec() for caps notifies if compiling against new-enough GLib
|
||||
* pipeline: If the currently used clock gets lost update it the next time when going from PAUSED to playing
|
||||
* plugin: add release datetime field to GstPluginDesc and set it if GST_PACKAGE_RELEASE_DATETIME is defined
|
||||
* utils: speed up pad linking utility functions by not trying pads that will never work
|
||||
* adapter: add function to get a list of buffers; support 0-sized buffers
|
||||
* adapter: optimize gst_adapter_take() and gst_adapter_peek() a little
|
||||
* basesink: only answer the SEGMENT query in pull mode
|
||||
* basesrc: return values in stream time for the POSITION query
|
||||
* basetransform: allow the subclass to add new fields to caps when getting new caps from downstream
|
||||
* basetransform: avoid useless memcpy
|
||||
* basetransform: upstream caps-renegotiation fixes
|
||||
* bitreader: add inlined and unchecked versions of the most important functions
|
||||
* bytewriter: add inline and unchecked variants of all important functions
|
||||
* bytewriter: fix possible infinite loop caused by an overflow
|
||||
* queue: add "silent" property to suppress signal emission (for better performance)
|
||||
* queue: avoid unnecessary g_cond_signal() (for better performance)
|
||||
* queue: push newsegment event when linking in PLAYING
|
||||
* queue2: extend ring buffer to support RAM mode
|
||||
* queue2: in download mode, prevent range corruption due to race
|
||||
* queue2: don't send seeks beyond the end of the file upstream in pull mode (fixes apple trailers and youtube/html5 playback in webkit)
|
||||
* multiqueue: flush the data queue if downstream return WRONG_STATE too
|
||||
* gst-inspect: print GST_PARAM_MUTABLE_* property flags
|
||||
* GLib requirement is now >= 2.22
|
||||
* New core element: valve (moved from -bad)
|
||||
* New core element: input-selector (N.B. without "select-all" property, use fsfunnel instead) (moved from -bad)
|
||||
* New core element: output-selector (with different negotiation behaviour by default, set pad-negotiation-mode=active for previous behaviour) (moved from -bad)
|
||||
* Performance improvements for many heavily-used code paths: GstPad, GstPoll, GstClock, GstTask, basesink, basesrc, queue2, multiqueue
|
||||
* gobject-introspection: add annotations for most core API
|
||||
* clock: make sync clock wait lockfree
|
||||
* fdsrc/fdsink: reenable on MSVC
|
||||
* registry: fix GStatBuf definition for win32 when building against older glib (fixes unnecessary rescanning of plugins at start-up)
|
||||
* element: add a more flexible way to get request pads from elements
|
||||
* multiqueue: return upon input when already eos
|
||||
* object: fix creation of default name (when creating more than 100000 elements)
|
||||
* pluginloader: fix hangs on OSX
|
||||
* poll: fixes for (p)select backend (used e.g. on OSX)
|
||||
* poll: refactor and make more lockfree; fixes for win32 and OSX (pselect backend)
|
||||
* registry: don't replace valid existing plugins by blacklisted ones
|
||||
* tags: don't produce duplicated entries when merging same value twice
|
||||
* basesink: preroll fixes for async=false case
|
||||
* basesink: rework position reporting code
|
||||
* basetransform: handle downstream giving a buffer with new caps but invalid size
|
||||
|
||||
Bugs fixed in this release
|
||||
|
||||
* 396774 : Make GstElementDetails extensible
|
||||
* 482147 : [queue] Issue with current time level if source task is not started
|
||||
* 579127 : gst-launch: disable CLOCK_LOST message handling
|
||||
* 594504 : Need a GType of " Date AND Time AND Timezone "
|
||||
* 600004 : underrun signal emits when i tested queue overrun test case from file /gstreamerXXXX/tests/check/element/queue.c
|
||||
* 610366 : [gstcollectpads][doc] Add a reminder for 'data' doc
|
||||
* 611918 : leaky queue might not push newsegment event
|
||||
* 618919 : Registry/Plugin Loading Memory Leak
|
||||
* 619522 : basetransform fix for upstream caps-renegotiation
|
||||
* 621299 : make simple queues faster
|
||||
* 621332 : BaseTransform should disable proxy alloc if downstream changes caps
|
||||
* 622740 : GstPad: Do not call gst_pad_accept_caps() when caps change
|
||||
* 623040 : Add release_datetime field to GstPluginDesc
|
||||
* 623121 : [queue2] downloaded areas of the media are not exposed
|
||||
* 623491 : make *_get_type() thread safe
|
||||
* 623541 : [basetransform] Implement POSITION query
|
||||
* 623622 : [basesink/basesrc] Should return values in stream time for POSITION query
|
||||
* 623806 : [pipeline] Doesn't update the clock if the currently used one gets lost and the start time did not change
|
||||
* 623875 : gstregistrybinary.c compatibility with glib > = 2.25.0
|
||||
* 624203 : gstutils: Make gst_pad_proxy_getcaps() return empty caps if it's what the other side has
|
||||
* 625239 : FTBFS: ./gstreamer-decl.txt:9461: warning: GstTagList has multiple definitions.
|
||||
* 625295 : [info] regression: doesn't flush output stream after every debug print any longer
|
||||
* 625368 : gstdatetime.c doesn't compile in VS 2008
|
||||
* 625862 : [docs] unused symbol GST_CAT_LEVEL_LOG_valist breaks the build
|
||||
* 626027 : [tag] Add GST_TAG_APPLICATION_NAME
|
||||
* 626181 : GstElementFactory: add listing/filtering API
|
||||
* 626651 : [tag] Photography/capture settings tags
|
||||
* 626784 : element: link_many might assert elements are in paused or playing
|
||||
* 627438 : gst: Add a gst_is_initialized() API
|
||||
* 627826 : GstInt64Range type
|
||||
* 627910 : Warnings emitted when -Wcast-qual used
|
||||
* 627959 : [queue2] on-disk buffering failing for AVI container
|
||||
* 628014 : Deprecate GST_FLOW_IS_FATAL/GST_FLOW_IS_SUCCESS
|
||||
* 628174 : New gstvalue checks cause trouble in thoggen
|
||||
* 628176 : [basetransform] Problems with buffer handling in inplace mode
|
||||
* 628408 : Use GDateTime that has been released
|
||||
* 629241 : Build broken with introspection using gobject-introspection from master
|
||||
* 629410 : GstBaseTransform: position query refers to sink pad, not source pad
|
||||
* 629494 : Latest gst-launch.c doesn't build in Visual Studio 2008
|
||||
* 629553 : GstAdapter: timestamp not updated when empty buffer is pushed
|
||||
* 629831 : [API] add gst_structure_take_value() and gst_structure_id_take_value()
|
||||
* 629946 : Enumerations have incorrect names of enum values (GEnumValue.value_name)
|
||||
* 630257 : GST_DEBUG_DUMP_DOT_DIR not working anymore
|
||||
* 630436 : basesink: renderdelay needs to be subtracted in adjust_time()
|
||||
* 630437 : basetransform: Make a WARNING into a DEBUG statement
|
||||
* 630439 : clock: fix racy shutdown clock id leak
|
||||
* 631755 : Fix build with glib 2.21.3
|
||||
* 631853 : [queue2] deadlock when using temp-location and dispatch-properties
|
||||
* 632236 : [gst-inspect] unhelpful uri handler output
|
||||
* 632433 : [basesink] hangs/drops going to PLAYING following flushing step in PAUSED
|
||||
* 632977 : [queue2] qtdemux causes soup to request seeks past the end of the range
|
||||
* 633147 : Simple reverse negotiation pipeline is broken.
|
||||
* 633886 : Visual Studio emits warnings about double defined _USE_MATH_DEFINES
|
||||
* 635031 : [datetime] Fix unix epoch handling
|
||||
* 635389 : Include information on exported packages in GIRs
|
||||
* 635869 : GST_BOILERPLATE_FULL causes warnings in user C++ code
|
||||
* 633176 : recent multiqueue changes break DVD playback
|
||||
* 635785 : basesrc: fix deadlock
|
||||
* 638599 : GST_PTR_FORMAT causes crashes if GLib-internal printf is used but system provides register_printf_specifier
|
||||
* 503592 : gstpad.c does many ref/unref of peer pad in dataflow
|
||||
* 564056 : Protect against umask(0177)
|
||||
* 607513 : input-selector segfaults in g_object_notify()
|
||||
* 632168 : [gsttask] MSVC thread names for task debugging
|
||||
* 632447 : reduce static memory allocated by the registry
|
||||
* 632557 : [macros] Define restrict keyword if not available
|
||||
* 632778 : Optimisations to GstBaseSink
|
||||
* 632779 : gstdataqueue: Only emit g_cond_signal when needed
|
||||
* 632780 : queue: Remove useless checks from e406f7
|
||||
* 633918 : [fakesink] [PATCH] print sink-message events like a message and its structure
|
||||
* 634965 : sinks render buffers in state PAUSED when async is FALSE
|
||||
* 635001 : basesink: fix position reporting in PAUSED
|
||||
* 636268 : configure test fails on FreeBSD
|
||||
* 636455 : basesrc: Avoid taking object locks for just checking tag presence
|
||||
* 637057 : [plugin-scanner] gstpoll fails with select backend
|
||||
* 637300 : [API] request pad based on caps
|
||||
* 637549 : build fails: ./.libs/libgstbase-0.10.so: undefined reference to `gst_clock_single_shot_id_reinit'
|
||||
* 637776 : merging the same tag values again produces lists containing duplicates
|
||||
* 638381 : {input,output}-selector: double-check API before release
|
||||
* 638399 : a few typos in GStreamer
|
||||
* 638900 : [GstPoll] Doesn't compile with MinGW
|
||||
* 638941 : registry scan/loading race and inconsistency
|
||||
|
||||
API changed in this release
|
||||
|
||||
- API additions:
|
||||
|
||||
* gst_is_initialized
|
||||
* gst_buffer_list_iterator_add_list
|
||||
* GstBin:message-forward
|
||||
* GST_TYPE_DATE_TIME
|
||||
* gst_date_time_get_day
|
||||
* gst_date_time_get_hour
|
||||
* gst_date_time_get_microsecond
|
||||
* gst_date_time_get_minute
|
||||
* gst_date_time_get_month
|
||||
* gst_date_time_get_second
|
||||
* gst_date_time_get_time_zone_offset
|
||||
* gst_date_time_get_type
|
||||
* gst_date_time_get_year
|
||||
* gst_date_time_new
|
||||
* gst_date_time_new_from_unix_epoch_local_time
|
||||
* gst_date_time_new_from_unix_epoch_utc
|
||||
* gst_date_time_new_local_time
|
||||
* gst_date_time_new_now_local_time
|
||||
* gst_date_time_new_now_utc
|
||||
* gst_date_time_ref
|
||||
* gst_date_time_unref
|
||||
* gst_tag_list_get_date_time
|
||||
* gst_tag_list_get_date_time_index
|
||||
* GST_TAG_GEO_LOCATION_HORIZONTAL_ERROR
|
||||
* GST_TAG_APPLICATION_DATA
|
||||
* GST_TAG_APPLICATION_NAME
|
||||
* GST_TAG_DATE_TIME
|
||||
* GST_ELEMENT_IS_SOURCE
|
||||
* gst_element_class_set_documentation_uri
|
||||
* gst_element_class_set_icon_name
|
||||
* gst_element_factory_get_documentation_uri
|
||||
* gst_element_factory_get_icon_name
|
||||
* gst_element_factory_list_filter
|
||||
* gst_element_factory_list_get_elements
|
||||
* gst_element_factory_list_is_type
|
||||
* GstElementFactoryListType
|
||||
* GST_ELEMENT_FACTORY_TYPE_ANY
|
||||
* GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS
|
||||
* GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER
|
||||
* GST_ELEMENT_FACTORY_TYPE_DECODABLE
|
||||
* GST_ELEMENT_FACTORY_TYPE_DECODER
|
||||
* GST_ELEMENT_FACTORY_TYPE_DEMUXER
|
||||
* GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER
|
||||
* GST_ELEMENT_FACTORY_TYPE_ENCODER
|
||||
* GST_ELEMENT_FACTORY_TYPE_FORMATTER
|
||||
* GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS
|
||||
* GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO
|
||||
* GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE
|
||||
* GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA
|
||||
* GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE
|
||||
* GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO
|
||||
* GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY
|
||||
* GST_ELEMENT_FACTORY_TYPE_MUXER
|
||||
* GST_ELEMENT_FACTORY_TYPE_PARSER
|
||||
* GST_ELEMENT_FACTORY_TYPE_PAYLOADER
|
||||
* GST_ELEMENT_FACTORY_TYPE_SINK
|
||||
* GST_ELEMENT_FACTORY_TYPE_SRC
|
||||
* GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER
|
||||
* GST_ELEMENT_FACTORY_KLASS_DECODER
|
||||
* GST_ELEMENT_FACTORY_KLASS_ENCODER
|
||||
* GST_ELEMENT_FACTORY_KLASS_SINK
|
||||
* GST_ELEMENT_FACTORY_KLASS_SRC
|
||||
* GST_ELEMENT_FACTORY_KLASS_MUXER
|
||||
* GST_ELEMENT_FACTORY_KLASS_DEMUXER
|
||||
* GST_ELEMENT_FACTORY_KLASS_PARSER
|
||||
* GST_ELEMENT_FACTORY_KLASS_PAYLOADER
|
||||
* GST_ELEMENT_FACTORY_KLASS_DEPAYLOADER
|
||||
* GST_ELEMENT_FACTORY_KLASS_FORMATTER
|
||||
* GST_ELEMENT_FACTORY_KLASS_MEDIA_VIDEO
|
||||
* GST_ELEMENT_FACTORY_KLASS_MEDIA_AUDIO
|
||||
* GST_ELEMENT_FACTORY_KLASS_MEDIA_IMAGE
|
||||
* GST_ELEMENT_FACTORY_KLASS_MEDIA_SUBTITLE
|
||||
* GST_ELEMENT_FACTORY_KLASS_MEDIA_METADATA
|
||||
* gst_plugin_feature_list_debug
|
||||
* gst_plugin_feature_rank_compare_func
|
||||
* gst_query_add_buffering_range
|
||||
* gst_query_get_n_buffering_ranges
|
||||
* gst_query_parse_nth_buffering_range
|
||||
* gst_structure_get_date_time
|
||||
* gst_structure_id_take_value
|
||||
* gst_structure_take_value
|
||||
* GST_TYPE_INT64_RANGE
|
||||
* gst_int64_range_get_type
|
||||
* gst_util_fraction_compare
|
||||
* gst_value_get_int64_range_max
|
||||
* gst_value_get_int64_range_min
|
||||
* gst_value_set_int64_range
|
||||
* GST_VALUE_HOLDS_DATE_TIME
|
||||
* gst_adapter_take_list
|
||||
* gst_bit_reader_skip_unchecked
|
||||
* gst_bit_reader_skip_to_byte_unchecked
|
||||
* gst_bit_reader_get_bits_uint16_unchecked
|
||||
* gst_bit_reader_get_bits_uint32_unchecked
|
||||
* gst_bit_reader_get_bits_uint64_unchecked
|
||||
* gst_bit_reader_get_bits_uint8_unchecked
|
||||
* gst_bit_reader_peek_bits_uint16_unchecked
|
||||
* gst_bit_reader_peek_bits_uint32_unchecked
|
||||
* gst_bit_reader_peek_bits_uint64_unchecked
|
||||
* gst_bit_reader_peek_bits_uint8_unchecked
|
||||
* gst_byte_writer_put_int8_unchecked
|
||||
* gst_byte_writer_put_int16_be_unchecked
|
||||
* gst_byte_writer_put_int16_le_unchecked
|
||||
* gst_byte_writer_put_int24_be_unchecked
|
||||
* gst_byte_writer_put_int24_le_unchecked
|
||||
* gst_byte_writer_put_int32_be_unchecked
|
||||
* gst_byte_writer_put_int32_le_unchecked
|
||||
* gst_byte_writer_put_int64_be_unchecked
|
||||
* gst_byte_writer_put_int64_le_unchecked
|
||||
* gst_byte_writer_put_uint8_unchecked
|
||||
* gst_byte_writer_put_uint16_be_unchecked
|
||||
* gst_byte_writer_put_uint16_le_unchecked
|
||||
* gst_byte_writer_put_uint24_be_unchecked
|
||||
* gst_byte_writer_put_uint24_le_unchecked
|
||||
* gst_byte_writer_put_uint32_be_unchecked
|
||||
* gst_byte_writer_put_uint32_le_unchecked
|
||||
* gst_byte_writer_put_uint64_be_unchecked
|
||||
* gst_byte_writer_put_uint64_le_unchecked
|
||||
* gst_byte_writer_put_float32_be_unchecked
|
||||
* gst_byte_writer_put_float32_le_unchecked
|
||||
* gst_byte_writer_put_float64_be_unchecked
|
||||
* gst_byte_writer_put_float64_le_unchecked
|
||||
* gst_byte_writer_put_data_unchecked
|
||||
* gst_byte_writer_fill_unchecked
|
||||
- API deprecations:
|
||||
|
||||
* GST_FLOW_IS_FATAL
|
||||
* GST_FLOW_IS_SUCCESS
|
||||
* gst_clock_single_shot_id_reinit()
|
||||
* gst_element_request_pad()
|
||||
* GstElementClass::request_new_pad_full()
|
||||
* gst_poll_get_read_gpollfd()
|
||||
* gst_value_list_merge()
|
||||
* GST_CLOCK_DONE
|
||||
|
||||
Download
|
||||
|
||||
|
@ -288,43 +113,31 @@ subscribe to the gstreamer-devel list. If there is sufficient interest we
|
|||
will create more lists as necessary.
|
||||
|
||||
|
||||
Applications
|
||||
|
||||
Applications ported to GStreamer 0.10 include Totem, RhythmBox, Sound-Juicer,
|
||||
Gnome Media, Flumotion, Amarok, Jamboree, Pitivi, Istanbul, AnnoAmp, Elisa, and others.
|
||||
Let us know if you want to be added to this list.
|
||||
|
||||
|
||||
Contributors to this release
|
||||
|
||||
* Alessandro Decina
|
||||
* Arun Raghavan
|
||||
* Colin Walters
|
||||
* Andoni Morales Alastruey
|
||||
* Benjamin Gaignard
|
||||
* Benjamin Otte
|
||||
* David Hoyt
|
||||
* David Schleef
|
||||
* Edward Hervey
|
||||
* Evan Nemerson
|
||||
* Havard Graff
|
||||
* Jan Schmidt
|
||||
* Jeffrey S. Smith
|
||||
* Jonas Holmberg
|
||||
* Jonathan Matthew
|
||||
* Kipp Cannon
|
||||
* Koop Mast
|
||||
* Lasse Laukkanen
|
||||
* Mark Nauwelaerts
|
||||
* Michael Bunk
|
||||
* Ognyan Tonchev
|
||||
* Michael Smith
|
||||
* Olivier Crete
|
||||
* Olivier Crête
|
||||
* Philippe Normand
|
||||
* Rob Clark
|
||||
* Robert Swain
|
||||
* Raimo Järvi
|
||||
* Sebastian Dröge
|
||||
* Shixin Zeng
|
||||
* Stefan Kost
|
||||
* Thiago Santos
|
||||
* Thijs Vermeir
|
||||
* Tim-Philipp Müller
|
||||
* Trond Andersen
|
||||
* Vincent Penquerc'h
|
||||
* Vladimir Eremeev
|
||||
* Tommi Myöhänen
|
||||
* Wim Taymans
|
||||
* reynaldo
|
||||
|
||||
* Zhang Wanming
|
||||
* Christian Schaller
|
||||
* Sjoerd Simons
|
||||
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 011bcc8a0fc7f798ee874a7ba899123fb2470e22
|
||||
Subproject commit 1de7f6ab2d4bc1af69f06079cf0f4e2cbbfdc178
|
21
configure.ac
21
configure.ac
|
@ -48,7 +48,7 @@ dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
|
|||
dnl - interfaces added -> increment AGE
|
||||
dnl - interfaces removed -> AGE = 0
|
||||
dnl sets GST_LT_LDFLAGS
|
||||
AS_LIBTOOL(GST, 27, 0, 27)
|
||||
AS_LIBTOOL(GST, 28, 0, 28)
|
||||
|
||||
dnl FIXME: this macro doesn't actually work;
|
||||
dnl the generated libtool script has no support for the listed tags.
|
||||
|
@ -601,6 +601,22 @@ AC_ARG_WITH([buffer-alignment],
|
|||
]
|
||||
)
|
||||
|
||||
dnl Check for -Bsymbolic-functions linker flag used to avoid
|
||||
dnl intra-library PLT jumps, if available.
|
||||
AC_ARG_ENABLE(Bsymbolic,
|
||||
[AC_HELP_STRING([--disable-Bsymbolic],
|
||||
[avoid linking with -Bsymbolic])],,
|
||||
[SAVED_LDFLAGS="${LDFLAGS}"
|
||||
AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
|
||||
LDFLAGS=-Wl,-Bsymbolic-functions
|
||||
AC_TRY_LINK([], [int main (void) { return 0; }],
|
||||
AC_MSG_RESULT(yes)
|
||||
enable_Bsymbolic=yes,
|
||||
AC_MSG_RESULT(no)
|
||||
enable_Bsymbolic=no)
|
||||
LDFLAGS="${SAVED_LDFLAGS}"])
|
||||
|
||||
|
||||
dnl *** set variables based on configure arguments
|
||||
|
||||
dnl set license and copyright notice
|
||||
|
@ -680,6 +696,9 @@ GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL \$(GCOV_LIBS)"
|
|||
dnl LDFLAGS really should only contain flags, not libs - they get added before
|
||||
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
|
||||
GST_ALL_LDFLAGS="-no-undefined"
|
||||
if test "x${enable_Bsymbolic}" = "xyes"; then
|
||||
GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
|
||||
fi
|
||||
|
||||
AC_SUBST(GST_ALL_CFLAGS)
|
||||
AC_SUBST(GST_ALL_CXXFLAGS)
|
||||
|
|
415
docs/design/draft-bufferpool.txt
Normal file
415
docs/design/draft-bufferpool.txt
Normal file
|
@ -0,0 +1,415 @@
|
|||
Bufferpool
|
||||
----------
|
||||
|
||||
This document details a possible design for how buffers can be allocated
|
||||
and managed in pools.
|
||||
|
||||
Bufferpools should increase performance by reducing allocation overhead and
|
||||
improving possibilities to implement zero-copy memory transfer.
|
||||
|
||||
|
||||
Current Situation
|
||||
-----------------
|
||||
|
||||
- elements can choose to implement a pool of buffers. These pools
|
||||
can contain buffers for both source and sink pad buffers.
|
||||
|
||||
- elements can provide buffers to upstream elements when the upstream element
|
||||
requests a buffer with gst_pad_alloc_buffer().
|
||||
|
||||
- The buffer pool can preallocate a certain amount of buffers to avoid
|
||||
runtime allocation. pad_alloc_buffer() is allowed to block the upstream
|
||||
element until buffers are recycled in the pool.
|
||||
|
||||
- the pad_alloc_buffer function call can be passed downstream to the sink
|
||||
that actually will perform the allocation. A fallback option exists to use
|
||||
a default memory bufferpool whe there is no alloc_buffer function installed
|
||||
on a pad.
|
||||
|
||||
- Upstream renegotiation is performed by making the pad_alloc_buffer function
|
||||
return a buffer with new caps.
|
||||
|
||||
|
||||
Problems
|
||||
--------
|
||||
|
||||
- There is currently no helper base class to implement efficient buffer pools
|
||||
meaning that each element has to implement its own version.
|
||||
|
||||
- There is no negotiation between elements about their buffer requirements.
|
||||
Upstream elements that decide to use pad_alloc_buffer() can find that the
|
||||
buffer they received is not appropriate at all. The most common problem
|
||||
is that the buffers don't have the right alignment or insufficient padding.
|
||||
|
||||
- There is no negotiation of minimum and maximum amounts of preallocated
|
||||
buffers. In order to not avoid deadlocks, this means that buffer pool
|
||||
implementations should be able to allocate unlimited amounts of buffers and
|
||||
are never allowed to block in pad_alloc_buffer()
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- maintain and reuse a list of buffers in a reusable base GstBufferPool
|
||||
object
|
||||
|
||||
- negotiate allocation configuration between source and sink pad.
|
||||
- have minimum and maximum amount of buffers with the option of
|
||||
preallocating buffers.
|
||||
- alignment and padding support
|
||||
- arbitrary extra options
|
||||
|
||||
- integrate with dynamic caps renegotiation
|
||||
|
||||
- dynamically change bufferpool configuration based on pipeline changes.
|
||||
|
||||
- allow the application to control buffer allocation
|
||||
|
||||
|
||||
GstBufferPool
|
||||
-------------
|
||||
|
||||
The bufferpool object manages a list of buffers with the same properties such
|
||||
as size, padding and alignment.
|
||||
|
||||
The bufferpool has two states: flushing and non-flushing. In the flushing
|
||||
state, the bufferpool can be configured with the required allocation
|
||||
preferences. In the non-flushing state, buffers can be retrieved from and
|
||||
returned to the pool.
|
||||
|
||||
The default implementation of the bufferpool is able to allocate buffers
|
||||
from main memory with arbitrary alignment and padding/prefix.
|
||||
|
||||
Custom implementations of the bufferpool can override the allocation and
|
||||
free algorithms of the buffers from the pool. This should allow for
|
||||
different allocation strategies such as using shared memory or hardware
|
||||
mapped memory.
|
||||
|
||||
The bufferpool object is also used to perform the negotiation of configuration
|
||||
between elements.
|
||||
|
||||
|
||||
GstPad
|
||||
------
|
||||
|
||||
The GstPad has a method to query a GstBufferPool and its configuration.
|
||||
|
||||
GstBufferPool * gst_pad_query_bufferpool (GstPad * pad);
|
||||
|
||||
This function can return a handle to a bufferpool object or NULL when no
|
||||
bufferpool object can be provided by the pad.
|
||||
|
||||
This function should return a bufferpool object with the
|
||||
GstBufferPoolConfig set to the desired parameters of the buffers that will be
|
||||
handled by the given pad. This function can only be called on a sinkpad and
|
||||
will usually be called by the peer srcpad with the convenience method:
|
||||
|
||||
GstBufferPool * gst_pad_peer_query_bufferpool (GstPad * pad);
|
||||
|
||||
|
||||
There is also a new function to configure a bufferpool on a pad and its peer
|
||||
pad:
|
||||
|
||||
gboolean gst_pad_set_bufferpool (GstPad * pad, GstBufferPool *pool);
|
||||
|
||||
This function is to inform a pad and its peer pad that a bufferpool should
|
||||
be used for allocation (on source pads) and that bufferpool is used by the
|
||||
upstream element (on sinkpads).
|
||||
|
||||
The currently configured bufferpool can be retrieved with:
|
||||
|
||||
GstBufferPool * gst_pad_get_bufferpool (GstPad * pad);
|
||||
|
||||
New functions exist to configure these bufferpool functions on pads:
|
||||
gst_pad_set_querybufferpool_function and gst_pad_set_setbufferpool_function.
|
||||
|
||||
|
||||
negotiating pool and config
|
||||
---------------------------
|
||||
|
||||
Since upstream needs to allocate buffers from a buffer pool, it should first
|
||||
negotiate a buffer pool with the downstream element. We propose a simple
|
||||
scheme where a sink can propose a bufferpool and some configuration and where
|
||||
the source can choose to use this allocator or use its own.
|
||||
|
||||
The algorithm for doing this is rougly like this:
|
||||
|
||||
|
||||
/* srcpad knows media type and size of buffers and is ready to
|
||||
* prepare an output buffer but has no pool yet */
|
||||
|
||||
/* first get the pool from the downstream peer */
|
||||
pool = gst_pad_peer_query_bufferpool (srcpad);
|
||||
|
||||
if (pool != NULL) {
|
||||
GstBufferPoolConfig config;
|
||||
|
||||
/* clear the pool so that we can reconfigure it */
|
||||
gst_buffer_pool_set_flushing (pool, TRUE);
|
||||
|
||||
do {
|
||||
/* get the config */
|
||||
gst_buffer_pool_get_config (pool, &config);
|
||||
|
||||
/* check and modify the config to match our requirements */
|
||||
if (!tweak_config (&config)) {
|
||||
/* we can't tweak the config any more, exit and fail */
|
||||
gst_object_unref (pool);
|
||||
pool = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* update the config */
|
||||
while (!gst_buffer_pool_set_config (pool, &config));
|
||||
|
||||
/* we managed to update the config, all is fine now */
|
||||
/* set the pool to non-flushing to make it allocate things */
|
||||
gst_buffer_pool_set_flushing (pool, FALSE);
|
||||
}
|
||||
|
||||
if (pool == NULL) {
|
||||
/* still no pool, we create one ourself with our ideal config */
|
||||
pool = gst_buffer_pool_new (...);
|
||||
}
|
||||
|
||||
/* now set the pool on this pad and the peer pad */
|
||||
gst_pad_set_bufferpool (pad, pool);
|
||||
|
||||
|
||||
Negotiation is the same for both push and pull mode. In the case of pull
|
||||
mode scheduling, the srcpad will perform the negotiation of the pool
|
||||
when it receives the first pull request.
|
||||
|
||||
|
||||
Allocating from pool
|
||||
--------------------
|
||||
|
||||
Buffers are allocated from the pool of a pad:
|
||||
|
||||
res = gst_buffer_pool_acquire_buffer (pool, &buffer, ¶ms);
|
||||
|
||||
convenience functions to automatically get the pool from a pad can be made:
|
||||
|
||||
res = gst_pad_acquire_buffer (pad, &buffer, ¶ms);
|
||||
|
||||
Buffers are refcounted in te usual way. When the refcount of the buffer
|
||||
reaches 0, the buffer is automatically returned to the pool. This is achieved
|
||||
by setting and reffing the pool as a new buffer member.
|
||||
|
||||
Since all the buffers allocated from the pool keep a reference to the pool,
|
||||
when nothing else is holding a refcount to the pool, it will be finalized
|
||||
when all the buffers from the pool are unreffed. By setting the pool to
|
||||
the flushing state we can drain all buffers from the pool.
|
||||
|
||||
|
||||
Renegotiation
|
||||
-------------
|
||||
|
||||
Renegotiation of the bufferpool might need to be performed when the
|
||||
configuration of the pool changes. Changes can be in the buffer size (because
|
||||
of a caps change), alignment or number of buffers.
|
||||
|
||||
* downstream
|
||||
|
||||
When the upstream element wants to negotiate a new format, it might need
|
||||
to renegotiate a new bufferpool configuration with the downstream element.
|
||||
This can, for example, happen when the buffer size changes.
|
||||
|
||||
We can not just reconfigure the existing bufferpool because there might
|
||||
still be outstanding buffers from the pool in the pipeline. Therefore we
|
||||
need to create a new bufferpool for the new configuration while we let the
|
||||
old pool drain.
|
||||
|
||||
Implementations can choose to reuse the same bufferpool object and wait for
|
||||
the drain to finish before reconfiguring the pool.
|
||||
|
||||
The element that wants to renegotiate a new bufferpool uses exactly the same
|
||||
algorithm as when it first started.
|
||||
|
||||
* upstream
|
||||
|
||||
When a downstream element wants to negotiate a new format, it will send a
|
||||
RECONFIGURE event upstream. This instructs upstream to renegotiate both
|
||||
the format and the bufferpool when needed.
|
||||
|
||||
A pipeline reconfiguration is when new elements are added or removed from
|
||||
the pipeline or when the topology of the pipeline changes. Pipeline
|
||||
reconfiguration also triggers possible renegotiation of the bufferpool and
|
||||
caps.
|
||||
|
||||
A RECONFIGURE event tags each pad it travels on as needing reconfiguration.
|
||||
The next buffer allocation will then require the renegotiation or
|
||||
reconfiguration of a pool.
|
||||
|
||||
If downstream has specified a RENEGOTIATE flag, it must be prepared to
|
||||
received NOT_NEGOTIATED results when allocating buffers, which instructs
|
||||
it to start caps and bufferpool renegotiation. When using this flag,
|
||||
upstream can more quickly react to downstream format or size changes.
|
||||
|
||||
|
||||
Shutting down
|
||||
-------------
|
||||
|
||||
In push mode, a source pad is responsible for setting the pool to the
|
||||
flushing state when streaming stops. The flush will unblock any pending
|
||||
allocations so that the element can shut down.
|
||||
|
||||
In pull mode, the sink element should set the pool to the flushing state when
|
||||
shutting down so that the peer _get_range() function can unblock.
|
||||
|
||||
In the flushing state, all the buffers that are returned to the pool will
|
||||
be automatically freed by the pool and new allocations will fail.
|
||||
|
||||
|
||||
|
||||
|
||||
Use cases
|
||||
---------
|
||||
|
||||
1) videotestsrc ! xvimagesink
|
||||
|
||||
Before videotestsrc can output a buffer, it needs to negotiate caps and
|
||||
a bufferpool with the downstream peer pad.
|
||||
|
||||
First it will negotiate a suitable format with downstream according to the
|
||||
normal rules.
|
||||
|
||||
Then it does gst_pad_peer_query_bufferpool() which triggers the querybufferpool
|
||||
function installed on the xvimagesink pad. This bufferpool is currently in
|
||||
the flushing state and thus has no buffers allocated.
|
||||
|
||||
videotestsrc gets the configuration of the bufferpool object. This
|
||||
configuration lists the desired configuration of the xvimagesink, which can
|
||||
have specific alignment and/or min/max amount of buffers.
|
||||
|
||||
videotestsrc updates the configuration of the bufferpool, it will likely
|
||||
set the min buffers to 1 and the size of the desired buffers. It then
|
||||
updates the bufferpool configuration with the new properties.
|
||||
|
||||
When the configuration is successfully updated, videotestsrc sets the
|
||||
bufferpool on its source pad, this will also set the pool on the peer
|
||||
sinkpad.
|
||||
|
||||
It then sets the bufferpool to the non-flushing state. This preallocates
|
||||
the buffers in the pool (if needed). This operation can fail when there
|
||||
is not enough memory available. Since the bufferpool is provided by
|
||||
xvimagesink, it will allocate buffers backed by an XvImage and pointing
|
||||
to shared memory with the X server.
|
||||
|
||||
If the bufferpool is successfully activated, videotestsrc can acquire a
|
||||
buffer from the pool, set the caps on it, fill in the data and push it
|
||||
out to xvimagesink.
|
||||
|
||||
xvimagesink can know that the buffer originated from its pool by following
|
||||
the pool member or checking the specific GType of it GstBuffer subclass.
|
||||
It might need to get the parent buffer first in case of subbuffers.
|
||||
|
||||
when shutting down, videotestsrc will set the pool to the flushing state,
|
||||
this will cause further allocations to fail and currently allocated buffers
|
||||
to be freed. videotestsrc will then free the pool and stop streaming.
|
||||
|
||||
|
||||
2) videotestsrc ! queue ! myvideosink
|
||||
|
||||
In this second use case we have a videosink that can at most allocate
|
||||
3 video buffers.
|
||||
|
||||
Again videotestsrc will have to negotiate a bufferpool with the peer
|
||||
element. For this it will perform gst_pad_peer_query_bufferpool() which
|
||||
queue will proxy to its downstream peer element.
|
||||
|
||||
The bufferpool returned from myvideosink will have a max_buffers set to 3.
|
||||
queue and videotestsrc can operate with this upper limit because none of
|
||||
those elements require more than that amount of buffers for temporary
|
||||
storage.
|
||||
|
||||
The bufferpool of myvideosink will then be configured with the size of the
|
||||
buffers for the negotiated format and according to the padding and alignment
|
||||
rules. When videotestsrc sets the pool to non-flushing, the 3 video
|
||||
buffers will be preallocated in the pool.
|
||||
|
||||
The pool will then be configured on the src of videotestsrc and the
|
||||
sinkpad of the queue. The queue will proxy the setbufferpool method to
|
||||
its srcpad, which finally configures the pool all the way to the sink.
|
||||
|
||||
videotestsrc acquires a buffer from the configured pool on its srcpad and
|
||||
pushes this into the queue. When the videotestsrc has acquired and pushed
|
||||
3 frames, the next call to gst_buffer_pool_acquire_buffer() will block
|
||||
(assuming the GST_BUFFER_POOL_FLAG_WAIT is specified).
|
||||
|
||||
When the queue has pushed out a buffer and the sink has rendered it, the
|
||||
refcount of the buffer reaches 0 and the buffer is recycled in the pool.
|
||||
This will wake up the videotestsrc that was blocked, waiting for more
|
||||
buffers and will make it produce the next buffer.
|
||||
|
||||
In this setup, there are at most 3 buffers active in the pipeline and
|
||||
the videotestsrc is rate limited by the rate at which buffers are recycled
|
||||
in the bufferpool.
|
||||
|
||||
When shutting down, videotestsrc will first set the bufferpool on the srcpad
|
||||
to flushing. This causes any pending (blocked) acquire to return with a
|
||||
WRONG_STATE result and causes the streaming thread to pause.
|
||||
|
||||
|
||||
3) .. ! myvideodecoder ! queue ! fakesink
|
||||
|
||||
In this case, the myvideodecoder requires buffers to be aligned to 128
|
||||
bytes and padded with 4096 bytes. The pipeline starts out with the
|
||||
decoder linked to a fakesink but we will then dynamically change the
|
||||
sink to one that can provide a bufferpool.
|
||||
|
||||
When it negotiates the size with the downstream element fakesink, it will
|
||||
receive a NULL bufferpool because fakesink does not provide a bufferpool.
|
||||
It will then select it own custom bufferpool to start the datatransfer.
|
||||
|
||||
At some point we block the queue srcpad, unlink the queue from the
|
||||
fakesink, link a new sink, set the new sink to the PLAYING state and send
|
||||
the right newsegment event to the sink. Linking the new sink would
|
||||
automatically send a RENEGOTIATE event upstream and, through queue, inform
|
||||
myvideodecoder that it should renegotiate its bufferpool because downstream
|
||||
has been reconfigured.
|
||||
|
||||
Before pushing the next buffer, myvideodecoder would renegotiate a new
|
||||
bufferpool. To do this, it performs the usual bufferpool negotiation
|
||||
algorithm. If it can obtain and configure a new bufferpool from downstream,
|
||||
it sets its own (old) pool to flushing and unrefs it. This will eventually
|
||||
drain and unref the old bufferpool.
|
||||
|
||||
The new bufferpool is set as the new bufferpool for the srcpad and sinkpad
|
||||
of the queue and set to the non-flushing state.
|
||||
|
||||
|
||||
4) .. ! myvideodecoder ! queue ! myvideosink
|
||||
|
||||
myvideodecoder has negotiated a bufferpool with the downstream myvideosink
|
||||
to handle buffers of size 320x240. It has now detected a change in the
|
||||
video format and need to renegotiate to a resolution of 640x480. This
|
||||
requires it to negotiate a new bufferpool with a larger buffersize.
|
||||
|
||||
When myvideodecoder needs to get the bigger buffer, it starts the
|
||||
negotiation of a new bufferpool. It queries a bufferpool from downstream,
|
||||
reconfigures it with the new configuration (which includes the bigger buffer
|
||||
size), it sets the bufferpool to non-flushing and sets the bufferpool as
|
||||
the new pool for the srcpad and its peer. This automatically flushes the
|
||||
old pool and unrefs it, which causes the old format to drain.
|
||||
|
||||
It then uses the new bufferpool for allocating new buffers of the new
|
||||
dimension.
|
||||
|
||||
If at some point, the decoder wants to switch to a lower resolution again,
|
||||
it can choose to use the current pool (which has buffers that are larger
|
||||
than the required size) or it can choose to renegotiate a new bufferpool.
|
||||
|
||||
|
||||
5) .. ! myvideodecoder ! videoscale ! myvideosink
|
||||
|
||||
myvideosink is providing a bufferpool for upstream elements and wants to
|
||||
change the resolution.
|
||||
|
||||
myvideosink sends a RENEGOTIATE event upstream to notify upstream that a
|
||||
new format is desirable. upstream elements try to negotiate a new format
|
||||
and bufferpool before pushing out a new buffer. The old bufferpools are
|
||||
drained in the regular way.
|
||||
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ Shared data structures and writability:
|
|||
The advantage of this method is that no reader/writers locks are needed. all
|
||||
threads can concurrently read but writes happen locally on a new copy. In most
|
||||
cases _get_writable() can avoid a real copy because the calling method is the
|
||||
only one holding a reference, wich makes read/writes very cheap.
|
||||
only one holding a reference, which makes read/write very cheap.
|
||||
|
||||
The drawback is that sometimes 1 needless copy can be done. This would happen
|
||||
when N threads call _get_writable() at the same time, all seeing that N
|
||||
|
@ -193,7 +193,7 @@ Objects
|
|||
disposed it has to unset itself as the parent of the object before disposing
|
||||
itself, else the child object holds a parent pointer to invalid memory.
|
||||
|
||||
The responsibilites for an object that sinks other objects are summarised as:
|
||||
The responsibilities for an object that sinks other objects are summarised as:
|
||||
|
||||
- taking ownership of the object
|
||||
- call _object_set_parent() to set itself as the object parent, this call
|
||||
|
|
|
@ -38,7 +38,7 @@ is called or the sync block returned) no data is flowing in elem2.sink.
|
|||
In this situation, the streaming thread is blocked on a GCond and is
|
||||
waiting to be unblocked.
|
||||
|
||||
When sending a flushing seek upstream on elem1.src, the FLUSH_START and
|
||||
When sending a flushing seek upstream on elem1.src, the FLUSH_START event
|
||||
will temporary unblock the streaming thread and make all pad functions that
|
||||
triggers a block (_push/_alloc_buffer/_push_event/_pull_range) return
|
||||
GST_FLOW_WRONG_STATE. This will then eventually pause the streaming thread
|
||||
|
|
|
@ -44,7 +44,8 @@ Some use cases:
|
|||
posted, which instructs the application to continue playback.
|
||||
- When during playback, the low watermark is hit, the queue will start posting
|
||||
BUFFERING messages again, making the application PAUSE the pipeline again
|
||||
until the high watermark is hit again.
|
||||
until the high watermark is hit again. This is called the rebuffering
|
||||
stage.
|
||||
- during playback, the queue level will fluctuate between the high and the
|
||||
low watermark as a way to compensate for network irregularities.
|
||||
|
||||
|
@ -247,3 +248,61 @@ A GstBaseSrc in push mode replies to the BUFFERING query with:
|
|||
"stop" = current position
|
||||
"estimated-total" = -1
|
||||
|
||||
|
||||
Buffering strategies
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Buffering strategies are specific implementations based on the buffering
|
||||
message and query described above.
|
||||
|
||||
Most strategies have to balance buffering time versus maximal playback
|
||||
experience.
|
||||
|
||||
* simple buffering
|
||||
|
||||
NON-live pipelines are kept in the paused state while buffering messages with
|
||||
a percent < 100% are received.
|
||||
|
||||
This buffering strategy relies on the buffer size and low/high watermarks of
|
||||
the element. It can work with a fixed size buffer in memory or on disk.
|
||||
|
||||
The size of the buffer is usually expressed in a fixed amount of time units
|
||||
and the estimated bitrate of the upstream source is used to convert this time
|
||||
to bytes.
|
||||
|
||||
All GStreamer applications must implement this strategy. Failure to do so
|
||||
will result in starvation at the sink.
|
||||
|
||||
* no-rebuffer strategy
|
||||
|
||||
This strategy tries to buffer as much data as possible so that playback can
|
||||
continue without any further rebuffering.
|
||||
|
||||
This strategy is initially similar to simple buffering, the difference is in
|
||||
deciding on the condition to continue playback. When a 100% buffering message
|
||||
has been received, the application will not yet start the playback but it will
|
||||
start a periodic buffering query, which will return the estimated amount of
|
||||
buffering time left. When the estimated time left is less than the remaining
|
||||
playback time, playback can continue.
|
||||
|
||||
This strategy requires a unlimited buffer size in memory or on disk, such as
|
||||
provided by elements that implement the incremental download buffering mode.
|
||||
|
||||
Usually, the application can choose to start playback even before the
|
||||
remaining buffer time elapsed in order to more quickly start the playback at
|
||||
the expense of a possible rebuffering phase.
|
||||
|
||||
* Incremental rebuffering
|
||||
|
||||
The application implements the simple buffering strategy but with each
|
||||
rebuffering phase, it increases the size of the buffer.
|
||||
|
||||
This strategy has quick, fixed time startup times but incrementally longer
|
||||
rebuffering times if the network is slower than the media bitrate.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ organized in a list) to be treated as a multiple groups of GstBuffers. This allo
|
|||
for the following extra functionality:
|
||||
|
||||
- A logical GstBuffer (called a group) can consist of disjoint memory each with
|
||||
their own copy/free and metadata. Logicallty the group should be treated as
|
||||
their own copy/free and metadata. Logically the group should be treated as
|
||||
one single GstBuffer.
|
||||
- Multiple groups can be put into one bufferlist. This allows for a single
|
||||
method call to pass multiple (logical) buffers downstream.
|
||||
|
|
|
@ -5,7 +5,7 @@ The GstClock returns a monotonically increasing time with the method
|
|||
_get_time(). Its accuracy and base time depends on the specific clock
|
||||
implementation but time is always expessed in nanoseconds. Since the
|
||||
baseline of the clock is undefined, the clock time returned is not
|
||||
meaningfull in itself, what matters are the deltas between two clock
|
||||
meaningful in itself, what matters are the deltas between two clock
|
||||
times.
|
||||
The time reported by the clock is called the absolute_time.
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ Sink elements
|
|||
|
||||
Sink elements consume data. They normally have no source pads.
|
||||
|
||||
typical sink elements include:
|
||||
Typical sink elements include:
|
||||
|
||||
- audio/video renderers
|
||||
- network sinks
|
||||
|
|
|
@ -35,7 +35,7 @@ operations on itself to all of its children. This includes:
|
|||
|
||||
- state changes
|
||||
- index get/set
|
||||
- clock gst/set
|
||||
- clock get/set
|
||||
|
||||
The state change distribution is the most complex and is explained in
|
||||
part-states.txt.
|
||||
|
@ -107,7 +107,7 @@ Subclassing
|
|||
|
||||
Subclasses of GstBin are free to implement their own add/remove implementations.
|
||||
It is a good idea to update the GList of children so that the _iterate() functions
|
||||
can still be used if the custom bin allows acces to its children.
|
||||
can still be used if the custom bin allows access to its children.
|
||||
|
||||
Any bin subclass can also implement a custom message handler by overriding the
|
||||
default message handler.
|
||||
|
|
|
@ -55,7 +55,7 @@ Some design requirements
|
|||
+----* internal |
|
||||
(------------)
|
||||
|
||||
Which we will abreviate to:
|
||||
Which we will abbreviate to:
|
||||
|
||||
(- X --------)
|
||||
| |
|
||||
|
|
|
@ -53,7 +53,7 @@ The task of the application is to construct a pipeline as above using existing
|
|||
elements. This is further explained in the pipeline building topic.
|
||||
|
||||
The application does not have to manage any of the complexities of the
|
||||
actual dataflow/decoding/conversions/synchronsiation etc. but only calls high
|
||||
actual dataflow/decoding/conversions/synchronisation etc. but only calls high
|
||||
level functions on the pipeline object such as PLAY/PAUSE/STOP.
|
||||
|
||||
The application also receives messages and notifications from the pipeline such
|
||||
|
@ -249,7 +249,7 @@ Dataflow and events
|
|||
Parallel to the dataflow is a flow of events. Unlike the buffers, events can pass
|
||||
both upstream and downstream. Some events only travel upstream others only downstream.
|
||||
|
||||
the events are used to denote special conditions in the dataflow such as EOS or
|
||||
The events are used to denote special conditions in the dataflow such as EOS or
|
||||
to inform plugins of special events such as flushing or seeking.
|
||||
|
||||
Some events must be serialized with the buffer flow, others don't. Serialized
|
||||
|
@ -491,7 +491,7 @@ element performs the following steps.
|
|||
5) send NEWSEGMENT event to inform all elements of the new position and to complete
|
||||
the seek.
|
||||
|
||||
In step 1) all dowstream elements have to return from any blocking operations
|
||||
In step 1) all downstream elements have to return from any blocking operations
|
||||
and have to refuse any further buffers or events different from a FLUSH done.
|
||||
|
||||
The first step ensures that the streaming thread eventually unblocks and that
|
||||
|
|
|
@ -6,7 +6,7 @@ has been queued on the input pad or pads. This process is called prerolling
|
|||
and is needed to fill the pipeline with buffers so that the transition to
|
||||
PLAYING goes as fast as possible with no visual delay for the user.
|
||||
|
||||
Preroll is also crucial in maintaining correct audio and video synchronsation
|
||||
Preroll is also crucial in maintaining correct audio and video synchronisation
|
||||
and ensuring that no buffers are dropped in the sinks.
|
||||
|
||||
After receiving a buffer (or EOS) on a pad the chain/event function should
|
||||
|
|
233
docs/design/part-progress.txt
Normal file
233
docs/design/part-progress.txt
Normal file
|
@ -0,0 +1,233 @@
|
|||
Progress Reporting
|
||||
------------------
|
||||
|
||||
This document describes the design and use cases for the progress reporting
|
||||
messages.
|
||||
|
||||
PROGRESS messages are posted on the bus to inform the application about the
|
||||
progress of asynchonous operations in the pipeline. This should not be confused
|
||||
with asynchronous state changes.
|
||||
|
||||
We accomodate for the following requirements:
|
||||
|
||||
- Application is informed when an async operation starts and completes.
|
||||
- It should be possible for the application to generically detect common
|
||||
operations and incorporate their progress into the GUI.
|
||||
- Applications can cancel pending operations by doing regular state changes.
|
||||
- Applications should be abe able to wait for completion of async operations.
|
||||
|
||||
We allow for the following scenarios:
|
||||
|
||||
- Elements want to inform the application about asynchronous DNS lookups and
|
||||
pending network requests. This includes starting and completing the lookup.
|
||||
- Elements opening devices and resources assynchronously.
|
||||
- Applications having more freedom to implement timeout and cancelation of
|
||||
operations that currently block the state changes or happen invisibly behind
|
||||
the scenes.
|
||||
|
||||
|
||||
Rationale
|
||||
~~~~~~~~~
|
||||
|
||||
The main reason for adding these extra progress notifications is twofold:
|
||||
|
||||
1) to give the application more information of what is going on
|
||||
|
||||
When there are well defined progress information codes, applications
|
||||
can let the user know about the status of the progress. We anticipate to
|
||||
have at least DNS resolving and server connections and requests be well
|
||||
defined.
|
||||
|
||||
2) To make the state changes non-blocking and cancelable.
|
||||
|
||||
Currently state changes such as going to the READY or PAUSED state often do
|
||||
blocking calls such as resolving DNS or connecting to a remote server. These
|
||||
operations often block the main thread and are often not cancelable, causing
|
||||
application lockups.
|
||||
|
||||
We would like to make the state change function, instead, start a separate
|
||||
thread that performs the blocking operations in a cancelable way. When going
|
||||
back to the NULL state, all pending operations would be canceled immediately.
|
||||
|
||||
For downward state changes, we want to let the application implement its own
|
||||
timeout mechanism. For example: when stopping an RTSP stream, the clients
|
||||
needs to send a TEARDOWN request to the server. This can however take an
|
||||
unlimited amount of time in case of network problems. We want to give the
|
||||
application an opportunity to wait (and timeout) for the completion of the
|
||||
async operation before setting the element to the final NULL state.
|
||||
|
||||
Progress updates are very similar to buffering messages in the same way that the
|
||||
application can decide to wait for the completion of the buffering process
|
||||
before performing the next state change. It might make sense to implement
|
||||
buffering with the progress messages in the future.
|
||||
|
||||
|
||||
Async state changes
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
GStreamer currently has a GST_STATE_CHANGE_ASYNC return value to note to the
|
||||
application that a state change is happening assynchronously.
|
||||
|
||||
The main purpose of this return value is to make the pipeline wait for preroll
|
||||
and delay a future (upwards) state changes until the sinks are prerolled.
|
||||
|
||||
In the case of async operations on source, this will automatically force sinks
|
||||
to stay async because they will not preroll before the source can produce data.
|
||||
|
||||
The fact that other asynchonous operations happen behind the scnes is irrelevant
|
||||
for the prerolling process so it is not implemented with the ASYNC state change
|
||||
return value in order to not complicate the state changes and mix concepts.
|
||||
|
||||
|
||||
Use cases
|
||||
~~~~~~~~~
|
||||
|
||||
* RTSP client (but also HTTP, MMS, ...)
|
||||
|
||||
When the client goes from the READY to the PAUSED state, it opens a socket,
|
||||
performs a DNS lookup, retieves the SDP and negotiates the streams. All these
|
||||
operations currently block the state change function for an undefinite amount
|
||||
of time and while they are blocking cannot be canceled.
|
||||
|
||||
Instead, a thread would be started to perform these operations assynchronously
|
||||
and the state change would complete with the usual NO_PREROLL return value.
|
||||
Before starting the thread a PROGRESS message would be posted to mark the
|
||||
start of the async operation.
|
||||
|
||||
As the DNS lookup completes and the connection is established, PROGRESS messages
|
||||
are posted on the bus to inform the application of the progress. When
|
||||
something fails, an error is posted and a PROGRESS CANCELED message is posted.
|
||||
The application can then stop the pipeline.
|
||||
|
||||
If there are no errors and the setup of the streams completed successfully, a
|
||||
PROGRESS COMPLETED is posted on the bus. The thread then goes to sleep and the
|
||||
assynchronous operation completed.
|
||||
|
||||
The RTSP protocol requires to send a TEARDOWN request to the server
|
||||
before closing the connection and destroying the socket. A state change to the
|
||||
READY state will issue the TEARDOWN request in the background and notify the
|
||||
application of this pending request with a PROGRESS message.
|
||||
|
||||
The application might want to only go to the NULL state after it got confirmation
|
||||
that the TEARDOWN request completed or it might choose to go to NULL after a
|
||||
timeout. It might also be possible that the application just want to close the
|
||||
socket as fast as possible without waiting for completion of the TEARDOWN request.
|
||||
|
||||
* Network performance measuring
|
||||
|
||||
DNS lookup and connection times can be measured by calculating the elapsed
|
||||
time between the various PROGRESS messages.
|
||||
|
||||
|
||||
|
||||
Messages
|
||||
~~~~~~~~
|
||||
|
||||
A new PROGRESS message will be created.
|
||||
The following fields will be contained in the message:
|
||||
|
||||
- "type", GST_TYPE_PROGRESS_TYPE
|
||||
|
||||
- a set of types to define the type of progress
|
||||
|
||||
GST_PROGRESS_TYPE_START: A new task is started in the background
|
||||
GST_PROGRESS_TYPE_CONTINUE: The previous tasks completed and a new
|
||||
one continues. This is done so that the application can follow
|
||||
a set of continuous tasks and react to COMPLETE only when the
|
||||
element completely finished.
|
||||
GST_PROGRESS_TYPE_CANCELED: A task is canceled by the user.
|
||||
GST_PROGRESS_TYPE_ERROR: A task stopped because of an error. In case of
|
||||
an error, an error message will have been posted before.
|
||||
GST_PROGRESS_TYPE_COMPLETE: A task completed successfully.
|
||||
|
||||
- "code", G_TYPE_STRING
|
||||
|
||||
A generic extensible string that can be used to programatically determine the
|
||||
action that is in progress. Some standard predefined codes will be
|
||||
defined.
|
||||
|
||||
- "text", G_TYPE_STRING
|
||||
|
||||
A user visible string detailing the action.
|
||||
|
||||
- "percent", G_TYPE_INT between 0 and 100
|
||||
|
||||
Progress of the action as a percentage, the following values are allowed:
|
||||
- GST_PROGRESS_TYPE_START always has a 0% value.
|
||||
- GST_PROGRESS_TYPE_CONTINUE have a value between 0 and 100
|
||||
- GST_PROGRESS_TYPE_CANCELED, GST_PROGRESS_TYPE_ERROR and
|
||||
GST_PROGRESS_TYPE_COMPLETE always have a 100% value.
|
||||
|
||||
- "timeout", G_TYPE_INT in milliseconds
|
||||
|
||||
The timeout of the async operation. -1 if unknown/unlimited..
|
||||
This field can be interesting to the application when it wants to display
|
||||
some sort of progress indication.
|
||||
|
||||
- ....
|
||||
|
||||
Depending on the code, more fields can be put here.
|
||||
|
||||
|
||||
Implementation
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Elements should not do blocking operations from the state change function.
|
||||
Instead, elements should post an appropriate progress message with the right
|
||||
code and of type GST_PROGRESS_TYPE_START and then start a thread to perform
|
||||
the blocking calls in a cancelable manner.
|
||||
|
||||
It is highly recommended to only start async operations from the READY to PAUSED
|
||||
state and onwards and not from the NULL to READY state. The reason for this is
|
||||
that streaming threads are usually started in the READY to PAUSED state and that
|
||||
the current NULL to READY state change is used to perform a blocking check for
|
||||
the presence of devices.
|
||||
|
||||
The progress message needs to be posted from the state change function so that
|
||||
the application can immediately take appropriate action after setting the state.
|
||||
|
||||
The threads will usually perform many blocking calls with different codes
|
||||
in a row, a client might first do a DNS query and then continue with
|
||||
establishing a connection to the server. For this purpose the
|
||||
GST_PROGRESS_TYPE_CONTINUE must be used.
|
||||
|
||||
Usually, the thread used to perform the blocking operations can be used to
|
||||
implement the streaming threads when needed.
|
||||
|
||||
Upon downward state changes, operations that are busy in the thread are canceled
|
||||
and GST_PROGRESS_TYPE_CANCELED is posted.
|
||||
|
||||
The application can know about pending tasks because they received the
|
||||
GST_PROGRESS_TYPE_START messages that didn't complete with a
|
||||
GST_PROGRESS_TYPE_COMPLETE message, got canceled with a
|
||||
GST_PROGRESS_TYPE_CANCELED or errored with GST_PROGRESS_TYPE_ERROR.
|
||||
Applications should be able to choose if they wait for the pending
|
||||
operation or cancel them.
|
||||
|
||||
If an async operation fails, an error message is posted first before the
|
||||
GST_PROGRESS_TYPE_ERROR progress message.
|
||||
|
||||
|
||||
Categories
|
||||
~~~~~~~~~~
|
||||
|
||||
We want to propose some standard codes here:
|
||||
|
||||
"open" : A resource is being opened
|
||||
"close" : A resource is being closed
|
||||
|
||||
"name-lookup" : A DNS lookup.
|
||||
|
||||
"connect" : A socket connection is established
|
||||
|
||||
"disconnect" : a socket connection is closed
|
||||
|
||||
"request" : A request is sent to a server and we are waiting for a
|
||||
reply. This message is posted right before the request is sent
|
||||
and completed when the reply has arrived completely.
|
||||
|
||||
"mount" : A volume is being mounted
|
||||
|
||||
"unmount" : A volume is being unmounted
|
||||
|
||||
More codes can be posted by elements and can be made official later.
|
|
@ -8,7 +8,7 @@ driving force in the pipeline as it initiates data transport.
|
|||
|
||||
It is also possible for an element to pull data from an upstream element.
|
||||
The downstream element does this by calling gst_pad_pull_range() on one
|
||||
of its sinkpads. In this mode, the upstream element is the driving force
|
||||
of its sinkpads. In this mode, the downstream element is the driving force
|
||||
in the pipeline as it initiates data transfer.
|
||||
|
||||
It is important that the elements are in the correct state to handle a
|
||||
|
|
|
@ -16,6 +16,10 @@ made:
|
|||
in the sinks.
|
||||
- long term rate corrections based on trends observed in the sinks.
|
||||
|
||||
It is also possible for the application to artificially introduce delay
|
||||
between synchronized buffers, this is called throttling. It can be used
|
||||
to reduce the framerate, for example.
|
||||
|
||||
|
||||
Sources of quality problems
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -23,6 +27,7 @@ Sources of quality problems
|
|||
- High CPU load
|
||||
- Network problems
|
||||
- Other resource problems such as disk load, memory bottlenecks etc.
|
||||
- application level throttling
|
||||
|
||||
|
||||
QoS event
|
||||
|
@ -31,6 +36,19 @@ QoS event
|
|||
The QoS event is generated by an element that synchronizes against the clock. It
|
||||
travels upstream and contains the following fields:
|
||||
|
||||
- type, GST_TYPE_QOS_TYPE:
|
||||
The type of the QoS event, we have the following types and the default type
|
||||
is GST_QOS_TYPE_UNDERFLOW:
|
||||
|
||||
GST_QOS_TYPE_OVERFLOW: an element is receiving buffers too fast and can't
|
||||
keep up processing them. Upstream should reduce the
|
||||
rate.
|
||||
GST_QOS_TYPE_UNDERFLOW: an element is receiving buffers too slowly and has
|
||||
to drop them because they are too late. Upstream should
|
||||
increase the processing rate.
|
||||
GST_QOS_TYPE_THROTTLE: the application is asking to add extra delay between
|
||||
buffers, upstream is allowed to drop buffers
|
||||
|
||||
- timestamp, G_TYPE_UINT64:
|
||||
The timestamp on the buffer that generated the QoS event. These timestamps
|
||||
are expressed in total running_time in the sink so that the value is ever
|
||||
|
@ -39,7 +57,10 @@ travels upstream and contains the following fields:
|
|||
- jitter, G_TYPE_INT64:
|
||||
The difference of that timestamp against the current clock time. Negative
|
||||
values mean the timestamp was on time. Positive values indicate the
|
||||
timestamp was late by that amount.
|
||||
timestamp was late by that amount. When buffers are received in time and
|
||||
throttling is not enabled, the QoS type field is set to OVERFLOW.
|
||||
When throttling, the jitter contains the throttling delay added by the
|
||||
application and the type is set to THROTTLE.
|
||||
|
||||
- proportion, G_TYPE_DOUBLE:
|
||||
Long term prediction of the ideal rate relative to normal rate to get
|
||||
|
@ -175,7 +196,7 @@ Values DR1 > 1.0 mean that the upstream element cannot produce buffers of
|
|||
duration D1 in real-time. It is exactly DR1 that tells the amount of speedup
|
||||
we require from upstream to regain real-time performance.
|
||||
|
||||
An element that is not receiving enough data is said to be starved.
|
||||
An element that is not receiving enough data is said to be underflowed.
|
||||
|
||||
|
||||
Element measurements
|
||||
|
@ -185,7 +206,7 @@ In addition to the measurements of the datarate of the upstream element, a
|
|||
typical element must also measure its own performance. Global pipeline
|
||||
performance problems can indeed also be caused by the element itself when it
|
||||
receives too much data it cannot process in time. The element is then said to
|
||||
be flooded.
|
||||
be overflowed.
|
||||
|
||||
|
||||
Short term correction
|
||||
|
@ -259,6 +280,24 @@ as given by the proportion member. Failure to do so will certainly lead to
|
|||
more dropped frames and a generally worse QoS.
|
||||
|
||||
|
||||
Throttling
|
||||
----------
|
||||
|
||||
In throttle mode, the time distance between buffers is kept to a configurable
|
||||
throttle interval. This means that effectively the buffer rate is limited
|
||||
to 1 buffer per throttle interval. This can be used to limit the framerate,
|
||||
for example.
|
||||
|
||||
When an element is configured in throttling mode (this is usually only
|
||||
implemented on sinks) it should produce QoS events upstream with the jitter
|
||||
field set to the throttle interval. This should instruct upstream elements to
|
||||
skip or drop the remaining buffers in the configured throttle interval.
|
||||
|
||||
The proportion field is set to the desired slowdown needed to get the
|
||||
desired throttle interval. Implementations can use the QoS Throttle type,
|
||||
the proportion and the jitter member to tune their implementations.
|
||||
|
||||
|
||||
QoS strategies
|
||||
--------------
|
||||
|
||||
|
@ -299,7 +338,7 @@ calculate a proportion.
|
|||
|
||||
The processing time in system time is compared to render time to decide if
|
||||
the majority of the time is spend upstream or in the sink itself. This value
|
||||
is used to decide flood or starvation.
|
||||
is used to decide overflow or underflow.
|
||||
|
||||
The number of rendered and dropped buffers is used to query stats on the sink.
|
||||
|
||||
|
@ -316,6 +355,11 @@ the human eye.
|
|||
|
||||
A QoS message is posted whenever a (part of a) buffer is dropped.
|
||||
|
||||
In throttle mode, the sink sends QoS event upstream with the timestamp set to
|
||||
the running_time of the latest buffer and the jitter set to the throttle interval.
|
||||
If the throttled buffer is late, the lateness is subtracted from the throttle
|
||||
interval in order to keep the desired throttle interval.
|
||||
|
||||
|
||||
GstBaseTransform
|
||||
----------------
|
||||
|
@ -380,7 +424,7 @@ Sources
|
|||
The QoS events only apply to push based sources since pull based sources are entirely
|
||||
controlled by another downstream element.
|
||||
|
||||
Sources can receive a flood or starvation event that can be used to switch to
|
||||
Sources can receive a overflow or underflow event that can be used to switch to
|
||||
less demanding source material. In case of a network stream, a switch could be done
|
||||
to a lower or higher quality stream or additional enhancement layers could be used
|
||||
or ignored.
|
||||
|
|
|
@ -33,7 +33,7 @@ push function to push the result to the peer sinkpad.
|
|||
Deciding the scheduling mode
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
When tha pad is activated, the _activate() function is called. The pad can then
|
||||
When a pad is activated, the _activate() function is called. The pad can then
|
||||
choose to activate itself in push or pull mode depending on upstream
|
||||
capabilities.
|
||||
|
||||
|
@ -43,13 +43,13 @@ activate function for the pad.
|
|||
The chain function
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The chain function will be called when a upstream element perform a _push() on the pad.
|
||||
The chain function will be called when a upstream element performs a _push() on the pad.
|
||||
The upstream element can be another chain based element or a pushing source.
|
||||
|
||||
The getrange function
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The getrange function is called when a peer pad perform a _pull_range() on the pad. This
|
||||
The getrange function is called when a peer pad performs a _pull_range() on the pad. This
|
||||
downstream pad can be a pulling element or another _pull_range() based element.
|
||||
|
||||
Plug-in techniques
|
||||
|
|
|
@ -11,15 +11,15 @@ pipeline. Sending the seek event to a bin will by default forward
|
|||
the event to all sinks in the bin.
|
||||
|
||||
When performing a seek, the start and stop values of the segment can be
|
||||
specified as absoulte positions or relative to the currently configured
|
||||
specified as absolute positions or relative to the currently configured
|
||||
playback segment. Note that it is not possible to seek relative to the current
|
||||
playback position. To seek relative to the current playback position, one must
|
||||
query the position first and then perform an absolute seek to the desired
|
||||
position.
|
||||
|
||||
Feedback of the seek operation can be immediatly using the GST_SEEK_FLAG_FLUSH
|
||||
Feedback of the seek operation can be immediately using the GST_SEEK_FLAG_FLUSH
|
||||
flag. With this flag, all pending data in the pipeline is discarded and playback
|
||||
starts from the new position immediatly.
|
||||
starts from the new position immediately.
|
||||
|
||||
When the FLUSH flag is not set, the seek will be queued and executed as
|
||||
soon as possible, which might be after all queues are emptied.
|
||||
|
@ -47,7 +47,7 @@ application has some time to issue a new seek to make the transition seamless.
|
|||
Typically the allowed delay is defined by the buffer sizes of the sinks as well
|
||||
as the size of any queues in the pipeline.
|
||||
|
||||
The seek can also change the playback speed of the configured segment.
|
||||
The seek can also change the playback speed of the configured segment.
|
||||
A speed of 1.0 is normal speed, 2.0 is double speed. Negative values
|
||||
mean backward playback.
|
||||
|
||||
|
@ -83,8 +83,8 @@ FLUSH seeking
|
|||
^^^^^^^^^^^^^
|
||||
|
||||
This is the most common way of performing a seek in a playback application.
|
||||
The application issues a seek on the pipeline and the new media is immediatly
|
||||
played after the seek calls returns.
|
||||
The application issues a seek on the pipeline and the new media is immediately
|
||||
played after the seek call returns.
|
||||
|
||||
|
||||
seeking without FLUSH
|
||||
|
|
|
@ -80,7 +80,7 @@ Use case: FLUSHING seek
|
|||
synchronisation and position reporting.
|
||||
|
||||
Since after a flushing seek the stream_time is reset to 0, the new buffer
|
||||
will be rendered immediatly after the seek and the current_position will be
|
||||
will be rendered immediately after the seek and the current_position will be
|
||||
the stream_time of the seek that was performed.
|
||||
|
||||
The stop time is important when the video format contains B frames. The
|
||||
|
|
|
@ -48,7 +48,7 @@ the following state changes are possible:
|
|||
PAUSED -> PLAYING
|
||||
- Most elements ignore this state change.
|
||||
- The pipeline selects a clock and distributes this to all the children
|
||||
before setting them to PLAYING. This means that it is only alowed to
|
||||
before setting them to PLAYING. This means that it is only allowed to
|
||||
synchronize on the clock in the PLAYING state.
|
||||
- The pipeline uses the clock and the running_time to calculate the base_time.
|
||||
The base_time is distributed to all children when performing the state
|
||||
|
@ -113,7 +113,7 @@ _set_state(), called the STATE_LOCK.
|
|||
Setting state on elements
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The state of an element can be changed with _element_set_state(). When chaning
|
||||
The state of an element can be changed with _element_set_state(). When changing
|
||||
the state of an element all intermediate states will also be set on the element
|
||||
until the final desired state is set.
|
||||
|
||||
|
@ -125,7 +125,7 @@ The _set_state() function can return 3 possible values:
|
|||
GST_STATE_SUCCESS: The state change is completed successfully.
|
||||
|
||||
GST_STATE_ASYNC: The state change will complete later on. This can happen
|
||||
When the element needs a long time to perform the state
|
||||
when the element needs a long time to perform the state
|
||||
change or for sinks that need to receive the first buffer
|
||||
before they can complete the state change (preroll).
|
||||
|
||||
|
@ -143,7 +143,7 @@ When setting the state of an element, the STATE_PENDING is set to the required
|
|||
state. Then the state change function of the element is called and the result of
|
||||
that function is used to update the STATE and STATE_RETURN fields, STATE_NEXT,
|
||||
STATE_PENDING and STATE_RETURN fields. If the function returned ASYNC, this result
|
||||
is immediatly returned to the caller.
|
||||
is immediately returned to the caller.
|
||||
|
||||
|
||||
Getting state of elements
|
||||
|
|
|
@ -24,9 +24,9 @@ Typical stream
|
|||
~~~~~~~~~~~~~~
|
||||
|
||||
A typical stream starts with a newsegment event that marks the
|
||||
buffer timestamp range. After that buffers are send one after the
|
||||
buffer timestamp range. After that buffers are sent one after the
|
||||
other. After the last buffer an EOS marks the end of the stream. No
|
||||
more buffer are to be processed after the EOS event.
|
||||
more buffers are to be processed after the EOS event.
|
||||
|
||||
+--+ +-++-+ +-+ +---+
|
||||
|NS| |B||B| ... |B| |EOS|
|
||||
|
|
|
@ -55,7 +55,7 @@ to PAUSED and restores this time based on the current absolute_time when going
|
|||
back to PLAYING. This allows for both clocks that progress when in the PAUSED
|
||||
state (systemclock) and clocks that don't (audioclock).
|
||||
|
||||
The clock and pipeline now provides a running_time to all elements that want to
|
||||
The clock and pipeline now provide a running_time to all elements that want to
|
||||
perform synchronisation. Indeed, the running time can be observed in each
|
||||
element (during the PLAYING state) as:
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ Windows. It is released under the GNU Library General Public License
|
|||
</para>
|
||||
|
||||
<xi:include href="xml/gst.xml" />
|
||||
<xi:include href="xml/gstatomicqueue.xml" />
|
||||
<xi:include href="xml/gstbin.xml" />
|
||||
<xi:include href="xml/gstbuffer.xml" />
|
||||
<xi:include href="xml/gstbufferlist.xml" />
|
||||
|
|
|
@ -38,6 +38,22 @@ GstPluginLoader
|
|||
GstPluginLoaderFuncs
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gstatomicqueue</FILE>
|
||||
<TITLE>GstAtomicQueue</TITLE>
|
||||
GstAtomicQueue
|
||||
gst_atomic_queue_new
|
||||
|
||||
gst_atomic_queue_ref
|
||||
gst_atomic_queue_unref
|
||||
|
||||
gst_atomic_queue_push
|
||||
gst_atomic_queue_peek
|
||||
gst_atomic_queue_pop
|
||||
|
||||
gst_atomic_queue_length
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gstbin</FILE>
|
||||
<TITLE>GstBin</TITLE>
|
||||
|
@ -400,6 +416,7 @@ gst_clock_get_time
|
|||
gst_clock_new_single_shot_id
|
||||
gst_clock_new_periodic_id
|
||||
gst_clock_single_shot_id_reinit
|
||||
gst_clock_periodic_id_reinit
|
||||
gst_clock_get_internal_time
|
||||
gst_clock_adjust_unlocked
|
||||
gst_clock_unadjust_unlocked
|
||||
|
@ -522,6 +539,7 @@ gst_element_get_compatible_pad
|
|||
gst_element_get_compatible_pad_template
|
||||
gst_element_get_request_pad
|
||||
gst_element_get_static_pad
|
||||
gst_element_request_pad
|
||||
gst_element_no_more_pads
|
||||
gst_element_release_request_pad
|
||||
gst_element_remove_pad
|
||||
|
@ -785,8 +803,11 @@ gst_event_parse_tag
|
|||
gst_event_new_buffer_size
|
||||
gst_event_parse_buffer_size
|
||||
|
||||
GstQOSType
|
||||
gst_event_new_qos
|
||||
gst_event_new_qos_full
|
||||
gst_event_parse_qos
|
||||
gst_event_parse_qos_full
|
||||
|
||||
GstSeekType
|
||||
GstSeekFlags
|
||||
|
@ -815,6 +836,7 @@ GST_TYPE_EVENT
|
|||
GST_TYPE_EVENT_TYPE
|
||||
GST_TYPE_SEEK_TYPE
|
||||
GST_TYPE_SEEK_FLAGS
|
||||
GST_TYPE_QOS_TYPE
|
||||
GST_TYPE_EVENT_TYPE_FLAGS
|
||||
<SUBSECTION Private>
|
||||
GST_EVENT_TYPE_SHIFT
|
||||
|
@ -823,6 +845,7 @@ gst_event_get_type
|
|||
gst_event_type_get_type
|
||||
gst_seek_type_get_type
|
||||
gst_seek_flags_get_type
|
||||
gst_qos_type_get_type
|
||||
gst_event_type_flags_get_type
|
||||
</SECTION>
|
||||
|
||||
|
@ -1232,6 +1255,10 @@ gst_message_parse_stream_status
|
|||
gst_message_set_stream_status_object
|
||||
gst_message_get_stream_status_object
|
||||
|
||||
GstProgressType
|
||||
gst_message_new_progress
|
||||
gst_message_parse_progress
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GstMessageClass
|
||||
GST_MESSAGE
|
||||
|
@ -1244,11 +1271,13 @@ GST_MESSAGE_GET_CLASS
|
|||
GST_TYPE_MESSAGE_TYPE
|
||||
GST_TYPE_STRUCTURE_CHANGE_TYPE
|
||||
GST_TYPE_STREAM_STATUS_TYPE
|
||||
GST_TYPE_PROGRESS_TYPE
|
||||
<SUBSECTION Private>
|
||||
gst_message_get_type
|
||||
gst_message_type_get_type
|
||||
gst_structure_change_type_get_type
|
||||
gst_stream_status_type_get_type
|
||||
gst_progress_type_get_type
|
||||
GST_MESSAGE_COND
|
||||
GST_MESSAGE_GET_LOCK
|
||||
GST_MESSAGE_LOCK
|
||||
|
@ -2181,6 +2210,7 @@ GST_TAG_ISRC
|
|||
GST_TAG_ORGANIZATION
|
||||
GST_TAG_COPYRIGHT
|
||||
GST_TAG_COPYRIGHT_URI
|
||||
GST_TAG_ENCODED_BY
|
||||
GST_TAG_COMPOSER
|
||||
GST_TAG_CONTACT
|
||||
GST_TAG_LICENSE
|
||||
|
@ -2677,6 +2707,7 @@ GST_TYPE_ARRAY
|
|||
gst_value_list_append_value
|
||||
gst_value_list_prepend_value
|
||||
gst_value_list_concat
|
||||
gst_value_list_merge
|
||||
gst_value_list_get_size
|
||||
gst_value_list_get_value
|
||||
|
||||
|
|
|
@ -275,6 +275,8 @@ gst_base_sink_is_last_buffer_enabled
|
|||
gst_base_sink_get_last_buffer
|
||||
gst_base_sink_set_blocksize
|
||||
gst_base_sink_get_blocksize
|
||||
gst_base_sink_get_throttle_time
|
||||
gst_base_sink_set_throttle_time
|
||||
|
||||
GST_BASE_SINK_PAD
|
||||
|
||||
|
|
|
@ -63,9 +63,9 @@
|
|||
means to make data throughput between threads threadsafe, and it can
|
||||
also act as a buffer. Queues have several <classname>GObject</classname>
|
||||
properties to be configured for specific uses. For example, you can set
|
||||
lower and upper tresholds for the element. If there's less data than
|
||||
the lower treshold (default: disabled), it will block output. If
|
||||
there's more data than the upper treshold, it will block input or
|
||||
lower and upper thresholds for the element. If there's less data than
|
||||
the lower threshold (default: disabled), it will block output. If
|
||||
there's more data than the upper threshold, it will block input or
|
||||
(if configured to do so) drop data.
|
||||
</para>
|
||||
<para>
|
||||
|
|
|
@ -135,6 +135,10 @@ main (int argc,
|
|||
[..]
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
(This is a silly example of course, there already exists a much more
|
||||
powerful and versatile custom bin like this: the playbin2 element.)
|
||||
</para>
|
||||
<para>
|
||||
Custom bins can be created with a plugin or an XML description. You
|
||||
will find more information about creating custom bin in the <ulink
|
||||
|
@ -143,10 +147,31 @@ main (int argc,
|
|||
Writers Guide</ulink>.
|
||||
</para>
|
||||
<para>
|
||||
Examples of such custom bins are the playbin and decodebin elements from<ulink
|
||||
Examples of such custom bins are the playbin2 and uridecodebin elements from<ulink
|
||||
type="http"
|
||||
url="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/index.html">
|
||||
gst-plugins-base</ulink>.
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 id="section-bin-state-change-handling">
|
||||
<title>Bins manage states of their children</title>
|
||||
<para>
|
||||
Bins manage the state of all elements contained in them. If you set
|
||||
a bin (or a pipeline, which is a special top-level type of bin) to
|
||||
a certain target state using <function>gst_element_set_state ()</function>,
|
||||
it will make sure all elements contained within it will also be set
|
||||
to this state. This means it's usually only necessary to set the state
|
||||
of the top-level pipeline to start up the pipeline or shut it down.
|
||||
</para>
|
||||
<para>
|
||||
Note, however, that if elements are added to a bin or pipeline that's
|
||||
already running, , e.g. from within a "pad-added" or "new-decoded-pad"
|
||||
signal callback, its state will not automatically be brought in line with
|
||||
the current state or target state of the bin or pipeline it was added to.
|
||||
Instead, you have to need to set it to the desired target state yourself
|
||||
using <function>gst_element_set_state ()</function> or
|
||||
<function>gst_element_sync_state_with_parent ()</function> when adding
|
||||
elements to an already-running pipeline.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
|
|
@ -554,5 +554,16 @@ main (int argc,
|
|||
url="&URLAPI;GstBus.html"><classname>GstBus</classname></ulink>. See
|
||||
<xref linkend="chapter-bus"/> for details.
|
||||
</para>
|
||||
<para>
|
||||
When you set a bin or pipeline to a certain target state, it will usually
|
||||
propagate the state change to all elements within the bin or pipeline
|
||||
automatically, so it's usually only necessary to set the state of the
|
||||
top-level pipeline to start up the pipeline or shut it down. However,
|
||||
when adding elements dynamically to an already-running pipeline, e.g.
|
||||
from within a "pad-added" or "new-decoded-pad" signal callback, you
|
||||
need to set it to the desired target state yourself using
|
||||
<function>gst_element_set_state ()</function> or
|
||||
<function>gst_element_sync_state_with_parent ()</function>.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
|
|
@ -118,6 +118,14 @@ main (int argc,
|
|||
<!-- example-begin pad.c d -->
|
||||
}
|
||||
<!-- example-end pad.c d --></programlisting>
|
||||
<para>
|
||||
It is not uncommon to add elements to the pipeline only from within
|
||||
the "pad-added" or "new-decoded-pad" callback. If you do this, don't
|
||||
forget to set the state of the newly-added elements to the target
|
||||
state of the pipeline using
|
||||
<function>gst_element_set_state ()</function> or
|
||||
<function>gst_element_sync_state_with_parent ()</function>.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="section-pads-request">
|
||||
|
|
|
@ -89,6 +89,7 @@ $(BUILDDIR)/$(MAIN): $(XML) $(CSS) $(EXTRA_SRC)
|
|||
|
||||
# we should switch to xsltproc
|
||||
# docbook2html aka jade can't add the encoding easily to the html meta
|
||||
# (but we are lazy and just abuse sed to add it)
|
||||
# jw -f docbook -b html -d pwg.dsl -o ../html -V '%use-id-as-filename%' $(MAIN)
|
||||
# this is a starting point
|
||||
# xsltproc --nonet /usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl pwg.xml
|
||||
|
@ -98,7 +99,8 @@ html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
|
|||
@echo "*** Generating HTML output ***"
|
||||
@-mkdir -p html
|
||||
@cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
|
||||
@cd $(BUILDDIR) && docbook2html -o ../html -V '%use-id-as-filename%' $(MAIN)
|
||||
@cd $(BUILDDIR) && SP_ENCODING="UTF-8" docbook2html -o ../html -V '%use-id-as-filename%' $(MAIN)
|
||||
@$(SED) -i -e 's/\(^CONTENT.*\)\(.>\)/\1;charset=UTF-8\2/' html/*html
|
||||
@test "x$(CSS)" != "x" && \
|
||||
echo "Copying .css files: $(CSS)" && \
|
||||
cp $(srcdir)/$(CSS) html
|
||||
|
@ -111,7 +113,7 @@ $(DOC).ps: $(BUILDDIR)/$(MAIN) $(EPS_BUILT) $(PNG_SRC) $(FIG_SRC)
|
|||
@$(MAKE) check-local
|
||||
@echo "*** Generating PS output ***"
|
||||
@cp -f $(srcdir)/../image-eps $(BUILDDIR)/image.entities
|
||||
cd $(BUILDDIR) && docbook2ps -o .. $(MAIN)
|
||||
cd $(BUILDDIR) && SP_ENCODING="UTF-8" docbook2ps -o .. $(MAIN)
|
||||
# export LC_PAPER=$(PAPER_LOCALE) && cd $(BUILDDIR) && xmlto ps -o .. $(MAIN)
|
||||
|
||||
$(DOC).pdf: $(DOC).ps
|
||||
|
|
|
@ -86,11 +86,14 @@ EXTRA_HFILES = \
|
|||
$(top_srcdir)/plugins/elements/gstfilesrc.h \
|
||||
$(top_srcdir)/plugins/elements/gstfilesink.h \
|
||||
$(top_srcdir)/plugins/elements/gstidentity.h \
|
||||
$(top_srcdir)/plugins/elements/gstinputselector.h \
|
||||
$(top_srcdir)/plugins/elements/gstmultiqueue.h \
|
||||
$(top_srcdir)/plugins/elements/gstoutputselector.h \
|
||||
$(top_srcdir)/plugins/elements/gstqueue.h \
|
||||
$(top_srcdir)/plugins/elements/gstqueue2.h \
|
||||
$(top_srcdir)/plugins/elements/gsttypefindelement.h \
|
||||
$(top_srcdir)/plugins/elements/gsttee.h
|
||||
$(top_srcdir)/plugins/elements/gsttee.h \
|
||||
$(top_srcdir)/plugins/elements/gstvalve.h
|
||||
|
||||
# Images to copy into HTML directory.
|
||||
HTML_IMAGES =
|
||||
|
|
|
@ -25,11 +25,14 @@
|
|||
<xi:include href="xml/element-filesrc.xml" />
|
||||
<xi:include href="xml/element-filesink.xml" />
|
||||
<xi:include href="xml/element-identity.xml" />
|
||||
<xi:include href="xml/element-input-selector.xml" />
|
||||
<xi:include href="xml/element-multiqueue.xml" />
|
||||
<xi:include href="xml/element-output-selector.xml" />
|
||||
<xi:include href="xml/element-queue.xml" />
|
||||
<xi:include href="xml/element-queue2.xml" />
|
||||
<xi:include href="xml/element-tee.xml" />
|
||||
<xi:include href="xml/element-typefind.xml" />
|
||||
<xi:include href="xml/element-valve.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
|
|
|
@ -71,6 +71,7 @@ GstFileSrc
|
|||
<SUBSECTION Standard>
|
||||
GstFileSrcClass
|
||||
GST_FILE_SRC
|
||||
GST_FILE_SRC_CAST
|
||||
GST_IS_FILE_SRC
|
||||
GST_TYPE_FILE_SRC
|
||||
GST_FILE_SRC_CLASS
|
||||
|
@ -124,6 +125,26 @@ GST_IS_IDENTITY_CLASS
|
|||
gst_identity_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-input-selector</FILE>
|
||||
<TITLE>input-selector</TITLE>
|
||||
GstInputSelector
|
||||
<SUBSECTION Standard>
|
||||
GstInputSelectorClass
|
||||
GST_INPUT_SELECTOR
|
||||
GST_INPUT_SELECTOR_CLASS
|
||||
GST_IS_INPUT_SELECTOR
|
||||
GST_IS_INPUT_SELECTOR_CLASS
|
||||
GST_TYPE_INPUT_SELECTOR
|
||||
gst_input_selector_get_type
|
||||
GST_INPUT_SELECTOR_BROADCAST
|
||||
GST_INPUT_SELECTOR_GET_COND
|
||||
GST_INPUT_SELECTOR_GET_LOCK
|
||||
GST_INPUT_SELECTOR_LOCK
|
||||
GST_INPUT_SELECTOR_UNLOCK
|
||||
GST_INPUT_SELECTOR_WAIT
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-queue</FILE>
|
||||
<TITLE>queue</TITLE>
|
||||
|
@ -155,6 +176,7 @@ GST_IS_QUEUE2_CLASS
|
|||
GST_TYPE_QUEUE2
|
||||
<SUBSECTION Private>
|
||||
GstQueue2Size
|
||||
GstQueue2Range
|
||||
gst_queue2_get_type
|
||||
</SECTION>
|
||||
|
||||
|
@ -173,6 +195,20 @@ GST_TYPE_MULTI_QUEUE
|
|||
gst_multi_queue_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-output-selector</FILE>
|
||||
<TITLE>output-selector</TITLE>
|
||||
GstOutputSelector
|
||||
<SUBSECTION Standard>
|
||||
GstOutputSelectorClass
|
||||
GST_OUTPUT_SELECTOR
|
||||
GST_OUTPUT_SELECTOR_CLASS
|
||||
GST_IS_OUTPUT_SELECTOR
|
||||
GST_IS_OUTPUT_SELECTOR_CLASS
|
||||
GST_TYPE_OUTPUT_SELECTOR
|
||||
gst_output_selector_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-typefind</FILE>
|
||||
<TITLE>typefind</TITLE>
|
||||
|
@ -206,3 +242,18 @@ GST_IS_TEE_CLASS
|
|||
gst_tee_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>element-valve</FILE>
|
||||
<TITLE>valve</TITLE>
|
||||
GstValve
|
||||
<SUBSECTION Standard>
|
||||
GstValveClass
|
||||
GST_VALVE
|
||||
GST_IS_VALVE
|
||||
GST_TYPE_VALVE
|
||||
GST_VALVE_CLASS
|
||||
GST_IS_VALVE_CLASS
|
||||
<SUBSECTION Private>
|
||||
gst_valve_get_type
|
||||
</SECTION>
|
||||
|
||||
|
|
|
@ -998,3 +998,73 @@
|
|||
<DEFAULT>0</DEFAULT>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GstValve::drop</NAME>
|
||||
<TYPE>gboolean</TYPE>
|
||||
<RANGE></RANGE>
|
||||
<FLAGS>rw</FLAGS>
|
||||
<NICK>Drop buffers and events</NICK>
|
||||
<BLURB>Whether to drop buffers and events or let them through.</BLURB>
|
||||
<DEFAULT>FALSE</DEFAULT>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GstOutputSelector::active-pad</NAME>
|
||||
<TYPE>GstPad*</TYPE>
|
||||
<RANGE></RANGE>
|
||||
<FLAGS>rw</FLAGS>
|
||||
<NICK>Active pad</NICK>
|
||||
<BLURB>Currently active src pad.</BLURB>
|
||||
<DEFAULT></DEFAULT>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GstOutputSelector::resend-latest</NAME>
|
||||
<TYPE>gboolean</TYPE>
|
||||
<RANGE></RANGE>
|
||||
<FLAGS>rw</FLAGS>
|
||||
<NICK>Resend latest buffer</NICK>
|
||||
<BLURB>Resend latest buffer after a switch to a new pad.</BLURB>
|
||||
<DEFAULT>FALSE</DEFAULT>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GstOutputSelector::pad-negotiation-mode</NAME>
|
||||
<TYPE>GstOutputSelectorPadNegotiationMode</TYPE>
|
||||
<RANGE></RANGE>
|
||||
<FLAGS>rw</FLAGS>
|
||||
<NICK>Pad negotiation mode</NICK>
|
||||
<BLURB>The mode to be used for pad negotiation.</BLURB>
|
||||
<DEFAULT>All</DEFAULT>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GstInputSelector::active-pad</NAME>
|
||||
<TYPE>GstPad*</TYPE>
|
||||
<RANGE></RANGE>
|
||||
<FLAGS>rw</FLAGS>
|
||||
<NICK>Active pad</NICK>
|
||||
<BLURB>The currently active sink pad.</BLURB>
|
||||
<DEFAULT></DEFAULT>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GstInputSelector::n-pads</NAME>
|
||||
<TYPE>guint</TYPE>
|
||||
<RANGE></RANGE>
|
||||
<FLAGS>r</FLAGS>
|
||||
<NICK>Number of Pads</NICK>
|
||||
<BLURB>The number of sink pads.</BLURB>
|
||||
<DEFAULT>0</DEFAULT>
|
||||
</ARG>
|
||||
|
||||
<ARG>
|
||||
<NAME>GstInputSelector::select-all</NAME>
|
||||
<TYPE>gboolean</TYPE>
|
||||
<RANGE></RANGE>
|
||||
<FLAGS>rw</FLAGS>
|
||||
<NICK>Select all mode</NICK>
|
||||
<BLURB>Forwards data from all input pads.</BLURB>
|
||||
<DEFAULT>FALSE</DEFAULT>
|
||||
</ARG>
|
||||
|
||||
|
|
|
@ -17,11 +17,14 @@ GObject
|
|||
GstIdentity
|
||||
GstBin
|
||||
GstPipeline
|
||||
GstInputSelector
|
||||
GstMultiQueue
|
||||
GstOutputSelector
|
||||
GstQueue
|
||||
GstQueue2
|
||||
GstTee
|
||||
GstTypeFindElement
|
||||
GstValve
|
||||
GstIndex
|
||||
GstFileIndex
|
||||
GstMemIndex
|
||||
|
|
|
@ -107,3 +107,20 @@ GstMultiQueue *gstmultiqueue
|
|||
GstMultiQueue *gstmultiqueue
|
||||
</SIGNAL>
|
||||
|
||||
<SIGNAL>
|
||||
<NAME>GstInputSelector::block</NAME>
|
||||
<RETURNS>gint64</RETURNS>
|
||||
<FLAGS>la</FLAGS>
|
||||
GstInputSelector *gstinputselector
|
||||
</SIGNAL>
|
||||
|
||||
<SIGNAL>
|
||||
<NAME>GstInputSelector::switch</NAME>
|
||||
<RETURNS>void</RETURNS>
|
||||
<FLAGS>l</FLAGS>
|
||||
GstInputSelector *gstinputselector
|
||||
GstPad *arg1
|
||||
gint64 arg2
|
||||
gint64 arg3
|
||||
</SIGNAL>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<description>standard GStreamer elements</description>
|
||||
<filename>../../plugins/elements/.libs/libgstcoreelements.so</filename>
|
||||
<basename>libgstcoreelements.so</basename>
|
||||
<version>0.10.31.1</version>
|
||||
<version>0.10.32.1</version>
|
||||
<license>LGPL</license>
|
||||
<source>gstreamer</source>
|
||||
<package>GStreamer git</package>
|
||||
|
@ -141,6 +141,27 @@
|
|||
</caps>
|
||||
</pads>
|
||||
</element>
|
||||
<element>
|
||||
<name>input-selector</name>
|
||||
<longname>Input selector</longname>
|
||||
<class>Generic</class>
|
||||
<description>N-to-1 input stream selector</description>
|
||||
<author>Julien Moutte <julien@moutte.net>, Jan Schmidt <thaytan@mad.scientist.com>, Wim Taymans <wim.taymans@gmail.com></author>
|
||||
<pads>
|
||||
<caps>
|
||||
<name>sink%d</name>
|
||||
<direction>sink</direction>
|
||||
<presence>request</presence>
|
||||
<details>ANY</details>
|
||||
</caps>
|
||||
<caps>
|
||||
<name>src</name>
|
||||
<direction>source</direction>
|
||||
<presence>always</presence>
|
||||
<details>ANY</details>
|
||||
</caps>
|
||||
</pads>
|
||||
</element>
|
||||
<element>
|
||||
<name>multiqueue</name>
|
||||
<longname>MultiQueue</longname>
|
||||
|
@ -162,6 +183,27 @@
|
|||
</caps>
|
||||
</pads>
|
||||
</element>
|
||||
<element>
|
||||
<name>output-selector</name>
|
||||
<longname>Output selector</longname>
|
||||
<class>Generic</class>
|
||||
<description>1-to-N output stream selector</description>
|
||||
<author>Stefan Kost <stefan.kost@nokia.com></author>
|
||||
<pads>
|
||||
<caps>
|
||||
<name>sink</name>
|
||||
<direction>sink</direction>
|
||||
<presence>always</presence>
|
||||
<details>ANY</details>
|
||||
</caps>
|
||||
<caps>
|
||||
<name>src%d</name>
|
||||
<direction>source</direction>
|
||||
<presence>request</presence>
|
||||
<details>ANY</details>
|
||||
</caps>
|
||||
</pads>
|
||||
</element>
|
||||
<element>
|
||||
<name>queue</name>
|
||||
<longname>Queue</longname>
|
||||
|
@ -246,5 +288,26 @@
|
|||
</caps>
|
||||
</pads>
|
||||
</element>
|
||||
<element>
|
||||
<name>valve</name>
|
||||
<longname>Valve element</longname>
|
||||
<class>Filter</class>
|
||||
<description>Drops buffers and events or lets them through</description>
|
||||
<author>Olivier Crete <olivier.crete@collabora.co.uk></author>
|
||||
<pads>
|
||||
<caps>
|
||||
<name>sink</name>
|
||||
<direction>sink</direction>
|
||||
<presence>always</presence>
|
||||
<details>ANY</details>
|
||||
</caps>
|
||||
<caps>
|
||||
<name>src</name>
|
||||
<direction>source</direction>
|
||||
<presence>always</presence>
|
||||
<details>ANY</details>
|
||||
</caps>
|
||||
</pads>
|
||||
</element>
|
||||
</elements>
|
||||
</plugin>
|
|
@ -3,7 +3,7 @@
|
|||
<description>GStreamer core indexers</description>
|
||||
<filename>../../plugins/indexers/.libs/libgstcoreindexers.so</filename>
|
||||
<basename>libgstcoreindexers.so</basename>
|
||||
<version>0.10.31.1</version>
|
||||
<version>0.10.32.1</version>
|
||||
<license>LGPL</license>
|
||||
<source>gstreamer</source>
|
||||
<package>GStreamer git</package>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
for application-element interaction, signals are probably not what
|
||||
you're looking for. In many cases, however, signals can be very useful.
|
||||
See the <ulink type="http"
|
||||
url="http://www.le-hacker.org/papers/gobject/index.html">GObject
|
||||
url="http://library.gnome.org/devel/gobject/stable/">GObject
|
||||
documentation</ulink> for all internals about signals.
|
||||
</para>
|
||||
</chapter>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0'?>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
|
||||
<!ENTITY % image-entities SYSTEM "image.entities">
|
||||
|
|
|
@ -104,7 +104,7 @@ factory:
|
|||
The static autoplugger has to be carefull when connecting the mpg123
|
||||
element with the audiosink because it is theoretically possible that
|
||||
the mpg123 element outputs raw audio with a rate that cannot be
|
||||
handled by the audiosink (ex. 4000KHz). In the absense of another
|
||||
handled by the audiosink (ex. 4000KHz). In the absence of another
|
||||
audiosink with more capabilities, the autoplugging of this simple
|
||||
pipeline will not be possible and would fail.
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ for the negotiated format.
|
|||
|
||||
The bufferpool could be a helper GObject (like we use GstAdapter). If would
|
||||
manage a collection of GstBuffers. For each buffer t tracks wheter its in use or
|
||||
available. The bufferpool in gst-plgin-good/sys/v4l2/gstv4l2bufferpool might be
|
||||
available. The bufferpool in gst-plugin-good/sys/v4l2/gstv4l2bufferpool might be
|
||||
a starting point.
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ Add interface to control the level of output, both compile- and run-time
|
|||
|
||||
(done) Make sure the build is capable of being run without any debugging noise
|
||||
|
||||
Make sure that the absense of any of the optional libraries will not be fatal
|
||||
Make sure that the absence of any of the optional libraries will not be fatal
|
||||
|
||||
Make sure all the old plugins don't build normally, via some configure option?
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ ELEMENTS (v4lsrc, alsasrc, osssrc)
|
|||
|
||||
- a second element can be responsible for making the stream time-contiguous.
|
||||
(ie, T1 + D1 = T2 for all buffers). This way they are made
|
||||
acceptible for gapless presentation (which is useful for audio).
|
||||
acceptable for gapless presentation (which is useful for audio).
|
||||
- The element treats the incoming stream as data-contiguous but not
|
||||
necessarily time-contiguous.
|
||||
- If the timestamps are contiguous as well, then everything is fine and
|
||||
|
|
|
@ -11,7 +11,7 @@ and properties are still used for plugin-app communication).
|
|||
|
||||
Events will be generated by either a plugin or the app. It should be
|
||||
possible for a plugin to generate an event on one of its pads and it
|
||||
should be possible for an app to insert an event on an abitrary pad in
|
||||
should be possible for an app to insert an event on an arbitrary pad in
|
||||
the pipeline.
|
||||
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ and properties are still used for plugin-app communication).
|
|||
|
||||
Events will be generated by either a plugin or the app. It should be
|
||||
possible for a plugin to generate an event on one of its pads and it
|
||||
should be possible for an app to insert an event on an abitrary pad or
|
||||
should be possible for an app to insert an event on an arbitrary pad or
|
||||
element in the pipeline.
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ Introduction (1)
|
|||
GStreamer is a library and set of tools to build arbitrary,
|
||||
reconfigurable filter graphs. It derives from the OGI Pipeline
|
||||
and DirectShow (docs, no experience), and is in its second
|
||||
generation (first was completed/abandonded *in* Atlanta on the
|
||||
generation (first was completed/abandoned *in* Atlanta on the
|
||||
way to the Linux Expo).
|
||||
0.1.0 release is scheduled for Oct 31, 1999.
|
||||
Will cover Background, Goals, Design, and Futures
|
||||
|
|
|
@ -6,7 +6,7 @@ dnl AM_GST_ELEMENT_CHECK(ELEMENT-NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
|
|||
|
||||
AC_DEFUN([AM_GST_ELEMENT_CHECK],
|
||||
[
|
||||
if test "x$GST_INSPECT" == "x"; then
|
||||
if test "x$GST_INSPECT" = "x"; then
|
||||
AC_CHECK_PROG(GST_INSPECT, gst-inspect-@GST_MAJORMINOR@, gst-inspect-@GST_MAJORMINOR@, [])
|
||||
fi
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
|
|||
gstinfo.c \
|
||||
gstinterface.c \
|
||||
gstiterator.c \
|
||||
gstatomicqueue.c \
|
||||
gstmessage.c \
|
||||
gstminiobject.c \
|
||||
gstpad.c \
|
||||
|
@ -160,6 +161,7 @@ gst_headers = \
|
|||
gstinfo.h \
|
||||
gstinterface.h \
|
||||
gstiterator.h \
|
||||
gstatomicqueue.h \
|
||||
gstmacros.h \
|
||||
gstmessage.h \
|
||||
gstminiobject.h \
|
||||
|
|
|
@ -13,9 +13,15 @@
|
|||
G_BEGIN_DECLS
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2,25,0)
|
||||
|
||||
#if defined (_MSC_VER) && !defined(_WIN64)
|
||||
typedef struct _stat32 GStatBuf;
|
||||
#else
|
||||
typedef struct stat GStatBuf;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if GLIB_CHECK_VERSION(2,26,0)
|
||||
#define GLIB_HAS_GDATETIME
|
||||
#endif
|
||||
|
|
31
gst/gst.c
31
gst/gst.c
|
@ -297,7 +297,7 @@ DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
* threading system as one of the very first things in your program
|
||||
* (see the example at the beginning of this section).
|
||||
*
|
||||
* Returns: a pointer to GStreamer's option group.
|
||||
* Returns: (transfer full): a pointer to GStreamer's option group.
|
||||
*/
|
||||
|
||||
GOptionGroup *
|
||||
|
@ -398,7 +398,7 @@ gst_init_get_option_group (void)
|
|||
|
||||
/**
|
||||
* gst_init_check:
|
||||
* @argc: (inout): pointer to application's argc
|
||||
* @argc: (inout) (allow-none): pointer to application's argc
|
||||
* @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
|
||||
* @err: pointer to a #GError to which a message will be posted on error
|
||||
*
|
||||
|
@ -457,7 +457,7 @@ gst_init_check (int *argc, char **argv[], GError ** err)
|
|||
|
||||
/**
|
||||
* gst_init:
|
||||
* @argc: (inout): pointer to application's argc
|
||||
* @argc: (inout) (allow-none): pointer to application's argc
|
||||
* @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
|
||||
*
|
||||
* Initializes the GStreamer library, setting up internal path lists,
|
||||
|
@ -572,16 +572,6 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/* GStreamer was built against a GLib >= 2.8 and is therefore not doing
|
||||
* the refcount hack. Check that it isn't being run against an older GLib */
|
||||
if (glib_major_version < 2 ||
|
||||
(glib_major_version == 2 && glib_minor_version < 8)) {
|
||||
g_warning ("GStreamer was compiled against GLib %d.%d.%d but is running"
|
||||
" against %d.%d.%d. This will cause reference counting issues",
|
||||
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION,
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
}
|
||||
|
||||
g_type_init ();
|
||||
|
||||
/* we need threading to be enabled right here */
|
||||
|
@ -715,6 +705,7 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
|
|||
g_type_class_ref (gst_event_type_get_type ());
|
||||
g_type_class_ref (gst_seek_type_get_type ());
|
||||
g_type_class_ref (gst_seek_flags_get_type ());
|
||||
g_type_class_ref (gst_qos_type_get_type ());
|
||||
g_type_class_ref (gst_format_get_type ());
|
||||
g_type_class_ref (gst_index_certainty_get_type ());
|
||||
g_type_class_ref (gst_index_entry_type_get_type ());
|
||||
|
@ -755,6 +746,7 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
|
|||
g_type_class_ref (gst_parse_error_get_type ());
|
||||
g_type_class_ref (gst_parse_flags_get_type ());
|
||||
g_type_class_ref (gst_search_mode_get_type ());
|
||||
g_type_class_ref (gst_progress_type_get_type ());
|
||||
|
||||
gst_structure_get_type ();
|
||||
_gst_value_initialize ();
|
||||
|
@ -1081,6 +1073,7 @@ gst_deinit (void)
|
|||
g_type_class_unref (g_type_class_peek (gst_event_type_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_seek_type_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_seek_flags_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_qos_type_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_format_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_index_certainty_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_index_entry_type_get_type ()));
|
||||
|
@ -1118,6 +1111,7 @@ gst_deinit (void)
|
|||
g_type_class_unref (g_type_class_peek (gst_uri_type_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_parse_error_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_param_spec_fraction_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_progress_type_get_type ()));
|
||||
|
||||
gst_deinitialized = TRUE;
|
||||
GST_INFO ("deinitialized GStreamer");
|
||||
|
@ -1125,10 +1119,10 @@ gst_deinit (void)
|
|||
|
||||
/**
|
||||
* gst_version:
|
||||
* @major: pointer to a guint to store the major version number
|
||||
* @minor: pointer to a guint to store the minor version number
|
||||
* @micro: pointer to a guint to store the micro version number
|
||||
* @nano: pointer to a guint to store the nano version number
|
||||
* @major: (out): pointer to a guint to store the major version number
|
||||
* @minor: (out): pointer to a guint to store the minor version number
|
||||
* @micro: (out): pointer to a guint to store the micro version number
|
||||
* @nano: (out): pointer to a guint to store the nano version number
|
||||
*
|
||||
* Gets the version number of the GStreamer library.
|
||||
*/
|
||||
|
@ -1152,7 +1146,8 @@ gst_version (guint * major, guint * minor, guint * micro, guint * nano)
|
|||
* This function returns a string that is useful for describing this version
|
||||
* of GStreamer to the outside world: user agent strings, logging, ...
|
||||
*
|
||||
* Returns: a newly allocated string describing this version of GStreamer.
|
||||
* Returns: (transfer full): a newly allocated string describing this version
|
||||
* of GStreamer.
|
||||
*/
|
||||
|
||||
gchar *
|
||||
|
|
406
gst/gstatomicqueue.c
Normal file
406
gst/gstatomicqueue.c
Normal file
|
@ -0,0 +1,406 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) 2009 Edward Hervey <bilboed@bilboed.com>
|
||||
* 2011 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* gstatomicqueue.c:
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gst_private.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include "gstatomicqueue.h"
|
||||
|
||||
/**
|
||||
* SECTION:gstatomicqueue
|
||||
* @title: GstAtomicQueue
|
||||
* @short_description: An atomic queue implementation
|
||||
*
|
||||
* The #GstAtomicQueue object implements a queue that can be used from multiple
|
||||
* threads without performing any blocking operations.
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*/
|
||||
|
||||
/* By default the queue uses 2 * sizeof(gpointer) * clp2 (max_items) of
|
||||
* memory. clp2(x) is the next power of two >= than x.
|
||||
*
|
||||
* The queue can operate in low memory mode, in which it consumes almost
|
||||
* half the memory at the expense of extra overhead in the readers. This
|
||||
* is disabled by default because even without LOW_MEM mode, the memory
|
||||
* consumption is still lower than a plain GList.
|
||||
*/
|
||||
#undef LOW_MEM
|
||||
|
||||
typedef struct _GstAQueueMem GstAQueueMem;
|
||||
|
||||
struct _GstAQueueMem
|
||||
{
|
||||
gint size;
|
||||
gpointer *array;
|
||||
volatile gint head;
|
||||
volatile gint tail;
|
||||
GstAQueueMem *next;
|
||||
GstAQueueMem *free;
|
||||
};
|
||||
|
||||
static guint
|
||||
clp2 (guint n)
|
||||
{
|
||||
guint res = 1;
|
||||
|
||||
while (res < n)
|
||||
res <<= 1;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static GstAQueueMem *
|
||||
new_queue_mem (guint size, gint pos)
|
||||
{
|
||||
GstAQueueMem *mem;
|
||||
|
||||
mem = g_new (GstAQueueMem, 1);
|
||||
|
||||
/* we keep the size as a mask for performance */
|
||||
mem->size = clp2 (MAX (size, 16)) - 1;
|
||||
mem->array = g_new0 (gpointer, mem->size + 1);
|
||||
mem->head = pos;
|
||||
mem->tail = pos;
|
||||
mem->next = NULL;
|
||||
mem->free = NULL;
|
||||
|
||||
return mem;
|
||||
}
|
||||
|
||||
static void
|
||||
free_queue_mem (GstAQueueMem * mem)
|
||||
{
|
||||
g_free (mem->array);
|
||||
g_free (mem);
|
||||
}
|
||||
|
||||
struct _GstAtomicQueue
|
||||
{
|
||||
volatile gint refcount;
|
||||
#ifdef LOW_MEM
|
||||
gint num_readers;
|
||||
#endif
|
||||
GstAQueueMem *head_mem;
|
||||
GstAQueueMem *tail_mem;
|
||||
GstAQueueMem *free_list;
|
||||
};
|
||||
|
||||
static void
|
||||
add_to_free_list (GstAtomicQueue * queue, GstAQueueMem * mem)
|
||||
{
|
||||
do {
|
||||
mem->free = g_atomic_pointer_get (&queue->free_list);
|
||||
} while (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
|
||||
queue->free_list, mem->free, mem));
|
||||
}
|
||||
|
||||
static void
|
||||
clear_free_list (GstAtomicQueue * queue)
|
||||
{
|
||||
GstAQueueMem *free_list;
|
||||
|
||||
/* take the free list and replace with NULL */
|
||||
do {
|
||||
free_list = g_atomic_pointer_get (&queue->free_list);
|
||||
if (free_list == NULL)
|
||||
return;
|
||||
} while (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
|
||||
queue->free_list, free_list, NULL));
|
||||
|
||||
while (free_list) {
|
||||
GstAQueueMem *next = free_list->free;
|
||||
|
||||
free_queue_mem (free_list);
|
||||
|
||||
free_list = next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_atomic_queue_new:
|
||||
* @initial_size: initial queue size
|
||||
*
|
||||
* Create a new atomic queue instance. @initial_size will be rounded up to the
|
||||
* nearest power of 2 and used as the initial size of the queue.
|
||||
*
|
||||
* Returns: a new #GstAtomicQueue
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*/
|
||||
GstAtomicQueue *
|
||||
gst_atomic_queue_new (guint initial_size)
|
||||
{
|
||||
GstAtomicQueue *queue;
|
||||
|
||||
queue = g_new (GstAtomicQueue, 1);
|
||||
|
||||
queue->refcount = 1;
|
||||
#ifdef LOW_MEM
|
||||
queue->num_readers = 0;
|
||||
#endif
|
||||
queue->head_mem = queue->tail_mem = new_queue_mem (initial_size, 0);
|
||||
queue->free_list = NULL;
|
||||
|
||||
return queue;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_atomic_queue_ref:
|
||||
* @queue: a #GstAtomicQueue
|
||||
*
|
||||
* Increase the refcount of @queue.
|
||||
*/
|
||||
void
|
||||
gst_atomic_queue_ref (GstAtomicQueue * queue)
|
||||
{
|
||||
g_return_if_fail (queue != NULL);
|
||||
|
||||
g_atomic_int_inc (&queue->refcount);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_atomic_queue_free (GstAtomicQueue * queue)
|
||||
{
|
||||
free_queue_mem (queue->head_mem);
|
||||
if (queue->head_mem != queue->tail_mem)
|
||||
free_queue_mem (queue->tail_mem);
|
||||
clear_free_list (queue);
|
||||
g_free (queue);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_atomic_queue_unref:
|
||||
* @queue: a #GstAtomicQueue
|
||||
*
|
||||
* Unref @queue and free the memory when the refcount reaches 0.
|
||||
*/
|
||||
void
|
||||
gst_atomic_queue_unref (GstAtomicQueue * queue)
|
||||
{
|
||||
g_return_if_fail (queue != NULL);
|
||||
|
||||
if (g_atomic_int_dec_and_test (&queue->refcount))
|
||||
gst_atomic_queue_free (queue);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_atomic_queue_peek:
|
||||
* @queue: a #GstAtomicQueue
|
||||
*
|
||||
* Peek the head element of the queue without removing it from the queue.
|
||||
*
|
||||
* Returns: the head element of @queue or NULL when the queue is empty.
|
||||
*/
|
||||
gpointer
|
||||
gst_atomic_queue_peek (GstAtomicQueue * queue)
|
||||
{
|
||||
GstAQueueMem *head_mem;
|
||||
gint head, tail, size;
|
||||
|
||||
g_return_val_if_fail (queue != NULL, NULL);
|
||||
|
||||
while (TRUE) {
|
||||
GstAQueueMem *next;
|
||||
|
||||
head_mem = g_atomic_pointer_get (&queue->head_mem);
|
||||
|
||||
head = g_atomic_int_get (&head_mem->head);
|
||||
tail = g_atomic_int_get (&head_mem->tail);
|
||||
size = head_mem->size;
|
||||
|
||||
/* when we are not empty, we can continue */
|
||||
if (G_LIKELY (head != tail))
|
||||
break;
|
||||
|
||||
/* else array empty, try to take next */
|
||||
next = g_atomic_pointer_get (&head_mem->next);
|
||||
if (next == NULL)
|
||||
return NULL;
|
||||
|
||||
/* now we try to move the next array as the head memory. If we fail to do that,
|
||||
* some other reader managed to do it first and we retry */
|
||||
if (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
|
||||
queue->head_mem, head_mem, next))
|
||||
continue;
|
||||
|
||||
/* when we managed to swing the head pointer the old head is now
|
||||
* useless and we add it to the freelist. We can't free the memory yet
|
||||
* because we first need to make sure no reader is accessing it anymore. */
|
||||
add_to_free_list (queue, head_mem);
|
||||
}
|
||||
|
||||
return head_mem->array[head & size];
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_atomic_queue_pop:
|
||||
* @queue: a #GstAtomicQueue
|
||||
*
|
||||
* Get the head element of the queue.
|
||||
*
|
||||
* Returns: the head element of @queue or NULL when the queue is empty.
|
||||
*/
|
||||
gpointer
|
||||
gst_atomic_queue_pop (GstAtomicQueue * queue)
|
||||
{
|
||||
gpointer ret;
|
||||
GstAQueueMem *head_mem;
|
||||
gint head, tail, size;
|
||||
|
||||
g_return_val_if_fail (queue != NULL, NULL);
|
||||
|
||||
#ifdef LOW_MEM
|
||||
g_atomic_int_inc (&queue->num_readers);
|
||||
#endif
|
||||
|
||||
do {
|
||||
while (TRUE) {
|
||||
GstAQueueMem *next;
|
||||
|
||||
head_mem = g_atomic_pointer_get (&queue->head_mem);
|
||||
|
||||
head = g_atomic_int_get (&head_mem->head);
|
||||
tail = g_atomic_int_get (&head_mem->tail);
|
||||
size = head_mem->size;
|
||||
|
||||
/* when we are not empty, we can continue */
|
||||
if (G_LIKELY (head != tail))
|
||||
break;
|
||||
|
||||
/* else array empty, try to take next */
|
||||
next = g_atomic_pointer_get (&head_mem->next);
|
||||
if (next == NULL)
|
||||
return NULL;
|
||||
|
||||
/* now we try to move the next array as the head memory. If we fail to do that,
|
||||
* some other reader managed to do it first and we retry */
|
||||
if (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
|
||||
queue->head_mem, head_mem, next))
|
||||
continue;
|
||||
|
||||
/* when we managed to swing the head pointer the old head is now
|
||||
* useless and we add it to the freelist. We can't free the memory yet
|
||||
* because we first need to make sure no reader is accessing it anymore. */
|
||||
add_to_free_list (queue, head_mem);
|
||||
}
|
||||
|
||||
ret = head_mem->array[head & size];
|
||||
} while (!g_atomic_int_compare_and_exchange (&head_mem->head, head,
|
||||
head + 1));
|
||||
|
||||
#ifdef LOW_MEM
|
||||
/* decrement number of readers, when we reach 0 readers we can be sure that
|
||||
* none is accessing the memory in the free list and we can try to clean up */
|
||||
if (g_atomic_int_dec_and_test (&queue->num_readers))
|
||||
clear_free_list (queue);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_atomic_queue_push:
|
||||
* @queue: a #GstAtomicQueue
|
||||
* @data: the data
|
||||
*
|
||||
* Append @data to the tail of the queue.
|
||||
*/
|
||||
void
|
||||
gst_atomic_queue_push (GstAtomicQueue * queue, gpointer data)
|
||||
{
|
||||
GstAQueueMem *tail_mem;
|
||||
gint head, tail, size;
|
||||
|
||||
g_return_if_fail (queue != NULL);
|
||||
|
||||
do {
|
||||
while (TRUE) {
|
||||
GstAQueueMem *mem;
|
||||
|
||||
tail_mem = g_atomic_pointer_get (&queue->tail_mem);
|
||||
head = g_atomic_int_get (&tail_mem->head);
|
||||
tail = g_atomic_int_get (&tail_mem->tail);
|
||||
size = tail_mem->size;
|
||||
|
||||
/* we're not full, continue */
|
||||
if (tail - head <= size)
|
||||
break;
|
||||
|
||||
/* else we need to grow the array, we store a mask so we have to add 1 */
|
||||
mem = new_queue_mem ((size << 1) + 1, tail);
|
||||
|
||||
/* try to make our new array visible to other writers */
|
||||
if (!g_atomic_pointer_compare_and_exchange ((gpointer *) &
|
||||
queue->tail_mem, tail_mem, mem)) {
|
||||
/* we tried to swap the new writer array but something changed. This is
|
||||
* because some other writer beat us to it, we free our memory and try
|
||||
* again */
|
||||
free_queue_mem (mem);
|
||||
continue;
|
||||
}
|
||||
/* make sure that readers can find our new array as well. The one who
|
||||
* manages to swap the pointer is the only one who can set the next
|
||||
* pointer to the new array */
|
||||
g_atomic_pointer_set (&tail_mem->next, mem);
|
||||
}
|
||||
} while (!g_atomic_int_compare_and_exchange (&tail_mem->tail, tail,
|
||||
tail + 1));
|
||||
|
||||
tail_mem->array[tail & size] = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_atomic_queue_length:
|
||||
* @queue: a #GstAtomicQueue
|
||||
*
|
||||
* Get the amount of items in the queue.
|
||||
*
|
||||
* Returns: the number of elements in the queue.
|
||||
*/
|
||||
guint
|
||||
gst_atomic_queue_length (GstAtomicQueue * queue)
|
||||
{
|
||||
GstAQueueMem *head_mem, *tail_mem;
|
||||
gint head, tail;
|
||||
|
||||
g_return_val_if_fail (queue != NULL, 0);
|
||||
|
||||
#ifdef LOW_MEM
|
||||
g_atomic_int_inc (&queue->num_readers);
|
||||
#endif
|
||||
|
||||
head_mem = g_atomic_pointer_get (&queue->head_mem);
|
||||
head = g_atomic_int_get (&head_mem->head);
|
||||
|
||||
tail_mem = g_atomic_pointer_get (&queue->tail_mem);
|
||||
tail = g_atomic_int_get (&tail_mem->tail);
|
||||
|
||||
#ifdef LOW_MEM
|
||||
if (g_atomic_int_dec_and_test (&queue->num_readers))
|
||||
clear_free_list (queue);
|
||||
#endif
|
||||
|
||||
return tail - head;
|
||||
}
|
52
gst/gstatomicqueue.h
Normal file
52
gst/gstatomicqueue.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) 2009-2010 Edward Hervey <bilboed@bilboed.com>
|
||||
* (C) 2011 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* gstatomicqueue.h:
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifndef __GST_ATOMIC_QUEUE_H__
|
||||
#define __GST_ATOMIC_QUEUE_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GstAtomicQueue:
|
||||
* Opaque atomic data queue.
|
||||
*
|
||||
* Use the acessor functions to get the stored values.
|
||||
*/
|
||||
typedef struct _GstAtomicQueue GstAtomicQueue;
|
||||
|
||||
|
||||
GstAtomicQueue * gst_atomic_queue_new (guint initial_size);
|
||||
|
||||
void gst_atomic_queue_ref (GstAtomicQueue * queue);
|
||||
void gst_atomic_queue_unref (GstAtomicQueue * queue);
|
||||
|
||||
void gst_atomic_queue_push (GstAtomicQueue* queue, gpointer data);
|
||||
gpointer gst_atomic_queue_pop (GstAtomicQueue* queue);
|
||||
gpointer gst_atomic_queue_peek (GstAtomicQueue* queue);
|
||||
|
||||
guint gst_atomic_queue_length (GstAtomicQueue * queue);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_ATOMIC_QUEUE_H__ */
|
34
gst/gstbin.c
34
gst/gstbin.c
|
@ -561,7 +561,7 @@ gst_bin_dispose (GObject * object)
|
|||
*
|
||||
* Creates a new bin with the given name.
|
||||
*
|
||||
* Returns: a new #GstBin
|
||||
* Returns: (transfer full): a new #GstBin
|
||||
*/
|
||||
GstElement *
|
||||
gst_bin_new (const gchar * name)
|
||||
|
@ -1159,7 +1159,7 @@ had_parent:
|
|||
/**
|
||||
* gst_bin_add:
|
||||
* @bin: a #GstBin
|
||||
* @element: the #GstElement to add
|
||||
* @element: (transfer full): the #GstElement to add
|
||||
*
|
||||
* Adds the given element to the bin. Sets the element's parent, and thus
|
||||
* takes ownership of the element. An element can only be added to one bin.
|
||||
|
@ -1167,6 +1167,14 @@ had_parent:
|
|||
* If the element's pads are linked to other pads, the pads will be unlinked
|
||||
* before the element is added to the bin.
|
||||
*
|
||||
* <note>
|
||||
* When you add an element to an already-running pipeline, you will have to
|
||||
* take care to set the state of the newly-added element to the desired
|
||||
* state (usually PLAYING or PAUSED, same you set the pipeline to originally)
|
||||
* with gst_element_set_state(), or use gst_element_sync_state_with_parent().
|
||||
* The bin or pipeline will not take care of this for you.
|
||||
* </note>
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
* Returns: TRUE if the element could be added, FALSE if
|
||||
|
@ -1455,7 +1463,7 @@ already_removing:
|
|||
/**
|
||||
* gst_bin_remove:
|
||||
* @bin: a #GstBin
|
||||
* @element: the #GstElement to remove
|
||||
* @element: (transfer none): the #GstElement to remove
|
||||
*
|
||||
* Removes the element from the bin, unparenting it as well.
|
||||
* Unparenting the element means that the element will be dereferenced,
|
||||
|
@ -1520,7 +1528,7 @@ iterate_child (GstIterator * it, GstElement * child)
|
|||
*
|
||||
* MT safe. Caller owns returned value.
|
||||
*
|
||||
* Returns: a #GstIterator of #GstElement, or NULL
|
||||
* Returns: (transfer full): a #GstIterator of #GstElement, or NULL
|
||||
*/
|
||||
GstIterator *
|
||||
gst_bin_iterate_elements (GstBin * bin)
|
||||
|
@ -1570,7 +1578,7 @@ iterate_child_recurse (GstIterator * it, GstElement * child)
|
|||
*
|
||||
* MT safe. Caller owns returned value.
|
||||
*
|
||||
* Returns: a #GstIterator of #GstElement, or NULL
|
||||
* Returns: (transfer full): a #GstIterator of #GstElement, or NULL
|
||||
*/
|
||||
GstIterator *
|
||||
gst_bin_iterate_recurse (GstBin * bin)
|
||||
|
@ -1641,7 +1649,7 @@ sink_iterator_filter (GstElement * child, GstBin * bin)
|
|||
*
|
||||
* MT safe. Caller owns returned value.
|
||||
*
|
||||
* Returns: a #GstIterator of #GstElement, or NULL
|
||||
* Returns: (transfer full): a #GstIterator of #GstElement, or NULL
|
||||
*/
|
||||
GstIterator *
|
||||
gst_bin_iterate_sinks (GstBin * bin)
|
||||
|
@ -1703,7 +1711,7 @@ src_iterator_filter (GstElement * child, GstBin * bin)
|
|||
*
|
||||
* MT safe. Caller owns returned value.
|
||||
*
|
||||
* Returns: a #GstIterator of #GstElement, or NULL
|
||||
* Returns: (transfer full): a #GstIterator of #GstElement, or NULL
|
||||
*/
|
||||
GstIterator *
|
||||
gst_bin_iterate_sources (GstBin * bin)
|
||||
|
@ -2056,7 +2064,7 @@ gst_bin_sort_iterator_new (GstBin * bin)
|
|||
*
|
||||
* MT safe. Caller owns returned value.
|
||||
*
|
||||
* Returns: a #GstIterator of #GstElement, or NULL
|
||||
* Returns: (transfer full): a #GstIterator of #GstElement, or NULL
|
||||
*/
|
||||
GstIterator *
|
||||
gst_bin_iterate_sorted (GstBin * bin)
|
||||
|
@ -3661,7 +3669,7 @@ compare_name (GstElement * element, const gchar * name)
|
|||
*
|
||||
* MT safe. Caller owns returned reference.
|
||||
*
|
||||
* Returns: the #GstElement with the given name, or NULL
|
||||
* Returns: (transfer full): the #GstElement with the given name, or NULL
|
||||
*/
|
||||
GstElement *
|
||||
gst_bin_get_by_name (GstBin * bin, const gchar * name)
|
||||
|
@ -3695,7 +3703,7 @@ gst_bin_get_by_name (GstBin * bin, const gchar * name)
|
|||
*
|
||||
* MT safe. Caller owns returned reference.
|
||||
*
|
||||
* Returns: the #GstElement with the given name, or NULL
|
||||
* Returns: (transfer full): the #GstElement with the given name, or NULL
|
||||
*/
|
||||
GstElement *
|
||||
gst_bin_get_by_name_recurse_up (GstBin * bin, const gchar * name)
|
||||
|
@ -3752,7 +3760,7 @@ compare_interface (GstElement * element, gpointer interface)
|
|||
*
|
||||
* MT safe. Caller owns returned reference.
|
||||
*
|
||||
* Returns: A #GstElement inside the bin implementing the interface
|
||||
* Returns: (transfer full): A #GstElement inside the bin implementing the interface
|
||||
*/
|
||||
GstElement *
|
||||
gst_bin_get_by_interface (GstBin * bin, GType iface)
|
||||
|
@ -3786,8 +3794,8 @@ gst_bin_get_by_interface (GstBin * bin, GType iface)
|
|||
*
|
||||
* MT safe. Caller owns returned value.
|
||||
*
|
||||
* Returns: a #GstIterator of #GstElement for all elements in the bin
|
||||
* implementing the given interface, or NULL
|
||||
* Returns: (transfer full): a #GstIterator of #GstElement for all elements
|
||||
* in the bin implementing the given interface, or NULL
|
||||
*/
|
||||
GstIterator *
|
||||
gst_bin_iterate_all_by_interface (GstBin * bin, GType iface)
|
||||
|
|
|
@ -323,7 +323,8 @@ gst_buffer_init (GstBuffer * buffer)
|
|||
* Creates a newly allocated buffer without any data.
|
||||
*
|
||||
* MT safe.
|
||||
* Returns: the new #GstBuffer.
|
||||
*
|
||||
* Returns: (transfer full): the new #GstBuffer.
|
||||
*/
|
||||
GstBuffer *
|
||||
gst_buffer_new (void)
|
||||
|
@ -339,7 +340,7 @@ gst_buffer_new (void)
|
|||
|
||||
/**
|
||||
* gst_buffer_new_and_alloc:
|
||||
* @size: the size of the new buffer's data.
|
||||
* @size: the size in bytes of the new buffer's data.
|
||||
*
|
||||
* Creates a newly allocated buffer with data of the given size.
|
||||
* The buffer memory is not cleared. If the requested amount of
|
||||
|
@ -352,7 +353,8 @@ gst_buffer_new (void)
|
|||
* Note that when @size == 0, the buffer data pointer will be NULL.
|
||||
*
|
||||
* MT safe.
|
||||
* Returns: the new #GstBuffer.
|
||||
*
|
||||
* Returns: (transfer full): the new #GstBuffer.
|
||||
*/
|
||||
GstBuffer *
|
||||
gst_buffer_new_and_alloc (guint size)
|
||||
|
@ -387,7 +389,7 @@ gst_buffer_new_and_alloc (guint size)
|
|||
|
||||
/**
|
||||
* gst_buffer_try_new_and_alloc:
|
||||
* @size: the size of the new buffer's data.
|
||||
* @size: the size in bytes of the new buffer's data.
|
||||
*
|
||||
* Tries to create a newly allocated buffer with data of the given size. If
|
||||
* the requested amount of memory can't be allocated, NULL will be returned.
|
||||
|
@ -397,7 +399,8 @@ gst_buffer_new_and_alloc (guint size)
|
|||
*
|
||||
* MT safe.
|
||||
*
|
||||
* Returns: a new #GstBuffer, or NULL if the memory couldn't be allocated.
|
||||
* Returns: (transfer full): a new #GstBuffer, or NULL if the memory couldn't
|
||||
* be allocated.
|
||||
*
|
||||
* Since: 0.10.13
|
||||
*/
|
||||
|
@ -448,7 +451,7 @@ gst_buffer_try_new_and_alloc (guint size)
|
|||
* Gets the media type of the buffer. This can be NULL if there
|
||||
* is no media type attached to this buffer.
|
||||
*
|
||||
* Returns: a reference to the #GstCaps. unref after usage.
|
||||
* Returns: (transfer full): a reference to the #GstCaps. unref after usage.
|
||||
* Returns NULL if there were no caps on this buffer.
|
||||
*/
|
||||
/* this is not made atomic because if the buffer were reffed from multiple
|
||||
|
@ -472,7 +475,7 @@ gst_buffer_get_caps (GstBuffer * buffer)
|
|||
/**
|
||||
* gst_buffer_set_caps:
|
||||
* @buffer: a #GstBuffer.
|
||||
* @caps: a #GstCaps.
|
||||
* @caps: (transfer none): a #GstCaps.
|
||||
*
|
||||
* Sets the media type on the buffer. The refcount of the caps will
|
||||
* be increased and any previous caps on the buffer will be
|
||||
|
@ -514,7 +517,7 @@ gst_buffer_is_metadata_writable (GstBuffer * buf)
|
|||
|
||||
/**
|
||||
* gst_buffer_make_metadata_writable:
|
||||
* @buf: a #GstBuffer
|
||||
* @buf: (transfer full): a #GstBuffer
|
||||
*
|
||||
* Similar to gst_buffer_make_writable, but does not ensure that the buffer
|
||||
* data array is writable. Instead, this just ensures that the returned buffer
|
||||
|
@ -524,7 +527,8 @@ gst_buffer_is_metadata_writable (GstBuffer * buf)
|
|||
* After calling this function, @buf should not be referenced anymore. The
|
||||
* result of this function has guaranteed writable metadata.
|
||||
*
|
||||
* Returns: A new #GstBuffer with writable metadata.
|
||||
* Returns: (transfer full): a new #GstBuffer with writable metadata, which
|
||||
* may or may not be the same as @buf.
|
||||
*/
|
||||
GstBuffer *
|
||||
gst_buffer_make_metadata_writable (GstBuffer * buf)
|
||||
|
@ -561,8 +565,9 @@ gst_buffer_make_metadata_writable (GstBuffer * buf)
|
|||
* to #GST_CLOCK_TIME_NONE and #GST_BUFFER_OFFSET_NONE.
|
||||
*
|
||||
* MT safe.
|
||||
* Returns: the new #GstBuffer.
|
||||
* Returns NULL if the arguments were invalid.
|
||||
*
|
||||
* Returns: (transfer full): the new #GstBuffer or NULL if the arguments were
|
||||
* invalid.
|
||||
*/
|
||||
GstBuffer *
|
||||
gst_buffer_create_sub (GstBuffer * buffer, guint offset, guint size)
|
||||
|
@ -572,7 +577,7 @@ gst_buffer_create_sub (GstBuffer * buffer, guint offset, guint size)
|
|||
gboolean complete;
|
||||
|
||||
g_return_val_if_fail (buffer != NULL, NULL);
|
||||
g_return_val_if_fail (buffer->mini_object.refcount, NULL);
|
||||
g_return_val_if_fail (buffer->mini_object.refcount > 0, NULL);
|
||||
g_return_val_if_fail (buffer->size >= offset + size, NULL);
|
||||
|
||||
/* find real parent */
|
||||
|
@ -652,8 +657,8 @@ gboolean
|
|||
gst_buffer_is_span_fast (GstBuffer * buf1, GstBuffer * buf2)
|
||||
{
|
||||
g_return_val_if_fail (buf1 != NULL && buf2 != NULL, FALSE);
|
||||
g_return_val_if_fail (buf1->mini_object.refcount, FALSE);
|
||||
g_return_val_if_fail (buf2->mini_object.refcount, FALSE);
|
||||
g_return_val_if_fail (buf1->mini_object.refcount > 0, FALSE);
|
||||
g_return_val_if_fail (buf2->mini_object.refcount > 0, FALSE);
|
||||
|
||||
/* it's only fast if we have subbuffers of the same parent */
|
||||
return (GST_IS_SUBBUFFER (buf1) &&
|
||||
|
@ -680,8 +685,9 @@ gst_buffer_is_span_fast (GstBuffer * buf1, GstBuffer * buf2)
|
|||
* gst_buffer_is_span_fast() to determine if a memcpy will be needed.
|
||||
*
|
||||
* MT safe.
|
||||
* Returns: the new #GstBuffer that spans the two source buffers.
|
||||
* Returns NULL if the arguments are invalid.
|
||||
*
|
||||
* Returns: (transfer full): the new #GstBuffer that spans the two source
|
||||
* buffers, or NULL if the arguments are invalid.
|
||||
*/
|
||||
GstBuffer *
|
||||
gst_buffer_span (GstBuffer * buf1, guint32 offset, GstBuffer * buf2,
|
||||
|
@ -690,9 +696,9 @@ gst_buffer_span (GstBuffer * buf1, guint32 offset, GstBuffer * buf2,
|
|||
GstBuffer *newbuf;
|
||||
|
||||
g_return_val_if_fail (buf1 != NULL && buf2 != NULL, NULL);
|
||||
g_return_val_if_fail (buf1->mini_object.refcount, NULL);
|
||||
g_return_val_if_fail (buf2->mini_object.refcount, NULL);
|
||||
g_return_val_if_fail (len, NULL);
|
||||
g_return_val_if_fail (buf1->mini_object.refcount > 0, NULL);
|
||||
g_return_val_if_fail (buf2->mini_object.refcount > 0, NULL);
|
||||
g_return_val_if_fail (len > 0, NULL);
|
||||
g_return_val_if_fail (len <= buf1->size + buf2->size - offset, NULL);
|
||||
|
||||
/* if the two buffers have the same parent and are adjacent */
|
||||
|
|
|
@ -333,7 +333,7 @@ G_STMT_START { \
|
|||
* GstBuffer instances can potentially increase the number
|
||||
* of memcpy operations in a pipeline.
|
||||
*
|
||||
* Returns: @buf
|
||||
* Returns: (transfer full): @buf
|
||||
*/
|
||||
#ifdef _FOOL_GTK_DOC_
|
||||
G_INLINE_FUNC GstBuffer * gst_buffer_ref (GstBuffer * buf);
|
||||
|
@ -347,7 +347,7 @@ gst_buffer_ref (GstBuffer * buf)
|
|||
|
||||
/**
|
||||
* gst_buffer_unref:
|
||||
* @buf: a #GstBuffer.
|
||||
* @buf: (transfer full): a #GstBuffer.
|
||||
*
|
||||
* Decreases the refcount of the buffer. If the refcount reaches 0, the buffer
|
||||
* will be freed. If GST_BUFFER_MALLOCDATA() is non-NULL, this pointer will
|
||||
|
@ -371,7 +371,7 @@ gst_buffer_unref (GstBuffer * buf)
|
|||
* Create a copy of the given buffer. This will also make a newly allocated
|
||||
* copy of the data the source buffer contains.
|
||||
*
|
||||
* Returns: a new copy of @buf.
|
||||
* Returns: (transfer full): a new copy of @buf.
|
||||
*/
|
||||
#ifdef _FOOL_GTK_DOC_
|
||||
G_INLINE_FUNC GstBuffer * gst_buffer_copy (const GstBuffer * buf);
|
||||
|
@ -428,11 +428,14 @@ void gst_buffer_copy_metadata (GstBuffer *dest, const GstBuffe
|
|||
#define gst_buffer_is_writable(buf) gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (buf))
|
||||
/**
|
||||
* gst_buffer_make_writable:
|
||||
* @buf: a #GstBuffer
|
||||
* @buf: (transfer full): a #GstBuffer
|
||||
*
|
||||
* Makes a writable buffer from the given buffer. If the source buffer is
|
||||
* already writable, this will simply return the same buffer. A copy will
|
||||
* otherwise be made using gst_buffer_copy().
|
||||
*
|
||||
* Returns: (transfer full): a writable buffer which may or may not be the
|
||||
* same as @buf
|
||||
*/
|
||||
#define gst_buffer_make_writable(buf) GST_BUFFER_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (buf)))
|
||||
|
||||
|
@ -443,9 +446,10 @@ GstBuffer* gst_buffer_make_metadata_writable (GstBuffer *buf);
|
|||
|
||||
/**
|
||||
* gst_buffer_replace:
|
||||
* @obuf: pointer to a pointer to a #GstBuffer to be replaced.
|
||||
* @nbuf: pointer to a #GstBuffer that will replace the buffer pointed to by
|
||||
* @obuf.
|
||||
* @obuf: (inout) (transfer full): pointer to a pointer to a #GstBuffer to be
|
||||
* replaced.
|
||||
* @nbuf: (transfer none) (allow-none): pointer to a #GstBuffer that will
|
||||
* replace the buffer pointed to by @obuf.
|
||||
*
|
||||
* Modifies a pointer to a #GstBuffer to point to a different #GstBuffer. The
|
||||
* modification is done atomically (so this is useful for ensuring thread safety
|
||||
|
@ -474,7 +478,7 @@ GstBuffer* gst_buffer_span (GstBuffer *buf1, guint32 offset
|
|||
/**
|
||||
* gst_value_set_buffer:
|
||||
* @v: a #GValue to receive the data
|
||||
* @b: a #GstBuffer to assign to the GstValue
|
||||
* @b: (transfer none): a #GstBuffer to assign to the GstValue
|
||||
*
|
||||
* Sets @b as the value of @v. Caller retains reference to buffer.
|
||||
*/
|
||||
|
@ -482,7 +486,7 @@ GstBuffer* gst_buffer_span (GstBuffer *buf1, guint32 offset
|
|||
/**
|
||||
* gst_value_take_buffer:
|
||||
* @v: a #GValue to receive the data
|
||||
* @b: a #GstBuffer to assign to the GstValue
|
||||
* @b: (transfer full): a #GstBuffer to assign to the GstValue
|
||||
*
|
||||
* Sets @b as the value of @v. Caller gives away reference to buffer.
|
||||
*/
|
||||
|
@ -494,6 +498,8 @@ GstBuffer* gst_buffer_span (GstBuffer *buf1, guint32 offset
|
|||
* Receives a #GstBuffer as the value of @v. Does not return a reference to
|
||||
* the buffer, so the pointer is only valid for as long as the caller owns
|
||||
* a reference to @v.
|
||||
*
|
||||
* Returns: (transfer none): buffer
|
||||
*/
|
||||
#define gst_value_get_buffer(v) GST_BUFFER_CAST (gst_value_get_mini_object(v))
|
||||
|
||||
|
|
|
@ -248,7 +248,10 @@ gst_buffer_list_class_init (GstBufferListClass * list_class)
|
|||
* Creates a new, empty #GstBufferList. The caller is responsible for unreffing
|
||||
* the returned #GstBufferList.
|
||||
*
|
||||
* Returns: the new #GstBufferList. gst_buffer_list_unref() after usage.
|
||||
* Free-function: gst_buffer_list_unref
|
||||
*
|
||||
* Returns: (transfer full): the new #GstBufferList. gst_buffer_list_unref()
|
||||
* after usage.
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -297,7 +300,7 @@ gst_buffer_list_n_groups (GstBufferList * list)
|
|||
/**
|
||||
* gst_buffer_list_foreach:
|
||||
* @list: a #GstBufferList
|
||||
* @func: a #GstBufferListFunc to call
|
||||
* @func: (scope call): a #GstBufferListFunc to call
|
||||
* @user_data: user data passed to @func
|
||||
*
|
||||
* Call @func with @data for each buffer in @list.
|
||||
|
@ -377,8 +380,8 @@ gst_buffer_list_foreach (GstBufferList * list, GstBufferListFunc func,
|
|||
* Note that this function is not efficient for iterating over the entire list.
|
||||
* Use an iterator or gst_buffer_list_foreach() instead.
|
||||
*
|
||||
* Returns: the buffer at @idx in @group or NULL when there is no buffer. The
|
||||
* buffer remains valid as long as @list is valid.
|
||||
* Returns: (transfer none): the buffer at @idx in @group or NULL when there
|
||||
* is no buffer. The buffer remains valid as long as @list is valid.
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -426,8 +429,10 @@ gst_buffer_list_get (GstBufferList * list, guint group, guint idx)
|
|||
* Iterate the buffers in @list. The owner of the iterator must also be the
|
||||
* owner of a reference to @list while the returned iterator is in use.
|
||||
*
|
||||
* Returns: a new #GstBufferListIterator of the buffers in @list.
|
||||
* gst_buffer_list_iterator_free() after usage
|
||||
* Free-function: gst_buffer_list_iterator_free
|
||||
*
|
||||
* Returns: (transfer full): a new #GstBufferListIterator of the buffers in
|
||||
* @list. gst_buffer_list_iterator_free() after usage
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -448,7 +453,7 @@ gst_buffer_list_iterate (GstBufferList * list)
|
|||
|
||||
/**
|
||||
* gst_buffer_list_iterator_free:
|
||||
* @it: the #GstBufferListIterator to free
|
||||
* @it: (transfer full): the #GstBufferListIterator to free
|
||||
*
|
||||
* Free the iterator.
|
||||
*
|
||||
|
@ -500,7 +505,7 @@ gst_buffer_list_iterator_n_buffers (const GstBufferListIterator * it)
|
|||
/**
|
||||
* gst_buffer_list_iterator_add:
|
||||
* @it: a #GstBufferListIterator
|
||||
* @buffer: a #GstBuffer
|
||||
* @buffer: (transfer full): a #GstBuffer
|
||||
*
|
||||
* Inserts @buffer into the #GstBufferList iterated with @it. The buffer is
|
||||
* inserted into the current group, immediately before the buffer that would be
|
||||
|
@ -529,7 +534,7 @@ gst_buffer_list_iterator_add (GstBufferListIterator * it, GstBuffer * buffer)
|
|||
/**
|
||||
* gst_buffer_list_iterator_add_list:
|
||||
* @it: a #GstBufferListIterator
|
||||
* @list: a #GList
|
||||
* @list: (transfer full) (element-type Gst.Buffer): a #GList of buffers
|
||||
*
|
||||
* Inserts @list of buffers into the #GstBufferList iterated with @it. The list is
|
||||
* inserted into the current group, immediately before the buffer that would be
|
||||
|
@ -610,7 +615,8 @@ gst_buffer_list_iterator_add_group (GstBufferListIterator * it)
|
|||
* The caller will not get a new ref to the returned #GstBuffer and must not
|
||||
* unref it.
|
||||
*
|
||||
* Returns: the next buffer in the current group of the buffer list, or NULL
|
||||
* Returns: (transfer none): the next buffer in the current group of the
|
||||
* buffer list, or NULL
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -707,7 +713,7 @@ gst_buffer_list_iterator_remove (GstBufferListIterator * it)
|
|||
/**
|
||||
* gst_buffer_list_iterator_take:
|
||||
* @it: a #GstBufferListIterator
|
||||
* @buffer: a #GstBuffer
|
||||
* @buffer: (transfer full): a #GstBuffer
|
||||
*
|
||||
* Replaces the last buffer returned by gst_buffer_list_iterator_next() with
|
||||
* @buffer in the #GstBufferList iterated with @it and takes ownership of
|
||||
|
@ -719,6 +725,8 @@ gst_buffer_list_iterator_remove (GstBufferListIterator * it)
|
|||
* gst_buffer_list_iterator_steal() and takes ownership of @buffer (i.e. the
|
||||
* refcount of @buffer is not increased).
|
||||
*
|
||||
* FIXME 0.11: this conditional taking-ownership is not good for bindings
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
void
|
||||
|
@ -742,7 +750,8 @@ gst_buffer_list_iterator_take (GstBufferListIterator * it, GstBuffer * buffer)
|
|||
* Returns the last buffer returned by gst_buffer_list_iterator_next() without
|
||||
* modifying the refcount of the buffer.
|
||||
*
|
||||
* Returns: the last buffer returned by gst_buffer_list_iterator_next()
|
||||
* Returns: (transfer none): the last buffer returned by
|
||||
* gst_buffer_list_iterator_next()
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -776,7 +785,7 @@ gst_buffer_list_iterator_steal (GstBufferListIterator * it)
|
|||
*
|
||||
* See #GstBufferListDoFunction for more details.
|
||||
*
|
||||
* Returns: the return value from @do_func
|
||||
* Returns: (transfer none): the return value from @do_func
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -818,7 +827,8 @@ gst_buffer_list_iterator_do (GstBufferListIterator * it,
|
|||
* This function will not move the implicit cursor or in any other way affect
|
||||
* the state of the iterator @it or the list.
|
||||
*
|
||||
* Returns: a new #GstBuffer, gst_buffer_unref() after usage, or NULL
|
||||
* Returns: (transfer full): a new #GstBuffer, gst_buffer_unref() after usage,
|
||||
* or NULL
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
|
|
@ -41,7 +41,7 @@ typedef struct _GstBufferListIterator GstBufferListIterator;
|
|||
|
||||
/**
|
||||
* GstBufferListDoFunction:
|
||||
* @buffer: the #GstBuffer
|
||||
* @buffer: (transfer full): the #GstBuffer
|
||||
* @user_data: user data
|
||||
*
|
||||
* A function for accessing the last buffer returned by
|
||||
|
@ -56,8 +56,8 @@ typedef struct _GstBufferListIterator GstBufferListIterator;
|
|||
* unreffed. If NULL is returned, the buffer will be removed from the list. The
|
||||
* list must be writable.
|
||||
*
|
||||
* Returns: the buffer to replace @buffer in the list, or NULL to remove @buffer
|
||||
* from the list
|
||||
* Returns: (transfer full): the buffer to replace @buffer in the list, or NULL
|
||||
* to remove @buffer from the list
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -125,7 +125,7 @@ GstBufferList *gst_buffer_list_new (void);
|
|||
* additional references to GstBufferList instances can potentially increase
|
||||
* the number of memcpy operations in a pipeline.
|
||||
*
|
||||
* Returns: @list
|
||||
* Returns: (transfer full): @list
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -142,7 +142,7 @@ gst_buffer_list_ref (GstBufferList * list)
|
|||
|
||||
/**
|
||||
* gst_buffer_list_unref:
|
||||
* @list: a #GstBufferList
|
||||
* @list: (transfer full): a #GstBufferList
|
||||
*
|
||||
* Decreases the refcount of the buffer list. If the refcount reaches 0, the
|
||||
* buffer list will be freed.
|
||||
|
@ -168,7 +168,7 @@ gst_buffer_list_unref (GstBufferList * list)
|
|||
* allocated copy of the source list with copies of buffer pointers. The
|
||||
* refcount of buffers pointed to will be increased by one.
|
||||
*
|
||||
* Returns: a new copy of @list.
|
||||
* Returns: (transfer full): a new copy of @list.
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -194,12 +194,15 @@ gst_buffer_list_copy (const GstBufferList * list)
|
|||
|
||||
/**
|
||||
* gst_buffer_list_make_writable:
|
||||
* @list: a #GstBufferList
|
||||
* @list: (transfer full): a #GstBufferList
|
||||
*
|
||||
* Makes a writable buffer list from the given buffer list. If the source buffer
|
||||
* list is already writable, this will simply return the same buffer list. A
|
||||
* copy will otherwise be made using gst_buffer_list_copy().
|
||||
*
|
||||
* Returns: (transfer full): a writable list, which may or may not be the
|
||||
* same as @list
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
#define gst_buffer_list_make_writable(list) GST_BUFFER_LIST_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (list)))
|
||||
|
|
219
gst/gstbus.c
219
gst/gstbus.c
|
@ -75,6 +75,7 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
#include "gstinfo.h"
|
||||
#include "gstpoll.h"
|
||||
|
||||
#include "gstbus.h"
|
||||
|
||||
|
@ -90,8 +91,6 @@ enum
|
|||
|
||||
static void gst_bus_dispose (GObject * object);
|
||||
|
||||
static void gst_bus_set_main_context (GstBus * bus, GMainContext * ctx);
|
||||
|
||||
static GstObjectClass *parent_class = NULL;
|
||||
static guint gst_bus_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
|
@ -100,7 +99,9 @@ struct _GstBusPrivate
|
|||
guint num_sync_message_emitters;
|
||||
GCond *queue_cond;
|
||||
GSource *watch_id;
|
||||
GMainContext *main_context;
|
||||
|
||||
GstPoll *poll;
|
||||
GPollFD pollfd;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GstBus, gst_bus, GST_TYPE_OBJECT);
|
||||
|
@ -184,12 +185,15 @@ gst_bus_class_init (GstBusClass * klass)
|
|||
static void
|
||||
gst_bus_init (GstBus * bus)
|
||||
{
|
||||
bus->queue = g_queue_new ();
|
||||
bus->queue = gst_atomic_queue_new (32);
|
||||
bus->queue_lock = g_mutex_new ();
|
||||
|
||||
bus->priv = G_TYPE_INSTANCE_GET_PRIVATE (bus, GST_TYPE_BUS, GstBusPrivate);
|
||||
bus->priv->queue_cond = g_cond_new ();
|
||||
|
||||
bus->priv->poll = gst_poll_new_timer ();
|
||||
gst_poll_get_read_gpollfd (bus->priv->poll, &bus->priv->pollfd);
|
||||
|
||||
GST_DEBUG_OBJECT (bus, "created");
|
||||
}
|
||||
|
||||
|
@ -203,69 +207,30 @@ gst_bus_dispose (GObject * object)
|
|||
|
||||
g_mutex_lock (bus->queue_lock);
|
||||
do {
|
||||
message = g_queue_pop_head (bus->queue);
|
||||
message = gst_atomic_queue_pop (bus->queue);
|
||||
if (message)
|
||||
gst_message_unref (message);
|
||||
} while (message != NULL);
|
||||
g_queue_free (bus->queue);
|
||||
gst_atomic_queue_unref (bus->queue);
|
||||
bus->queue = NULL;
|
||||
g_mutex_unlock (bus->queue_lock);
|
||||
g_mutex_free (bus->queue_lock);
|
||||
bus->queue_lock = NULL;
|
||||
g_cond_free (bus->priv->queue_cond);
|
||||
bus->priv->queue_cond = NULL;
|
||||
}
|
||||
|
||||
if (bus->priv->main_context) {
|
||||
g_main_context_unref (bus->priv->main_context);
|
||||
bus->priv->main_context = NULL;
|
||||
gst_poll_free (bus->priv->poll);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_bus_wakeup_main_context (GstBus * bus)
|
||||
{
|
||||
GMainContext *ctx;
|
||||
|
||||
GST_OBJECT_LOCK (bus);
|
||||
if ((ctx = bus->priv->main_context))
|
||||
g_main_context_ref (ctx);
|
||||
GST_OBJECT_UNLOCK (bus);
|
||||
|
||||
g_main_context_wakeup (ctx);
|
||||
|
||||
if (ctx)
|
||||
g_main_context_unref (ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_bus_set_main_context (GstBus * bus, GMainContext * ctx)
|
||||
{
|
||||
GST_OBJECT_LOCK (bus);
|
||||
|
||||
if (bus->priv->main_context != NULL) {
|
||||
g_main_context_unref (bus->priv->main_context);
|
||||
bus->priv->main_context = NULL;
|
||||
}
|
||||
|
||||
if (ctx != NULL) {
|
||||
bus->priv->main_context = g_main_context_ref (ctx);
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (bus, "setting main context to %p, GLib default context: %p",
|
||||
ctx, g_main_context_default ());
|
||||
|
||||
GST_OBJECT_UNLOCK (bus);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_bus_new:
|
||||
*
|
||||
* Creates a new #GstBus instance.
|
||||
*
|
||||
* Returns: a new #GstBus instance
|
||||
* Returns: (transfer full): a new #GstBus instance
|
||||
*/
|
||||
GstBus *
|
||||
gst_bus_new (void)
|
||||
|
@ -281,7 +246,7 @@ gst_bus_new (void)
|
|||
/**
|
||||
* gst_bus_post:
|
||||
* @bus: a #GstBus to post on
|
||||
* @message: The #GstMessage to post
|
||||
* @message: (transfer full): the #GstMessage to post
|
||||
*
|
||||
* Post a message on the given bus. Ownership of the message
|
||||
* is taken by the bus.
|
||||
|
@ -313,7 +278,7 @@ gst_bus_post (GstBus * bus, GstMessage * message)
|
|||
|
||||
handler = bus->sync_handler;
|
||||
handler_data = bus->sync_handler_data;
|
||||
emit_sync_message = bus->priv->num_sync_message_emitters;
|
||||
emit_sync_message = bus->priv->num_sync_message_emitters > 0;
|
||||
GST_OBJECT_UNLOCK (bus);
|
||||
|
||||
/* first call the sync handler if it is installed */
|
||||
|
@ -335,14 +300,10 @@ gst_bus_post (GstBus * bus, GstMessage * message)
|
|||
case GST_BUS_PASS:
|
||||
/* pass the message to the async queue, refcount passed in the queue */
|
||||
GST_DEBUG_OBJECT (bus, "[msg %p] pushing on async queue", message);
|
||||
g_mutex_lock (bus->queue_lock);
|
||||
g_queue_push_tail (bus->queue, message);
|
||||
g_cond_broadcast (bus->priv->queue_cond);
|
||||
g_mutex_unlock (bus->queue_lock);
|
||||
gst_atomic_queue_push (bus->queue, message);
|
||||
gst_poll_write_control (bus->priv->poll);
|
||||
GST_DEBUG_OBJECT (bus, "[msg %p] pushed on async queue", message);
|
||||
|
||||
gst_bus_wakeup_main_context (bus);
|
||||
|
||||
break;
|
||||
case GST_BUS_ASYNC:
|
||||
{
|
||||
|
@ -360,12 +321,9 @@ gst_bus_post (GstBus * bus, GstMessage * message)
|
|||
* queue. When the message is handled by the app and destroyed,
|
||||
* the cond will be signalled and we can continue */
|
||||
g_mutex_lock (lock);
|
||||
g_mutex_lock (bus->queue_lock);
|
||||
g_queue_push_tail (bus->queue, message);
|
||||
g_cond_broadcast (bus->priv->queue_cond);
|
||||
g_mutex_unlock (bus->queue_lock);
|
||||
|
||||
gst_bus_wakeup_main_context (bus);
|
||||
gst_atomic_queue_push (bus->queue, message);
|
||||
gst_poll_write_control (bus->priv->poll);
|
||||
|
||||
/* now block till the message is freed */
|
||||
g_cond_wait (cond, lock);
|
||||
|
@ -413,10 +371,8 @@ gst_bus_have_pending (GstBus * bus)
|
|||
|
||||
g_return_val_if_fail (GST_IS_BUS (bus), FALSE);
|
||||
|
||||
g_mutex_lock (bus->queue_lock);
|
||||
/* see if there is a message on the bus */
|
||||
result = !g_queue_is_empty (bus->queue);
|
||||
g_mutex_unlock (bus->queue_lock);
|
||||
result = gst_atomic_queue_length (bus->queue) != 0;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -468,10 +424,10 @@ gst_bus_set_flushing (GstBus * bus, gboolean flushing)
|
|||
* @timeout is #GST_CLOCK_TIME_NONE, this function will block forever until a
|
||||
* matching message was posted on the bus.
|
||||
*
|
||||
* Returns: a #GstMessage matching the filter in @types, or NULL if no matching
|
||||
* message was found on the bus until the timeout expired.
|
||||
* The message is taken from the bus and needs to be unreffed with
|
||||
* gst_message_unref() after usage.
|
||||
* Returns: (transfer full): a #GstMessage matching the filter in @types,
|
||||
* or NULL if no matching message was found on the bus until the timeout
|
||||
* expired. The message is taken from the bus and needs to be unreffed
|
||||
* with gst_message_unref() after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -482,7 +438,7 @@ gst_bus_timed_pop_filtered (GstBus * bus, GstClockTime timeout,
|
|||
GstMessageType types)
|
||||
{
|
||||
GstMessage *message;
|
||||
GTimeVal *timeval, abstimeout;
|
||||
GTimeVal now, then;
|
||||
gboolean first_round = TRUE;
|
||||
|
||||
g_return_val_if_fail (GST_IS_BUS (bus), NULL);
|
||||
|
@ -491,9 +447,13 @@ gst_bus_timed_pop_filtered (GstBus * bus, GstClockTime timeout,
|
|||
g_mutex_lock (bus->queue_lock);
|
||||
|
||||
while (TRUE) {
|
||||
GST_LOG_OBJECT (bus, "have %d messages", g_queue_get_length (bus->queue));
|
||||
gint ret;
|
||||
|
||||
while ((message = g_queue_pop_head (bus->queue))) {
|
||||
GST_LOG_OBJECT (bus, "have %d messages",
|
||||
gst_atomic_queue_length (bus->queue));
|
||||
|
||||
while ((message = gst_atomic_queue_pop (bus->queue))) {
|
||||
gst_poll_read_control (bus->priv->poll);
|
||||
GST_DEBUG_OBJECT (bus, "got message %p, %s, type mask is %u",
|
||||
message, GST_MESSAGE_TYPE_NAME (message), (guint) types);
|
||||
if ((GST_MESSAGE_TYPE (message) & types) != 0) {
|
||||
|
@ -510,28 +470,28 @@ gst_bus_timed_pop_filtered (GstBus * bus, GstClockTime timeout,
|
|||
if (timeout == 0)
|
||||
break;
|
||||
|
||||
if (timeout == GST_CLOCK_TIME_NONE) {
|
||||
/* wait forever */
|
||||
timeval = NULL;
|
||||
} else if (first_round) {
|
||||
glong add = timeout / 1000;
|
||||
else if (timeout != GST_CLOCK_TIME_NONE) {
|
||||
if (first_round) {
|
||||
g_get_current_time (&then);
|
||||
first_round = FALSE;
|
||||
} else {
|
||||
GstClockTime elapsed;
|
||||
|
||||
if (add == 0)
|
||||
/* no need to wait */
|
||||
break;
|
||||
g_get_current_time (&now);
|
||||
|
||||
/* make timeout absolute */
|
||||
g_get_current_time (&abstimeout);
|
||||
g_time_val_add (&abstimeout, add);
|
||||
timeval = &abstimeout;
|
||||
first_round = FALSE;
|
||||
GST_DEBUG_OBJECT (bus, "blocking for message, timeout %ld", add);
|
||||
} else {
|
||||
/* calculated the absolute end time already, no need to do it again */
|
||||
GST_DEBUG_OBJECT (bus, "blocking for message, again");
|
||||
timeval = &abstimeout; /* fool compiler */
|
||||
elapsed = GST_TIMEVAL_TO_TIME (now) - GST_TIMEVAL_TO_TIME (then);
|
||||
if (timeout > elapsed)
|
||||
timeout -= elapsed;
|
||||
else
|
||||
timeout = 0;
|
||||
}
|
||||
}
|
||||
if (!g_cond_timed_wait (bus->priv->queue_cond, bus->queue_lock, timeval)) {
|
||||
|
||||
g_mutex_unlock (bus->queue_lock);
|
||||
ret = gst_poll_wait (bus->priv->poll, timeout);
|
||||
g_mutex_lock (bus->queue_lock);
|
||||
|
||||
if (ret == 0) {
|
||||
GST_INFO_OBJECT (bus, "timed out, breaking loop");
|
||||
break;
|
||||
} else {
|
||||
|
@ -558,8 +518,8 @@ beach:
|
|||
* #GST_CLOCK_TIME_NONE, this function will block forever until a message was
|
||||
* posted on the bus.
|
||||
*
|
||||
* Returns: The #GstMessage that is on the bus after the specified timeout
|
||||
* or NULL if the bus is empty after the timeout expired.
|
||||
* Returns: (transfer full): the #GstMessage that is on the bus after the
|
||||
* specified timeout or NULL if the bus is empty after the timeout expired.
|
||||
* The message is taken from the bus and needs to be unreffed with
|
||||
* gst_message_unref() after usage.
|
||||
*
|
||||
|
@ -585,10 +545,10 @@ gst_bus_timed_pop (GstBus * bus, GstClockTime timeout)
|
|||
* message that does match @type. If there is no message matching @type on
|
||||
* the bus, all messages will be discarded.
|
||||
*
|
||||
* Returns: The next #GstMessage matching @type that is on the bus, or NULL if
|
||||
* the bus is empty or there is no message matching @type.
|
||||
* The message is taken from the bus and needs to be unreffed with
|
||||
* gst_message_unref() after usage.
|
||||
* Returns: (transfer full): the next #GstMessage matching @type that is on
|
||||
* the bus, or NULL if the bus is empty or there is no message matching
|
||||
* @type. The message is taken from the bus and needs to be unreffed with
|
||||
* gst_message_unref() after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -609,9 +569,9 @@ gst_bus_pop_filtered (GstBus * bus, GstMessageType types)
|
|||
*
|
||||
* Get a message from the bus.
|
||||
*
|
||||
* Returns: The #GstMessage that is on the bus, or NULL if the bus is empty.
|
||||
* The message is taken from the bus and needs to be unreffed with
|
||||
* gst_message_unref() after usage.
|
||||
* Returns: (transfer full): the #GstMessage that is on the bus, or NULL if the
|
||||
* bus is empty. The message is taken from the bus and needs to be unreffed
|
||||
* with gst_message_unref() after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -631,7 +591,8 @@ gst_bus_pop (GstBus * bus)
|
|||
* on the bus' message queue. A reference is returned, and needs to be unreffed
|
||||
* by the caller.
|
||||
*
|
||||
* Returns: The #GstMessage that is on the bus, or NULL if the bus is empty.
|
||||
* Returns: (transfer full): the #GstMessage that is on the bus, or NULL if the
|
||||
* bus is empty.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -643,7 +604,7 @@ gst_bus_peek (GstBus * bus)
|
|||
g_return_val_if_fail (GST_IS_BUS (bus), NULL);
|
||||
|
||||
g_mutex_lock (bus->queue_lock);
|
||||
message = g_queue_peek_head (bus->queue);
|
||||
message = gst_atomic_queue_peek (bus->queue);
|
||||
if (message)
|
||||
gst_message_ref (message);
|
||||
g_mutex_unlock (bus->queue_lock);
|
||||
|
@ -701,24 +662,13 @@ typedef struct
|
|||
{
|
||||
GSource source;
|
||||
GstBus *bus;
|
||||
gboolean inited;
|
||||
} GstBusSource;
|
||||
|
||||
static gboolean
|
||||
gst_bus_source_prepare (GSource * source, gint * timeout)
|
||||
{
|
||||
GstBusSource *bsrc = (GstBusSource *) source;
|
||||
|
||||
/* we do this here now that we know that we're attached to a main context
|
||||
* (we don't support detaching a source from a main context and then
|
||||
* re-attaching it to a different main context) */
|
||||
if (G_UNLIKELY (!bsrc->inited)) {
|
||||
gst_bus_set_main_context (bsrc->bus, g_source_get_context (source));
|
||||
bsrc->inited = TRUE;
|
||||
}
|
||||
|
||||
*timeout = -1;
|
||||
return gst_bus_have_pending (bsrc->bus);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -726,7 +676,7 @@ gst_bus_source_check (GSource * source)
|
|||
{
|
||||
GstBusSource *bsrc = (GstBusSource *) source;
|
||||
|
||||
return gst_bus_have_pending (bsrc->bus);
|
||||
return bsrc->bus->priv->pollfd.revents & (G_IO_IN | G_IO_HUP | G_IO_ERR);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -788,7 +738,6 @@ gst_bus_source_finalize (GSource * source)
|
|||
bus->priv->watch_id = NULL;
|
||||
GST_OBJECT_UNLOCK (bus);
|
||||
|
||||
gst_bus_set_main_context (bsource->bus, NULL);
|
||||
gst_object_unref (bsource->bus);
|
||||
bsource->bus = NULL;
|
||||
}
|
||||
|
@ -808,7 +757,7 @@ static GSourceFuncs gst_bus_source_funcs = {
|
|||
* a message is on the bus. After the GSource is dispatched, the
|
||||
* message is popped off the bus and unreffed.
|
||||
*
|
||||
* Returns: A #GSource that can be added to a mainloop.
|
||||
* Returns: (transfer full): a #GSource that can be added to a mainloop.
|
||||
*/
|
||||
GSource *
|
||||
gst_bus_create_watch (GstBus * bus)
|
||||
|
@ -820,7 +769,7 @@ gst_bus_create_watch (GstBus * bus)
|
|||
source = (GstBusSource *) g_source_new (&gst_bus_source_funcs,
|
||||
sizeof (GstBusSource));
|
||||
source->bus = gst_object_ref (bus);
|
||||
source->inited = FALSE;
|
||||
g_source_add_poll ((GSource *) source, &bus->priv->pollfd);
|
||||
|
||||
return (GSource *) source;
|
||||
}
|
||||
|
@ -830,6 +779,7 @@ static guint
|
|||
gst_bus_add_watch_full_unlocked (GstBus * bus, gint priority,
|
||||
GstBusFunc func, gpointer user_data, GDestroyNotify notify)
|
||||
{
|
||||
GMainContext *ctx;
|
||||
guint id;
|
||||
GSource *source;
|
||||
|
||||
|
@ -846,7 +796,8 @@ gst_bus_add_watch_full_unlocked (GstBus * bus, gint priority,
|
|||
|
||||
g_source_set_callback (source, (GSourceFunc) func, user_data, notify);
|
||||
|
||||
id = g_source_attach (source, NULL);
|
||||
ctx = g_main_context_get_thread_default ();
|
||||
id = g_source_attach (source, ctx);
|
||||
g_source_unref (source);
|
||||
|
||||
if (id) {
|
||||
|
@ -866,7 +817,11 @@ gst_bus_add_watch_full_unlocked (GstBus * bus, gint priority,
|
|||
* @notify: the function to call when the source is removed.
|
||||
*
|
||||
* Adds a bus watch to the default main context with the given @priority (e.g.
|
||||
* %G_PRIORITY_DEFAULT).
|
||||
* %G_PRIORITY_DEFAULT). Since 0.10.33 it is also possible to use a non-default
|
||||
* main context set up using g_main_context_push_thread_default() (before
|
||||
* one had to create a bus watch source and attach it to the desired main
|
||||
* context 'manually').
|
||||
*
|
||||
* This function is used to receive asynchronous messages in the main loop.
|
||||
* There can only be a single bus watch per bus, you must remove it before you
|
||||
* can set a new one.
|
||||
|
@ -903,7 +858,11 @@ gst_bus_add_watch_full (GstBus * bus, gint priority,
|
|||
* @user_data: user data passed to @func.
|
||||
*
|
||||
* Adds a bus watch to the default main context with the default priority
|
||||
* (%G_PRIORITY_DEFAULT).
|
||||
* (%G_PRIORITY_DEFAULT). Since 0.10.33 it is also possible to use a non-default
|
||||
* main context set up using g_main_context_push_thread_default() (before
|
||||
* one had to create a bus watch source and attach it to the desired main
|
||||
* context 'manually').
|
||||
*
|
||||
* This function is used to receive asynchronous messages in the main loop.
|
||||
* There can only be a single bus watch per bus, you must remove it before you
|
||||
* can set a new one.
|
||||
|
@ -1025,9 +984,9 @@ poll_destroy_timeout (GstBusPollData * poll_data)
|
|||
* better handled by setting up an asynchronous bus watch and doing things
|
||||
* from there.
|
||||
*
|
||||
* Returns: The message that was received, or NULL if the poll timed out.
|
||||
* The message is taken from the bus and needs to be unreffed with
|
||||
* gst_message_unref() after usage.
|
||||
* Returns: (transfer full): the message that was received, or NULL if the
|
||||
* poll timed out. The message is taken from the bus and needs to be
|
||||
* unreffed with gst_message_unref() after usage.
|
||||
*/
|
||||
GstMessage *
|
||||
gst_bus_poll (GstBus * bus, GstMessageType events, GstClockTimeDiff timeout)
|
||||
|
@ -1194,7 +1153,11 @@ gst_bus_disable_sync_message_emission (GstBus * bus)
|
|||
* @priority: The priority of the watch.
|
||||
*
|
||||
* Adds a bus signal watch to the default main context with the given @priority
|
||||
* (e.g. %G_PRIORITY_DEFAULT).
|
||||
* (e.g. %G_PRIORITY_DEFAULT). Since 0.10.33 it is also possible to use a
|
||||
* non-default main context set up using g_main_context_push_thread_default()
|
||||
* (before one had to create a bus watch source and attach it to the desired
|
||||
* main context 'manually').
|
||||
*
|
||||
* After calling this statement, the bus will emit the "message" signal for each
|
||||
* message posted on the bus when the main loop is running.
|
||||
*
|
||||
|
@ -1215,7 +1178,7 @@ gst_bus_add_signal_watch_full (GstBus * bus, gint priority)
|
|||
/* I know the callees don't take this lock, so go ahead and abuse it */
|
||||
GST_OBJECT_LOCK (bus);
|
||||
|
||||
if (bus->num_signal_watchers)
|
||||
if (bus->num_signal_watchers > 0)
|
||||
goto done;
|
||||
|
||||
/* this should not fail because the counter above takes care of it */
|
||||
|
@ -1249,7 +1212,11 @@ add_failed:
|
|||
* @bus: a #GstBus on which you want to receive the "message" signal
|
||||
*
|
||||
* Adds a bus signal watch to the default main context with the default priority
|
||||
* (%G_PRIORITY_DEFAULT).
|
||||
* (%G_PRIORITY_DEFAULT). Since 0.10.33 it is also possible to use a non-default
|
||||
* main context set up using g_main_context_push_thread_default() (before
|
||||
* one had to create a bus watch source and attach it to the desired main
|
||||
* context 'manually').
|
||||
*
|
||||
* After calling this statement, the bus will emit the "message" signal for each
|
||||
* message posted on the bus.
|
||||
*
|
||||
|
@ -1288,7 +1255,7 @@ gst_bus_remove_signal_watch (GstBus * bus)
|
|||
|
||||
bus->num_signal_watchers--;
|
||||
|
||||
if (bus->num_signal_watchers)
|
||||
if (bus->num_signal_watchers > 0)
|
||||
goto done;
|
||||
|
||||
id = bus->signal_watch_id;
|
||||
|
|
|
@ -28,6 +28,7 @@ typedef struct _GstBusClass GstBusClass;
|
|||
|
||||
#include <gst/gstmessage.h>
|
||||
#include <gst/gstclock.h>
|
||||
#include <gst/gstatomicqueue.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -115,7 +116,7 @@ struct _GstBus
|
|||
GstObject object;
|
||||
|
||||
/*< private >*/
|
||||
GQueue *queue;
|
||||
GstAtomicQueue *queue;
|
||||
GMutex *queue_lock;
|
||||
|
||||
GstBusSyncHandler sync_handler;
|
||||
|
|
|
@ -149,7 +149,7 @@ gst_caps_get_type (void)
|
|||
* #GstCaps contains no media formats.
|
||||
* Caller is responsible for unreffing the returned caps.
|
||||
*
|
||||
* Returns: the new #GstCaps
|
||||
* Returns: (transfer full): the new #GstCaps
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_new_empty (void)
|
||||
|
@ -179,7 +179,7 @@ gst_caps_new_empty (void)
|
|||
* Creates a new #GstCaps that indicates that it is compatible with
|
||||
* any media format.
|
||||
*
|
||||
* Returns: the new #GstCaps
|
||||
* Returns: (transfer full): the new #GstCaps
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_new_any (void)
|
||||
|
@ -202,7 +202,7 @@ gst_caps_new_any (void)
|
|||
* as gst_structure_new().
|
||||
* Caller is responsible for unreffing the returned caps.
|
||||
*
|
||||
* Returns: the new #GstCaps
|
||||
* Returns: (transfer full): the new #GstCaps
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_new_simple (const char *media_type, const char *fieldname, ...)
|
||||
|
@ -231,7 +231,7 @@ gst_caps_new_simple (const char *media_type, const char *fieldname, ...)
|
|||
* arguments. The list must be NULL-terminated. The structures
|
||||
* are not copied; the returned #GstCaps owns the structures.
|
||||
*
|
||||
* Returns: the new #GstCaps
|
||||
* Returns: (transfer full): the new #GstCaps
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_new_full (GstStructure * struct1, ...)
|
||||
|
@ -255,7 +255,7 @@ gst_caps_new_full (GstStructure * struct1, ...)
|
|||
* arguments. The list must be NULL-terminated. The structures
|
||||
* are not copied; the returned #GstCaps owns the structures.
|
||||
*
|
||||
* Returns: the new #GstCaps
|
||||
* Returns: (transfer full): the new #GstCaps
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_new_full_valist (GstStructure * structure, va_list var_args)
|
||||
|
@ -285,7 +285,7 @@ gst_caps_new_full_valist (GstStructure * structure, va_list var_args)
|
|||
*
|
||||
* When you are finished with the caps, call gst_caps_unref() on it.
|
||||
*
|
||||
* Returns: the new #GstCaps
|
||||
* Returns: (transfer full): the new #GstCaps
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_copy (const GstCaps * caps)
|
||||
|
@ -338,7 +338,7 @@ _gst_caps_free (GstCaps * caps)
|
|||
|
||||
/**
|
||||
* gst_caps_make_writable:
|
||||
* @caps: the #GstCaps to make writable
|
||||
* @caps: (transfer full): the #GstCaps to make writable
|
||||
*
|
||||
* Returns a writable copy of @caps.
|
||||
*
|
||||
|
@ -352,7 +352,7 @@ _gst_caps_free (GstCaps * caps)
|
|||
* that it returns. Don't access the argument after calling this function. See
|
||||
* also: gst_caps_ref().
|
||||
*
|
||||
* Returns: the same #GstCaps object.
|
||||
* Returns: (transfer full): the same #GstCaps object.
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_make_writable (GstCaps * caps)
|
||||
|
@ -386,7 +386,7 @@ gst_caps_make_writable (GstCaps * caps)
|
|||
* implicitly by e.g. gst_caps_new_simple(), or via taking one explicitly with
|
||||
* this function.
|
||||
*
|
||||
* Returns: the same #GstCaps object.
|
||||
* Returns: (transfer full): the same #GstCaps object.
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_ref (GstCaps * caps)
|
||||
|
@ -397,7 +397,7 @@ gst_caps_ref (GstCaps * caps)
|
|||
GST_CAT_TRACE (GST_CAT_REFCOUNTING, "%p %d->%d", caps,
|
||||
GST_CAPS_REFCOUNT_VALUE (caps), GST_CAPS_REFCOUNT_VALUE (caps) + 1);
|
||||
#endif
|
||||
g_return_val_if_fail (GST_CAPS_REFCOUNT_VALUE (caps), NULL);
|
||||
g_return_val_if_fail (GST_CAPS_REFCOUNT_VALUE (caps) > 0, NULL);
|
||||
|
||||
g_atomic_int_inc (&caps->refcount);
|
||||
|
||||
|
@ -406,7 +406,7 @@ gst_caps_ref (GstCaps * caps)
|
|||
|
||||
/**
|
||||
* gst_caps_unref:
|
||||
* @caps: the #GstCaps to unref
|
||||
* @caps: (transfer full): the #GstCaps to unref
|
||||
*
|
||||
* Unref a #GstCaps and and free all its structures and the
|
||||
* structures' values when the refcount reaches 0.
|
||||
|
@ -421,7 +421,7 @@ gst_caps_unref (GstCaps * caps)
|
|||
GST_CAPS_REFCOUNT_VALUE (caps), GST_CAPS_REFCOUNT_VALUE (caps) - 1);
|
||||
#endif
|
||||
|
||||
g_return_if_fail (GST_CAPS_REFCOUNT_VALUE (caps));
|
||||
g_return_if_fail (GST_CAPS_REFCOUNT_VALUE (caps) > 0);
|
||||
|
||||
/* if we ended up with the refcount at zero, free the caps */
|
||||
if (G_UNLIKELY (g_atomic_int_dec_and_test (&caps->refcount)))
|
||||
|
@ -446,9 +446,9 @@ gst_static_caps_get_type (void)
|
|||
*
|
||||
* Converts a #GstStaticCaps to a #GstCaps.
|
||||
*
|
||||
* Returns: A pointer to the #GstCaps. Unref after usage. Since the
|
||||
* core holds an additional ref to the returned caps,
|
||||
* use gst_caps_make_writable() on the returned caps to modify it.
|
||||
* Returns: (transfer full): a pointer to the #GstCaps. Unref after usage.
|
||||
* Since the core holds an additional ref to the returned caps,
|
||||
* use gst_caps_make_writable() on the returned caps to modify it.
|
||||
*/
|
||||
GstCaps *
|
||||
gst_static_caps_get (GstStaticCaps * static_caps)
|
||||
|
@ -466,7 +466,7 @@ gst_static_caps_get (GstStaticCaps * static_caps)
|
|||
|
||||
G_LOCK (static_caps_lock);
|
||||
/* check if other thread already updated */
|
||||
if (G_UNLIKELY (g_atomic_int_get (&caps->refcount)))
|
||||
if (G_UNLIKELY (g_atomic_int_get (&caps->refcount) > 0))
|
||||
goto done;
|
||||
|
||||
string = static_caps->string;
|
||||
|
@ -537,7 +537,8 @@ gst_caps_remove_and_get_structure (GstCaps * caps, guint idx)
|
|||
* Retrieves the stucture with the given index from the list of structures
|
||||
* contained in @caps. The caller becomes the owner of the returned structure.
|
||||
*
|
||||
* Returns: a pointer to the #GstStructure corresponding to @index.
|
||||
* Returns: (transfer full): a pointer to the #GstStructure corresponding
|
||||
* to @index.
|
||||
*
|
||||
* Since: 0.10.30
|
||||
*/
|
||||
|
@ -632,7 +633,7 @@ gst_caps_structure_is_subset (const GstStructure * minuend,
|
|||
/**
|
||||
* gst_caps_append:
|
||||
* @caps1: the #GstCaps that will be appended to
|
||||
* @caps2: the #GstCaps to append
|
||||
* @caps2: (transfer full): the #GstCaps to append
|
||||
*
|
||||
* Appends the structures contained in @caps2 to @caps1. The structures in
|
||||
* @caps2 are not copied -- they are transferred to @caps1, and then @caps2 is
|
||||
|
@ -671,7 +672,7 @@ gst_caps_append (GstCaps * caps1, GstCaps * caps2)
|
|||
/**
|
||||
* gst_caps_merge:
|
||||
* @caps1: the #GstCaps that will take the new entries
|
||||
* @caps2: the #GstCaps to merge in
|
||||
* @caps2: (transfer full): the #GstCaps to merge in
|
||||
*
|
||||
* Appends the structures contained in @caps2 to @caps1 if they are not yet
|
||||
* expressed by @caps1. The structures in @caps2 are not copied -- they are
|
||||
|
@ -726,7 +727,7 @@ gst_caps_merge (GstCaps * caps1, GstCaps * caps2)
|
|||
/**
|
||||
* gst_caps_append_structure:
|
||||
* @caps: the #GstCaps that will be appended to
|
||||
* @structure: the #GstStructure to append
|
||||
* @structure: (transfer full): the #GstStructure to append
|
||||
*
|
||||
* Appends @structure to @caps. The structure is not copied; @caps
|
||||
* becomes the owner of @structure.
|
||||
|
@ -772,7 +773,7 @@ gst_caps_remove_structure (GstCaps * caps, guint idx)
|
|||
/**
|
||||
* gst_caps_merge_structure:
|
||||
* @caps: the #GstCaps that will the the new structure
|
||||
* @structure: the #GstStructure to merge
|
||||
* @structure: (transfer full): the #GstStructure to merge
|
||||
*
|
||||
* Appends @structure to @caps if its not already expressed by @caps. The
|
||||
* structure is not copied; @caps becomes the owner of @structure.
|
||||
|
@ -847,7 +848,8 @@ gst_caps_get_size (const GstCaps * caps)
|
|||
* You do not need to free or unref the structure returned, it
|
||||
* belongs to the #GstCaps.
|
||||
*
|
||||
* Returns: a pointer to the #GstStructure corresponding to @index
|
||||
* Returns: (transfer none): a pointer to the #GstStructure corresponding
|
||||
* to @index
|
||||
*/
|
||||
GstStructure *
|
||||
gst_caps_get_structure (const GstCaps * caps, guint index)
|
||||
|
@ -866,7 +868,7 @@ gst_caps_get_structure (const GstCaps * caps, guint index)
|
|||
* Creates a new #GstCaps and appends a copy of the nth structure
|
||||
* contained in @caps.
|
||||
*
|
||||
* Returns: the new #GstCaps
|
||||
* Returns: (transfer full): the new #GstCaps
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_copy_nth (const GstCaps * caps, guint nth)
|
||||
|
@ -1583,7 +1585,7 @@ gst_caps_subtract (const GstCaps * minuend, const GstCaps * subtrahend)
|
|||
Note: there's a test that checks this behaviour. */
|
||||
g_return_val_if_fail (!CAPS_IS_ANY (minuend), NULL);
|
||||
sublen = subtrahend->structs->len;
|
||||
g_assert (sublen);
|
||||
g_assert (sublen > 0);
|
||||
|
||||
src = gst_caps_copy (minuend);
|
||||
for (i = 0; i < sublen; i++) {
|
||||
|
@ -1956,7 +1958,7 @@ gst_caps_do_simplify (GstCaps * caps)
|
|||
|
||||
/**
|
||||
* gst_caps_replace:
|
||||
* @caps: a pointer to #GstCaps
|
||||
* @caps: (inout) (transfer full): a pointer to #GstCaps
|
||||
* @newcaps: a #GstCaps to replace *caps
|
||||
*
|
||||
* Replaces *caps with @newcaps. Unrefs the #GstCaps in the location
|
||||
|
@ -2001,7 +2003,7 @@ gst_caps_replace (GstCaps ** caps, GstCaps * newcaps)
|
|||
* ]|
|
||||
* This prints the caps in human readble form.
|
||||
*
|
||||
* Returns: a newly allocated string representing @caps.
|
||||
* Returns: (transfer full): a newly allocated string representing @caps.
|
||||
*/
|
||||
gchar *
|
||||
gst_caps_to_string (const GstCaps * caps)
|
||||
|
@ -2038,7 +2040,7 @@ gst_caps_to_string (const GstCaps * caps)
|
|||
for (i = 0; i < clen; i++) {
|
||||
GstStructure *structure;
|
||||
|
||||
if (i) {
|
||||
if (i > 0) {
|
||||
/* ';' is now added by gst_structure_to_string */
|
||||
g_string_append_c (s, ' ');
|
||||
}
|
||||
|
@ -2097,7 +2099,7 @@ gst_caps_from_string_inplace (GstCaps * caps, const gchar * string)
|
|||
*
|
||||
* Converts @caps from a string representation.
|
||||
*
|
||||
* Returns: a newly allocated #GstCaps
|
||||
* Returns: (transfer full): a newly allocated #GstCaps
|
||||
*/
|
||||
GstCaps *
|
||||
gst_caps_from_string (const gchar * string)
|
||||
|
|
|
@ -71,7 +71,8 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
|||
*
|
||||
* Implementors can use #GstObject together with gst_object_get_name()
|
||||
*
|
||||
* Returns: the child object or %NULL if not found. Unref after usage.
|
||||
* Returns: (transfer full): the child object or %NULL if not found. Unref
|
||||
* after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -120,8 +121,8 @@ gst_child_proxy_get_child_by_name (GstChildProxy * parent, const gchar * name)
|
|||
*
|
||||
* Fetches a child by its number.
|
||||
*
|
||||
* Returns: the child object or %NULL if not found (index too high). Unref
|
||||
* after usage.
|
||||
* Returns: (transfer full): the child object or %NULL if not found (index
|
||||
* too high). Unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -156,8 +157,10 @@ gst_child_proxy_get_children_count (GstChildProxy * parent)
|
|||
* gst_child_proxy_lookup:
|
||||
* @object: object to lookup the property in
|
||||
* @name: name of the property to look up
|
||||
* @target: pointer to a #GstObject that takes the real object to set property on
|
||||
* @pspec: pointer to take the #GParamSpec describing the property
|
||||
* @target: (out) (allow-none) (transfer full): pointer to a #GstObject that
|
||||
* takes the real object to set property on
|
||||
* @pspec: (out) (allow-none) (transfer full): pointer to take the #GParamSpec
|
||||
* describing the property
|
||||
*
|
||||
* Looks up which object and #GParamSpec would be effected by the given @name.
|
||||
*
|
||||
|
@ -223,7 +226,7 @@ gst_child_proxy_lookup (GstObject * object, const gchar * name,
|
|||
* gst_child_proxy_get_property:
|
||||
* @object: object to query
|
||||
* @name: name of the property
|
||||
* @value: a #GValue that should take the result.
|
||||
* @value: (out caller-allocates): a #GValue that should take the result.
|
||||
*
|
||||
* Gets a single property using the GstChildProxy mechanism.
|
||||
* You are responsible for for freeing it by calling g_value_unset()
|
||||
|
|
|
@ -209,7 +209,7 @@ gst_clock_entry_new (GstClock * clock, GstClockTime time,
|
|||
return (GstClockID) entry;
|
||||
}
|
||||
|
||||
/* WARNING : Does not modify the refoucnt
|
||||
/* WARNING : Does not modify the refcount
|
||||
* WARNING : Do not use if a pending clock operation is happening on that entry */
|
||||
static gboolean
|
||||
gst_clock_entry_reinit (GstClock * clock, GstClockEntry * entry,
|
||||
|
@ -239,6 +239,8 @@ gst_clock_entry_reinit (GstClock * clock, GstClockEntry * entry,
|
|||
*
|
||||
* Returns: %TRUE if the GstClockID could be reinitialized to the provided
|
||||
* @time, else %FALSE.
|
||||
*
|
||||
* Since: 0.10.32
|
||||
*/
|
||||
gboolean
|
||||
gst_clock_single_shot_id_reinit (GstClock * clock, GstClockID id,
|
||||
|
@ -248,13 +250,37 @@ gst_clock_single_shot_id_reinit (GstClock * clock, GstClockID id,
|
|||
GST_CLOCK_TIME_NONE, GST_CLOCK_ENTRY_SINGLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_clock_periodic_id_reinit:
|
||||
* @clock: a #GstClock
|
||||
* @id: a #GstClockID
|
||||
* @start_time: the requested start time
|
||||
* @interval: the requested interval
|
||||
*
|
||||
* Reinitializes the provided periodic @id to the provided start time and
|
||||
* interval. Does not modify the reference count.
|
||||
*
|
||||
* Returns: %TRUE if the GstClockID could be reinitialized to the provided
|
||||
* @time, else %FALSE.
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*
|
||||
*/
|
||||
gboolean
|
||||
gst_clock_periodic_id_reinit (GstClock * clock, GstClockID id,
|
||||
GstClockTime start_time, GstClockTime interval)
|
||||
{
|
||||
return gst_clock_entry_reinit (clock, (GstClockEntry *) id, start_time,
|
||||
interval, GST_CLOCK_ENTRY_PERIODIC);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_clock_id_ref:
|
||||
* @id: The #GstClockID to ref
|
||||
*
|
||||
* Increase the refcount of given @id.
|
||||
*
|
||||
* Returns: The same #GstClockID with increased refcount.
|
||||
* Returns: (transfer full): The same #GstClockID with increased refcount.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -287,7 +313,7 @@ _gst_clock_id_free (GstClockID id)
|
|||
|
||||
/**
|
||||
* gst_clock_id_unref:
|
||||
* @id: The #GstClockID to unref
|
||||
* @id: (transfer full): The #GstClockID to unref
|
||||
*
|
||||
* Unref given @id. When the refcount reaches 0 the
|
||||
* #GstClockID will be freed.
|
||||
|
@ -309,7 +335,7 @@ gst_clock_id_unref (GstClockID id)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_clock_new_single_shot_id
|
||||
* gst_clock_new_single_shot_id:
|
||||
* @clock: The #GstClockID to get a single shot notification from
|
||||
* @time: the requested time
|
||||
*
|
||||
|
@ -317,7 +343,10 @@ gst_clock_id_unref (GstClockID id)
|
|||
* notification at the requested time. The single shot id should be
|
||||
* unreffed after usage.
|
||||
*
|
||||
* Returns: A #GstClockID that can be used to request the time notification.
|
||||
* Free-function: gst_clock_id_unref
|
||||
*
|
||||
* Returns: (transfer full): a #GstClockID that can be used to request the
|
||||
* time notification.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -331,7 +360,7 @@ gst_clock_new_single_shot_id (GstClock * clock, GstClockTime time)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_clock_new_periodic_id
|
||||
* gst_clock_new_periodic_id:
|
||||
* @clock: The #GstClockID to get a periodic notification id from
|
||||
* @start_time: the requested start time
|
||||
* @interval: the requested interval
|
||||
|
@ -341,7 +370,10 @@ gst_clock_new_single_shot_id (GstClock * clock, GstClockTime time)
|
|||
* will then be fired with the given @interval. @id should be unreffed
|
||||
* after usage.
|
||||
*
|
||||
* Returns: A #GstClockID that can be used to request the time notification.
|
||||
* Free-function: gst_clock_id_unref
|
||||
*
|
||||
* Returns: (transfer full): a #GstClockID that can be used to request the
|
||||
* time notification.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -408,7 +440,8 @@ gst_clock_id_get_time (GstClockID id)
|
|||
/**
|
||||
* gst_clock_id_wait
|
||||
* @id: The #GstClockID to wait on
|
||||
* @jitter: A pointer that will contain the jitter, can be %NULL.
|
||||
* @jitter: (out) (allow-none): a pointer that will contain the jitter,
|
||||
* can be %NULL.
|
||||
*
|
||||
* Perform a blocking wait on @id.
|
||||
* @id should have been created with gst_clock_new_single_shot_id()
|
||||
|
@ -1008,7 +1041,7 @@ gst_clock_set_calibration (GstClock * clock, GstClockTime internal, GstClockTime
|
|||
{
|
||||
g_return_if_fail (GST_IS_CLOCK (clock));
|
||||
g_return_if_fail (rate_num != GST_CLOCK_TIME_NONE);
|
||||
g_return_if_fail (rate_denom && rate_denom != GST_CLOCK_TIME_NONE);
|
||||
g_return_if_fail (rate_denom > 0 && rate_denom != GST_CLOCK_TIME_NONE);
|
||||
|
||||
write_seqlock (clock);
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock,
|
||||
|
@ -1027,10 +1060,10 @@ gst_clock_set_calibration (GstClock * clock, GstClockTime internal, GstClockTime
|
|||
/**
|
||||
* gst_clock_get_calibration
|
||||
* @clock: a #GstClock
|
||||
* @internal: a location to store the internal time
|
||||
* @external: a location to store the external time
|
||||
* @rate_num: a location to store the rate numerator
|
||||
* @rate_denom: a location to store the rate denominator
|
||||
* @internal: (out) (allow-none): a location to store the internal time
|
||||
* @external: (out) (allow-none): a location to store the external time
|
||||
* @rate_num: (out) (allow-none): a location to store the rate numerator
|
||||
* @rate_denom: (out) (allow-none): a location to store the rate denominator
|
||||
*
|
||||
* Gets the internal rate and reference time of @clock. See
|
||||
* gst_clock_set_calibration() for more information.
|
||||
|
@ -1088,7 +1121,7 @@ gst_clock_slave_callback (GstClock * master, GstClockTime time,
|
|||
/**
|
||||
* gst_clock_set_master
|
||||
* @clock: a #GstClock
|
||||
* @master: a master #GstClock
|
||||
* @master: (allow-none): a master #GstClock
|
||||
*
|
||||
* Set @master as the master clock for @clock. @clock will be automatically
|
||||
* calibrated so that gst_clock_get_time() reports the same time as the
|
||||
|
@ -1160,14 +1193,14 @@ not_supported:
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_clock_get_master
|
||||
* gst_clock_get_master:
|
||||
* @clock: a #GstClock
|
||||
*
|
||||
* Get the master clock that @clock is slaved to or %NULL when the clock is
|
||||
* not slaved to any master clock.
|
||||
*
|
||||
* Returns: a master #GstClock or %NULL when this clock is not slaved to a
|
||||
* master clock. Unref after usage.
|
||||
* Returns: (transfer full): a master #GstClock or %NULL when this clock is
|
||||
* not slaved to a master clock. Unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -1314,7 +1347,7 @@ invalid:
|
|||
* @clock: a #GstClock
|
||||
* @slave: a time on the slave
|
||||
* @master: a time on the master
|
||||
* @r_squared: a pointer to hold the result
|
||||
* @r_squared: (out): a pointer to hold the result
|
||||
*
|
||||
* The time @master of the master clock and the time @slave of the slave
|
||||
* clock are added to the list of observations. If enough observations
|
||||
|
|
|
@ -260,7 +260,7 @@ typedef gboolean (*GstClockCallback) (GstClock *clock, GstClockTime time,
|
|||
* @GST_CLOCK_BADTIME: A bad time was provided to a function.
|
||||
* @GST_CLOCK_ERROR: An error occurred
|
||||
* @GST_CLOCK_UNSUPPORTED: Operation is not supported
|
||||
* @GST_CLOCK_DONE: The ClockID is done waiting
|
||||
* @GST_CLOCK_DONE: The ClockID is done waiting (Since: 0.10.32)
|
||||
*
|
||||
* The return value of a clock operation.
|
||||
*/
|
||||
|
@ -560,6 +560,10 @@ void gst_clock_id_unschedule (GstClockID id);
|
|||
gboolean gst_clock_single_shot_id_reinit (GstClock * clock,
|
||||
GstClockID id,
|
||||
GstClockTime time);
|
||||
gboolean gst_clock_periodic_id_reinit (GstClock * clock,
|
||||
GstClockID id,
|
||||
GstClockTime start_time,
|
||||
GstClockTime interval);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -174,7 +174,9 @@
|
|||
*
|
||||
* (not official API)
|
||||
*/
|
||||
#ifdef GST_DISABLE_PRINTF_EXTENSION
|
||||
/* If GLib is not using the system printf, we can't use the registered
|
||||
* extensions because the GLib-internal printf won't know how to parse them */
|
||||
#if defined(GST_DISABLE_PRINTF_EXTENSION) || !defined(GLIB_USING_SYSTEM_PRINTF)
|
||||
#undef GST_PTR_FORMAT
|
||||
#define GST_PTR_FORMAT "p"
|
||||
#undef GST_SEGMENT_FORMAT
|
||||
|
|
|
@ -152,7 +152,9 @@
|
|||
* Creates a new #GstDateTime using the time since Jan 1, 1970 specified by
|
||||
* @secs. The #GstDateTime is in the local timezone.
|
||||
*
|
||||
* Return value: the newly created #GstDateTime
|
||||
* Free-function: gst_date_time_unref
|
||||
*
|
||||
* Return value: (transfer full): the newly created #GstDateTime
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
@ -164,7 +166,9 @@
|
|||
* Creates a new #GstDateTime using the time since Jan 1, 1970 specified by
|
||||
* @secs. The #GstDateTime is in the UTC timezone.
|
||||
*
|
||||
* Return value: the newly created #GstDateTime
|
||||
* Free-function: gst_date_time_unref
|
||||
*
|
||||
* Return value: (transfer full): the newly created #GstDateTime
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
@ -176,17 +180,17 @@
|
|||
* @day: the day of the gregorian month
|
||||
* @hour: the hour of the day
|
||||
* @minute: the minute of the hour
|
||||
* @second: the second of the minute
|
||||
* @microsecond: the microsecond of the second
|
||||
* @seconds: the second of the minute
|
||||
*
|
||||
* Creates a new #GstDateTime using the date and times in the gregorian calendar
|
||||
* in the local timezone.
|
||||
*
|
||||
* @year should be from 1 to 9999, @month should be from 1 to 12, @day from
|
||||
* 1 to 31, @hour from 0 to 23, @minutes and @seconds from 0 to 59 and
|
||||
* @microsecond from 0 to 999999.
|
||||
* 1 to 31, @hour from 0 to 23, @minutes and @seconds from 0 to 59.
|
||||
*
|
||||
* Return value: the newly created #GstDateTime
|
||||
* Free-function: gst_date_time_unref
|
||||
*
|
||||
* Return value: (transfer full): the newly created #GstDateTime
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
@ -199,21 +203,21 @@
|
|||
* @day: the day of the gregorian month
|
||||
* @hour: the hour of the day
|
||||
* @minute: the minute of the hour
|
||||
* @second: the second of the minute
|
||||
* @microsecond: the microsecond of the second
|
||||
* @seconds: the second of the minute
|
||||
*
|
||||
* Creates a new #GstDateTime using the date and times in the gregorian calendar
|
||||
* in the supplied timezone.
|
||||
*
|
||||
* @year should be from 1 to 9999, @month should be from 1 to 12, @day from
|
||||
* 1 to 31, @hour from 0 to 23, @minutes and @seconds from 0 to 59 and
|
||||
* @microsecond from 0 to 999999.
|
||||
* 1 to 31, @hour from 0 to 23, @minutes and @seconds from 0 to 59.
|
||||
*
|
||||
* Note that @tzoffset is a float and was chosen so for being able to handle
|
||||
* some fractional timezones, while it still keeps the readability of
|
||||
* represeting it in hours for most timezones.
|
||||
*
|
||||
* Return value: the newly created #GstDateTime
|
||||
* Free-function: gst_date_time_unref
|
||||
*
|
||||
* Return value: (transfer full): the newly created #GstDateTime
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
@ -223,8 +227,10 @@
|
|||
*
|
||||
* Creates a new #GstDateTime representing the current date and time.
|
||||
*
|
||||
* Return value: the newly created #GstDateTime which should be freed with
|
||||
* gst_date_time_unref().
|
||||
* Free-function: gst_date_time_unref
|
||||
*
|
||||
* Return value: (transfer full): the newly created #GstDateTime which should
|
||||
* be freed with gst_date_time_unref().
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
@ -235,8 +241,10 @@
|
|||
* Creates a new #GstDateTime that represents the current instant at Universal
|
||||
* coordinated time.
|
||||
*
|
||||
* Return value: the newly created #GstDateTime which should be freed with
|
||||
* gst_date_time_unref().
|
||||
* Free-function: gst_date_time_unref
|
||||
*
|
||||
* Return value: (transfer full): the newly created #GstDateTime which should
|
||||
* be freed with gst_date_time_unref().
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
@ -249,6 +257,14 @@
|
|||
#define GST_DATE_TIME_USEC_PER_SECOND (G_GINT64_CONSTANT (1000000))
|
||||
#define GST_DATE_TIME_USEC_PER_MILLISECOND (G_GINT64_CONSTANT (1000))
|
||||
|
||||
/* Jan 5th 2011 (Edward) : GLib's GDateTime is broken in regards to gmt offset
|
||||
* on macosx. Re-enable it once the following bug is fixed:
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=638666 */
|
||||
#ifdef HAVE_OSX
|
||||
#undef GLIB_HAS_GDATETIME
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef GLIB_HAS_GDATETIME
|
||||
|
||||
#define MAX_SUPPORTED_YEAR 9999
|
||||
|
@ -767,7 +783,7 @@ gst_date_time_free (GstDateTime * datetime)
|
|||
*
|
||||
* Atomically increments the reference count of @datetime by one.
|
||||
*
|
||||
* Return value: the reference @datetime
|
||||
* Return value: (transfer full): the reference @datetime
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
@ -782,7 +798,7 @@ gst_date_time_ref (GstDateTime * datetime)
|
|||
|
||||
/**
|
||||
* gst_date_time_unref:
|
||||
* @datetime: a #GstDateTime
|
||||
* @datetime: (transfer full): a #GstDateTime
|
||||
*
|
||||
* Atomically decrements the reference count of @datetime by one. When the
|
||||
* reference count reaches zero, the structure is freed.
|
||||
|
|
163
gst/gstelement.c
163
gst/gstelement.c
|
@ -186,7 +186,11 @@ gst_element_class_init (GstElementClass * klass)
|
|||
* @gstelement: the object which received the signal
|
||||
* @new_pad: the pad that has been added
|
||||
*
|
||||
* a new #GstPad has been added to the element.
|
||||
* a new #GstPad has been added to the element. Note that this signal will
|
||||
* usually be emitted from the context of the streaming thread. Also keep in
|
||||
* mind that if you add new elements to the pipeline in the signal handler
|
||||
* you will need to set them to the desired target state with
|
||||
* gst_element_set() or gst_element_sync_state_with_parent().
|
||||
*/
|
||||
gst_element_signals[PAD_ADDED] =
|
||||
g_signal_new ("pad-added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
|
@ -208,6 +212,8 @@ gst_element_class_init (GstElementClass * klass)
|
|||
* @gstelement: the object which received the signal
|
||||
*
|
||||
* This signals that the element will not generate more dynamic pads.
|
||||
* Note that this signal will usually be emitted from the context of
|
||||
* the streaming thread.
|
||||
*/
|
||||
gst_element_signals[NO_MORE_PADS] =
|
||||
g_signal_new ("no-more-pads", G_TYPE_FROM_CLASS (klass),
|
||||
|
@ -367,7 +373,7 @@ gst_element_provides_clock (GstElement * element)
|
|||
* <note>An element is only required to provide a clock in the PAUSED
|
||||
* state. Some elements can provide a clock in other states.</note>
|
||||
*
|
||||
* Returns: the GstClock provided by the element or %NULL
|
||||
* Returns: (transfer full): the GstClock provided by the element or %NULL
|
||||
* if no clock could be provided. Unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
|
@ -437,7 +443,7 @@ gst_element_set_clock (GstElement * element, GstClock * clock)
|
|||
* Gets the currently configured clock of the element. This is the clock as was
|
||||
* last set with gst_element_set_clock().
|
||||
*
|
||||
* Returns: the #GstClock of the element. unref after usage.
|
||||
* Returns: (transfer full): the #GstClock of the element. unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -601,7 +607,7 @@ gst_element_is_indexable (GstElement * element)
|
|||
/**
|
||||
* gst_element_set_index:
|
||||
* @element: a #GstElement.
|
||||
* @index: a #GstIndex.
|
||||
* @index: (transfer none): a #GstIndex.
|
||||
*
|
||||
* Set @index on the element. The refcount of the index
|
||||
* will be increased, any previously set index is unreffed.
|
||||
|
@ -628,7 +634,7 @@ gst_element_set_index (GstElement * element, GstIndex * index)
|
|||
*
|
||||
* Gets the index from the element.
|
||||
*
|
||||
* Returns: a #GstIndex or %NULL when no index was set on the
|
||||
* Returns: (transfer full): a #GstIndex or %NULL when no index was set on the
|
||||
* element. unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
|
@ -652,7 +658,7 @@ gst_element_get_index (GstElement * element)
|
|||
/**
|
||||
* gst_element_add_pad:
|
||||
* @element: a #GstElement to add the pad to.
|
||||
* @pad: the #GstPad to add to the element.
|
||||
* @pad: (transfer full): the #GstPad to add to the element.
|
||||
*
|
||||
* Adds a pad (link point) to @element. @pad's parent will be set to @element;
|
||||
* see gst_object_set_parent() for refcounting information.
|
||||
|
@ -768,7 +774,7 @@ no_direction:
|
|||
/**
|
||||
* gst_element_remove_pad:
|
||||
* @element: a #GstElement to remove pad from.
|
||||
* @pad: the #GstPad to remove from the element.
|
||||
* @pad: (transfer none): the #GstPad to remove from the element.
|
||||
*
|
||||
* Removes @pad from @element. @pad will be destroyed if it has not been
|
||||
* referenced elsewhere using gst_object_unparent().
|
||||
|
@ -904,8 +910,8 @@ pad_compare_name (GstPad * pad1, const gchar * name)
|
|||
* Retrieves a pad from @element by name. This version only retrieves
|
||||
* already-existing (i.e. 'static') pads.
|
||||
*
|
||||
* Returns: the requested #GstPad if found, otherwise %NULL. unref after
|
||||
* usage.
|
||||
* Returns: (transfer full): the requested #GstPad if found, otherwise %NULL.
|
||||
* unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -939,15 +945,17 @@ gst_element_get_static_pad (GstElement * element, const gchar * name)
|
|||
}
|
||||
|
||||
static GstPad *
|
||||
gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
|
||||
const gchar * name)
|
||||
_gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
|
||||
const gchar * name, const GstCaps * caps)
|
||||
{
|
||||
GstPad *newpad = NULL;
|
||||
GstElementClass *oclass;
|
||||
|
||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
if (oclass->request_new_pad)
|
||||
if (oclass->request_new_pad_full)
|
||||
newpad = (oclass->request_new_pad_full) (element, templ, name, caps);
|
||||
else if (oclass->request_new_pad)
|
||||
newpad = (oclass->request_new_pad) (element, templ, name);
|
||||
|
||||
if (newpad)
|
||||
|
@ -965,7 +973,11 @@ gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
|
|||
* request pads. The pad should be released with
|
||||
* gst_element_release_request_pad().
|
||||
*
|
||||
* Returns: requested #GstPad if found, otherwise %NULL. Release after usage.
|
||||
* This method is slow and will be deprecated in the future. New code should
|
||||
* use gst_element_request_pad() with the requested template.
|
||||
*
|
||||
* Returns: (transfer full): requested #GstPad if found, otherwise %NULL.
|
||||
* Release after usage.
|
||||
*/
|
||||
GstPad *
|
||||
gst_element_get_request_pad (GstElement * element, const gchar * name)
|
||||
|
@ -1018,7 +1030,8 @@ gst_element_get_request_pad (GstElement * element, const gchar * name)
|
|||
|
||||
/* it's an int */
|
||||
tmp = strtol (data, &endptr, 10);
|
||||
if (endptr && *endptr == '\0') {
|
||||
if (tmp != G_MINLONG && tmp != G_MAXLONG && endptr &&
|
||||
*endptr == '\0') {
|
||||
templ_found = TRUE;
|
||||
req_name = name;
|
||||
break;
|
||||
|
@ -1038,11 +1051,79 @@ gst_element_get_request_pad (GstElement * element, const gchar * name)
|
|||
if (!templ_found)
|
||||
return NULL;
|
||||
|
||||
pad = gst_element_request_pad (element, templ, req_name);
|
||||
pad = _gst_element_request_pad (element, templ, req_name, NULL);
|
||||
|
||||
return pad;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_element_request_pad:
|
||||
* @element: a #GstElement to find a request pad of.
|
||||
* @templ: a #GstPadTemplate of which we want a pad of.
|
||||
* @name: (transfer none) (allow-none): the name of the request #GstPad
|
||||
* to retrieve. Can be %NULL.
|
||||
* @caps: (transfer none) (allow-none): the caps of the pad we want to
|
||||
* request. Can be %NULL.
|
||||
*
|
||||
* Retrieves a request pad from the element according to the provided template.
|
||||
*
|
||||
* If the @caps are specified and the element implements thew new
|
||||
* request_new_pad_full virtual method, the element will use them to select
|
||||
* which pad to create.
|
||||
*
|
||||
* The pad should be released with gst_element_release_request_pad().
|
||||
*
|
||||
* Returns: (transfer full): requested #GstPad if found, otherwise %NULL.
|
||||
* Release after usage.
|
||||
*
|
||||
* Since: 0.10.32
|
||||
*/
|
||||
GstPad *
|
||||
gst_element_request_pad (GstElement * element,
|
||||
GstPadTemplate * templ, const gchar * name, const GstCaps * caps)
|
||||
{
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
|
||||
g_return_val_if_fail (templ != NULL, NULL);
|
||||
|
||||
return _gst_element_request_pad (element, templ, name, caps);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_element_get_pad:
|
||||
* @element: a #GstElement.
|
||||
* @name: the name of the pad to retrieve.
|
||||
*
|
||||
* Retrieves a pad from @element by name. Tries gst_element_get_static_pad()
|
||||
* first, then gst_element_get_request_pad().
|
||||
*
|
||||
* Deprecated: This function is deprecated as it's unclear if the reference
|
||||
* to the result pad should be released with gst_object_unref() in case of a static pad
|
||||
* or gst_element_release_request_pad() in case of a request pad.
|
||||
* Use gst_element_get_static_pad() or gst_element_get_request_pad() instead.
|
||||
*
|
||||
* Returns: (transfer full): the #GstPad if found, otherwise %NULL. Unref or Release after usage,
|
||||
* depending on the type of the pad.
|
||||
*/
|
||||
#ifndef GST_REMOVE_DEPRECATED
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
GstPad *gst_element_get_pad (GstElement * element, const gchar * name);
|
||||
#endif
|
||||
GstPad *
|
||||
gst_element_get_pad (GstElement * element, const gchar * name)
|
||||
{
|
||||
GstPad *pad;
|
||||
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
pad = gst_element_get_static_pad (element, name);
|
||||
if (!pad)
|
||||
pad = gst_element_get_request_pad (element, name);
|
||||
|
||||
return pad;
|
||||
}
|
||||
#endif /* GST_REMOVE_DEPRECATED */
|
||||
|
||||
static GstIteratorItem
|
||||
iterate_pad (GstIterator * it, GstPad * pad)
|
||||
{
|
||||
|
@ -1076,7 +1157,8 @@ gst_element_iterate_pad_list (GstElement * element, GList ** padlist)
|
|||
* Retrieves an iterattor of @element's pads. The iterator should
|
||||
* be freed after usage.
|
||||
*
|
||||
* Returns: the #GstIterator of #GstPad. Unref each pad after use.
|
||||
* Returns: (transfer full): the #GstIterator of #GstPad. Unref each pad
|
||||
* after use.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -1094,7 +1176,8 @@ gst_element_iterate_pads (GstElement * element)
|
|||
*
|
||||
* Retrieves an iterator of @element's source pads.
|
||||
*
|
||||
* Returns: the #GstIterator of #GstPad. Unref each pad after use.
|
||||
* Returns: (transfer full): the #GstIterator of #GstPad. Unref each pad
|
||||
* after use.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -1112,7 +1195,8 @@ gst_element_iterate_src_pads (GstElement * element)
|
|||
*
|
||||
* Retrieves an iterator of @element's sink pads.
|
||||
*
|
||||
* Returns: the #GstIterator of #GstPad. Unref each pad after use.
|
||||
* Returns: (transfer full): the #GstIterator of #GstPad. Unref each pad
|
||||
* after use.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -1127,7 +1211,7 @@ gst_element_iterate_sink_pads (GstElement * element)
|
|||
/**
|
||||
* gst_element_class_add_pad_template:
|
||||
* @klass: the #GstElementClass to add the pad template to.
|
||||
* @templ: a #GstPadTemplate to add to the element class.
|
||||
* @templ: (transfer none): a #GstPadTemplate to add to the element class.
|
||||
*
|
||||
* Adds a padtemplate to an element class. This is mainly used in the _base_init
|
||||
* functions of classes.
|
||||
|
@ -1213,7 +1297,8 @@ gst_element_class_set_metadata (GstElementClass * klass,
|
|||
* that has subclasses, make sure to pass the g_class parameter of the
|
||||
* #GInstanceInitFunc here.</note>
|
||||
*
|
||||
* Returns: the #GList of padtemplates.
|
||||
* Returns: (transfer none) (element-type Gst.PadTemplate): the #GList of
|
||||
* pad templates.
|
||||
*/
|
||||
GList *
|
||||
gst_element_class_get_pad_template_list (GstElementClass * element_class)
|
||||
|
@ -1233,8 +1318,8 @@ gst_element_class_get_pad_template_list (GstElementClass * element_class)
|
|||
* that has subclasses, make sure to pass the g_class parameter of the
|
||||
* #GInstanceInitFunc here.</note>
|
||||
*
|
||||
* Returns: the #GstPadTemplate with the given name, or %NULL if none was found.
|
||||
* No unreferencing is necessary.
|
||||
* Returns: (transfer none): the #GstPadTemplate with the given name, or %NULL
|
||||
* if none was found. No unreferencing is necessary.
|
||||
*/
|
||||
GstPadTemplate *
|
||||
gst_element_class_get_pad_template (GstElementClass * element_class,
|
||||
|
@ -1363,7 +1448,7 @@ gst_element_default_send_event (GstElement * element, GstEvent * event)
|
|||
/**
|
||||
* gst_element_send_event:
|
||||
* @element: a #GstElement to send the event to.
|
||||
* @event: the #GstEvent to send to the element.
|
||||
* @event: (transfer full): the #GstEvent to send to the element.
|
||||
*
|
||||
* Sends an event to an element. If the element doesn't implement an
|
||||
* event handler, the event will be pushed on a random linked sink pad for
|
||||
|
@ -1508,7 +1593,7 @@ gst_element_default_query (GstElement * element, GstQuery * query)
|
|||
/**
|
||||
* gst_element_query:
|
||||
* @element: a #GstElement to perform the query on.
|
||||
* @query: the #GstQuery.
|
||||
* @query: (transfer none): the #GstQuery.
|
||||
*
|
||||
* Performs a query on the given element.
|
||||
*
|
||||
|
@ -1546,7 +1631,7 @@ gst_element_query (GstElement * element, GstQuery * query)
|
|||
/**
|
||||
* gst_element_post_message:
|
||||
* @element: a #GstElement posting the message
|
||||
* @message: a #GstMessage to post
|
||||
* @message: (transfer full): a #GstMessage to post
|
||||
*
|
||||
* Post a message on the element's #GstBus. This function takes ownership of the
|
||||
* message; if you want to access the message after this call, you should add an
|
||||
|
@ -1599,7 +1684,8 @@ no_bus:
|
|||
*
|
||||
* This function is only used internally by the gst_element_error() macro.
|
||||
*
|
||||
* Returns: a newly allocated string, or %NULL if the format was %NULL or ""
|
||||
* Returns: (transfer full): a newly allocated string, or %NULL if the format
|
||||
* was %NULL or ""
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -1626,10 +1712,12 @@ _gst_element_error_printf (const gchar * format, ...)
|
|||
* @type: the #GstMessageType
|
||||
* @domain: the GStreamer GError domain this message belongs to
|
||||
* @code: the GError code belonging to the domain
|
||||
* @text: an allocated text string to be used as a replacement for the
|
||||
* default message connected to code, or %NULL
|
||||
* @debug: an allocated debug message to be used as a replacement for the
|
||||
* default debugging information, or %NULL
|
||||
* @text: (allow-none) (transfer full): an allocated text string to be used
|
||||
* as a replacement for the default message connected to code,
|
||||
* or %NULL
|
||||
* @debug: (allow-none) (transfer full): an allocated debug message to be
|
||||
* used as a replacement for the default debugging information,
|
||||
* or %NULL
|
||||
* @file: the source code file where the error was generated
|
||||
* @function: the source code function where the error was generated
|
||||
* @line: the source code line where the error was generated
|
||||
|
@ -1968,9 +2056,10 @@ interrupted:
|
|||
/**
|
||||
* gst_element_get_state:
|
||||
* @element: a #GstElement to get the state of.
|
||||
* @state: (out): a pointer to #GstState to hold the state. Can be %NULL.
|
||||
* @pending: (out): a pointer to #GstState to hold the pending state.
|
||||
* Can be %NULL.
|
||||
* @state: (out) (allow-none): a pointer to #GstState to hold the state.
|
||||
* Can be %NULL.
|
||||
* @pending: (out) (allow-none): a pointer to #GstState to hold the pending
|
||||
* state. Can be %NULL.
|
||||
* @timeout: a #GstClockTime to specify the timeout for an async
|
||||
* state change or %GST_CLOCK_TIME_NONE for infinite timeout.
|
||||
*
|
||||
|
@ -2756,8 +2845,8 @@ was_ok:
|
|||
*
|
||||
* Retrieves the factory that was used to create this element.
|
||||
*
|
||||
* Returns: the #GstElementFactory used for creating this element.
|
||||
* no refcounting is needed.
|
||||
* Returns: (transfer none): the #GstElementFactory used for creating this
|
||||
* element. no refcounting is needed.
|
||||
*/
|
||||
GstElementFactory *
|
||||
gst_element_get_factory (GstElement * element)
|
||||
|
@ -2863,7 +2952,7 @@ gst_element_set_bus_func (GstElement * element, GstBus * bus)
|
|||
/**
|
||||
* gst_element_set_bus:
|
||||
* @element: a #GstElement to set the bus of.
|
||||
* @bus: the #GstBus to set.
|
||||
* @bus: (transfer none): the #GstBus to set.
|
||||
*
|
||||
* Sets the bus of the element. Increases the refcount on the bus.
|
||||
* For internal use only, unless you're testing elements.
|
||||
|
@ -2890,7 +2979,7 @@ gst_element_set_bus (GstElement * element, GstBus * bus)
|
|||
* Returns the bus of the element. Note that only a #GstPipeline will provide a
|
||||
* bus for the application.
|
||||
*
|
||||
* Returns: the element's #GstBus. unref after usage.
|
||||
* Returns: (transfer full): the element's #GstBus. unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
|
|
@ -596,6 +596,7 @@ struct _GstElement
|
|||
* @send_event: send a #GstEvent to the element
|
||||
* @get_query_types: get the supported #GstQueryType of this element
|
||||
* @query: perform a #GstQuery on the element
|
||||
* @request_new_pad_full: called when a new pad is requested. Since: 0.10.32.
|
||||
*
|
||||
* GStreamer element class. Override the vmethods to implement the element
|
||||
* functionality.
|
||||
|
@ -654,6 +655,13 @@ struct _GstElementClass
|
|||
|
||||
/*< private >*/
|
||||
|
||||
/*< public >*/
|
||||
/* Virtual method for subclasses (additions) */
|
||||
/* FIXME-0.11 Make this the default behaviour */
|
||||
GstPad* (*request_new_pad_full) (GstElement *element, GstPadTemplate *templ,
|
||||
const gchar* name, const GstCaps *caps);
|
||||
|
||||
/*< private >*/
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
|
@ -686,7 +694,7 @@ GType gst_element_get_type (void);
|
|||
* For a nameless element, this returns NULL, which you can safely g_free()
|
||||
* as well.
|
||||
*
|
||||
* Returns: the name of @elem. g_free() after usage. MT safe.
|
||||
* Returns: (transfer full): the name of @elem. g_free() after usage. MT safe.
|
||||
*
|
||||
*/
|
||||
#define gst_element_get_name(elem) gst_object_get_name(GST_OBJECT_CAST(elem))
|
||||
|
@ -704,7 +712,7 @@ GType gst_element_get_type (void);
|
|||
* gst_element_get_parent:
|
||||
* @elem: a #GstElement to get the parent of.
|
||||
*
|
||||
* Gets the parent of an element.
|
||||
* Returns: (transfer full): the parent of an element.
|
||||
*/
|
||||
#define gst_element_get_parent(elem) gst_object_get_parent(GST_OBJECT_CAST(elem))
|
||||
|
||||
|
@ -744,6 +752,9 @@ void gst_element_no_more_pads (GstElement *element);
|
|||
|
||||
GstPad* gst_element_get_static_pad (GstElement *element, const gchar *name);
|
||||
GstPad* gst_element_get_request_pad (GstElement *element, const gchar *name);
|
||||
GstPad* gst_element_request_pad (GstElement *element,
|
||||
GstPadTemplate *templ,
|
||||
const gchar * name, const GstCaps *caps);
|
||||
void gst_element_release_request_pad (GstElement *element, GstPad *pad);
|
||||
|
||||
GstIterator * gst_element_iterate_pads (GstElement * element);
|
||||
|
|
|
@ -125,7 +125,7 @@ gst_element_factory_finalize (GObject * object)
|
|||
* Search for an element factory of the given name. Refs the returned
|
||||
* element factory; caller is responsible for unreffing.
|
||||
*
|
||||
* Returns: #GstElementFactory if found, NULL otherwise
|
||||
* Returns: (transfer full): #GstElementFactory if found, NULL otherwise
|
||||
*/
|
||||
GstElementFactory *
|
||||
gst_element_factory_find (const gchar * name)
|
||||
|
@ -192,8 +192,9 @@ gst_element_factory_cleanup (GstElementFactory * factory)
|
|||
|
||||
/**
|
||||
* gst_element_register:
|
||||
* @plugin: #GstPlugin to register the element with, or NULL for a static
|
||||
* element (note that passing NULL only works in GStreamer 0.10.13 and later)
|
||||
* @plugin: (allow-none): #GstPlugin to register the element with, or NULL for
|
||||
* a static element (note that passing NULL only works in GStreamer 0.10.13
|
||||
* and later)
|
||||
* @name: name of elements of this type
|
||||
* @rank: rank of element (higher rank means more importance when autoplugging)
|
||||
* @type: GType of element to register
|
||||
|
@ -342,7 +343,8 @@ detailserror:
|
|||
* It will be given the name supplied, since all elements require a name as
|
||||
* their first argument.
|
||||
*
|
||||
* Returns: new #GstElement or NULL if the element couldn't be created
|
||||
* Returns: (transfer full): new #GstElement or NULL if the element couldn't
|
||||
* be created
|
||||
*/
|
||||
GstElement *
|
||||
gst_element_factory_create (GstElementFactory * factory, const gchar * name)
|
||||
|
@ -427,7 +429,7 @@ no_element:
|
|||
* consisting of the element factory name and a number.
|
||||
* If name is given, it will be given the name supplied.
|
||||
*
|
||||
* Returns: new #GstElement or NULL if unable to create element
|
||||
* Returns: (transfer full): new #GstElement or NULL if unable to create element
|
||||
*/
|
||||
GstElement *
|
||||
gst_element_factory_make (const gchar * factoryname, const gchar * name)
|
||||
|
@ -548,7 +550,8 @@ __gst_element_factory_add_interface (GstElementFactory * elementfactory,
|
|||
*
|
||||
* Gets the #GList of #GstStaticPadTemplate for this factory.
|
||||
*
|
||||
* Returns: the padtemplates
|
||||
* Returns: (transfer none) (element-type Gst.StaticPadTemplate): the
|
||||
* static pad templates
|
||||
*/
|
||||
G_CONST_RETURN GList *
|
||||
gst_element_factory_get_static_pad_templates (GstElementFactory * factory)
|
||||
|
@ -583,7 +586,8 @@ gst_element_factory_get_uri_type (GstElementFactory * factory)
|
|||
* array, as it is still owned by the element factory. Use g_strdupv() to
|
||||
* make a copy of the protocol string array if you need to.
|
||||
*
|
||||
* Returns: the supported protocols or NULL
|
||||
* Returns: (transfer none) (array zero-terminated=1): the supported protocols
|
||||
* or NULL
|
||||
*/
|
||||
gchar **
|
||||
gst_element_factory_get_uri_protocols (GstElementFactory * factory)
|
||||
|
@ -725,8 +729,9 @@ element_filter (GstPluginFeature * feature, FilterData * data)
|
|||
* with a rank greater or equal to @minrank will be returned.
|
||||
* The list of factories is returned by decreasing rank.
|
||||
*
|
||||
* Returns: a #GList of #GstElementFactory elements. Use
|
||||
* gst_plugin_feature_list_free() after usage.
|
||||
* Returns: (transfer full) (element-type Gst.ElementFactory): a #GList of
|
||||
* #GstElementFactory elements. Use gst_plugin_feature_list_free() after
|
||||
* usage.
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
@ -753,7 +758,8 @@ gst_element_factory_list_get_elements (GstElementFactoryListType type,
|
|||
|
||||
/**
|
||||
* gst_element_factory_list_filter:
|
||||
* @list: a #GList of #GstElementFactory to filter
|
||||
* @list: (transfer none) (element-type Gst.ElementFactory): a #GList of
|
||||
* #GstElementFactory to filter
|
||||
* @caps: a #GstCaps
|
||||
* @direction: a #GstPadDirection to filter on
|
||||
* @subsetonly: whether to filter on caps subsets or not.
|
||||
|
@ -765,8 +771,9 @@ gst_element_factory_list_get_elements (GstElementFactoryListType type,
|
|||
* are a complete superset of @caps will be returned. Else any element
|
||||
* whose pad templates caps can intersect with @caps will be returned.
|
||||
*
|
||||
* Returns: a #GList of #GstElementFactory elements that match the
|
||||
* given requisits. Use #gst_plugin_feature_list_free after usage.
|
||||
* Returns: (transfer full) (element-type Gst.ElementFactory): a #GList of
|
||||
* #GstElementFactory elements that match the given requisits.
|
||||
* Use #gst_plugin_feature_list_free after usage.
|
||||
*
|
||||
* Since: 0.10.31
|
||||
*/
|
||||
|
|
|
@ -300,8 +300,8 @@ QUARK_FUNC (stream);
|
|||
*
|
||||
* Get a string describing the error message in the current locale.
|
||||
*
|
||||
* Returns: a newly allocated string describing the error message in the
|
||||
* current locale.
|
||||
* Returns: (transfer full): a newly allocated string describing
|
||||
* the error message (in UTF-8 encoding)
|
||||
*/
|
||||
gchar *
|
||||
gst_error_get_message (GQuark domain, gint code)
|
||||
|
|
138
gst/gstevent.c
138
gst/gstevent.c
|
@ -279,8 +279,8 @@ gst_event_new (GstEventType type)
|
|||
/**
|
||||
* gst_event_new_custom:
|
||||
* @type: The type of the new event
|
||||
* @structure: The structure for the event. The event will take ownership of
|
||||
* the structure.
|
||||
* @structure: (transfer full): the structure for the event. The event will
|
||||
* take ownership of the structure.
|
||||
*
|
||||
* Create a new custom-typed event. This can be used for anything not
|
||||
* handled by other event-specific functions to pass an event to another
|
||||
|
@ -293,7 +293,7 @@ gst_event_new (GstEventType type)
|
|||
* New custom events can also be created by subclassing the event type if
|
||||
* needed.
|
||||
*
|
||||
* Returns: The new custom event.
|
||||
* Returns: (transfer full): the new custom event.
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_custom (GstEventType type, GstStructure * structure)
|
||||
|
@ -431,7 +431,7 @@ gst_event_set_seqnum (GstEvent * event, guint32 seqnum)
|
|||
* This event is typically generated after a seek to flush out all queued data
|
||||
* in the pipeline so that the new media is played as soon as possible.
|
||||
*
|
||||
* Returns: A new flush start event.
|
||||
* Returns: (transfer full): a new flush start event.
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_flush_start (void)
|
||||
|
@ -453,7 +453,7 @@ gst_event_new_flush_start (void)
|
|||
* This event is typically generated to complete a seek and to resume
|
||||
* dataflow.
|
||||
*
|
||||
* Returns: A new flush stop event.
|
||||
* Returns: (transfer full): a new flush stop event.
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_flush_stop (void)
|
||||
|
@ -478,7 +478,7 @@ gst_event_new_flush_stop (void)
|
|||
*
|
||||
* The EOS event itself will not cause any state transitions of the pipeline.
|
||||
*
|
||||
* Returns: The new EOS event.
|
||||
* Returns: (transfer full): the new EOS event.
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_eos (void)
|
||||
|
@ -500,7 +500,7 @@ gst_event_new_eos (void)
|
|||
* This method calls gst_event_new_new_segment_full() passing a default
|
||||
* value of 1.0 for applied_rate
|
||||
*
|
||||
* Returns: A new newsegment event.
|
||||
* Returns: (transfer full): a new newsegment event.
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_new_segment (gboolean update, gdouble rate, GstFormat format,
|
||||
|
@ -575,7 +575,7 @@ gst_event_parse_new_segment (GstEvent * event, gboolean * update,
|
|||
*
|
||||
* position + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate)
|
||||
*
|
||||
* Returns: A new newsegment event.
|
||||
* Returns: (transfer full): a new newsegment event.
|
||||
*
|
||||
* Since: 0.10.6
|
||||
*/
|
||||
|
@ -683,11 +683,12 @@ gst_event_parse_new_segment_full (GstEvent * event, gboolean * update,
|
|||
|
||||
/**
|
||||
* gst_event_new_tag:
|
||||
* @taglist: metadata list. The event will take ownership of @taglist.
|
||||
* @taglist: (transfer full): metadata list. The event will take ownership
|
||||
* of the taglist.
|
||||
*
|
||||
* Generates a metadata tag event from the given @taglist.
|
||||
*
|
||||
* Returns: a new #GstEvent
|
||||
* Returns: (transfer full): a new #GstEvent
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_tag (GstTagList * taglist)
|
||||
|
@ -700,9 +701,12 @@ gst_event_new_tag (GstTagList * taglist)
|
|||
/**
|
||||
* gst_event_parse_tag:
|
||||
* @event: a tag event
|
||||
* @taglist: (out): pointer to metadata list
|
||||
* @taglist: (out) (transfer none): pointer to metadata list
|
||||
*
|
||||
* Parses a tag @event and stores the results in the given @taglist location.
|
||||
* No reference to the taglist will be returned, it remains valid only until
|
||||
* the @event is freed. Don't modify or free the taglist, make a copy if you
|
||||
* want to modify it or store it for later use.
|
||||
*/
|
||||
void
|
||||
gst_event_parse_tag (GstEvent * event, GstTagList ** taglist)
|
||||
|
@ -727,7 +731,7 @@ gst_event_parse_tag (GstEvent * event, GstTagList ** taglist)
|
|||
*
|
||||
* When the @async flag is set, a thread boundary is prefered.
|
||||
*
|
||||
* Returns: a new #GstEvent
|
||||
* Returns: (transfer full): a new #GstEvent
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_buffer_size (GstFormat format, gint64 minsize,
|
||||
|
@ -795,11 +799,47 @@ gst_event_parse_buffer_size (GstEvent * event, GstFormat * format,
|
|||
* @diff: The time difference of the last Clock sync
|
||||
* @timestamp: The timestamp of the buffer
|
||||
*
|
||||
* Allocate a new qos event with the given values. This function calls
|
||||
* gst_event_new_qos_full() with the type set to #GST_QOS_TYPE_OVERFLOW
|
||||
* when diff is negative (buffers are in time) and #GST_QOS_TYPE_UNDERFLOW
|
||||
* when @diff is positive (buffers are late).
|
||||
*
|
||||
* Returns: (transfer full): a new QOS event.
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff,
|
||||
GstClockTime timestamp)
|
||||
{
|
||||
GstQOSType type;
|
||||
|
||||
if (diff <= 0)
|
||||
type = GST_QOS_TYPE_OVERFLOW;
|
||||
else
|
||||
type = GST_QOS_TYPE_UNDERFLOW;
|
||||
|
||||
return gst_event_new_qos_full (type, proportion, diff, timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_event_new_qos_full:
|
||||
* @type: the QoS type
|
||||
* @proportion: the proportion of the qos message
|
||||
* @diff: The time difference of the last Clock sync
|
||||
* @timestamp: The timestamp of the buffer
|
||||
*
|
||||
* Allocate a new qos event with the given values.
|
||||
* The QOS event is generated in an element that wants an upstream
|
||||
* element to either reduce or increase its rate because of
|
||||
* high/low CPU load or other resource usage such as network performance.
|
||||
* Typically sinks generate these events for each buffer they receive.
|
||||
* high/low CPU load or other resource usage such as network performance or
|
||||
* throttling. Typically sinks generate these events for each buffer
|
||||
* they receive.
|
||||
*
|
||||
* @type indicates the reason for the QoS event. #GST_QOS_TYPE_OVERFLOW is
|
||||
* used when a buffer arrived in time or when the sink cannot keep up with
|
||||
* the upstream datarate. #GST_QOS_TYPE_UNDERFLOW is when the sink is not
|
||||
* receiving buffers fast enough and thus has to drop late buffers.
|
||||
* #GST_QOS_TYPE_THROTTLE is used when the datarate is artificially limited
|
||||
* by the application, for example to reduce power consumption.
|
||||
*
|
||||
* @proportion indicates the real-time performance of the streaming in the
|
||||
* element that generated the QoS event (usually the sink). The value is
|
||||
|
@ -814,7 +854,8 @@ gst_event_parse_buffer_size (GstEvent * event, GstFormat * format,
|
|||
* @diff is the difference against the clock in running time of the last
|
||||
* buffer that caused the element to generate the QOS event. A negative value
|
||||
* means that the buffer with @timestamp arrived in time. A positive value
|
||||
* indicates how late the buffer with @timestamp was.
|
||||
* indicates how late the buffer with @timestamp was. When throttling is
|
||||
* enabled, @diff will be set to the requested throttling interval.
|
||||
*
|
||||
* @timestamp is the timestamp of the last buffer that cause the element
|
||||
* to generate the QOS event. It is expressed in running time and thus an ever
|
||||
|
@ -829,11 +870,13 @@ gst_event_parse_buffer_size (GstEvent * event, GstFormat * format,
|
|||
* The application can use general event probes to intercept the QoS
|
||||
* event and implement custom application specific QoS handling.
|
||||
*
|
||||
* Returns: A new QOS event.
|
||||
* Returns: (transfer full): a new QOS event.
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff,
|
||||
GstClockTime timestamp)
|
||||
gst_event_new_qos_full (GstQOSType type, gdouble proportion,
|
||||
GstClockTimeDiff diff, GstClockTime timestamp)
|
||||
{
|
||||
GstEvent *event;
|
||||
GstStructure *structure;
|
||||
|
@ -842,11 +885,12 @@ gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff,
|
|||
g_return_val_if_fail (diff >= 0 || -diff <= timestamp, NULL);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_EVENT,
|
||||
"creating qos proportion %lf, diff %" G_GINT64_FORMAT
|
||||
", timestamp %" GST_TIME_FORMAT, proportion,
|
||||
"creating qos type %d, proportion %lf, diff %" G_GINT64_FORMAT
|
||||
", timestamp %" GST_TIME_FORMAT, type, proportion,
|
||||
diff, GST_TIME_ARGS (timestamp));
|
||||
|
||||
structure = gst_structure_id_new (GST_QUARK (EVENT_QOS),
|
||||
GST_QUARK (TYPE), GST_TYPE_QOS_TYPE, type,
|
||||
GST_QUARK (PROPORTION), G_TYPE_DOUBLE, proportion,
|
||||
GST_QUARK (DIFF), G_TYPE_INT64, diff,
|
||||
GST_QUARK (TIMESTAMP), G_TYPE_UINT64, timestamp, NULL);
|
||||
|
@ -868,6 +912,26 @@ gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff,
|
|||
void
|
||||
gst_event_parse_qos (GstEvent * event, gdouble * proportion,
|
||||
GstClockTimeDiff * diff, GstClockTime * timestamp)
|
||||
{
|
||||
gst_event_parse_qos_full (event, NULL, proportion, diff, timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_event_parse_qos_full:
|
||||
* @event: The event to query
|
||||
* @type: (out): A pointer to store the QoS type in
|
||||
* @proportion: (out): A pointer to store the proportion in
|
||||
* @diff: (out): A pointer to store the diff in
|
||||
* @timestamp: (out): A pointer to store the timestamp in
|
||||
*
|
||||
* Get the type, proportion, diff and timestamp in the qos event. See
|
||||
* gst_event_new_qos_full() for more information about the different QoS values.
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*/
|
||||
void
|
||||
gst_event_parse_qos_full (GstEvent * event, GstQOSType * type,
|
||||
gdouble * proportion, GstClockTimeDiff * diff, GstClockTime * timestamp)
|
||||
{
|
||||
const GstStructure *structure;
|
||||
|
||||
|
@ -875,6 +939,10 @@ gst_event_parse_qos (GstEvent * event, gdouble * proportion,
|
|||
g_return_if_fail (GST_EVENT_TYPE (event) == GST_EVENT_QOS);
|
||||
|
||||
structure = event->structure;
|
||||
if (type)
|
||||
*type =
|
||||
g_value_get_enum (gst_structure_id_get_value (structure,
|
||||
GST_QUARK (TYPE)));
|
||||
if (proportion)
|
||||
*proportion =
|
||||
g_value_get_double (gst_structure_id_get_value (structure,
|
||||
|
@ -931,7 +999,7 @@ gst_event_parse_qos (GstEvent * event, gdouble * proportion,
|
|||
* #GST_QUERY_POSITION and update the playback segment current position with a
|
||||
* #GST_SEEK_TYPE_SET to the desired position.
|
||||
*
|
||||
* Returns: A new seek event.
|
||||
* Returns: (transfer full): a new seek event.
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_seek (gdouble rate, GstFormat format, GstSeekFlags flags,
|
||||
|
@ -1027,12 +1095,12 @@ gst_event_parse_seek (GstEvent * event, gdouble * rate,
|
|||
|
||||
/**
|
||||
* gst_event_new_navigation:
|
||||
* @structure: description of the event. The event will take ownership of the
|
||||
* structure.
|
||||
* @structure: (transfer full): description of the event. The event will take
|
||||
* ownership of the structure.
|
||||
*
|
||||
* Create a new navigation event from the given description.
|
||||
*
|
||||
* Returns: a new #GstEvent
|
||||
* Returns: (transfer full): a new #GstEvent
|
||||
*/
|
||||
GstEvent *
|
||||
gst_event_new_navigation (GstStructure * structure)
|
||||
|
@ -1053,7 +1121,7 @@ gst_event_new_navigation (GstStructure * structure)
|
|||
* The latency is mostly used in live sinks and is always expressed in
|
||||
* the time format.
|
||||
*
|
||||
* Returns: a new #GstEvent
|
||||
* Returns: (transfer full): a new #GstEvent
|
||||
*
|
||||
* Since: 0.10.12
|
||||
*/
|
||||
|
@ -1115,7 +1183,7 @@ gst_event_parse_latency (GstEvent * event, GstClockTime * latency)
|
|||
* The @intermediate flag instructs the pipeline that this step operation is
|
||||
* part of a larger step operation.
|
||||
*
|
||||
* Returns: a new #GstEvent
|
||||
* Returns: (transfer full): a new #GstEvent
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -1144,11 +1212,12 @@ gst_event_new_step (GstFormat format, guint64 amount, gdouble rate,
|
|||
/**
|
||||
* gst_event_parse_step:
|
||||
* @event: The event to query
|
||||
* @format: (out): A pointer to store the format in.
|
||||
* @amount: (out): A pointer to store the amount in.
|
||||
* @rate: (out): A pointer to store the rate in.
|
||||
* @flush: (out): A pointer to store the flush boolean in.
|
||||
* @intermediate: (out): A pointer to store the intermediate boolean in.
|
||||
* @format: (out) (allow-none): a pointer to store the format in
|
||||
* @amount: (out) (allow-none): a pointer to store the amount in
|
||||
* @rate: (out) (allow-none): a pointer to store the rate in
|
||||
* @flush: (out) (allow-none): a pointer to store the flush boolean in
|
||||
* @intermediate: (out) (allow-none): a pointer to store the intermediate
|
||||
* boolean in
|
||||
*
|
||||
* Parse the step event.
|
||||
*
|
||||
|
@ -1183,16 +1252,17 @@ gst_event_parse_step (GstEvent * event, GstFormat * format, guint64 * amount,
|
|||
|
||||
/**
|
||||
* gst_event_new_sink_message:
|
||||
* @msg: The #GstMessage to be posted
|
||||
* @msg: (transfer none): the #GstMessage to be posted
|
||||
*
|
||||
* Create a new sink-message event. The purpose of the sink-message event is
|
||||
* to instruct a sink to post the message contained in the event synchronized
|
||||
* with the stream.
|
||||
*
|
||||
* Returns: a new #GstEvent
|
||||
* Returns: (transfer full): a new #GstEvent
|
||||
*
|
||||
* Since: 0.10.26
|
||||
*/
|
||||
/* FIXME 0.11: take ownership of msg for consistency? */
|
||||
GstEvent *
|
||||
gst_event_new_sink_message (GstMessage * msg)
|
||||
{
|
||||
|
@ -1213,7 +1283,7 @@ gst_event_new_sink_message (GstMessage * msg)
|
|||
/**
|
||||
* gst_event_parse_sink_message:
|
||||
* @event: The event to query
|
||||
* @msg: (out): A pointer to store the #GstMessage in.
|
||||
* @msg: (out) (transfer full): a pointer to store the #GstMessage in.
|
||||
*
|
||||
* Parse the sink-message event. Unref @msg after usage.
|
||||
*
|
||||
|
|
|
@ -94,8 +94,8 @@ typedef enum {
|
|||
* send messages that should be emitted in sync with
|
||||
* rendering.
|
||||
* @GST_EVENT_QOS: A quality message. Used to indicate to upstream elements
|
||||
* that the downstream elements are being starved of or
|
||||
* flooded with data.
|
||||
* that the downstream elements should adjust their processing
|
||||
* rate.
|
||||
* @GST_EVENT_SEEK: A request for a new playback position and rate.
|
||||
* @GST_EVENT_NAVIGATION: Navigation events are usually used for communicating
|
||||
* user requests, such as mouse or keyboard movements,
|
||||
|
@ -224,9 +224,10 @@ typedef struct _GstEventClass GstEventClass;
|
|||
|
||||
/**
|
||||
* gst_event_replace:
|
||||
* @old_event: pointer to a pointer to a #GstEvent to be replaced.
|
||||
* @new_event: pointer to a #GstEvent that will replace the event pointed to
|
||||
* by @old_event.
|
||||
* @old_event: (inout) (transfer full): pointer to a pointer to a #GstEvent
|
||||
* to be replaced.
|
||||
* @new_event: (allow-none) (transfer none): pointer to a #GstEvent that will
|
||||
* replace the event pointed to by @old_event.
|
||||
*
|
||||
* Modifies a pointer to a #GstEvent to point to a different #GstEvent. The
|
||||
* modification is done atomically (so this is useful for ensuring thread safety
|
||||
|
@ -307,6 +308,29 @@ typedef enum {
|
|||
GST_SEEK_FLAG_SKIP = (1 << 4)
|
||||
} GstSeekFlags;
|
||||
|
||||
/**
|
||||
* GstQOSType:
|
||||
* @GST_QOS_TYPE_OVERFLOW: The QoS event type that is produced when downstream
|
||||
* elements are producing data too quickly and the element can't keep up
|
||||
* processing the data. Upstream should reduce their processing rate. This
|
||||
* type is also used when buffers arrive early or in time.
|
||||
* @GST_QOS_TYPE_UNDERFLOW: The QoS event type that is produced when downstream
|
||||
* elements are producing data too slowly and need to speed up their processing
|
||||
* rate.
|
||||
* @GST_QOS_TYPE_THROTTLE: The QoS event type that is produced when the
|
||||
* application enabled throttling to limit the datarate.
|
||||
*
|
||||
* The different types of QoS events that can be given to the
|
||||
* gst_event_new_qos_full() method.
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*/
|
||||
typedef enum {
|
||||
GST_QOS_TYPE_OVERFLOW = 0,
|
||||
GST_QOS_TYPE_UNDERFLOW = 1,
|
||||
GST_QOS_TYPE_THROTTLE = 2
|
||||
} GstQOSType;
|
||||
|
||||
/**
|
||||
* GstEvent:
|
||||
* @mini_object: the parent structure
|
||||
|
@ -356,7 +380,7 @@ GType gst_event_get_type (void);
|
|||
*
|
||||
* Increase the refcount of this event.
|
||||
*
|
||||
* Returns: @event (for convenience when doing assignments)
|
||||
* Returns: (transfer full): @event (for convenience when doing assignments)
|
||||
*/
|
||||
#ifdef _FOOL_GTK_DOC_
|
||||
G_INLINE_FUNC GstEvent * gst_event_ref (GstEvent * event);
|
||||
|
@ -370,7 +394,7 @@ gst_event_ref (GstEvent * event)
|
|||
|
||||
/**
|
||||
* gst_event_unref:
|
||||
* @event: The event to refcount
|
||||
* @event: (transfer full): the event to refcount
|
||||
*
|
||||
* Decrease the refcount of an event, freeing it if the refcount reaches 0.
|
||||
*/
|
||||
|
@ -391,7 +415,7 @@ gst_event_unref (GstEvent * event)
|
|||
*
|
||||
* Copy the event using the event specific copy function.
|
||||
*
|
||||
* Returns: the new event
|
||||
* Returns: (transfer full): the new event
|
||||
*/
|
||||
#ifdef _FOOL_GTK_DOC_
|
||||
G_INLINE_FUNC GstEvent * gst_event_copy (const GstEvent * event);
|
||||
|
@ -460,8 +484,13 @@ void gst_event_parse_buffer_size (GstEvent *event, GstFormat *for
|
|||
/* QOS events */
|
||||
GstEvent* gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff,
|
||||
GstClockTime timestamp);
|
||||
GstEvent* gst_event_new_qos_full (GstQOSType type, gdouble proportion,
|
||||
GstClockTimeDiff diff, GstClockTime timestamp);
|
||||
void gst_event_parse_qos (GstEvent *event, gdouble *proportion, GstClockTimeDiff *diff,
|
||||
GstClockTime *timestamp);
|
||||
void gst_event_parse_qos_full (GstEvent *event, GstQOSType *type,
|
||||
gdouble *proportion, GstClockTimeDiff *diff,
|
||||
GstClockTime *timestamp);
|
||||
/* seek event */
|
||||
GstEvent* gst_event_new_seek (gdouble rate, GstFormat format, GstSeekFlags flags,
|
||||
GstSeekType start_type, gint64 start,
|
||||
|
|
|
@ -56,9 +56,9 @@
|
|||
* @data wil be made in any other way when prepending @data to the list of
|
||||
* results.
|
||||
*
|
||||
* Returns: the list of results. Free with g_list_free() when no longer needed
|
||||
* (the data contained in the list is a flat copy and does need to be
|
||||
* unreferenced or freed).
|
||||
* Returns: (transfer container): the list of results. Free with g_list_free()
|
||||
* when no longer needed (the data contained in the list is a flat copy
|
||||
* and does need to be unreferenced or freed).
|
||||
*/
|
||||
GList *
|
||||
gst_filter_run (const GList * list, GstFilterFunc func, gboolean first,
|
||||
|
|
|
@ -29,7 +29,7 @@ G_BEGIN_DECLS
|
|||
* @obj: the object
|
||||
* @user_data: filter data
|
||||
*
|
||||
* Function prototype for a filter callback taht can be use in gst_filter_run().
|
||||
* Function prototype for a filter callback that can be use in gst_filter_run().
|
||||
* The function should apply its filtering to @obj. Additional data passed to
|
||||
* gst_filter_run() are in @data.
|
||||
*
|
||||
|
|
|
@ -247,7 +247,7 @@ gst_format_get_details (GstFormat format)
|
|||
* Iterate all the registered formats. The format definition is read
|
||||
* only.
|
||||
*
|
||||
* Returns: A GstIterator of #GstFormatDefinition.
|
||||
* Returns: (transfer full): a GstIterator of #GstFormatDefinition.
|
||||
*/
|
||||
GstIterator *
|
||||
gst_format_iterate_definitions (void)
|
||||
|
|
|
@ -951,7 +951,7 @@ construct_failed:
|
|||
|
||||
/**
|
||||
* gst_ghost_pad_new_no_target:
|
||||
* @name: the name of the new pad, or NULL to assign a default name.
|
||||
* @name: (allow-none): the name of the new pad, or NULL to assign a default name.
|
||||
* @dir: the direction of the ghostpad
|
||||
*
|
||||
* Create a new ghostpad without a target with the given direction.
|
||||
|
@ -960,7 +960,7 @@ construct_failed:
|
|||
*
|
||||
* The created ghostpad will not have a padtemplate.
|
||||
*
|
||||
* Returns: a new #GstPad, or NULL in case of an error.
|
||||
* Returns: (transfer full): a new #GstPad, or NULL in case of an error.
|
||||
*/
|
||||
GstPad *
|
||||
gst_ghost_pad_new_no_target (const gchar * name, GstPadDirection dir)
|
||||
|
@ -978,15 +978,15 @@ gst_ghost_pad_new_no_target (const gchar * name, GstPadDirection dir)
|
|||
|
||||
/**
|
||||
* gst_ghost_pad_new:
|
||||
* @name: the name of the new pad, or NULL to assign a default name.
|
||||
* @target: the pad to ghost.
|
||||
* @name: (allow-none): the name of the new pad, or NULL to assign a default name
|
||||
* @target: (transfer none): the pad to ghost.
|
||||
*
|
||||
* Create a new ghostpad with @target as the target. The direction will be taken
|
||||
* from the target pad. @target must be unlinked.
|
||||
*
|
||||
* Will ref the target.
|
||||
*
|
||||
* Returns: a new #GstPad, or NULL in case of an error.
|
||||
* Returns: (transfer full): a new #GstPad, or NULL in case of an error.
|
||||
*/
|
||||
GstPad *
|
||||
gst_ghost_pad_new (const gchar * name, GstPad * target)
|
||||
|
@ -1017,16 +1017,16 @@ set_target_failed:
|
|||
|
||||
/**
|
||||
* gst_ghost_pad_new_from_template:
|
||||
* @name: the name of the new pad, or NULL to assign a default name.
|
||||
* @target: the pad to ghost.
|
||||
* @templ: the #GstPadTemplate to use on the ghostpad.
|
||||
* @name: (allow-none): the name of the new pad, or NULL to assign a default name.
|
||||
* @target: (transfer none): the pad to ghost.
|
||||
* @templ: (transfer none): the #GstPadTemplate to use on the ghostpad.
|
||||
*
|
||||
* Create a new ghostpad with @target as the target. The direction will be taken
|
||||
* from the target pad. The template used on the ghostpad will be @template.
|
||||
*
|
||||
* Will ref the target.
|
||||
*
|
||||
* Returns: a new #GstPad, or NULL in case of an error.
|
||||
* Returns: (transfer full): a new #GstPad, or NULL in case of an error.
|
||||
*
|
||||
* Since: 0.10.10
|
||||
*/
|
||||
|
@ -1064,13 +1064,13 @@ set_target_failed:
|
|||
|
||||
/**
|
||||
* gst_ghost_pad_new_no_target_from_template:
|
||||
* @name: the name of the new pad, or NULL to assign a default name.
|
||||
* @templ: the #GstPadTemplate to create the ghostpad from.
|
||||
* @name: (allow-none): the name of the new pad, or NULL to assign a default name
|
||||
* @templ: (transfer none): the #GstPadTemplate to create the ghostpad from.
|
||||
*
|
||||
* Create a new ghostpad based on @templ, without setting a target. The
|
||||
* direction will be taken from the @templ.
|
||||
*
|
||||
* Returns: a new #GstPad, or NULL in case of an error.
|
||||
* Returns: (transfer full): a new #GstPad, or NULL in case of an error.
|
||||
*
|
||||
* Since: 0.10.10
|
||||
*/
|
||||
|
@ -1094,7 +1094,7 @@ gst_ghost_pad_new_no_target_from_template (const gchar * name,
|
|||
*
|
||||
* Get the target pad of @gpad. Unref target pad after usage.
|
||||
*
|
||||
* Returns: the target #GstPad, can be NULL if the ghostpad
|
||||
* Returns: (transfer full): the target #GstPad, can be NULL if the ghostpad
|
||||
* has no target set. Unref target pad after usage.
|
||||
*/
|
||||
GstPad *
|
||||
|
@ -1114,14 +1114,14 @@ gst_ghost_pad_get_target (GstGhostPad * gpad)
|
|||
/**
|
||||
* gst_ghost_pad_set_target:
|
||||
* @gpad: the #GstGhostPad
|
||||
* @newtarget: the new pad target
|
||||
* @newtarget: (transfer none) (allow-none): the new pad target
|
||||
*
|
||||
* Set the new target of the ghostpad @gpad. Any existing target
|
||||
* is unlinked and links to the new target are established. if @newtarget is
|
||||
* NULL the target will be cleared.
|
||||
*
|
||||
* Returns: TRUE if the new target could be set. This function can return FALSE
|
||||
* when the internal pads could not be linked.
|
||||
* Returns: (transfer full): TRUE if the new target could be set. This function
|
||||
* can return FALSE when the internal pads could not be linked.
|
||||
*/
|
||||
gboolean
|
||||
gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget)
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
* in a pipeline.
|
||||
*/
|
||||
|
||||
/* FIXME: complete gobject annotations */
|
||||
|
||||
#include "gst_private.h"
|
||||
|
||||
#include "gstinfo.h"
|
||||
|
@ -281,7 +283,7 @@ gst_index_group_free (GstIndexGroup * group)
|
|||
*
|
||||
* Create a new tileindex object
|
||||
*
|
||||
* Returns: a new index object
|
||||
* Returns: (transfer full): a new index object
|
||||
*/
|
||||
GstIndex *
|
||||
gst_index_new (void)
|
||||
|
@ -501,7 +503,9 @@ gst_index_set_resolver_full (GstIndex * index, GstIndexResolver resolver,
|
|||
*
|
||||
* Copies an entry and returns the result.
|
||||
*
|
||||
* Returns: a newly allocated #GstIndexEntry.
|
||||
* Free-function: gst_index_entry_free
|
||||
*
|
||||
* Returns: (transfer full): a newly allocated #GstIndexEntry.
|
||||
*/
|
||||
GstIndexEntry *
|
||||
gst_index_entry_copy (GstIndexEntry * entry)
|
||||
|
@ -514,7 +518,7 @@ gst_index_entry_copy (GstIndexEntry * entry)
|
|||
|
||||
/**
|
||||
* gst_index_entry_free:
|
||||
* @entry: the entry to free
|
||||
* @entry: (transfer full): the entry to free
|
||||
*
|
||||
* Free the memory used by the given entry.
|
||||
*/
|
||||
|
@ -553,7 +557,9 @@ gst_index_entry_free (GstIndexEntry * entry)
|
|||
* used to map dynamic GstFormat ids to their original
|
||||
* format key.
|
||||
*
|
||||
* Returns: a pointer to the newly added entry in the index.
|
||||
* Free-function: gst_index_entry_free
|
||||
*
|
||||
* Returns: (transfer full): a pointer to the newly added entry in the index.
|
||||
*/
|
||||
GstIndexEntry *
|
||||
gst_index_add_format (GstIndex * index, gint id, GstFormat format)
|
||||
|
|
|
@ -78,7 +78,7 @@ gst_index_factory_finalize (GObject * object)
|
|||
*
|
||||
* Create a new indexfactory with the given parameters
|
||||
*
|
||||
* Returns: a new #GstIndexFactory.
|
||||
* Returns: (transfer full): a new #GstIndexFactory.
|
||||
*/
|
||||
GstIndexFactory *
|
||||
gst_index_factory_new (const gchar * name, const gchar * longdesc, GType type)
|
||||
|
@ -109,6 +109,7 @@ gst_index_factory_destroy (GstIndexFactory * factory)
|
|||
g_return_if_fail (factory != NULL);
|
||||
|
||||
/* we don't free the struct bacause someone might have a handle to it.. */
|
||||
/* FIXME: gst_index_factory_destroy */
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -117,7 +118,7 @@ gst_index_factory_destroy (GstIndexFactory * factory)
|
|||
*
|
||||
* Search for an indexfactory of the given name.
|
||||
*
|
||||
* Returns: #GstIndexFactory if found, NULL otherwise
|
||||
* Returns: (transfer full): #GstIndexFactory if found, NULL otherwise
|
||||
*/
|
||||
GstIndexFactory *
|
||||
gst_index_factory_find (const gchar * name)
|
||||
|
@ -143,7 +144,7 @@ gst_index_factory_find (const gchar * name)
|
|||
* Create a new #GstIndex instance from the
|
||||
* given indexfactory.
|
||||
*
|
||||
* Returns: A new #GstIndex instance.
|
||||
* Returns: (transfer full): a new #GstIndex instance.
|
||||
*/
|
||||
GstIndex *
|
||||
gst_index_factory_create (GstIndexFactory * factory)
|
||||
|
@ -173,7 +174,7 @@ gst_index_factory_create (GstIndexFactory * factory)
|
|||
* Create a new #GstIndex instance from the
|
||||
* indexfactory with the given name.
|
||||
*
|
||||
* Returns: A new #GstIndex instance.
|
||||
* Returns: (transfer full): a new #GstIndex instance.
|
||||
*/
|
||||
GstIndex *
|
||||
gst_index_factory_make (const gchar * name)
|
||||
|
|
|
@ -90,6 +90,9 @@
|
|||
#include "gst_private.h"
|
||||
#include "gstinfo.h"
|
||||
|
||||
#undef gst_debug_remove_log_function
|
||||
#undef gst_debug_add_log_function
|
||||
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
|
@ -439,7 +442,8 @@ _gst_debug_init (void)
|
|||
* @file: the file that emitted the message, usually the __FILE__ identifier
|
||||
* @function: the function that emitted the message
|
||||
* @line: the line from that the message was emitted, usually __LINE__
|
||||
* @object: the object this message relates to or NULL if none
|
||||
* @object: (transfer none) (allow-none): the object this message relates to,
|
||||
* or NULL if none
|
||||
* @format: a printf style format string
|
||||
* @...: optional arguments for the format
|
||||
*
|
||||
|
@ -458,6 +462,31 @@ gst_debug_log (GstDebugCategory * category, GstDebugLevel level,
|
|||
va_end (var_args);
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* based on g_basename(), which we can't use because it was deprecated */
|
||||
static inline const gchar *
|
||||
gst_path_basename (const gchar * file_name)
|
||||
{
|
||||
register const gchar *base;
|
||||
|
||||
base = strrchr (file_name, G_DIR_SEPARATOR);
|
||||
|
||||
{
|
||||
const gchar *q = strrchr (file_name, '/');
|
||||
if (base == NULL || (q != NULL && q > base))
|
||||
base = q;
|
||||
}
|
||||
|
||||
if (base)
|
||||
return base + 1;
|
||||
|
||||
if (g_ascii_isalpha (file_name[0]) && file_name[1] == ':')
|
||||
return file_name + 2;
|
||||
|
||||
return file_name;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* gst_debug_log_valist:
|
||||
* @category: category to log
|
||||
|
@ -465,7 +494,8 @@ gst_debug_log (GstDebugCategory * category, GstDebugLevel level,
|
|||
* @file: the file that emitted the message, usually the __FILE__ identifier
|
||||
* @function: the function that emitted the message
|
||||
* @line: the line from that the message was emitted, usually __LINE__
|
||||
* @object: the object this message relates to or NULL if none
|
||||
* @object: (transfer none) (allow-none): the object this message relates to,
|
||||
* or NULL if none
|
||||
* @format: a printf style format string
|
||||
* @args: optional arguments for the format
|
||||
*
|
||||
|
@ -480,22 +510,16 @@ gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level,
|
|||
LogFuncEntry *entry;
|
||||
GSList *handler;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
gchar *file_basename;
|
||||
#endif
|
||||
|
||||
g_return_if_fail (category != NULL);
|
||||
g_return_if_fail (file != NULL);
|
||||
g_return_if_fail (function != NULL);
|
||||
g_return_if_fail (format != NULL);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/*
|
||||
* The predefined macro __FILE__ is always the exact path given to the
|
||||
/* The predefined macro __FILE__ is always the exact path given to the
|
||||
* compiler with MSVC, which may or may not be the basename. We work
|
||||
* around it at runtime to improve the readability.
|
||||
*/
|
||||
file = file_basename = g_path_get_basename (file);
|
||||
* around it at runtime to improve the readability. */
|
||||
#ifdef _MSC_VER
|
||||
file = gst_path_basename (file);
|
||||
#endif
|
||||
|
||||
message.message = NULL;
|
||||
|
@ -511,10 +535,6 @@ gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level,
|
|||
}
|
||||
g_free (message.message);
|
||||
va_end (message.arguments);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
g_free (file_basename);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -734,7 +754,8 @@ gst_debug_print_segment (gpointer ptr)
|
|||
* terminals.
|
||||
* You need to free the string after use.
|
||||
*
|
||||
* Returns: a string containing the color definition
|
||||
* Returns: (transfer full) (type gchar*): a string containing the color
|
||||
* definition
|
||||
*/
|
||||
gchar *
|
||||
gst_debug_construct_term_color (guint colorinfo)
|
||||
|
@ -883,7 +904,8 @@ static const gchar *levelcolormap[GST_LEVEL_COUNT] = {
|
|||
* @function: the function that emitted the message
|
||||
* @line: the line from that the message was emitted, usually __LINE__
|
||||
* @message: the actual message
|
||||
* @object: the object this message relates to or NULL if none
|
||||
* @object: (transfer none) (allow-none): the object this message relates to,
|
||||
* or NULL if none
|
||||
* @unused: an unused variable, reserved for some user_data.
|
||||
*
|
||||
* The default logging handler used by GStreamer. Logging functions get called
|
||||
|
@ -1034,7 +1056,7 @@ gst_debug_level_get_name (GstDebugLevel level)
|
|||
/**
|
||||
* gst_debug_add_log_function:
|
||||
* @func: the function to use
|
||||
* @data: user data
|
||||
* @data: (closure): user data
|
||||
*
|
||||
* Adds the logging function to the list of logging functions.
|
||||
* Be sure to use #G_GNUC_NO_INSTRUMENT on that function, it is needed.
|
||||
|
@ -1045,7 +1067,8 @@ gst_debug_add_log_function (GstLogFunction func, gpointer data)
|
|||
LogFuncEntry *entry;
|
||||
GSList *list;
|
||||
|
||||
g_return_if_fail (func != NULL);
|
||||
if (func == NULL)
|
||||
func = gst_debug_log_default;
|
||||
|
||||
entry = g_slice_new (LogFuncEntry);
|
||||
entry->func = func;
|
||||
|
@ -1121,7 +1144,8 @@ gst_debug_remove_log_function (GstLogFunction func)
|
|||
{
|
||||
guint removals;
|
||||
|
||||
g_return_val_if_fail (func != NULL, 0);
|
||||
if (func == NULL)
|
||||
func = gst_debug_log_default;
|
||||
|
||||
removals =
|
||||
gst_debug_remove_with_compare_func
|
||||
|
@ -1509,7 +1533,8 @@ gst_debug_category_get_description (GstDebugCategory * category)
|
|||
* may change anytime.
|
||||
* The caller has to free the list after use.
|
||||
*
|
||||
* Returns: the list of categories
|
||||
* Returns: (transfer container) (element-type Gst.DebugCategory): the list of
|
||||
* debug categories
|
||||
*/
|
||||
GSList *
|
||||
gst_debug_get_all_categories (void)
|
||||
|
|
|
@ -337,9 +337,24 @@ G_CONST_RETURN gchar *
|
|||
|
||||
void gst_debug_add_log_function (GstLogFunction func,
|
||||
gpointer data);
|
||||
|
||||
guint gst_debug_remove_log_function (GstLogFunction func);
|
||||
guint gst_debug_remove_log_function_by_data (gpointer data);
|
||||
|
||||
#define gst_debug_add_log_function(func,data) \
|
||||
G_STMT_START{ \
|
||||
if (func == gst_debug_log_default) { \
|
||||
gst_debug_add_log_function(NULL,data); \
|
||||
} else { \
|
||||
gst_debug_add_log_function(func,data); \
|
||||
} \
|
||||
}G_STMT_END
|
||||
|
||||
#define gst_debug_remove_log_function(func) \
|
||||
(func == gst_debug_log_default) ? \
|
||||
gst_debug_remove_log_function(NULL) : \
|
||||
gst_debug_remove_log_function(func)
|
||||
|
||||
void gst_debug_set_active (gboolean active);
|
||||
gboolean gst_debug_is_active (void);
|
||||
|
||||
|
|
328
gst/gstmessage.c
328
gst/gstmessage.c
|
@ -112,6 +112,7 @@ static GstMessageQuarks message_quarks[] = {
|
|||
{GST_MESSAGE_REQUEST_STATE, "request-state", 0},
|
||||
{GST_MESSAGE_STEP_START, "step-start", 0},
|
||||
{GST_MESSAGE_QOS, "qos", 0},
|
||||
{GST_MESSAGE_PROGRESS, "progress", 0},
|
||||
{0, NULL, 0}
|
||||
};
|
||||
|
||||
|
@ -246,14 +247,14 @@ _gst_message_copy (GstMessage * message)
|
|||
* gst_message_new_custom:
|
||||
* @type: The #GstMessageType to distinguish messages
|
||||
* @src: The object originating the message.
|
||||
* @structure: The structure for the message. The message will take ownership of
|
||||
* the structure.
|
||||
* @structure: (transfer full): the structure for the message. The message
|
||||
* will take ownership of the structure.
|
||||
*
|
||||
* Create a new custom-typed message. This can be used for anything not
|
||||
* handled by other message-specific functions to pass a message to the
|
||||
* app. The structure field can be NULL.
|
||||
*
|
||||
* Returns: The new message.
|
||||
* Returns: (transfer full): The new message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -342,13 +343,13 @@ gst_message_set_seqnum (GstMessage * message, guint32 seqnum)
|
|||
|
||||
/**
|
||||
* gst_message_new_eos:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
*
|
||||
* Create a new eos message. This message is generated and posted in
|
||||
* the sink elements of a GstBin. The bin will only forward the EOS
|
||||
* message to the application if all sinks have posted an EOS message.
|
||||
*
|
||||
* Returns: The new eos message.
|
||||
* Returns: (transfer full): The new eos message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -364,8 +365,8 @@ gst_message_new_eos (GstObject * src)
|
|||
|
||||
/**
|
||||
* gst_message_new_error:
|
||||
* @src: The object originating the message.
|
||||
* @error: The GError for this message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @error: (transfer none): The GError for this message.
|
||||
* @debug: A debugging string.
|
||||
*
|
||||
* Create a new error message. The message will copy @error and
|
||||
|
@ -373,7 +374,7 @@ gst_message_new_eos (GstObject * src)
|
|||
* occured. The pipeline will probably (partially) stop. The application
|
||||
* receiving this message should stop the pipeline.
|
||||
*
|
||||
* Returns: The new error message.
|
||||
* Returns: (transfer full): the new error message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -393,14 +394,14 @@ gst_message_new_error (GstObject * src, GError * error, const gchar * debug)
|
|||
|
||||
/**
|
||||
* gst_message_new_warning:
|
||||
* @src: The object originating the message.
|
||||
* @error: The GError for this message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @error: (transfer none): The GError for this message.
|
||||
* @debug: A debugging string.
|
||||
*
|
||||
* Create a new warning message. The message will make copies of @error and
|
||||
* @debug.
|
||||
*
|
||||
* Returns: The new warning message.
|
||||
* Returns: (transfer full): The new warning message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -420,8 +421,8 @@ gst_message_new_warning (GstObject * src, GError * error, const gchar * debug)
|
|||
|
||||
/**
|
||||
* gst_message_new_info:
|
||||
* @src: The object originating the message.
|
||||
* @error: The GError for this message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @error: (transfer none): The GError for this message.
|
||||
* @debug: A debugging string.
|
||||
*
|
||||
* Create a new info message. The message will make copies of @error and
|
||||
|
@ -429,7 +430,7 @@ gst_message_new_warning (GstObject * src, GError * error, const gchar * debug)
|
|||
*
|
||||
* MT safe.
|
||||
*
|
||||
* Returns: The new info message.
|
||||
* Returns: (transfer full): the new info message.
|
||||
*
|
||||
* Since: 0.10.12
|
||||
*/
|
||||
|
@ -449,13 +450,13 @@ gst_message_new_info (GstObject * src, GError * error, const gchar * debug)
|
|||
|
||||
/**
|
||||
* gst_message_new_tag:
|
||||
* @src: The object originating the message.
|
||||
* @tag_list: The tag list for the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @tag_list: (transfer full): the tag list for the message.
|
||||
*
|
||||
* Create a new tag message. The message will take ownership of the tag list.
|
||||
* The message is posted by elements that discovered a new taglist.
|
||||
*
|
||||
* Returns: The new tag message.
|
||||
* Returns: (transfer full): the new tag message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -474,16 +475,16 @@ gst_message_new_tag (GstObject * src, GstTagList * tag_list)
|
|||
|
||||
/**
|
||||
* gst_message_new_tag_full:
|
||||
* @src: The object originating the message.
|
||||
* @pad: The originating pad for the tag.
|
||||
* @tag_list: The tag list for the message.
|
||||
* @src: (transfer none): the object originating the message.
|
||||
* @pad: (transfer none): the originating pad for the tag.
|
||||
* @tag_list: (transfer full): the tag list for the message.
|
||||
*
|
||||
* Create a new tag message. The message will take ownership of the tag list.
|
||||
* The message is posted by elements that discovered a new taglist.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
* Returns: The new tag message.
|
||||
* Returns: (transfer full): the new tag message.
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -507,7 +508,7 @@ gst_message_new_tag_full (GstObject * src, GstPad * pad, GstTagList * tag_list)
|
|||
|
||||
/**
|
||||
* gst_message_new_buffering:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @percent: The buffering percent
|
||||
*
|
||||
* Create a new buffering message. This message can be posted by an element that
|
||||
|
@ -523,7 +524,7 @@ gst_message_new_tag_full (GstObject * src, GstPad * pad, GstTagList * tag_list)
|
|||
*
|
||||
* MT safe.
|
||||
*
|
||||
* Returns: The new buffering message.
|
||||
* Returns: (transfer full): The new buffering message.
|
||||
*
|
||||
* Since: 0.10.11
|
||||
*/
|
||||
|
@ -549,7 +550,7 @@ gst_message_new_buffering (GstObject * src, gint percent)
|
|||
|
||||
/**
|
||||
* gst_message_new_state_changed:
|
||||
* @src: the object originating the message
|
||||
* @src: (transfer none): the object originating the message
|
||||
* @oldstate: the previous state
|
||||
* @newstate: the new (current) state
|
||||
* @pending: the pending (target) state
|
||||
|
@ -557,7 +558,7 @@ gst_message_new_buffering (GstObject * src, gint percent)
|
|||
* Create a state change message. This message is posted whenever an element
|
||||
* changed its state.
|
||||
*
|
||||
* Returns: The new state change message.
|
||||
* Returns: (transfer full): the new state change message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -579,13 +580,13 @@ gst_message_new_state_changed (GstObject * src,
|
|||
|
||||
/**
|
||||
* gst_message_new_state_dirty:
|
||||
* @src: the object originating the message
|
||||
* @src: (transfer none): the object originating the message
|
||||
*
|
||||
* Create a state dirty message. This message is posted whenever an element
|
||||
* changed its state asynchronously and is used internally to update the
|
||||
* states of container objects.
|
||||
*
|
||||
* Returns: The new state dirty message.
|
||||
* Returns: (transfer full): the new state dirty message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -601,8 +602,8 @@ gst_message_new_state_dirty (GstObject * src)
|
|||
|
||||
/**
|
||||
* gst_message_new_clock_provide:
|
||||
* @src: The object originating the message.
|
||||
* @clock: The clock it provides
|
||||
* @src: (transfer none): the object originating the message.
|
||||
* @clock: (transfer none): the clock it provides
|
||||
* @ready: TRUE if the sender can provide a clock
|
||||
*
|
||||
* Create a clock provide message. This message is posted whenever an
|
||||
|
@ -612,7 +613,7 @@ gst_message_new_state_dirty (GstObject * src)
|
|||
* This message is mainly used internally to manage the clock
|
||||
* selection.
|
||||
*
|
||||
* Returns: The new provide clock message.
|
||||
* Returns: (transfer full): the new provide clock message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -633,8 +634,8 @@ gst_message_new_clock_provide (GstObject * src, GstClock * clock,
|
|||
|
||||
/**
|
||||
* gst_message_new_clock_lost:
|
||||
* @src: The object originating the message.
|
||||
* @clock: the clock that was lost
|
||||
* @src: (transfer none): the object originating the message.
|
||||
* @clock: (transfer none): the clock that was lost
|
||||
*
|
||||
* Create a clock lost message. This message is posted whenever the
|
||||
* clock is not valid anymore.
|
||||
|
@ -643,7 +644,7 @@ gst_message_new_clock_provide (GstObject * src, GstClock * clock,
|
|||
* select a new clock again when it goes to PLAYING. It might therefore
|
||||
* be needed to set the pipeline to PAUSED and PLAYING again.
|
||||
*
|
||||
* Returns: The new clock lost message.
|
||||
* Returns: (transfer full): The new clock lost message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -662,13 +663,13 @@ gst_message_new_clock_lost (GstObject * src, GstClock * clock)
|
|||
|
||||
/**
|
||||
* gst_message_new_new_clock:
|
||||
* @src: The object originating the message.
|
||||
* @clock: the new selected clock
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @clock: (transfer none): the new selected clock
|
||||
*
|
||||
* Create a new clock message. This message is posted whenever the
|
||||
* pipeline selectes a new clock for the pipeline.
|
||||
*
|
||||
* Returns: The new new clock message.
|
||||
* Returns: (transfer full): The new new clock message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -687,9 +688,9 @@ gst_message_new_new_clock (GstObject * src, GstClock * clock)
|
|||
|
||||
/**
|
||||
* gst_message_new_structure_change:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @type: The change type.
|
||||
* @owner: The owner element of @src.
|
||||
* @owner: (transfer none): The owner element of @src.
|
||||
* @busy: Whether the structure change is busy.
|
||||
*
|
||||
* Create a new structure change message. This message is posted when the
|
||||
|
@ -698,7 +699,7 @@ gst_message_new_new_clock (GstObject * src, GstClock * clock)
|
|||
*
|
||||
* @src should be the sinkpad that unlinked or linked.
|
||||
*
|
||||
* Returns: The new structure change message.
|
||||
* Returns: (transfer full): the new structure change message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -728,7 +729,7 @@ gst_message_new_structure_change (GstObject * src, GstStructureChangeType type,
|
|||
|
||||
/**
|
||||
* gst_message_new_segment_start:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @format: The format of the position being played
|
||||
* @position: The position of the segment being played
|
||||
*
|
||||
|
@ -737,7 +738,7 @@ gst_message_new_structure_change (GstObject * src, GstStructureChangeType type,
|
|||
* is not received by the application but is used for maintenance reasons in
|
||||
* container elements.
|
||||
*
|
||||
* Returns: The new segment start message.
|
||||
* Returns: (transfer full): the new segment start message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -758,7 +759,7 @@ gst_message_new_segment_start (GstObject * src, GstFormat format,
|
|||
|
||||
/**
|
||||
* gst_message_new_segment_done:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): the object originating the message.
|
||||
* @format: The format of the position being done
|
||||
* @position: The position of the segment being done
|
||||
*
|
||||
|
@ -767,7 +768,7 @@ gst_message_new_segment_start (GstObject * src, GstFormat format,
|
|||
* is received by the application after all elements that posted a segment_start
|
||||
* have posted the segment_done.
|
||||
*
|
||||
* Returns: The new segment done message.
|
||||
* Returns: (transfer full): the new segment done message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -788,14 +789,14 @@ gst_message_new_segment_done (GstObject * src, GstFormat format,
|
|||
|
||||
/**
|
||||
* gst_message_new_application:
|
||||
* @src: The object originating the message.
|
||||
* @structure: The structure for the message. The message will take ownership of
|
||||
* the structure.
|
||||
* @src: (transfer none): the object originating the message.
|
||||
* @structure: (transfer full): the structure for the message. The message
|
||||
* will take ownership of the structure.
|
||||
*
|
||||
* Create a new application-typed message. GStreamer will never create these
|
||||
* messages; they are a gift from us to you. Enjoy.
|
||||
*
|
||||
* Returns: The new application message.
|
||||
* Returns: (transfer full): The new application message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -807,16 +808,16 @@ gst_message_new_application (GstObject * src, GstStructure * structure)
|
|||
|
||||
/**
|
||||
* gst_message_new_element:
|
||||
* @src: The object originating the message.
|
||||
* @structure: The structure for the message. The message will take ownership of
|
||||
* the structure.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @structure: (transfer full): The structure for the message. The message
|
||||
* will take ownership of the structure.
|
||||
*
|
||||
* Create a new element-specific message. This is meant as a generic way of
|
||||
* allowing one-way communication from an element to an application, for example
|
||||
* "the firewire cable was unplugged". The format of the message should be
|
||||
* documented in the element's documentation. The structure field can be NULL.
|
||||
*
|
||||
* Returns: The new element message.
|
||||
* Returns: (transfer full): The new element message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -828,7 +829,7 @@ gst_message_new_element (GstObject * src, GstStructure * structure)
|
|||
|
||||
/**
|
||||
* gst_message_new_duration:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @format: The format of the duration
|
||||
* @duration: The new duration
|
||||
*
|
||||
|
@ -840,7 +841,7 @@ gst_message_new_element (GstObject * src, GstStructure * structure)
|
|||
* cached duration should be discarded. The new duration can then be
|
||||
* retrieved via a query.
|
||||
*
|
||||
* Returns: The new duration message.
|
||||
* Returns: (transfer full): The new duration message.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -860,14 +861,14 @@ gst_message_new_duration (GstObject * src, GstFormat format, gint64 duration)
|
|||
|
||||
/**
|
||||
* gst_message_new_async_start:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
* @new_base_time: if a new base_time should be set on the element
|
||||
*
|
||||
* This message is posted by elements when they start an ASYNC state change.
|
||||
* @new_base_time is set to TRUE when the element lost its state when it was
|
||||
* PLAYING.
|
||||
*
|
||||
* Returns: The new async_start message.
|
||||
* Returns: (transfer full): The new async_start message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -888,11 +889,11 @@ gst_message_new_async_start (GstObject * src, gboolean new_base_time)
|
|||
|
||||
/**
|
||||
* gst_message_new_async_done:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
*
|
||||
* The message is posted when elements completed an ASYNC state change.
|
||||
*
|
||||
* Returns: The new async_done message.
|
||||
* Returns: (transfer full): The new async_done message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -910,12 +911,12 @@ gst_message_new_async_done (GstObject * src)
|
|||
|
||||
/**
|
||||
* gst_message_new_latency:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): The object originating the message.
|
||||
*
|
||||
* This message can be posted by elements when their latency requirements have
|
||||
* changed.
|
||||
*
|
||||
* Returns: The new latency message.
|
||||
* Returns: (transfer full): The new latency message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -933,14 +934,14 @@ gst_message_new_latency (GstObject * src)
|
|||
|
||||
/**
|
||||
* gst_message_new_request_state:
|
||||
* @src: The object originating the message.
|
||||
* @src: (transfer none): the object originating the message.
|
||||
* @state: The new requested state
|
||||
*
|
||||
* This message can be posted by elements when they want to have their state
|
||||
* changed. A typical use case would be an audio server that wants to pause the
|
||||
* pipeline because a higher priority stream is being played.
|
||||
*
|
||||
* Returns: The new requst state message.
|
||||
* Returns: (transfer full): the new requst state message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -965,8 +966,8 @@ gst_message_new_request_state (GstObject * src, GstState state)
|
|||
*
|
||||
* Access the structure of the message.
|
||||
*
|
||||
* Returns: The structure of the message. The structure is still
|
||||
* owned by the message, which means that you should not free it and
|
||||
* Returns: (transfer none): The structure of the message. The structure is
|
||||
* still owned by the message, which means that you should not free it and
|
||||
* that the pointer becomes invalid when you free the message.
|
||||
*
|
||||
* MT safe.
|
||||
|
@ -982,7 +983,7 @@ gst_message_get_structure (GstMessage * message)
|
|||
/**
|
||||
* gst_message_parse_tag:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_TAG.
|
||||
* @tag_list: (out): Return location for the tag-list.
|
||||
* @tag_list: (out callee-allocates): return location for the tag-list.
|
||||
*
|
||||
* Extracts the tag list from the GstMessage. The tag list returned in the
|
||||
* output argument is a copy; the caller must free it when done.
|
||||
|
@ -1025,8 +1026,9 @@ gst_message_parse_tag (GstMessage * message, GstTagList ** tag_list)
|
|||
/**
|
||||
* gst_message_parse_tag_full:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_TAG.
|
||||
* @pad: (out): Location where the originating pad is stored, unref after usage
|
||||
* @tag_list: (out): Return location for the tag-list.
|
||||
* @pad: (out callee-allocates): location where the originating pad is stored,
|
||||
* unref after usage
|
||||
* @tag_list: (out callee-allocates): return location for the tag-list.
|
||||
*
|
||||
* Extracts the tag list from the GstMessage. The tag list returned in the
|
||||
* output argument is a copy; the caller must free it when done.
|
||||
|
@ -1066,7 +1068,7 @@ gst_message_parse_tag_full (GstMessage * message, GstPad ** pad,
|
|||
/**
|
||||
* gst_message_parse_buffering:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_BUFFERING.
|
||||
* @percent: (out): Return location for the percent.
|
||||
* @percent: (out) (allow-none): Return location for the percent.
|
||||
*
|
||||
* Extracts the buffering percent from the GstMessage. see also
|
||||
* gst_message_new_buffering().
|
||||
|
@ -1114,10 +1116,11 @@ gst_message_set_buffering_stats (GstMessage * message, GstBufferingMode mode,
|
|||
/**
|
||||
* gst_message_parse_buffering_stats:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_BUFFERING.
|
||||
* @mode: (out): a buffering mode
|
||||
* @avg_in: (out): the average input rate
|
||||
* @avg_out: (out): the average output rate
|
||||
* @buffering_left: (out): amount of buffering time left in milliseconds.
|
||||
* @mode: (out) (allow-none): a buffering mode, or NULL
|
||||
* @avg_in: (out) (allow-none): the average input rate, or NULL
|
||||
* @avg_out: (out) (allow-none): the average output rate, or NULL
|
||||
* @buffering_left: (out) (allow-none): amount of buffering time left in
|
||||
* milliseconds, or NULL
|
||||
*
|
||||
* Extracts the buffering stats values from @message.
|
||||
*
|
||||
|
@ -1148,9 +1151,9 @@ gst_message_parse_buffering_stats (GstMessage * message,
|
|||
/**
|
||||
* gst_message_parse_state_changed:
|
||||
* @message: a valid #GstMessage of type GST_MESSAGE_STATE_CHANGED
|
||||
* @oldstate: (out): the previous state, or NULL
|
||||
* @newstate: (out): the new (current) state, or NULL
|
||||
* @pending: (out): the pending (target) state, or NULL
|
||||
* @oldstate: (out) (allow-none): the previous state, or NULL
|
||||
* @newstate: (out) (allow-none): the new (current) state, or NULL
|
||||
* @pending: (out) (allow-none): the pending (target) state, or NULL
|
||||
*
|
||||
* Extracts the old and new states from the GstMessage.
|
||||
*
|
||||
|
@ -1198,8 +1201,9 @@ gst_message_parse_state_changed (GstMessage * message,
|
|||
/**
|
||||
* gst_message_parse_clock_provide:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_CLOCK_PROVIDE.
|
||||
* @clock: (out): A pointer to hold a clock object.
|
||||
* @ready: (out): A pointer to hold the ready flag.
|
||||
* @clock: (out) (allow-none) (transfer none): a pointer to hold a clock
|
||||
* object, or NULL
|
||||
* @ready: (out) (allow-none): a pointer to hold the ready flag, or NULL
|
||||
*
|
||||
* Extracts the clock and ready flag from the GstMessage.
|
||||
* The clock object returned remains valid until the message is freed.
|
||||
|
@ -1231,7 +1235,7 @@ gst_message_parse_clock_provide (GstMessage * message, GstClock ** clock,
|
|||
/**
|
||||
* gst_message_parse_clock_lost:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_CLOCK_LOST.
|
||||
* @clock: (out): A pointer to hold the lost clock
|
||||
* @clock: (out) (allow-none) (transfer none): a pointer to hold the lost clock
|
||||
*
|
||||
* Extracts the lost clock from the GstMessage.
|
||||
* The clock object returned remains valid until the message is freed.
|
||||
|
@ -1258,7 +1262,8 @@ gst_message_parse_clock_lost (GstMessage * message, GstClock ** clock)
|
|||
/**
|
||||
* gst_message_parse_new_clock:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_NEW_CLOCK.
|
||||
* @clock: A pointer to hold the selected new clock
|
||||
* @clock: (out) (allow-none) (transfer none): a pointer to hold the selected
|
||||
* new clock
|
||||
*
|
||||
* Extracts the new clock from the GstMessage.
|
||||
* The clock object returned remains valid until the message is freed.
|
||||
|
@ -1286,9 +1291,10 @@ gst_message_parse_new_clock (GstMessage * message, GstClock ** clock)
|
|||
* gst_message_parse_structure_change:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_STRUCTURE_CHANGE.
|
||||
* @type: (out): A pointer to hold the change type
|
||||
* @owner: (out): The owner element of the message source
|
||||
* @busy: (out): A pointer to hold whether the change is in progress or has been
|
||||
* completed
|
||||
* @owner: (out) (allow-none) (transfer none): The owner element of the
|
||||
* message source
|
||||
* @busy: (out) (allow-none): a pointer to hold whether the change is in
|
||||
* progress or has been completed
|
||||
*
|
||||
* Extracts the change type and completion status from the GstMessage.
|
||||
*
|
||||
|
@ -1324,8 +1330,9 @@ gst_message_parse_structure_change (GstMessage * message,
|
|||
/**
|
||||
* gst_message_parse_error:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_ERROR.
|
||||
* @gerror: (out): Location for the GError
|
||||
* @debug: (out): Location for the debug message, or NULL
|
||||
* @gerror: (out) (allow-none) (transfer full): location for the GError
|
||||
* @debug: (out) (allow-none) (transfer full): location for the debug message,
|
||||
* or NULL
|
||||
*
|
||||
* Extracts the GError and debug string from the GstMessage. The values returned
|
||||
* in the output arguments are copies; the caller must free them when done.
|
||||
|
@ -1382,8 +1389,9 @@ gst_message_parse_error (GstMessage * message, GError ** gerror, gchar ** debug)
|
|||
/**
|
||||
* gst_message_parse_warning:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_WARNING.
|
||||
* @gerror: (out): Location for the GError
|
||||
* @debug: (out): Location for the debug message, or NULL
|
||||
* @gerror: (out) (allow-none) (transfer full): location for the GError
|
||||
* @debug: (out) (allow-none) (transfer full): location for the debug message,
|
||||
* or NULL
|
||||
*
|
||||
* Extracts the GError and debug string from the GstMessage. The values returned
|
||||
* in the output arguments are copies; the caller must free them when done.
|
||||
|
@ -1420,8 +1428,9 @@ gst_message_parse_warning (GstMessage * message, GError ** gerror,
|
|||
/**
|
||||
* gst_message_parse_info:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_INFO.
|
||||
* @gerror: (out): Location for the GError
|
||||
* @debug: (out): Location for the debug message, or NULL
|
||||
* @gerror: (out) (allow-none) (transfer full): location for the GError
|
||||
* @debug: (out) (allow-none) (transfer full): location for the debug message,
|
||||
* or NULL
|
||||
*
|
||||
* Extracts the GError and debug string from the GstMessage. The values returned
|
||||
* in the output arguments are copies; the caller must free them when done.
|
||||
|
@ -1589,12 +1598,12 @@ gst_message_parse_request_state (GstMessage * message, GstState * state)
|
|||
* gst_message_new_stream_status:
|
||||
* @src: The object originating the message.
|
||||
* @type: The stream status type.
|
||||
* @owner: The owner element of @src.
|
||||
* @owner: (transfer none): the owner element of @src.
|
||||
*
|
||||
* Create a new stream status message. This message is posted when a streaming
|
||||
* thread is created/destroyed or when the state changed.
|
||||
*
|
||||
* Returns: The new stream status message.
|
||||
* Returns: (transfer full): the new stream status message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -1619,7 +1628,7 @@ gst_message_new_stream_status (GstObject * src, GstStreamStatusType type,
|
|||
* gst_message_parse_stream_status:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_STREAM_STATUS.
|
||||
* @type: (out): A pointer to hold the status type
|
||||
* @owner: (out): The owner element of the message source
|
||||
* @owner: (out) (transfer none): The owner element of the message source
|
||||
*
|
||||
* Extracts the stream status type and owner the GstMessage. The returned
|
||||
* owner remains valid for as long as the reference to @message is valid and
|
||||
|
@ -1712,7 +1721,7 @@ gst_message_get_stream_status_object (GstMessage * message)
|
|||
* @duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped
|
||||
* @amount of media in format @format.
|
||||
*
|
||||
* Returns: The new step_done message.
|
||||
* Returns: (transfer full): the new step_done message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -1742,13 +1751,13 @@ gst_message_new_step_done (GstObject * src, GstFormat format, guint64 amount,
|
|||
/**
|
||||
* gst_message_parse_step_done:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_STEP_DONE.
|
||||
* @format: (out): result location for the format
|
||||
* @amount: (out): result location for the amount
|
||||
* @rate: (out): result location for the rate
|
||||
* @flush: (out): result location for the flush flag
|
||||
* @intermediate: (out): result location for the intermediate flag
|
||||
* @duration: (out): result location for the duration
|
||||
* @eos: (out): result location for the EOS flag
|
||||
* @format: (out) (allow-none): result location for the format
|
||||
* @amount: (out) (allow-none): result location for the amount
|
||||
* @rate: (out) (allow-none): result location for the rate
|
||||
* @flush: (out) (allow-none): result location for the flush flag
|
||||
* @intermediate: (out) (allow-none): result location for the intermediate flag
|
||||
* @duration: (out) (allow-none): result location for the duration
|
||||
* @eos: (out) (allow-none): result location for the EOS flag
|
||||
*
|
||||
* Extract the values the step_done message.
|
||||
*
|
||||
|
@ -1795,7 +1804,7 @@ gst_message_parse_step_done (GstMessage * message, GstFormat * format,
|
|||
* message is emited, the application can queue a new step operation in the
|
||||
* element.
|
||||
*
|
||||
* Returns: The new step_start message.
|
||||
* Returns: (transfer full): The new step_start message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -1823,12 +1832,12 @@ gst_message_new_step_start (GstObject * src, gboolean active, GstFormat format,
|
|||
/**
|
||||
* gst_message_parse_step_start:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_STEP_DONE.
|
||||
* @active: (out): result location for the active flag
|
||||
* @format: (out): result location for the format
|
||||
* @amount: (out): result location for the amount
|
||||
* @rate: (out): result location for the rate
|
||||
* @flush: (out): result location for the flush flag
|
||||
* @intermediate: (out): result location for the intermediate flag
|
||||
* @active: (out) (allow-none): result location for the active flag
|
||||
* @format: (out) (allow-none): result location for the format
|
||||
* @amount: (out) (allow-none): result location for the amount
|
||||
* @rate: (out) (allow-none): result location for the rate
|
||||
* @flush: (out) (allow-none): result location for the flush flag
|
||||
* @intermediate: (out) (allow-none): result location for the intermediate flag
|
||||
*
|
||||
* Extract the values from step_start message.
|
||||
*
|
||||
|
@ -1876,7 +1885,7 @@ gst_message_parse_step_start (GstMessage * message, gboolean * active,
|
|||
* buffer that generated the QoS event. Values can be left to
|
||||
* GST_CLOCK_TIME_NONE when unknown.
|
||||
*
|
||||
* Returns: The new qos message.
|
||||
* Returns: (transfer full): The new qos message.
|
||||
*
|
||||
* MT safe.
|
||||
*
|
||||
|
@ -1971,11 +1980,15 @@ gst_message_set_qos_stats (GstMessage * message, GstFormat format,
|
|||
/**
|
||||
* gst_message_parse_qos:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_QOS.
|
||||
* @live: (out): if the message was generated by a live element
|
||||
* @running_time: (out): the running time of the buffer that generated the message
|
||||
* @stream_time: (out): the stream time of the buffer that generated the message
|
||||
* @timestamp: (out): the timestamps of the buffer that generated the message
|
||||
* @duration: (out): the duration of the buffer that generated the message
|
||||
* @live: (out) (allow-none): if the message was generated by a live element
|
||||
* @running_time: (out) (allow-none): the running time of the buffer that
|
||||
* generated the message
|
||||
* @stream_time: (out) (allow-none): the stream time of the buffer that
|
||||
* generated the message
|
||||
* @timestamp: (out) (allow-none): the timestamps of the buffer that
|
||||
* generated the message
|
||||
* @duration: (out) (allow-none): the duration of the buffer that
|
||||
* generated the message
|
||||
*
|
||||
* Extract the timestamps and live status from the QoS message.
|
||||
*
|
||||
|
@ -2006,11 +2019,13 @@ gst_message_parse_qos (GstMessage * message, gboolean * live,
|
|||
/**
|
||||
* gst_message_parse_qos_values:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_QOS.
|
||||
* @jitter: (out): The difference of the running-time against the deadline.
|
||||
* @proportion: (out): Long term prediction of the ideal rate relative to normal rate
|
||||
* to get optimal quality.
|
||||
* @quality: (out): An element dependent integer value that specifies the current
|
||||
* quality level of the element. The default maximum quality is 1000000.
|
||||
* @jitter: (out) (allow-none): The difference of the running-time against
|
||||
* the deadline.
|
||||
* @proportion: (out) (allow-none): Long term prediction of the ideal rate
|
||||
* relative to normal rate to get optimal quality.
|
||||
* @quality: (out) (allow-none): An element dependent integer value that
|
||||
* specifies the current quality level of the element. The default
|
||||
* maximum quality is 1000000.
|
||||
*
|
||||
* Extract the QoS values that have been calculated/analysed from the QoS data
|
||||
*
|
||||
|
@ -2034,13 +2049,14 @@ gst_message_parse_qos_values (GstMessage * message, gint64 * jitter,
|
|||
/**
|
||||
* gst_message_parse_qos_stats:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_QOS.
|
||||
* @format: (out): Units of the 'processed' and 'dropped' fields. Video sinks and video
|
||||
* filters will use GST_FORMAT_BUFFERS (frames). Audio sinks and audio filters
|
||||
* will likely use GST_FORMAT_DEFAULT (samples).
|
||||
* @processed: (out): Total number of units correctly processed since the last state
|
||||
* change to READY or a flushing operation.
|
||||
* @dropped: (out): Total number of units dropped since the last state change to READY
|
||||
* or a flushing operation.
|
||||
* @format: (out) (allow-none): Units of the 'processed' and 'dropped' fields.
|
||||
* Video sinks and video filters will use GST_FORMAT_BUFFERS (frames).
|
||||
* Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT
|
||||
* (samples).
|
||||
* @processed: (out) (allow-none): Total number of units correctly processed
|
||||
* since the last state change to READY or a flushing operation.
|
||||
* @dropped: (out) (allow-none): Total number of units dropped since the last
|
||||
* state change to READY or a flushing operation.
|
||||
*
|
||||
* Extract the QoS stats representing the history of the current continuous
|
||||
* pipeline playback period.
|
||||
|
@ -2064,3 +2080,69 @@ gst_message_parse_qos_stats (GstMessage * message, GstFormat * format,
|
|||
GST_QUARK (PROCESSED), G_TYPE_UINT64, processed,
|
||||
GST_QUARK (DROPPED), G_TYPE_UINT64, dropped, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_message_new_progress:
|
||||
* @src: The object originating the message.
|
||||
* @type: a #GstProgressType
|
||||
* @code: a progress code
|
||||
* @text: free, user visible text describing the progress
|
||||
*
|
||||
* Progress messages are posted by elements when they use an asynchronous task
|
||||
* to perform actions triggered by a state change.
|
||||
*
|
||||
* @code contains a well defined string describing the action.
|
||||
* @test should contain a user visible string detailing the current action.
|
||||
*
|
||||
* Returns: (transfer full): The new qos message.
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*/
|
||||
GstMessage *
|
||||
gst_message_new_progress (GstObject * src, GstProgressType type,
|
||||
const gchar * code, const gchar * text)
|
||||
{
|
||||
GstMessage *message;
|
||||
GstStructure *structure;
|
||||
gint percent = 100, timeout = -1;
|
||||
|
||||
g_return_val_if_fail (code != NULL, NULL);
|
||||
g_return_val_if_fail (text != NULL, NULL);
|
||||
|
||||
if (type == GST_PROGRESS_TYPE_START || type == GST_PROGRESS_TYPE_CONTINUE)
|
||||
percent = 0;
|
||||
|
||||
structure = gst_structure_id_new (GST_QUARK (MESSAGE_PROGRESS),
|
||||
GST_QUARK (TYPE), GST_TYPE_PROGRESS_TYPE, type,
|
||||
GST_QUARK (CODE), G_TYPE_STRING, code,
|
||||
GST_QUARK (TEXT), G_TYPE_STRING, text,
|
||||
GST_QUARK (PERCENT), G_TYPE_INT, percent,
|
||||
GST_QUARK (TIMEOUT), G_TYPE_INT, timeout, NULL);
|
||||
message = gst_message_new_custom (GST_MESSAGE_PROGRESS, src, structure);
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_message_parse_progress:
|
||||
* @message: A valid #GstMessage of type GST_MESSAGE_PROGRESS.
|
||||
* @type: (out) (allow-none): location for the type
|
||||
* @code: (out) (allow-none) (transfer full): location for the code
|
||||
* @text: (out) (allow-none) (transfer full): location for the text
|
||||
*
|
||||
* Parses the progress @type, @code and @text.
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*/
|
||||
void
|
||||
gst_message_parse_progress (GstMessage * message, GstProgressType * type,
|
||||
gchar ** code, gchar ** text)
|
||||
{
|
||||
g_return_if_fail (GST_IS_MESSAGE (message));
|
||||
g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_PROGRESS);
|
||||
|
||||
gst_structure_id_get (message->structure,
|
||||
GST_QUARK (TYPE), GST_TYPE_PROGRESS_TYPE, type,
|
||||
GST_QUARK (CODE), G_TYPE_STRING, code,
|
||||
GST_QUARK (TEXT), G_TYPE_STRING, text, NULL);
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ typedef struct _GstMessageClass GstMessageClass;
|
|||
* @GST_MESSAGE_STEP_START: A stepping operation was started. Since: 0.10.24
|
||||
* @GST_MESSAGE_QOS: A buffer was dropped or an element changed its processing
|
||||
* strategy for Quality of Service reasons. Since: 0.10.29
|
||||
* @GST_MESSAGE_PROGRESS: A progress message. Since: 0.10.33
|
||||
* @GST_MESSAGE_ANY: mask for all of the above messages.
|
||||
*
|
||||
* The different message types that are available.
|
||||
|
@ -123,6 +124,7 @@ typedef enum
|
|||
GST_MESSAGE_REQUEST_STATE = (1 << 22),
|
||||
GST_MESSAGE_STEP_START = (1 << 23),
|
||||
GST_MESSAGE_QOS = (1 << 24),
|
||||
GST_MESSAGE_PROGRESS = (1 << 25),
|
||||
GST_MESSAGE_ANY = ~0
|
||||
} GstMessageType;
|
||||
|
||||
|
@ -240,6 +242,28 @@ typedef enum {
|
|||
GST_STREAM_STATUS_TYPE_STOP = 10
|
||||
} GstStreamStatusType;
|
||||
|
||||
/**
|
||||
* GstProgressType:
|
||||
* @GST_PROGRESS_TYPE_START: A new task started.
|
||||
* @GST_PROGRESS_TYPE_CONTINUE: A task completed and a new one continues.
|
||||
* @GST_PROGRESS_TYPE_COMPLETE: A task completed.
|
||||
* @GST_PROGRESS_TYPE_CANCELED: A task was canceled.
|
||||
* @GST_PROGRESS_TYPE_ERROR: A task caused an error. An error message is also
|
||||
* posted on the bus.
|
||||
*
|
||||
* The type of a %GST_MESSAGE_PROGRESS. The progress messages inform the
|
||||
* application of the status of assynchronous tasks.
|
||||
*
|
||||
* Since: 0.10.33
|
||||
*/
|
||||
typedef enum {
|
||||
GST_PROGRESS_TYPE_START = 0,
|
||||
GST_PROGRESS_TYPE_CONTINUE = 1,
|
||||
GST_PROGRESS_TYPE_COMPLETE = 2,
|
||||
GST_PROGRESS_TYPE_CANCELED = 3,
|
||||
GST_PROGRESS_TYPE_ERROR = 4,
|
||||
} GstProgressType;
|
||||
|
||||
/**
|
||||
* GstMessage:
|
||||
* @mini_object: the parent structure
|
||||
|
@ -330,7 +354,7 @@ gst_message_unref (GstMessage * msg)
|
|||
*
|
||||
* Creates a copy of the message. Returns a copy of the message.
|
||||
*
|
||||
* Returns: a new copy of @msg.
|
||||
* Returns: (transfer full): a new copy of @msg.
|
||||
*
|
||||
* MT safe
|
||||
*/
|
||||
|
@ -346,10 +370,12 @@ gst_message_copy (const GstMessage * msg)
|
|||
|
||||
/**
|
||||
* gst_message_make_writable:
|
||||
* @msg: the message to make writable
|
||||
* @msg: (transfer full): the message to make writable
|
||||
*
|
||||
* Checks if a message is writable. If not, a writable copy is made and
|
||||
* returned. Returns a message (possibly a duplicate) that is writable.
|
||||
* returned.
|
||||
*
|
||||
* Returns: (transfer full): a message (possibly a duplicate) that is writable.
|
||||
*
|
||||
* MT safe
|
||||
*/
|
||||
|
@ -490,6 +516,12 @@ void gst_message_parse_qos_values (GstMessage * message, gint64 *
|
|||
gint * quality);
|
||||
void gst_message_parse_qos_stats (GstMessage * message, GstFormat * format, guint64 * processed,
|
||||
guint64 * dropped);
|
||||
/* PROGRESS */
|
||||
GstMessage * gst_message_new_progress (GstObject * src, GstProgressType type, const gchar *code,
|
||||
const gchar *text);
|
||||
void gst_message_parse_progress (GstMessage * message, GstProgressType * type, gchar ** code,
|
||||
gchar ** text);
|
||||
|
||||
|
||||
/* custom messages */
|
||||
GstMessage * gst_message_new_custom (GstMessageType type,
|
||||
|
|
|
@ -177,7 +177,7 @@ gst_mini_object_finalize (GstMiniObject * obj)
|
|||
*
|
||||
* MT safe
|
||||
*
|
||||
* Returns: the new mini-object.
|
||||
* Returns: (transfer full): the new mini-object.
|
||||
*/
|
||||
GstMiniObject *
|
||||
gst_mini_object_new (GType type)
|
||||
|
@ -217,7 +217,7 @@ gst_mini_object_new (GType type)
|
|||
*
|
||||
* MT safe
|
||||
*
|
||||
* Returns: the new mini-object.
|
||||
* Returns: (transfer full): the new mini-object.
|
||||
*/
|
||||
GstMiniObject *
|
||||
gst_mini_object_copy (const GstMiniObject * mini_object)
|
||||
|
@ -255,7 +255,7 @@ gst_mini_object_is_writable (const GstMiniObject * mini_object)
|
|||
|
||||
/**
|
||||
* gst_mini_object_make_writable:
|
||||
* @mini_object: the mini-object to make writable
|
||||
* @mini_object: (transfer full): the mini-object to make writable
|
||||
*
|
||||
* Checks if a mini-object is writable. If not, a writable copy is made and
|
||||
* returned. This gives away the reference to the original mini object,
|
||||
|
@ -263,7 +263,8 @@ gst_mini_object_is_writable (const GstMiniObject * mini_object)
|
|||
*
|
||||
* MT safe
|
||||
*
|
||||
* Returns: a mini-object (possibly the same pointer) that is writable.
|
||||
* Returns: (transfer full): a mini-object (possibly the same pointer) that
|
||||
* is writable.
|
||||
*/
|
||||
GstMiniObject *
|
||||
gst_mini_object_make_writable (GstMiniObject * mini_object)
|
||||
|
@ -357,7 +358,7 @@ void
|
|||
gst_mini_object_unref (GstMiniObject * mini_object)
|
||||
{
|
||||
g_return_if_fail (GST_IS_MINI_OBJECT (mini_object));
|
||||
g_return_if_fail (mini_object->refcount);
|
||||
g_return_if_fail (mini_object->refcount > 0);
|
||||
|
||||
GST_CAT_TRACE (GST_CAT_REFCOUNTING, "%p unref %d->%d",
|
||||
mini_object,
|
||||
|
@ -371,7 +372,8 @@ gst_mini_object_unref (GstMiniObject * mini_object)
|
|||
|
||||
/**
|
||||
* gst_mini_object_replace:
|
||||
* @olddata: pointer to a pointer to a mini-object to be replaced
|
||||
* @olddata: (inout) (transfer full): pointer to a pointer to a mini-object to
|
||||
* be replaced
|
||||
* @newdata: pointer to new mini-object
|
||||
*
|
||||
* Modifies a pointer to point to a new mini-object. The modification
|
||||
|
@ -475,8 +477,8 @@ gst_value_mini_object_lcopy (const GValue * value, guint n_collect_values,
|
|||
|
||||
/**
|
||||
* gst_value_set_mini_object:
|
||||
* @value: a valid #GValue of %GST_TYPE_MINI_OBJECT derived type
|
||||
* @mini_object: mini object value to set
|
||||
* @value: a valid #GValue of %GST_TYPE_MINI_OBJECT derived type
|
||||
* @mini_object: (transfer none): mini object value to set
|
||||
*
|
||||
* Set the contents of a %GST_TYPE_MINI_OBJECT derived #GValue to
|
||||
* @mini_object.
|
||||
|
@ -496,8 +498,8 @@ gst_value_set_mini_object (GValue * value, GstMiniObject * mini_object)
|
|||
|
||||
/**
|
||||
* gst_value_take_mini_object:
|
||||
* @value: a valid #GValue of %GST_TYPE_MINI_OBJECT derived type
|
||||
* @mini_object: mini object value to take
|
||||
* @value: a valid #GValue of %GST_TYPE_MINI_OBJECT derived type
|
||||
* @mini_object: (transfer full): mini object value to take
|
||||
*
|
||||
* Set the contents of a %GST_TYPE_MINI_OBJECT derived #GValue to
|
||||
* @mini_object.
|
||||
|
@ -527,7 +529,7 @@ gst_value_take_mini_object (GValue * value, GstMiniObject * mini_object)
|
|||
* Get the contents of a %GST_TYPE_MINI_OBJECT derived #GValue.
|
||||
* Does not increase the refcount of the returned object.
|
||||
*
|
||||
* Returns: mini object contents of @value
|
||||
* Returns: (transfer none): mini object contents of @value
|
||||
*/
|
||||
GstMiniObject *
|
||||
gst_value_get_mini_object (const GValue * value)
|
||||
|
@ -544,7 +546,7 @@ gst_value_get_mini_object (const GValue * value)
|
|||
* Get the contents of a %GST_TYPE_MINI_OBJECT derived #GValue,
|
||||
* increasing its reference count.
|
||||
*
|
||||
* Returns: mini object contents of @value
|
||||
* Returns: (transfer full): mini object contents of @value
|
||||
*
|
||||
* Since: 0.10.20
|
||||
*/
|
||||
|
@ -633,7 +635,7 @@ gst_param_spec_mini_object_get_type (void)
|
|||
*
|
||||
* Creates a new #GParamSpec instance that hold #GstMiniObject references.
|
||||
*
|
||||
* Returns: a newly allocated #GParamSpec instance
|
||||
* Returns: (transfer full): a newly allocated #GParamSpec instance
|
||||
*/
|
||||
GParamSpec *
|
||||
gst_param_spec_mini_object (const char *name, const char *nick,
|
||||
|
|
|
@ -220,7 +220,7 @@ gst_object_init (GstObject * object)
|
|||
* constructs like :
|
||||
* result = gst_object_ref (object->parent);
|
||||
*
|
||||
* Returns: A pointer to @object
|
||||
* Returns: (transfer full): A pointer to @object
|
||||
*/
|
||||
gpointer
|
||||
gst_object_ref (gpointer object)
|
||||
|
@ -251,7 +251,7 @@ void
|
|||
gst_object_unref (gpointer object)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (((GObject *) object)->ref_count);
|
||||
g_return_if_fail (((GObject *) object)->ref_count > 0);
|
||||
|
||||
#ifdef DEBUG_REFCOUNT
|
||||
GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p unref %d->%d", object,
|
||||
|
@ -288,8 +288,9 @@ gst_object_ref_sink (gpointer object)
|
|||
|
||||
/**
|
||||
* gst_object_replace:
|
||||
* @oldobj: pointer to a place of a #GstObject to replace
|
||||
* @newobj: a new #GstObject
|
||||
* @oldobj: (inout) (transfer full): pointer to a place of a #GstObject to
|
||||
* replace
|
||||
* @newobj: (transfer none): a new #GstObject
|
||||
*
|
||||
* Unrefs the #GstObject pointed to by @oldobj, refs @newobj and
|
||||
* puts @newobj in *@oldobj. Be carefull when calling this
|
||||
|
@ -436,8 +437,9 @@ gst_object_dispatch_properties_changed (GObject * object,
|
|||
* @object: the #GObject that signalled the notify.
|
||||
* @orig: a #GstObject that initiated the notify.
|
||||
* @pspec: a #GParamSpec of the property.
|
||||
* @excluded_props: a set of user-specified properties to exclude or
|
||||
* NULL to show all changes.
|
||||
* @excluded_props: (array zero-terminated=1) (element-type gchar*)
|
||||
* (allow-none):a set of user-specified properties to exclude or
|
||||
* NULL to show all changes.
|
||||
*
|
||||
* A default deep_notify signal callback for an object. The user data
|
||||
* should contain a pointer to an array of strings that should be excluded
|
||||
|
@ -517,11 +519,10 @@ gst_object_set_name_default (GstObject * object)
|
|||
type_name = g_quark_to_string (q);
|
||||
if (strncmp (type_name, "Gst", 3) == 0)
|
||||
type_name += 3;
|
||||
l = strlen (type_name);
|
||||
name = g_malloc (l + 6 + 1);
|
||||
name = g_strdup_printf ("%s%d", type_name, count);
|
||||
l = strlen (name);
|
||||
for (i = 0; i < l; i++)
|
||||
name[i] = g_ascii_tolower (type_name[i]);
|
||||
g_snprintf (&name[i], 6, "%d", count);
|
||||
name[i] = g_ascii_tolower (name[i]);
|
||||
|
||||
GST_OBJECT_LOCK (object);
|
||||
if (G_UNLIKELY (object->parent != NULL))
|
||||
|
@ -605,7 +606,9 @@ had_parent:
|
|||
* For a nameless object, this returns NULL, which you can safely g_free()
|
||||
* as well.
|
||||
*
|
||||
* Returns: the name of @object. g_free() after usage.
|
||||
* Free-function: g_free
|
||||
*
|
||||
* Returns: (transfer full): the name of @object. g_free() after usage.
|
||||
*
|
||||
* MT safe. This function grabs and releases @object's LOCK.
|
||||
*/
|
||||
|
@ -678,8 +681,8 @@ had_parent:
|
|||
* Returns the parent of @object. This function increases the refcount
|
||||
* of the parent object so you should gst_object_unref() it after usage.
|
||||
*
|
||||
* Returns: parent of @object, this can be NULL if @object has no
|
||||
* parent. unref after usage.
|
||||
* Returns: (transfer full): parent of @object, this can be NULL if @object
|
||||
* has no parent. unref after usage.
|
||||
*
|
||||
* MT safe. Grabs and releases @object's LOCK.
|
||||
*/
|
||||
|
@ -768,7 +771,8 @@ gst_object_has_ancestor (GstObject * object, GstObject * ancestor)
|
|||
|
||||
/**
|
||||
* gst_object_check_uniqueness:
|
||||
* @list: a list of #GstObject to check through
|
||||
* @list: (transfer none) (element-type Gst.Object): a list of #GstObject to
|
||||
* check through
|
||||
* @name: the name to search for
|
||||
*
|
||||
* Checks to see if there is any object named @name in @list. This function
|
||||
|
@ -857,7 +861,9 @@ gst_object_get_property (GObject * object, guint prop_id,
|
|||
* Generates a string describing the path of @object in
|
||||
* the object hierarchy. Only useful (or used) for debugging.
|
||||
*
|
||||
* Returns: a string describing the path of @object. You must
|
||||
* Free-function: g_free
|
||||
*
|
||||
* Returns: (transfer full): a string describing the path of @object. You must
|
||||
* g_free() the string after usage.
|
||||
*
|
||||
* MT safe. Grabs and releases the #GstObject's LOCK for all objects
|
||||
|
|
114
gst/gstpad.c
114
gst/gstpad.c
|
@ -497,7 +497,7 @@ gst_pad_get_property (GObject * object, guint prop_id,
|
|||
* will be assigned.
|
||||
* This function makes a copy of the name so you can safely free the name.
|
||||
*
|
||||
* Returns: a new #GstPad, or NULL in case of an error.
|
||||
* Returns: (transfer full): a new #GstPad, or NULL in case of an error.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -518,7 +518,7 @@ gst_pad_new (const gchar * name, GstPadDirection direction)
|
|||
* will be assigned.
|
||||
* This function makes a copy of the name so you can safely free the name.
|
||||
*
|
||||
* Returns: a new #GstPad, or NULL in case of an error.
|
||||
* Returns: (transfer full): a new #GstPad, or NULL in case of an error.
|
||||
*/
|
||||
GstPad *
|
||||
gst_pad_new_from_template (GstPadTemplate * templ, const gchar * name)
|
||||
|
@ -539,7 +539,7 @@ gst_pad_new_from_template (GstPadTemplate * templ, const gchar * name)
|
|||
* will be assigned.
|
||||
* This function makes a copy of the name so you can safely free the name.
|
||||
*
|
||||
* Returns: a new #GstPad, or NULL in case of an error.
|
||||
* Returns: (transfer full): a new #GstPad, or NULL in case of an error.
|
||||
*/
|
||||
GstPad *
|
||||
gst_pad_new_from_static_template (GstStaticPadTemplate * templ,
|
||||
|
@ -987,7 +987,7 @@ gst_pad_is_active (GstPad * pad)
|
|||
* @blocked: boolean indicating whether the pad should be blocked or unblocked
|
||||
* @callback: #GstPadBlockCallback that will be called when the
|
||||
* operation succeeds
|
||||
* @user_data: user data passed to the callback
|
||||
* @user_data: (closure): user data passed to the callback
|
||||
* @destroy_data: #GDestroyNotify for user_data
|
||||
*
|
||||
* Blocks or unblocks the dataflow on a pad. The provided callback
|
||||
|
@ -1083,7 +1083,7 @@ had_right_state:
|
|||
* @blocked: boolean indicating whether the pad should be blocked or unblocked
|
||||
* @callback: #GstPadBlockCallback that will be called when the
|
||||
* operation succeeds
|
||||
* @user_data: user data passed to the callback
|
||||
* @user_data: (closure): user data passed to the callback
|
||||
*
|
||||
* Blocks or unblocks the dataflow on a pad. The provided callback
|
||||
* is called when the operation succeeds; this happens right before the next
|
||||
|
@ -1390,7 +1390,8 @@ gst_pad_set_query_type_function (GstPad * pad,
|
|||
* Get an array of supported queries that can be performed
|
||||
* on this pad.
|
||||
*
|
||||
* Returns: a zero-terminated array of #GstQueryType.
|
||||
* Returns: (transfer none) (array zero-terminated=1): a zero-terminated array
|
||||
* of #GstQueryType.
|
||||
*/
|
||||
const GstQueryType *
|
||||
gst_pad_get_query_types (GstPad * pad)
|
||||
|
@ -1425,8 +1426,9 @@ gst_pad_get_query_types_dispatcher (GstPad * pad, const GstQueryType ** data)
|
|||
* Invoke the default dispatcher for the query types on
|
||||
* the pad.
|
||||
*
|
||||
* Returns: an zero-terminated array of #GstQueryType, or NULL if none of the
|
||||
* internally-linked pads has a query types function.
|
||||
* Returns: (transfer none) (array zero-terminated=1): a zero-terminated array
|
||||
* of #GstQueryType, or NULL if none of the internally-linked pads has a
|
||||
* query types function.
|
||||
*/
|
||||
const GstQueryType *
|
||||
gst_pad_get_query_types_default (GstPad * pad)
|
||||
|
@ -2124,8 +2126,8 @@ gst_pad_set_pad_template (GstPad * pad, GstPadTemplate * templ)
|
|||
*
|
||||
* Gets the template for @pad.
|
||||
*
|
||||
* Returns: the #GstPadTemplate from which this pad was instantiated, or %NULL
|
||||
* if this pad has no template.
|
||||
* Returns: (transfer none): the #GstPadTemplate from which this pad was
|
||||
* instantiated, or %NULL if this pad has no template.
|
||||
*
|
||||
* FIXME: currently returns an unrefcounted padtemplate.
|
||||
*/
|
||||
|
@ -2519,7 +2521,7 @@ no_peer:
|
|||
/**
|
||||
* gst_pad_set_caps:
|
||||
* @pad: a #GstPad to set the capabilities of.
|
||||
* @caps: a #GstCaps to set.
|
||||
* @caps: (transfer none): a #GstCaps to set.
|
||||
*
|
||||
* Sets the capabilities of this pad. The caps must be fixed. Any previous
|
||||
* caps on the pad will be unreffed. This function refs the caps so you should
|
||||
|
@ -2662,8 +2664,8 @@ not_accepted:
|
|||
*
|
||||
* Gets the capabilities for @pad's template.
|
||||
*
|
||||
* Returns: the #GstCaps of this pad template. If you intend to keep a
|
||||
* reference on the caps, make a copy (see gst_caps_copy ()).
|
||||
* Returns: (transfer none): the #GstCaps of this pad template. If you intend
|
||||
* to keep a reference on the caps, make a copy (see gst_caps_copy ()).
|
||||
*/
|
||||
const GstCaps *
|
||||
gst_pad_get_pad_template_caps (GstPad * pad)
|
||||
|
@ -2685,7 +2687,7 @@ gst_pad_get_pad_template_caps (GstPad * pad)
|
|||
* Gets the peer of @pad. This function refs the peer pad so
|
||||
* you need to unref it after use.
|
||||
*
|
||||
* Returns: the peer #GstPad. Unref after usage.
|
||||
* Returns: (transfer full): the peer #GstPad. Unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -2716,8 +2718,9 @@ gst_pad_get_peer (GstPad * pad)
|
|||
* calling gst_pad_get_caps() on @pad and its peer. The caller owns a reference
|
||||
* on the resulting caps.
|
||||
*
|
||||
* Returns: the allowed #GstCaps of the pad link. Unref the caps when you no
|
||||
* longer need it. This function returns NULL when @pad has no peer.
|
||||
* Returns: (transfer full): the allowed #GstCaps of the pad link. Unref the
|
||||
* caps when you no longer need it. This function returns NULL when @pad
|
||||
* has no peer.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -2775,9 +2778,9 @@ no_peer:
|
|||
* always negotiated before sinkpads so it is possible that the negotiated caps
|
||||
* on the srcpad do not match the negotiated caps of the peer.
|
||||
*
|
||||
* Returns: the negotiated #GstCaps of the pad link. Unref the caps when
|
||||
* you no longer need it. This function returns NULL when the @pad has no
|
||||
* peer or is not negotiated yet.
|
||||
* Returns: (transfer full): the negotiated #GstCaps of the pad link. Unref
|
||||
* the caps when you no longer need it. This function returns NULL when
|
||||
* the @pad has no peer or is not negotiated yet.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -3044,8 +3047,8 @@ gst_pad_alloc_buffer (GstPad * pad, guint64 offset, gint size, GstCaps * caps,
|
|||
* @pad: a source #GstPad
|
||||
* @offset: the offset of the new buffer in the stream
|
||||
* @size: the size of the new buffer
|
||||
* @caps: the caps of the new buffer
|
||||
* @buf: a newly allocated buffer
|
||||
* @caps: (transfer none): the caps of the new buffer
|
||||
* @buf: (out callee-allocates): a newly allocated buffer
|
||||
*
|
||||
* In addition to the function gst_pad_alloc_buffer(), this function
|
||||
* automatically calls gst_pad_set_caps() when the caps of the
|
||||
|
@ -3157,8 +3160,11 @@ no_parent:
|
|||
* Each #GstPad element yielded by the iterator will have its refcount increased,
|
||||
* so unref after use.
|
||||
*
|
||||
* Returns: a new #GstIterator of #GstPad or %NULL when the pad does not have an
|
||||
* iterator function configured. Use gst_iterator_free() after usage.
|
||||
* Free-function: gst_iterator_free
|
||||
*
|
||||
* Returns: (transfer full): a new #GstIterator of #GstPad or %NULL when the
|
||||
* pad does not have an iterator function configured. Use
|
||||
* gst_iterator_free() after usage.
|
||||
*
|
||||
* Since: 0.10.21
|
||||
*/
|
||||
|
@ -3265,7 +3271,7 @@ no_iter:
|
|||
/**
|
||||
* gst_pad_event_default:
|
||||
* @pad: a #GstPad to call the default event handler on.
|
||||
* @event: the #GstEvent to handle.
|
||||
* @event: (transfer full): the #GstEvent to handle.
|
||||
*
|
||||
* Invokes the default event handler for the given pad. End-of-stream and
|
||||
* discontinuity events are handled specially, and then the event is sent to all
|
||||
|
@ -3301,7 +3307,7 @@ gst_pad_event_default (GstPad * pad, GstEvent * event)
|
|||
* gst_pad_dispatcher:
|
||||
* @pad: a #GstPad to dispatch.
|
||||
* @dispatch: the #GstPadDispatcherFunction to call.
|
||||
* @data: gpointer user data passed to the dispatcher function.
|
||||
* @data: (closure): gpointer user data passed to the dispatcher function.
|
||||
*
|
||||
* Invokes the given dispatcher function on each respective peer of
|
||||
* all pads that are internally linked to the given pad.
|
||||
|
@ -3369,7 +3375,7 @@ no_iter:
|
|||
/**
|
||||
* gst_pad_query:
|
||||
* @pad: a #GstPad to invoke the default query on.
|
||||
* @query: the #GstQuery to perform.
|
||||
* @query: (transfer none): the #GstQuery to perform.
|
||||
*
|
||||
* Dispatches a query to a pad. The query should have been allocated by the
|
||||
* caller via one of the type-specific allocation functions. The element that
|
||||
|
@ -3409,7 +3415,7 @@ no_func:
|
|||
/**
|
||||
* gst_pad_peer_query:
|
||||
* @pad: a #GstPad to invoke the peer query on.
|
||||
* @query: the #GstQuery to perform.
|
||||
* @query: (transfer none): the #GstQuery to perform.
|
||||
*
|
||||
* Performs gst_pad_query() on the peer of @pad.
|
||||
*
|
||||
|
@ -3459,7 +3465,7 @@ no_peer:
|
|||
/**
|
||||
* gst_pad_query_default:
|
||||
* @pad: a #GstPad to call the default query handler on.
|
||||
* @query: the #GstQuery to handle.
|
||||
* @query: (transfer none): the #GstQuery to handle.
|
||||
*
|
||||
* Invokes the default query handler for the given pad.
|
||||
* The query is sent to all pads internally linked to @pad. Note that
|
||||
|
@ -3702,7 +3708,7 @@ gst_pad_chain_data_unchecked (GstPad * pad, gboolean is_buffer, void *data,
|
|||
caps = gst_pad_data_get_caps (is_buffer, data);
|
||||
caps_changed = caps && caps != GST_PAD_CAPS (pad);
|
||||
|
||||
emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) != 0;
|
||||
emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) > 0;
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
/* see if the signal should be emited, we emit before caps nego as
|
||||
|
@ -3847,7 +3853,8 @@ no_function:
|
|||
/**
|
||||
* gst_pad_chain:
|
||||
* @pad: a sink #GstPad, returns GST_FLOW_ERROR if not.
|
||||
* @buffer: the #GstBuffer to send, return GST_FLOW_ERROR if not.
|
||||
* @buffer: (transfer full): the #GstBuffer to send, return GST_FLOW_ERROR
|
||||
* if not.
|
||||
*
|
||||
* Chain a buffer to @pad.
|
||||
*
|
||||
|
@ -3883,7 +3890,8 @@ gst_pad_chain (GstPad * pad, GstBuffer * buffer)
|
|||
/**
|
||||
* gst_pad_chain_list:
|
||||
* @pad: a sink #GstPad, returns GST_FLOW_ERROR if not.
|
||||
* @list: the #GstBufferList to send, return GST_FLOW_ERROR if not.
|
||||
* @list: (transfer full): the #GstBufferList to send, return GST_FLOW_ERROR
|
||||
* if not.
|
||||
*
|
||||
* Chain a bufferlist to @pad.
|
||||
*
|
||||
|
@ -3937,7 +3945,7 @@ gst_pad_push_data (GstPad * pad, gboolean is_buffer, void *data,
|
|||
|
||||
/* we emit signals on the pad arg, the peer will have a chance to
|
||||
* emit in the _chain() function */
|
||||
if (G_UNLIKELY (GST_PAD_DO_BUFFER_SIGNALS (pad))) {
|
||||
if (G_UNLIKELY (GST_PAD_DO_BUFFER_SIGNALS (pad) > 0)) {
|
||||
cache = NULL;
|
||||
/* unlock before emitting */
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
@ -4119,7 +4127,8 @@ _priv_gst_pad_invalidate_cache (GstPad * pad)
|
|||
/**
|
||||
* gst_pad_push:
|
||||
* @pad: a source #GstPad, returns #GST_FLOW_ERROR if not.
|
||||
* @buffer: the #GstBuffer to push returns GST_FLOW_ERROR if not.
|
||||
* @buffer: (transfer full): the #GstBuffer to push returns GST_FLOW_ERROR
|
||||
* if not.
|
||||
*
|
||||
* Pushes a buffer to the peer of @pad.
|
||||
*
|
||||
|
@ -4172,6 +4181,8 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer)
|
|||
peer = cache->peer;
|
||||
|
||||
GST_PAD_STREAM_LOCK (peer);
|
||||
if (G_UNLIKELY (g_atomic_pointer_get (cache_ptr) == PAD_CACHE_INVALID))
|
||||
goto invalid;
|
||||
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "calling chainfunction &%s",
|
||||
GST_DEBUG_FUNCPTR_NAME (GST_PAD_CHAINFUNC (peer)));
|
||||
|
@ -4211,12 +4222,19 @@ slow_path:
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
invalid:
|
||||
{
|
||||
pad_free_cache (cache);
|
||||
GST_PAD_STREAM_UNLOCK (peer);
|
||||
goto slow_path;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_push_list:
|
||||
* @pad: a source #GstPad, returns #GST_FLOW_ERROR if not.
|
||||
* @list: the #GstBufferList to push returns GST_FLOW_ERROR if not.
|
||||
* @list: (transfer full): the #GstBufferList to push returns GST_FLOW_ERROR
|
||||
* if not.
|
||||
*
|
||||
* Pushes a buffer list to the peer of @pad.
|
||||
*
|
||||
|
@ -4283,6 +4301,8 @@ gst_pad_push_list (GstPad * pad, GstBufferList * list)
|
|||
peer = cache->peer;
|
||||
|
||||
GST_PAD_STREAM_LOCK (peer);
|
||||
if (G_UNLIKELY (g_atomic_pointer_get (cache_ptr) == PAD_CACHE_INVALID))
|
||||
goto invalid;
|
||||
|
||||
ret = GST_PAD_CHAINLISTFUNC (peer) (peer, list);
|
||||
|
||||
|
@ -4314,6 +4334,12 @@ slow_path:
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
invalid:
|
||||
{
|
||||
pad_free_cache (cache);
|
||||
GST_PAD_STREAM_UNLOCK (peer);
|
||||
goto slow_path;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4402,7 +4428,7 @@ gst_pad_get_range_unchecked (GstPad * pad, guint64 offset, guint size,
|
|||
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
|
||||
goto flushing;
|
||||
|
||||
emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) != 0;
|
||||
emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) > 0;
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
if (G_UNLIKELY ((getrangefunc = GST_PAD_GETRANGEFUNC (pad)) == NULL))
|
||||
|
@ -4490,7 +4516,8 @@ not_negotiated:
|
|||
* @pad: a src #GstPad, returns #GST_FLOW_ERROR if not.
|
||||
* @offset: The start offset of the buffer
|
||||
* @size: The length of the buffer
|
||||
* @buffer: a pointer to hold the #GstBuffer, returns #GST_FLOW_ERROR if %NULL.
|
||||
* @buffer: (out callee-allocates): a pointer to hold the #GstBuffer,
|
||||
* returns #GST_FLOW_ERROR if %NULL.
|
||||
*
|
||||
* When @pad is flushing this function returns #GST_FLOW_WRONG_STATE
|
||||
* immediatly and @buffer is %NULL.
|
||||
|
@ -4522,7 +4549,8 @@ gst_pad_get_range (GstPad * pad, guint64 offset, guint size,
|
|||
* @pad: a sink #GstPad, returns GST_FLOW_ERROR if not.
|
||||
* @offset: The start offset of the buffer
|
||||
* @size: The length of the buffer
|
||||
* @buffer: a pointer to hold the #GstBuffer, returns GST_FLOW_ERROR if %NULL.
|
||||
* @buffer: (out callee-allocates): a pointer to hold the #GstBuffer, returns
|
||||
* GST_FLOW_ERROR if %NULL.
|
||||
*
|
||||
* Pulls a @buffer from the peer pad.
|
||||
*
|
||||
|
@ -4570,7 +4598,7 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size,
|
|||
|
||||
/* signal emision for the pad, peer has chance to emit when
|
||||
* we call _get_range() */
|
||||
emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) != 0;
|
||||
emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) > 0;
|
||||
|
||||
gst_object_ref (peer);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
@ -4640,7 +4668,7 @@ not_negotiated:
|
|||
/**
|
||||
* gst_pad_push_event:
|
||||
* @pad: a #GstPad to push the event to.
|
||||
* @event: the #GstEvent to send to the pad.
|
||||
* @event: (transfer full): the #GstEvent to send to the pad.
|
||||
*
|
||||
* Sends the event to the peer of the given pad. This function is
|
||||
* mainly used by elements to send events to their peer
|
||||
|
@ -4708,7 +4736,7 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
|
|||
GST_EVENT_SRC (event) = gst_object_ref (pad);
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (GST_PAD_DO_EVENT_SIGNALS (pad) != 0)) {
|
||||
if (G_UNLIKELY (GST_PAD_DO_EVENT_SIGNALS (pad) > 0)) {
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
if (!gst_pad_emit_have_data_signal (pad, GST_MINI_OBJECT (event)))
|
||||
|
@ -4761,7 +4789,7 @@ flushed:
|
|||
/**
|
||||
* gst_pad_send_event:
|
||||
* @pad: a #GstPad to send the event to.
|
||||
* @event: the #GstEvent to send to the pad.
|
||||
* @event: (transfer full): the #GstEvent to send to the pad.
|
||||
*
|
||||
* Sends the event to the pad. This function can be used
|
||||
* by applications to send events in the pipeline.
|
||||
|
@ -4815,7 +4843,7 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
/* pad signals */
|
||||
if (G_UNLIKELY (GST_PAD_DO_EVENT_SIGNALS (pad) != 0)) {
|
||||
if (G_UNLIKELY (GST_PAD_DO_EVENT_SIGNALS (pad) > 0)) {
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
if (!gst_pad_emit_have_data_signal (pad, GST_MINI_OBJECT_CAST (event)))
|
||||
|
@ -4948,7 +4976,7 @@ gst_pad_set_element_private (GstPad * pad, gpointer priv)
|
|||
* Gets the private data of a pad.
|
||||
* No locking is performed in this function.
|
||||
*
|
||||
* Returns: a #gpointer to the private data.
|
||||
* Returns: (transfer none): a #gpointer to the private data.
|
||||
*/
|
||||
gpointer
|
||||
gst_pad_get_element_private (GstPad * pad)
|
||||
|
|
|
@ -256,10 +256,9 @@ gst_pad_template_dispose (GObject * object)
|
|||
* 'sink%d' template is automatically selected), so we need to restrict their
|
||||
* naming.
|
||||
*/
|
||||
static inline gboolean
|
||||
static gboolean
|
||||
name_is_valid (const gchar * name, GstPadPresence presence)
|
||||
{
|
||||
#ifndef G_DISABLE_ASSERT
|
||||
const gchar *str;
|
||||
|
||||
if (presence == GST_PAD_ALWAYS) {
|
||||
|
@ -285,7 +284,7 @@ name_is_valid (const gchar * name, GstPadPresence presence)
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -307,7 +306,7 @@ gst_static_pad_template_get_type (void)
|
|||
*
|
||||
* Converts a #GstStaticPadTemplate into a #GstPadTemplate.
|
||||
*
|
||||
* Returns: a new #GstPadTemplate.
|
||||
* Returns: (transfer full): a new #GstPadTemplate.
|
||||
*/
|
||||
/* FIXME0.11: rename to gst_pad_template_new_from_static_pad_template() */
|
||||
GstPadTemplate *
|
||||
|
@ -337,13 +336,14 @@ gst_static_pad_template_get (GstStaticPadTemplate * pad_template)
|
|||
* @name_template: the name template.
|
||||
* @direction: the #GstPadDirection of the template.
|
||||
* @presence: the #GstPadPresence of the pad.
|
||||
* @caps: a #GstCaps set for the template. The caps are taken ownership of.
|
||||
* @caps: (transfer full): a #GstCaps set for the template. The caps are
|
||||
* taken ownership of.
|
||||
*
|
||||
* Creates a new pad template with a name according to the given template
|
||||
* and with the given arguments. This functions takes ownership of the provided
|
||||
* caps, so be sure to not use them afterwards.
|
||||
*
|
||||
* Returns: a new #GstPadTemplate.
|
||||
* Returns: (transfer full): a new #GstPadTemplate.
|
||||
*/
|
||||
GstPadTemplate *
|
||||
gst_pad_template_new (const gchar * name_template,
|
||||
|
@ -378,7 +378,7 @@ gst_pad_template_new (const gchar * name_template,
|
|||
*
|
||||
* Gets the capabilities of the static pad template.
|
||||
*
|
||||
* Returns: the #GstCaps of the static pad template.
|
||||
* Returns: (transfer full): the #GstCaps of the static pad template.
|
||||
* Unref after usage. Since the core holds an additional
|
||||
* ref to the returned caps, use gst_caps_make_writable()
|
||||
* on the returned caps to modify it.
|
||||
|
@ -397,8 +397,8 @@ gst_static_pad_template_get_caps (GstStaticPadTemplate * templ)
|
|||
*
|
||||
* Gets the capabilities of the pad template.
|
||||
*
|
||||
* Returns: the #GstCaps of the pad template. If you need to keep a reference to
|
||||
* the caps, take a ref (see gst_caps_ref ()).
|
||||
* Returns: (transfer none): the #GstCaps of the pad template. If you need to
|
||||
* keep a reference to the caps, take a ref (see gst_caps_ref ()).
|
||||
*/
|
||||
GstCaps *
|
||||
gst_pad_template_get_caps (GstPadTemplate * templ)
|
||||
|
|
|
@ -68,8 +68,10 @@ gst_parse_error_quark (void)
|
|||
* Allocates a parse context for use with gst_parse_launch_full() or
|
||||
* gst_parse_launchv_full().
|
||||
*
|
||||
* Returns: a newly-allocated parse context. Free with gst_parse_context_free()
|
||||
* when no longer needed.
|
||||
* Free-function: gst_parse_context_free
|
||||
*
|
||||
* Returns: (transfer full): a newly-allocated parse context. Free with
|
||||
* gst_parse_context_free() when no longer needed.
|
||||
*
|
||||
* Since: 0.10.20
|
||||
*/
|
||||
|
@ -90,7 +92,7 @@ gst_parse_context_new (void)
|
|||
|
||||
/**
|
||||
* gst_parse_context_free:
|
||||
* @context: a #GstParseContext
|
||||
* @context: (transfer full): a #GstParseContext
|
||||
*
|
||||
* Frees a parse context previously allocated with gst_parse_context_new().
|
||||
*
|
||||
|
@ -116,8 +118,9 @@ gst_parse_context_free (GstParseContext * context)
|
|||
* or gst_parse_launchv_full(). Will only return results if an error code
|
||||
* of %GST_PARSE_ERROR_NO_SUCH_ELEMENT was returned.
|
||||
*
|
||||
* Returns: a NULL-terminated array of element factory name strings of
|
||||
* missing elements. Free with g_strfreev() when no longer needed.
|
||||
* Returns: (transfer full) (array zero-terminated=1) (element-type gchar*): a
|
||||
* NULL-terminated array of element factory name strings of missing
|
||||
* elements. Free with g_strfreev() when no longer needed.
|
||||
*
|
||||
* Since: 0.10.20
|
||||
*/
|
||||
|
@ -172,14 +175,14 @@ _gst_parse_escape (const gchar * str)
|
|||
|
||||
/**
|
||||
* gst_parse_launchv:
|
||||
* @argv: null-terminated array of arguments
|
||||
* @argv: (in) (array zero-terminated=1): null-terminated array of arguments
|
||||
* @error: pointer to a #GError
|
||||
*
|
||||
* Create a new element based on command line syntax.
|
||||
* @error will contain an error message if an erroneuos pipeline is specified.
|
||||
* An error does not mean that the pipeline could not be constructed.
|
||||
*
|
||||
* Returns: a new element on success and %NULL on failure.
|
||||
* Returns: (transfer full): a new element on success and %NULL on failure.
|
||||
*/
|
||||
GstElement *
|
||||
gst_parse_launchv (const gchar ** argv, GError ** error)
|
||||
|
@ -189,8 +192,9 @@ gst_parse_launchv (const gchar ** argv, GError ** error)
|
|||
|
||||
/**
|
||||
* gst_parse_launchv_full:
|
||||
* @argv: null-terminated array of arguments
|
||||
* @context: a parse context allocated with gst_parse_context_new(), or %NULL
|
||||
* @argv: (in) (array zero-terminated=1): null-terminated array of arguments
|
||||
* @context: (allow-none): a parse context allocated with
|
||||
* gst_parse_context_new(), or %NULL
|
||||
* @flags: parsing options, or #GST_PARSE_FLAG_NONE
|
||||
* @error: pointer to a #GError (which must be initialised to %NULL)
|
||||
*
|
||||
|
@ -198,10 +202,10 @@ gst_parse_launchv (const gchar ** argv, GError ** error)
|
|||
* @error will contain an error message if an erroneous pipeline is specified.
|
||||
* An error does not mean that the pipeline could not be constructed.
|
||||
*
|
||||
* Returns: a new element on success; on failure, either %NULL or a
|
||||
* partially-constructed bin or element will be returned and @error will be set
|
||||
* (unless you passed #GST_PARSE_FLAG_FATAL_ERRORS in @flags, then %NULL will
|
||||
* always be returned on failure)
|
||||
* Returns: (transfer full): a new element on success; on failure, either %NULL
|
||||
* or a partially-constructed bin or element will be returned and @error will
|
||||
* be set (unless you passed #GST_PARSE_FLAG_FATAL_ERRORS in @flags, then
|
||||
* %NULL will always be returned on failure)
|
||||
*
|
||||
* Since: 0.10.20
|
||||
*/
|
||||
|
@ -252,9 +256,9 @@ gst_parse_launchv_full (const gchar ** argv, GstParseContext * context,
|
|||
* the @error is set. In this case there was a recoverable parsing error and you
|
||||
* can try to play the pipeline.
|
||||
*
|
||||
* Returns: a new element on success, %NULL on failure. If more than one toplevel
|
||||
* element is specified by the @pipeline_description, all elements are put into
|
||||
* a #GstPipeline, which than is returned.
|
||||
* Returns: (transfer full): a new element on success, %NULL on failure. If
|
||||
* more than one toplevel element is specified by the @pipeline_description,
|
||||
* all elements are put into a #GstPipeline, which than is returned.
|
||||
*/
|
||||
GstElement *
|
||||
gst_parse_launch (const gchar * pipeline_description, GError ** error)
|
||||
|
@ -265,7 +269,8 @@ gst_parse_launch (const gchar * pipeline_description, GError ** error)
|
|||
/**
|
||||
* gst_parse_launch_full:
|
||||
* @pipeline_description: the command line describing the pipeline
|
||||
* @context: a parse context allocated with gst_parse_context_new(), or %NULL
|
||||
* @context: (allow-none): a parse context allocated with
|
||||
* gst_parse_context_new(), or %NULL
|
||||
* @flags: parsing options, or #GST_PARSE_FLAG_NONE
|
||||
* @error: the error message in case of an erroneous pipeline.
|
||||
*
|
||||
|
@ -274,9 +279,9 @@ gst_parse_launch (const gchar * pipeline_description, GError ** error)
|
|||
* the @error is set. In this case there was a recoverable parsing error and you
|
||||
* can try to play the pipeline.
|
||||
*
|
||||
* Returns: a new element on success, %NULL on failure. If more than one toplevel
|
||||
* element is specified by the @pipeline_description, all elements are put into
|
||||
* a #GstPipeline, which then is returned.
|
||||
* Returns: (transfer full): a new element on success, %NULL on failure. If
|
||||
* more than one toplevel element is specified by the @pipeline_description,
|
||||
* all elements are put into a #GstPipeline, which then is returned.
|
||||
*
|
||||
* Since: 0.10.20
|
||||
*/
|
||||
|
|
|
@ -310,7 +310,7 @@ reset_start_time (GstPipeline * pipeline)
|
|||
*
|
||||
* Create a new pipeline with the given name.
|
||||
*
|
||||
* Returns: newly created GstPipeline
|
||||
* Returns: (transfer full): newly created GstPipeline
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -594,7 +594,7 @@ gst_pipeline_handle_message (GstBin * bin, GstMessage * message)
|
|||
* Gets the #GstBus of @pipeline. The bus allows applications to receive
|
||||
* #GstMessage packets.
|
||||
*
|
||||
* Returns: a #GstBus, unref after usage.
|
||||
* Returns: (transfer full): a #GstBus, unref after usage.
|
||||
*
|
||||
* MT safe.
|
||||
*/
|
||||
|
@ -646,7 +646,7 @@ gst_pipeline_provide_clock_func (GstElement * element)
|
|||
*
|
||||
* Gets the current clock used by @pipeline.
|
||||
*
|
||||
* Returns: a #GstClock, unref after usage.
|
||||
* Returns: (transfer full): a #GstClock, unref after usage.
|
||||
*/
|
||||
GstClock *
|
||||
gst_pipeline_get_clock (GstPipeline * pipeline)
|
||||
|
@ -660,7 +660,7 @@ gst_pipeline_get_clock (GstPipeline * pipeline)
|
|||
/**
|
||||
* gst_pipeline_use_clock:
|
||||
* @pipeline: a #GstPipeline
|
||||
* @clock: the clock to use
|
||||
* @clock: (transfer none): the clock to use
|
||||
*
|
||||
* Force @pipeline to use the given @clock. The pipeline will
|
||||
* always use the given clock even if new clock providers are added
|
||||
|
@ -692,7 +692,7 @@ gst_pipeline_use_clock (GstPipeline * pipeline, GstClock * clock)
|
|||
/**
|
||||
* gst_pipeline_set_clock:
|
||||
* @pipeline: a #GstPipeline
|
||||
* @clock: the clock to set
|
||||
* @clock: (transfer none): the clock to set
|
||||
*
|
||||
* Set the clock for @pipeline. The clock will be distributed
|
||||
* to all the elements managed by the pipeline.
|
||||
|
|
|
@ -174,7 +174,7 @@ gst_plugin_error_quark (void)
|
|||
* library-specific namespace prefix in order to avoid name conflicts in
|
||||
* case a similar plugin with the same name ever gets added to GStreamer)
|
||||
* @description: description of the plugin
|
||||
* @init_func: pointer to the init function of this plugin.
|
||||
* @init_func: (scope call): pointer to the init function of this plugin.
|
||||
* @version: version string of the plugin
|
||||
* @license: effective license of plugin. Must be one of the approved licenses
|
||||
* (see #GstPluginDesc above) or the plugin will not be registered.
|
||||
|
@ -237,7 +237,8 @@ gst_plugin_register_static (gint major_version, gint minor_version,
|
|||
* library-specific namespace prefix in order to avoid name conflicts in
|
||||
* case a similar plugin with the same name ever gets added to GStreamer)
|
||||
* @description: description of the plugin
|
||||
* @init_full_func: pointer to the init function with user data of this plugin.
|
||||
* @init_full_func: (scope call): pointer to the init function with user data
|
||||
* of this plugin.
|
||||
* @version: version string of the plugin
|
||||
* @license: effective license of plugin. Must be one of the approved licenses
|
||||
* (see #GstPluginDesc above) or the plugin will not be registered.
|
||||
|
@ -667,8 +668,8 @@ static GStaticMutex gst_plugin_loading_mutex = G_STATIC_MUTEX_INIT;
|
|||
*
|
||||
* Loads the given plugin and refs it. Caller needs to unref after use.
|
||||
*
|
||||
* Returns: a reference to the existing loaded GstPlugin, a reference to the
|
||||
* newly-loaded GstPlugin, or NULL if an error occurred.
|
||||
* Returns: (transfer full): a reference to the existing loaded GstPlugin, a
|
||||
* reference to the newly-loaded GstPlugin, or NULL if an error occurred.
|
||||
*/
|
||||
GstPlugin *
|
||||
gst_plugin_load_file (const gchar * filename, GError ** error)
|
||||
|
@ -993,8 +994,8 @@ gst_plugin_get_origin (GstPlugin * plugin)
|
|||
* Gets the #GModule of the plugin. If the plugin isn't loaded yet, NULL is
|
||||
* returned.
|
||||
*
|
||||
* Returns: module belonging to the plugin or NULL if the plugin isn't
|
||||
* loaded yet.
|
||||
* Returns: (transfer none): module belonging to the plugin or NULL if the
|
||||
* plugin isn't loaded yet.
|
||||
*/
|
||||
GModule *
|
||||
gst_plugin_get_module (GstPlugin * plugin)
|
||||
|
@ -1027,7 +1028,7 @@ gst_plugin_is_loaded (GstPlugin * plugin)
|
|||
* Gets the plugin specific data cache. If it is %NULL there is no cached data
|
||||
* stored. This is the case when the registry is getting rebuilt.
|
||||
*
|
||||
* Returns: The cached data as a #GstStructure or %NULL.
|
||||
* Returns: (transfer none): The cached data as a #GstStructure or %NULL.
|
||||
*
|
||||
* Since: 0.10.24
|
||||
*/
|
||||
|
@ -1042,7 +1043,7 @@ gst_plugin_get_cache_data (GstPlugin * plugin)
|
|||
/**
|
||||
* gst_plugin_set_cache_data:
|
||||
* @plugin: a plugin
|
||||
* @cache_data: a structure containing the data to cache
|
||||
* @cache_data: (transfer full): a structure containing the data to cache
|
||||
*
|
||||
* Adds plugin specific data to cache. Passes the ownership of the structure to
|
||||
* the @plugin.
|
||||
|
@ -1249,7 +1250,7 @@ gst_plugin_find_feature_by_name (GstPlugin * plugin, const gchar * name)
|
|||
*
|
||||
* Load the named plugin. Refs the plugin.
|
||||
*
|
||||
* Returns: A reference to a loaded plugin, or NULL on error.
|
||||
* Returns: (transfer full): a reference to a loaded plugin, or NULL on error.
|
||||
*/
|
||||
GstPlugin *
|
||||
gst_plugin_load_by_name (const gchar * name)
|
||||
|
@ -1279,7 +1280,7 @@ gst_plugin_load_by_name (const gchar * name)
|
|||
|
||||
/**
|
||||
* gst_plugin_load:
|
||||
* @plugin: plugin to load
|
||||
* @plugin: (transfer none): plugin to load
|
||||
*
|
||||
* Loads @plugin. Note that the *return value* is the loaded plugin; @plugin is
|
||||
* untouched. The normal use pattern of this function goes like this:
|
||||
|
@ -1292,7 +1293,7 @@ gst_plugin_load_by_name (const gchar * name)
|
|||
* plugin = loaded_plugin;
|
||||
* </programlisting>
|
||||
*
|
||||
* Returns: A reference to a loaded plugin, or NULL on error.
|
||||
* Returns: (transfer full): a reference to a loaded plugin, or NULL on error.
|
||||
*/
|
||||
GstPlugin *
|
||||
gst_plugin_load (GstPlugin * plugin)
|
||||
|
@ -1319,7 +1320,7 @@ load_error:
|
|||
|
||||
/**
|
||||
* gst_plugin_list_free:
|
||||
* @list: list of #GstPlugin
|
||||
* @list: (transfer full) (element-type Gst.Plugin): list of #GstPlugin
|
||||
*
|
||||
* Unrefs each member of @list, then frees the list.
|
||||
*/
|
||||
|
|
|
@ -72,7 +72,7 @@ gst_plugin_feature_finalize (GObject * object)
|
|||
|
||||
/**
|
||||
* gst_plugin_feature_load:
|
||||
* @feature: the plugin feature to check
|
||||
* @feature: (transfer none): the plugin feature to check
|
||||
*
|
||||
* Loads the plugin containing @feature if it's not already loaded. @feature is
|
||||
* unaffected; use the return value instead.
|
||||
|
@ -87,7 +87,7 @@ gst_plugin_feature_finalize (GObject * object)
|
|||
* feature = loaded_feature;
|
||||
* ]|
|
||||
*
|
||||
* Returns: A reference to the loaded feature, or NULL on error.
|
||||
* Returns: (transfer full): a reference to the loaded feature, or NULL on error
|
||||
*/
|
||||
GstPluginFeature *
|
||||
gst_plugin_feature_load (GstPluginFeature * feature)
|
||||
|
@ -146,7 +146,7 @@ not_found:
|
|||
/**
|
||||
* gst_plugin_feature_type_name_filter:
|
||||
* @feature: the #GstPluginFeature
|
||||
* @data: the type and name to check against
|
||||
* @data: (in): the type and name to check against
|
||||
*
|
||||
* Compares type and name of plugin feature. Can be used with gst_filter_run().
|
||||
*
|
||||
|
@ -238,7 +238,8 @@ gst_plugin_feature_get_rank (GstPluginFeature * feature)
|
|||
|
||||
/**
|
||||
* gst_plugin_feature_list_free:
|
||||
* @list: list of #GstPluginFeature
|
||||
* @list: (transfer full) (element-type Gst.PluginFeature): list
|
||||
* of #GstPluginFeature
|
||||
*
|
||||
* Unrefs each member of @list, then frees the list.
|
||||
*/
|
||||
|
@ -257,12 +258,14 @@ gst_plugin_feature_list_free (GList * list)
|
|||
|
||||
/**
|
||||
* gst_plugin_feature_list_copy:
|
||||
* @list: list of #GstPluginFeature
|
||||
* @list: (transfer none) (element-type Gst.PluginFeature): list
|
||||
* of #GstPluginFeature
|
||||
*
|
||||
* Copies the list of features. Caller should call @gst_plugin_feature_list_free
|
||||
* when done with the list.
|
||||
*
|
||||
* Returns: a copy of @list, with each feature's reference count incremented.
|
||||
* Returns: (transfer full) (element-type Gst.PluginFeature): a copy of @list,
|
||||
* with each feature's reference count incremented.
|
||||
*
|
||||
* Since: 0.10.26
|
||||
*/
|
||||
|
@ -294,7 +297,8 @@ gst_plugin_feature_list_copy (GList * list)
|
|||
|
||||
/**
|
||||
* gst_plugin_feature_list_debug:
|
||||
* @list: a #GList of plugin features
|
||||
* @list: (transfer none) (element-type Gst.PluginFeature): a #GList of
|
||||
* plugin features
|
||||
*
|
||||
* Debug the plugin feature names in @list.
|
||||
*
|
||||
|
|
|
@ -339,9 +339,9 @@ plugin_loader_create_blacklist_plugin (GstPluginLoader * l,
|
|||
|
||||
plugin->basename = g_path_get_basename (plugin->filename);
|
||||
plugin->desc.name = g_intern_string (plugin->basename);
|
||||
plugin->desc.description = g_strdup_printf ("Plugin for blacklisted file");
|
||||
plugin->desc.version = g_intern_string ("0.0.0");
|
||||
plugin->desc.license = g_intern_string ("BLACKLIST");
|
||||
plugin->desc.description = "Plugin for blacklisted file";
|
||||
plugin->desc.version = "0.0.0";
|
||||
plugin->desc.license = "BLACKLIST";
|
||||
plugin->desc.source = plugin->desc.license;
|
||||
plugin->desc.package = plugin->desc.license;
|
||||
plugin->desc.origin = plugin->desc.license;
|
||||
|
@ -725,11 +725,10 @@ handle_rx_packet (GstPluginLoader * l,
|
|||
case PACKET_EXIT:
|
||||
gst_poll_fd_ctl_read (l->fdset, &l->fd_r, FALSE);
|
||||
if (l->is_child) {
|
||||
/* Respond, then we keep looping until the parent closes the fd */
|
||||
/* Respond */
|
||||
put_packet (l, PACKET_EXIT, 0, NULL, 0);
|
||||
} else {
|
||||
l->rx_done = TRUE; /* All done reading from child */
|
||||
}
|
||||
l->rx_done = TRUE;
|
||||
return TRUE;
|
||||
case PACKET_LOAD_PLUGIN:{
|
||||
if (!l->is_child)
|
||||
|
|
|
@ -376,6 +376,7 @@ fd_set_to_pollfd (GstPoll * set, fd_set * readfds, fd_set * writefds,
|
|||
struct pollfd *pfd = &g_array_index (set->active_fds, struct pollfd, i);
|
||||
|
||||
if (pfd->fd < FD_SETSIZE) {
|
||||
pfd->revents = 0;
|
||||
if (FD_ISSET (pfd->fd, readfds))
|
||||
pfd->revents |= POLLIN;
|
||||
if (FD_ISSET (pfd->fd, writefds))
|
||||
|
@ -533,8 +534,10 @@ gst_poll_collect_winsock_events (GstPoll * set)
|
|||
* is possible to restart or flush a call to gst_poll_wait() with
|
||||
* gst_poll_restart() and gst_poll_set_flushing() respectively.
|
||||
*
|
||||
* Returns: a new #GstPoll, or %NULL in case of an error. Free with
|
||||
* gst_poll_free().
|
||||
* Free-function: gst_poll_free
|
||||
*
|
||||
* Returns: (transfer full): a new #GstPoll, or %NULL in case of an error.
|
||||
* Free with gst_poll_free().
|
||||
*
|
||||
* Since: 0.10.18
|
||||
*/
|
||||
|
@ -579,6 +582,9 @@ gst_poll_new (gboolean controllable)
|
|||
nset->wakeup_event = CreateEvent (NULL, TRUE, FALSE, NULL);
|
||||
#endif
|
||||
|
||||
/* ensure (re)build, though already sneakily set in non-windows case */
|
||||
MARK_REBUILD (nset);
|
||||
|
||||
nset->controllable = controllable;
|
||||
|
||||
return nset;
|
||||
|
@ -603,8 +609,10 @@ no_socket_pair:
|
|||
* A timeout is performed with gst_poll_wait(). Multiple timeouts can be
|
||||
* performed from different threads.
|
||||
*
|
||||
* Returns: a new #GstPoll, or %NULL in case of an error. Free with
|
||||
* gst_poll_free().
|
||||
* Free-function: gst_poll_free
|
||||
*
|
||||
* Returns: (transfer full): a new #GstPoll, or %NULL in case of an error.
|
||||
* Free with gst_poll_free().
|
||||
*
|
||||
* Since: 0.10.23
|
||||
*/
|
||||
|
@ -626,7 +634,7 @@ done:
|
|||
|
||||
/**
|
||||
* gst_poll_free:
|
||||
* @set: a file descriptor set.
|
||||
* @set: (transfer full): a file descriptor set.
|
||||
*
|
||||
* Free a file descriptor set.
|
||||
*
|
||||
|
@ -684,7 +692,11 @@ gst_poll_get_read_gpollfd (GstPoll * set, GPollFD * fd)
|
|||
#ifndef G_OS_WIN32
|
||||
fd->fd = set->control_read_fd.fd;
|
||||
#else
|
||||
fd->fd = set->wakeup_event;
|
||||
#if GLIB_SIZEOF_VOID_P == 8
|
||||
fd->fd = (gint64) set->wakeup_event;
|
||||
#else
|
||||
fd->fd = (gint) set->wakeup_event;
|
||||
#endif
|
||||
#endif
|
||||
fd->events = G_IO_IN | G_IO_HUP | G_IO_ERR;
|
||||
fd->revents = 0;
|
||||
|
|
|
@ -867,7 +867,8 @@ no_presets:
|
|||
*
|
||||
* Get a copy of preset names as a NULL terminated string array.
|
||||
*
|
||||
* Returns: list with names, ue g_strfreev() after usage.
|
||||
* Returns: (transfer full) (array zero-terminated=1) (element-type gchar*):
|
||||
* list with names, ue g_strfreev() after usage.
|
||||
*
|
||||
* Since: 0.10.20
|
||||
*/
|
||||
|
@ -885,7 +886,8 @@ gst_preset_get_preset_names (GstPreset * preset)
|
|||
*
|
||||
* Get a the names of the GObject properties that can be used for presets.
|
||||
*
|
||||
* Returns: an array of property names which should be freed with g_strfreev() after use.
|
||||
* Returns: (transfer full) (array zero-terminated=1) (element-type gchar*): an
|
||||
* array of property names which should be freed with g_strfreev() after use.
|
||||
*
|
||||
* Since: 0.10.20
|
||||
*/
|
||||
|
@ -1014,7 +1016,7 @@ gst_preset_set_meta (GstPreset * preset, const gchar * name, const gchar * tag,
|
|||
* @preset: a #GObject that implements #GstPreset
|
||||
* @name: preset name
|
||||
* @tag: meta data item name
|
||||
* @value: value
|
||||
* @value: (out callee-allocates): value
|
||||
*
|
||||
* Gets the @value for an existing meta data @tag. Meta data @tag names can be
|
||||
* something like e.g. "comment". Returned values need to be released when done.
|
||||
|
|
|
@ -49,7 +49,8 @@ static const gchar *_quark_strings[] = {
|
|||
"GstQueryURI", "GstEventStep", "GstMessageStepDone", "amount", "flush",
|
||||
"intermediate", "GstMessageStepStart", "active", "eos", "sink-message",
|
||||
"message", "GstMessageQOS", "running-time", "stream-time", "jitter",
|
||||
"quality", "processed", "dropped", "buffering-ranges"
|
||||
"quality", "processed", "dropped", "buffering-ranges", "GstMessageProgress",
|
||||
"code", "text", "percent", "timeout"
|
||||
};
|
||||
|
||||
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
||||
|
|
|
@ -127,8 +127,13 @@ typedef enum _GstQuarkId
|
|||
GST_QUARK_PROCESSED = 98,
|
||||
GST_QUARK_DROPPED = 99,
|
||||
GST_QUARK_BUFFERING_RANGES = 100,
|
||||
GST_QUARK_MESSAGE_PROGRESS = 101,
|
||||
GST_QUARK_CODE = 102,
|
||||
GST_QUARK_TEXT = 103,
|
||||
GST_QUARK_PERCENT = 104,
|
||||
GST_QUARK_TIMEOUT = 105,
|
||||
|
||||
GST_QUARK_MAX = 101
|
||||
GST_QUARK_MAX = 106
|
||||
} GstQuarkId;
|
||||
|
||||
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
|
||||
|
|
126
gst/gstquery.c
126
gst/gstquery.c
|
@ -334,7 +334,9 @@ gst_query_type_get_details (GstQueryType type)
|
|||
* Get a #GstIterator of all the registered query types. The definitions
|
||||
* iterated over are read only.
|
||||
*
|
||||
* Returns: A #GstIterator of #GstQueryTypeDefinition.
|
||||
* Free-function: gst_iterator_free
|
||||
*
|
||||
* Returns: (transfer full): a #GstIterator of #GstQueryTypeDefinition.
|
||||
*/
|
||||
GstIterator *
|
||||
gst_query_type_iterate_definitions (void)
|
||||
|
@ -381,7 +383,9 @@ gst_query_new (GstQueryType type, GstStructure * structure)
|
|||
* when done with it. A position query is used to query the current position
|
||||
* of playback in the streams, in some format.
|
||||
*
|
||||
* Returns: A #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstQuery
|
||||
*/
|
||||
GstQuery *
|
||||
gst_query_new_position (GstFormat format)
|
||||
|
@ -419,8 +423,9 @@ gst_query_set_position (GstQuery * query, GstFormat format, gint64 cur)
|
|||
/**
|
||||
* gst_query_parse_position:
|
||||
* @query: a #GstQuery
|
||||
* @format: (out): the storage for the #GstFormat of the position values (may be NULL)
|
||||
* @cur: (out): the storage for the current position (may be NULL)
|
||||
* @format: (out) (allow-none): the storage for the #GstFormat of the
|
||||
* position values (may be NULL)
|
||||
* @cur: (out) (allow-none): the storage for the current position (may be NULL)
|
||||
*
|
||||
* Parse a position query, writing the format into @format, and the position
|
||||
* into @cur, if the respective parameters are non-NULL.
|
||||
|
@ -450,7 +455,9 @@ gst_query_parse_position (GstQuery * query, GstFormat * format, gint64 * cur)
|
|||
* Use gst_query_unref() when done with it. A duration query will give the
|
||||
* total length of the stream.
|
||||
*
|
||||
* Returns: A #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstQuery
|
||||
*/
|
||||
GstQuery *
|
||||
gst_query_new_duration (GstFormat format)
|
||||
|
@ -488,8 +495,9 @@ gst_query_set_duration (GstQuery * query, GstFormat format, gint64 duration)
|
|||
/**
|
||||
* gst_query_parse_duration:
|
||||
* @query: a #GstQuery
|
||||
* @format: (out): the storage for the #GstFormat of the duration value, or NULL.
|
||||
* @duration: (out): the storage for the total duration, or NULL.
|
||||
* @format: (out) (allow-none): the storage for the #GstFormat of the duration
|
||||
* value, or NULL.
|
||||
* @duration: (out) (allow-none): the storage for the total duration, or NULL.
|
||||
*
|
||||
* Parse a duration query answer. Write the format of the duration into @format,
|
||||
* and the value into @duration, if the respective variables are non-NULL.
|
||||
|
@ -519,7 +527,9 @@ gst_query_parse_duration (GstQuery * query, GstFormat * format,
|
|||
* by sinks to compensate for additional latency introduced by elements in the
|
||||
* pipeline.
|
||||
*
|
||||
* Returns: A #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a #GstQuery
|
||||
*
|
||||
* Since: 0.10.12
|
||||
*/
|
||||
|
@ -565,9 +575,9 @@ gst_query_set_latency (GstQuery * query, gboolean live,
|
|||
/**
|
||||
* gst_query_parse_latency:
|
||||
* @query: a #GstQuery
|
||||
* @live: (out): storage for live or NULL
|
||||
* @min_latency: (out): the storage for the min latency or NULL
|
||||
* @max_latency: (out): the storage for the max latency or NULL
|
||||
* @live: (out) (allow-none): storage for live or NULL
|
||||
* @min_latency: (out) (allow-none): the storage for the min latency or NULL
|
||||
* @max_latency: (out) (allow-none): the storage for the max latency or NULL
|
||||
*
|
||||
* Parse a latency query answer.
|
||||
*
|
||||
|
@ -604,7 +614,9 @@ gst_query_parse_latency (GstQuery * query, gboolean * live,
|
|||
* when done with it. A convert query is used to ask for a conversion between
|
||||
* one format and another.
|
||||
*
|
||||
* Returns: A #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a #GstQuery
|
||||
*/
|
||||
GstQuery *
|
||||
gst_query_new_convert (GstFormat src_format, gint64 value,
|
||||
|
@ -650,10 +662,13 @@ gst_query_set_convert (GstQuery * query, GstFormat src_format, gint64 src_value,
|
|||
/**
|
||||
* gst_query_parse_convert:
|
||||
* @query: a #GstQuery
|
||||
* @src_format: (out): the storage for the #GstFormat of the source value, or NULL
|
||||
* @src_value: (out): the storage for the source value, or NULL
|
||||
* @dest_format: (out): the storage for the #GstFormat of the destination value, or NULL
|
||||
* @dest_value: (out): the storage for the destination value, or NULL
|
||||
* @src_format: (out) (allow-none): the storage for the #GstFormat of the
|
||||
* source value, or NULL
|
||||
* @src_value: (out) (allow-none): the storage for the source value, or NULL
|
||||
* @dest_format: (out) (allow-none): the storage for the #GstFormat of the
|
||||
* destination value, or NULL
|
||||
* @dest_value: (out) (allow-none): the storage for the destination value,
|
||||
* or NULL
|
||||
*
|
||||
* Parse a convert query answer. Any of @src_format, @src_value, @dest_format,
|
||||
* and @dest_value may be NULL, in which case that value is omitted.
|
||||
|
@ -689,7 +704,9 @@ gst_query_parse_convert (GstQuery * query, GstFormat * src_format,
|
|||
* when done with it. A segment query is used to discover information about the
|
||||
* currently configured segment for playback.
|
||||
*
|
||||
* Returns: a #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstQuery
|
||||
*/
|
||||
GstQuery *
|
||||
gst_query_new_segment (GstFormat format)
|
||||
|
@ -744,10 +761,11 @@ gst_query_set_segment (GstQuery * query, gdouble rate, GstFormat format,
|
|||
/**
|
||||
* gst_query_parse_segment:
|
||||
* @query: a #GstQuery
|
||||
* @rate: (out): the storage for the rate of the segment, or NULL
|
||||
* @format: (out): the storage for the #GstFormat of the values, or NULL
|
||||
* @start_value: (out): the storage for the start value, or NULL
|
||||
* @stop_value: (out): the storage for the stop value, or NULL
|
||||
* @rate: (out) (allow-none): the storage for the rate of the segment, or NULL
|
||||
* @format: (out) (allow-none): the storage for the #GstFormat of the values,
|
||||
* or NULL
|
||||
* @start_value: (out) (allow-none): the storage for the start value, or NULL
|
||||
* @stop_value: (out) (allow-none): the storage for the stop value, or NULL
|
||||
*
|
||||
* Parse a segment query answer. Any of @rate, @format, @start_value, and
|
||||
* @stop_value may be NULL, which will cause this value to be omitted.
|
||||
|
@ -785,7 +803,9 @@ gst_query_parse_segment (GstQuery * query, gdouble * rate, GstFormat * format,
|
|||
* Constructs a new custom application query object. Use gst_query_unref()
|
||||
* when done with it.
|
||||
*
|
||||
* Returns: a #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstQuery
|
||||
*/
|
||||
GstQuery *
|
||||
gst_query_new_application (GstQueryType type, GstStructure * structure)
|
||||
|
@ -802,8 +822,9 @@ gst_query_new_application (GstQueryType type, GstStructure * structure)
|
|||
*
|
||||
* Get the structure of a query.
|
||||
*
|
||||
* Returns: The #GstStructure of the query. The structure is still owned
|
||||
* by the query and will therefore be freed when the query is unreffed.
|
||||
* Returns: (transfer none): the #GstStructure of the query. The structure is
|
||||
* still owned by the query and will therefore be freed when the query
|
||||
* is unreffed.
|
||||
*/
|
||||
GstStructure *
|
||||
gst_query_get_structure (GstQuery * query)
|
||||
|
@ -820,7 +841,9 @@ gst_query_get_structure (GstQuery * query)
|
|||
* Constructs a new query object for querying seeking properties of
|
||||
* the stream.
|
||||
*
|
||||
* Returns: A #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstQuery
|
||||
*/
|
||||
GstQuery *
|
||||
gst_query_new_seeking (GstFormat format)
|
||||
|
@ -865,10 +888,11 @@ gst_query_set_seeking (GstQuery * query, GstFormat format,
|
|||
/**
|
||||
* gst_query_parse_seeking:
|
||||
* @query: a GST_QUERY_SEEKING type query #GstQuery
|
||||
* @format: (out): the format to set for the @segment_start and @segment_end values
|
||||
* @seekable: (out): the seekable flag to set
|
||||
* @segment_start: (out): the segment_start to set
|
||||
* @segment_end: (out): the segment_end to set
|
||||
* @format: (out) (allow-none): the format to set for the @segment_start
|
||||
* and @segment_end values, or NULL
|
||||
* @seekable: (out) (allow-none): the seekable flag to set, or NULL
|
||||
* @segment_start: (out) (allow-none): the segment_start to set, or NULL
|
||||
* @segment_end: (out) (allow-none): the segment_end to set, or NULL
|
||||
*
|
||||
* Parse a seeking query, writing the format into @format, and
|
||||
* other results into the passed parameters, if the respective parameters
|
||||
|
@ -903,7 +927,9 @@ gst_query_parse_seeking (GstQuery * query, GstFormat * format,
|
|||
* Constructs a new query object for querying formats of
|
||||
* the stream.
|
||||
*
|
||||
* Returns: A #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstQuery
|
||||
*
|
||||
* Since: 0.10.4
|
||||
*/
|
||||
|
@ -966,7 +992,8 @@ gst_query_set_formats (GstQuery * query, gint n_formats, ...)
|
|||
* gst_query_set_formatsv:
|
||||
* @query: a #GstQuery
|
||||
* @n_formats: the number of formats to set.
|
||||
* @formats: An array containing @n_formats @GstFormat values.
|
||||
* @formats: (in) (array length=n_formats): an array containing @n_formats
|
||||
* @GstFormat values.
|
||||
*
|
||||
* Set the formats query result fields in @query. The number of formats passed
|
||||
* in the @formats array must be equal to @n_formats.
|
||||
|
@ -1054,7 +1081,9 @@ gst_query_parse_formats_nth (GstQuery * query, guint nth, GstFormat * format)
|
|||
* Constructs a new query object for querying the buffering status of
|
||||
* a stream.
|
||||
*
|
||||
* Returns: A #GstQuery
|
||||
* Free-function: gst_query_new
|
||||
*
|
||||
* Returns: (transfer full): a new #GstQuery
|
||||
*
|
||||
* Since: 0.10.20
|
||||
*/
|
||||
|
@ -1108,8 +1137,8 @@ gst_query_set_buffering_percent (GstQuery * query, gboolean busy, gint percent)
|
|||
/**
|
||||
* gst_query_parse_buffering_percent
|
||||
* @query: A valid #GstQuery of type GST_QUERY_BUFFERING.
|
||||
* @busy: (out): if buffering is busy
|
||||
* @percent: (out): a buffering percent
|
||||
* @busy: (out) (allow-none): if buffering is busy, or NULL
|
||||
* @percent: (out) (allow-none): a buffering percent, or NULL
|
||||
*
|
||||
* Get the percentage of buffered data. This is a value between 0 and 100.
|
||||
* The @busy indicator is %TRUE when the buffering is in progress.
|
||||
|
@ -1158,10 +1187,10 @@ gst_query_set_buffering_stats (GstQuery * query, GstBufferingMode mode,
|
|||
/**
|
||||
* gst_query_parse_buffering_stats:
|
||||
* @query: A valid #GstQuery of type GST_QUERY_BUFFERING.
|
||||
* @mode: (out): a buffering mode
|
||||
* @avg_in: (out): the average input rate
|
||||
* @avg_out: (out): the average output rate
|
||||
* @buffering_left: (out): amount of buffering time left
|
||||
* @mode: (out) (allow-none): a buffering mode, or NULL
|
||||
* @avg_in: (out) (allow-none): the average input rate, or NULL
|
||||
* @avg_out: (out) (allow-none): the average output rat, or NULLe
|
||||
* @buffering_left: (out) (allow-none): amount of buffering time left, or NULL
|
||||
*
|
||||
* Extracts the buffering stats values from @query.
|
||||
*
|
||||
|
@ -1218,10 +1247,12 @@ gst_query_set_buffering_range (GstQuery * query, GstFormat format,
|
|||
/**
|
||||
* gst_query_parse_buffering_range:
|
||||
* @query: a GST_QUERY_BUFFERING type query #GstQuery
|
||||
* @format: (out): the format to set for the @segment_start and @segment_end values
|
||||
* @start: (out): the start to set
|
||||
* @stop: (out): the stop to set
|
||||
* @estimated_total: (out): estimated total amount of download time
|
||||
* @format: (out) (allow-none): the format to set for the @segment_start
|
||||
* and @segment_end values, or NULL
|
||||
* @start: (out) (allow-none): the start to set, or NULL
|
||||
* @stop: (out) (allow-none): the stop to set, or NULL
|
||||
* @estimated_total: (out) (allow-none): estimated total amount of download
|
||||
* time, or NULL
|
||||
*
|
||||
* Parse an available query, writing the format into @format, and
|
||||
* other results into the passed parameters, if the respective parameters
|
||||
|
@ -1344,8 +1375,8 @@ gst_query_get_n_buffering_ranges (GstQuery * query)
|
|||
* gst_query_parse_nth_buffering_range
|
||||
* @query: a GST_QUERY_BUFFERING type query #GstQuery
|
||||
* @index: position in the buffered-ranges array to read
|
||||
* @start: (out): the start position to set
|
||||
* @stop: (out): the stop position to set
|
||||
* @start: (out) (allow-none): the start position to set, or NULL
|
||||
* @stop: (out) (allow-none): the stop position to set, or NULL
|
||||
*
|
||||
* Parse an available query and get the start and stop values stored
|
||||
* at the @index of the buffered ranges array.
|
||||
|
@ -1389,7 +1420,9 @@ gst_query_parse_nth_buffering_range (GstQuery * query, guint index,
|
|||
* when done with it. An URI query is used to query the current URI
|
||||
* that is used by the source or sink.
|
||||
*
|
||||
* Returns: A #GstQuery
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstQuery
|
||||
*
|
||||
* Since: 0.10.22
|
||||
*/
|
||||
|
@ -1429,7 +1462,8 @@ gst_query_set_uri (GstQuery * query, const gchar * uri)
|
|||
/**
|
||||
* gst_query_parse_uri:
|
||||
* @query: a #GstQuery
|
||||
* @uri: (out): the storage for the current URI (may be NULL)
|
||||
* @uri: (out callee-allocates) (allow-none): the storage for the current URI
|
||||
* (may be NULL)
|
||||
*
|
||||
* Parse an URI query, writing the URI into @uri as a newly
|
||||
* allocated string, if the respective parameters are non-NULL.
|
||||
|
|
|
@ -228,7 +228,9 @@ gst_query_unref (GstQuery * q)
|
|||
*
|
||||
* Copies the given query using the copy function of the parent #GstStructure.
|
||||
*
|
||||
* Returns: a new copy of @q.
|
||||
* Free-function: gst_query_unref
|
||||
*
|
||||
* Returns: (transfer full): a new copy of @q.
|
||||
*/
|
||||
#ifdef _FOOL_GTK_DOC_
|
||||
G_INLINE_FUNC GstQuery * gst_query_copy (const GstQuery * q);
|
||||
|
@ -242,9 +244,11 @@ gst_query_copy (const GstQuery * q)
|
|||
|
||||
/**
|
||||
* gst_query_make_writable:
|
||||
* @q: a #GstQuery to make writable
|
||||
* @q: (transfer full): a #GstQuery to make writable
|
||||
*
|
||||
* Makes a writable query from the given query.
|
||||
*
|
||||
* Returns: (transfer full): a new writable query (possibly same as @q)
|
||||
*/
|
||||
#define gst_query_make_writable(q) GST_QUERY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (q)))
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue