Commit graph

1095 commits

Author SHA1 Message Date
Benjamin Otte 7e7f51f617 Fixes for -Wmissing-declarations -Wmissing-prototypes
Also adds those flags to the configure warning flags

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2010-03-11 10:59:57 +01:00
Benjamin Otte a9d1a493a7 Fixes for -Wwrite-strings
This changes some APIs in compatible ways:
- Some functions now take "const char *" arguments, not "char *"
- Some structs now have "conts char *" members, not "char *"
The changes may cause warnings when compiling with the right warning
flags. You've been warned.

Also adds -Wwrite-strings as a warning flag in configure.ac.

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2010-03-10 20:50:10 +01:00
Sebastian Dröge 1eea2495ff corelements: Combine redundant code 2010-02-19 14:31:54 +01:00
Andoni Morales Alastruey 09bbc1493d Fix compilation of fdsink and fdsrc with MSVC 2010-02-19 14:31:54 +01:00
Mark Nauwelaerts 2aea9ad231 memindex: avoid busy loop when doing EXACT lookup
Fixes #610367.
2010-02-18 17:17:34 +01:00
Edward Hervey 1f0b6f35d5 filesrc: Don't use expensive cast checks in _create
_create() is a pad function set by ourselves, therefore we're sure basesrc
is a GstFileSrc.

Speeds up _create() by 17% and the total call by 8% (instruction calls measurements
done with valgrind).

Fixes #610246
2010-02-17 12:37:11 +01:00
Stefan Kost 3c2abf5581 fdsrc: cleanup parameter initialisation and add comemnt+logging
Initialize new_fd with DEFAULT_FD and fd with -1. Setting the property will set
new_fd and in _update_fd() we cehck fd against -1. Also add a coment about the
warning we get in the log from gst_poll_remove_fd(). We could get rid of the
warning if we want by tracking if fd has been added to fdset.
2010-02-17 11:31:07 +02:00
Stefan Kost 7937808ac7 docs: prefer short desc from GstElementDetails 2010-02-15 23:12:56 +02:00
Edward Hervey ed6f62f763 typefind: Reset the working mode when going to READY/NULL
This allows properly re-using typefind (else it would think it's
already done the typefinding when being re-used with another
stream).
2010-02-13 15:18:05 +01:00
Thiago Santos 51d382e2ee typefind: Avoid messing pads activation
Typefind might mess up pads modes (pull/push) if a
downstream element is plugged and its pads activated
in 'step 2' of typefind pads activation.

This happens because the following steps don't check
if we already emitted typefound due to upstream setting
caps on buffers being pulled in the typefind helpers.

Avoid that by checking if typefound is already emmited.

Fixes #608036
2010-02-12 17:23:29 -03:00
Sebastian Dröge 88736cd675 typefindelement: Protect internal fields from concurrent changes from different threads
Fixes bug #608877.
2010-02-12 11:02:08 +01:00
Edward Hervey 4e0b2dc832 multiqueue: Don't stop threads on UNEXPECTED and forward flow returns.
When a downstream element returns GST_FLOW_UNEXPECTED we want to:
* let the dataqueue task running
* forward the flow return upstream.

This allows upstream elements to push EOS, and have that EOS event come
downstream.

Fixes #609274
2010-02-09 16:15:18 +01:00
Edward Hervey 9cc47f8cba Revert "multiqueue: handle UNEXPECTED flowreturn better"
This reverts commit fbdf4dceda.

Partly fixes #609274
2010-02-09 15:58:36 +01:00
Tim-Philipp Müller 467f0a2c0f filesrc: fix typo in warning message
Spotted by bsreerenj@gmail.com.

Fixes #608442.
2010-01-30 18:57:44 +00:00
Wim Taymans fbdf4dceda multiqueue: handle UNEXPECTED flowreturn better
When we receive an UNEXPECTED flowreturn from downstream, we must not shutdown
the pushing thread because upstream will at some point push an EOS that we still
need to push further downstream.

To achieve this, convert the UNEXPECTED return value to OK. Add a fixme so that
we implement the right logic to propagate the flowreturn upstream at some point.

Also clean up the unit test a little.

Fixes #608136
2010-01-26 17:07:31 +01:00
Wim Taymans 62e0d976f3 queue2: add some docs to mark new property 2010-01-22 18:00:53 +01:00
Wim Taymans 183ffdc126 queue2: add option to remove the temp-file
Add an option to automatically remove the temp file (TRUE by default). This
should make it possible for the application to keep the temp file by other means
than hardlinking or holding an fd open.

Fixes #607739
2010-01-22 17:58:07 +01:00
Tim-Philipp Müller 2b0b3923e8 typefind: don't leak uri string 2010-01-22 02:05:58 +00:00
Tim-Philipp Müller 087aa6ced4 gst_private.h: make sure gst_private.h is included before glib.h
For the reason outlined at the beginning of gst_private.h (inline
functions in glib may need the g_log_domain variable). Also include
gst_private.h before using any G_OS_* defines, esp. in plugin loader.
2010-01-20 01:48:56 +00:00
Tim-Philipp Müller 745b35e7d4 docs: minor gtk-doc markup fixes 2010-01-20 01:48:56 +00:00
Wim Taymans fc2f4ae37a typefindelement: use new typefind function
Refactor a little.
Use the new typefind helper function that uses the extension to speed up
typefinding.
2010-01-12 17:38:32 +01:00
Håvard Graff a3c4a3201a tee: make release_pad threadsafe
Protect the ->removed field with the object lock as well. Take the DYN lock
earlier so that we can mark the pad removed and avoid a race in pad_alloc.

Fixes #606435
2010-01-11 11:55:52 +01:00
Mark Nauwelaerts 7b2c5f5168 multiqueue: set iterate_interal_links function on source pad 2009-12-30 22:59:29 +01:00
Wim Taymans 5e577aa385 tee: small cleanups, use some G_LIKELY 2009-12-22 22:52:02 +01:00
Olivier Crête 3144354aae tee: Don't crash if there is no source pad 2009-12-22 22:31:06 +01:00
Mark Nauwelaerts 5fde7d1ed0 filesrc: printf format fixes 2009-12-15 18:55:38 +01:00
Havard Graff 494495eae6 tee: release pads in dispose
Make sure to release all request-pads in the dispose-method, in case of a
shutdown-race, where a pad-alloc is about to happen.

Fixes #604091
2009-12-09 13:31:07 +01:00
Edward Hervey e572d3bf0b tee: avoid expensive typechecks, and avoid getting ref to parent.
Speeds up tee processing 2 to 5 times.
2009-12-07 09:51:03 +01:00
Tim-Philipp Müller 5351298266 filesink, filesrc: printf format fixes
gstfilesink.c:399: error: format ‘%d’ expects type ‘int’, but argument 8 has type ‘size_t’
gstfilesink.c:399: error: format ‘%d’ expects type ‘int’, but argument 9 has type ‘gsize’
gstfilesrc.c:588: error: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 8 has type ‘off_t’
2009-12-03 20:53:25 +00:00
Stefan Kost c92178827b tee: add special case for only one pad conected
It is not easy to setup a tee on the fly, thus apps need to add them always if
they might need them. This changes the code so, that if only one src-pad is
active, we push buffers directly. In the normal code path all buffers are pushed
with an extra ref, that forces followup inplace elements to copy the data.
2009-12-03 16:44:28 +02:00
Stefan Kost 15bac7df00 tee: only message once per received buffer
Avoids checking for each source pad. The messages would be almost identical
anyway.
2009-12-03 16:11:59 +02:00
Stefan Kost d80750e8d2 tee: remove unused offset member 2009-12-03 16:06:35 +02:00
Stefan Kost 33f9abda38 tee: only notify alloc-pad property if changed. 2009-12-03 16:02:35 +02:00
Edward Hervey 4452672001 queue: Register debug funcptr only once.
Makes creating queue elements 3-4 times faster and avoids contention on the
global funcptr lock.
2009-12-01 19:29:25 +01:00
Thiago Santos 1a50186630 queue2: fix printf format
Cast the variable to gint to conform to the printf format used.
It is casted rather than changing the format because the
message is created with a cast to gint too.
2009-11-10 11:55:34 -03:00
Thiago Santos 245089c9bd queue2: avoid crashing due to negative percent
queue2 would crash when using small buffer sizes because
it would overflow when calculating the percentage, resulting
in the buffering GstMessage not being created and trying to be
used. This patch uses a gint64 instead of a gint to do the
percentage math, making it harder to overflow.
2009-11-10 10:10:56 -03:00
Thiago Santos 5c7104c002 queue2: Fix small doc typo 2009-11-10 09:52:30 -03:00
Bastien Nocera 9581e5887c implement buffering-left argument to buffer messages
Using the current fill level of the queue, and the average input
rate, we can determine how long it will take to finish downloading
the whole stream to the temporary file.

Fixes #600726
2009-11-05 15:22:35 +01:00
Stefan Kost 69ea131cfa build: include stdio.h for FILE 2009-11-03 17:30:14 +02:00
Sebastian Dröge 22fbce48bb queue2: Use "Queue 2" as long name 2009-10-29 11:38:21 +01:00
Sebastian Dröge 0f1c4ab188 queue2: Use GST_BOILERPLATE_FULL() and add pad templates/set details in base_init 2009-10-29 11:35:08 +01:00
Sebastian Dröge 5c821a0df5 queue2: Use gst_element_class_set_details_simple() 2009-10-29 11:30:57 +01:00
Sebastian Dröge 40732dd308 queue2: Integrate into coreplugins 2009-10-29 11:30:11 +01:00
Sebastian Dröge 08e3cb531c queue2: Move struct declarations to a separate header 2009-10-29 11:21:36 +01:00
Sebastian Dröge 9236921a34 queue2: Move queue2 to gstreamer coreplugins
Fixes bug #599996.
2009-10-29 11:18:20 +01:00
Tim-Philipp Müller daecaf0e8a Remove GST_DEBUG_FUNCPTR where they're pointless
There's not much point in using GST_DEBUG_FUNCPTR with GObject
virtual functions such as get_property, set_propery, finalize and
dispose, since they'll never be used by anyone anyway. Saves a
few bytes and possibly a tenth of a polar bear.
2009-10-28 00:44:24 +00:00
Tim-Philipp Müller ff7d9470b7 capsfilter: sprinkle some GST_DEBUG_FUNCPTR 2009-10-28 00:44:07 +00:00
Wim Taymans 03baa04059 multiqueue: buffering is implemented now 2009-10-27 14:40:19 +01:00
Wim Taymans b852da60d4 multiqueue: make sure percent increases
Keep track of the last posted percent message and make sure the next percent
messages are strictly increasing.
2009-10-27 14:40:17 +01:00
Wim Taymans 30fc865162 multiqueue: refactor buffering code
Move the buffering update code to a separate function so that we can call it
when the buffering state changes due to EOS.
Avoid dividing by 0.
2009-10-27 14:40:15 +01:00