Commit graph

2302 commits

Author SHA1 Message Date
Philip Withnall
3c8424d9ae net: Constify a parameter to gst_net_client_clock_new()
Even though this parameter is not used, it should be const to fit in with the
coding standards for other similar parameters. Client code already passes in
const strings under the expectation that they won’t be modified.

https://bugzilla.gnome.org/show_bug.cgi?id=710442
2013-10-18 09:59:25 +01:00
Thibault Saunier
0564c1c2b8 collectpads: Call the collected function while it returns FLOW_OK
This allows us to make sure the elements is EOS and does not have
remaining buffers to be drained.

https://bugzilla.gnome.org/show_bug.cgi?id=709637
2013-10-09 20:29:02 -03:00
Brendan Long
a89d53dd32 docs: fix spelling of "generic" in GstBaseSrc's documentation.
https://bugzilla.gnome.org/show_bug.cgi?id=708870
2013-09-26 21:15:27 +01:00
Sebastian Dröge
20f1c96c89 collectpads: Make sure that the object lock is always taken when accessing the private pad list
https://bugzilla.gnome.org/show_bug.cgi?id=708636
2013-09-24 10:44:34 +02:00
Mathieu Duponchelle
c79e5bbcad collectpads: Use private pad list in set_flushing_unlocked
pads->data is the public list. It is dynamically rebuilt at each call to
check_collected, in check_pads to be specific. When you add a pad and
collectpads have been started, it is not added to the public list.

Thus there exists a possible race where :

1) You would add a pad to collectpads while running.
2) You set collectpads to flushing before check_collected has been called again
-> the pad is not set to flushing
3) the pad starts pushing data as downstream might not be prepared, in the case
of adder it then returns FLOW_FLUSHING.
4) elements like demuxers, when they get a FLOW_FLUSHING, stop their tasks,
never to be seen again.

https://bugzilla.gnome.org/show_bug.cgi?id=708636
2013-09-24 10:44:34 +02:00
Wim Taymans
cba26c9ed9 tests: handle unscheduled entries correctly
Make the testclock return GST_CLOCK_UNSCHEDULED when an unscheduled entry is
used for gst_clock_wait() or gst_clock_wait_async().

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708605
2013-09-23 11:47:14 +02:00
Tim-Philipp Müller
0e66790134 check: testclock: fix function guards
Should be g_return_*() not g_assert(), even if it's for tests only.
2013-09-19 17:12:14 +01:00
Tim-Philipp Müller
cc4ba028ff check: testclock: don't put code with side-effects in g_assert()
Fixes unit test failures when -DG_DISABLE_ASSERT is used.

https://bugzilla.gnome.org/show_bug.cgi?id=706551
2013-09-19 16:43:18 +01:00
Rico Tzschichholz
f1971fe1e9 controlbindings: fix pspec relaxation for control source properties
The change should have been from PARAM_CONSTRUCT_ONLY to
PARAM_CONSTRUCT, otherwise bindings are affected, since
they look for the CONSTRUCT flag.

See ec55363d
2013-09-10 16:41:30 +01:00
Mathieu Duponchelle
8d24c4e451 basetransform: implement a default transform_meta.
If a metadata has no dependency as shown by the tags, copy it.
2013-09-09 15:32:18 +02:00
Thiago Santos
3dc8ee97e5 basesrc: preserve seqnum on segments after seeks
The seqnum of the segment after a seek should be the same of
the seek event. Downstream elements might rely on seqnums to
identify events related to a seek.

This is particularly important when a demuxer maps a TIME seek
into a BYTES seek for upstream and it needs to identify the
corresponding segment event and map it back into TIME to push
downstream, possibly using the values from the original seek
event.

https://bugzilla.gnome.org/show_bug.cgi?id=707530
2013-09-05 15:40:04 -03:00
Zaheer Abbas Merali
d1d99af229 collectpads: Don't unref NULL GstCollectData
If a pad is removed while a collectpads element (say adder) is in a chain
function waiting to be collected, there is a possibility that an unref happens
on a NULL pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=707536
2013-09-05 14:15:30 +02:00
Tim-Philipp Müller
3057001622 basesink: demote log message, don't spam INFO level when handling buffer lists 2013-08-29 11:07:38 +01:00
Edward Hervey
307d67f8c0 basetransform: Don't push out identical caps
This avoids triggering plenty of extra code/methods/overhead downstream when
we can just quickly check whenever we want to set caps whether they are
identical or not

https://bugzilla.gnome.org/show_bug.cgi?id=706600
2013-08-22 19:06:47 +02:00
Jonas Holmberg
3c4873458e check: Call gst_deinit() at exit of all processes 2013-08-16 10:21:19 +01:00
Wim Taymans
44811ab650 basesrc: improve flush-start handling
Use custom code to implement flush-stop, we can't reuse the set_flushing code
because we can't touch the live_playing flag and we need to signal the
streaming thread.
2013-08-14 17:44:48 +02:00
Wim Taymans
9006f203d0 basesrc: stop flushing in flush-stop 2013-08-14 17:14:15 +02:00
Wim Taymans
d95c227641 basesrc: handle flush better
Unlock the streaming thread when flushing so that we can
insert the flush-stop correctly.
2013-08-14 16:58:41 +02:00
Edward Hervey
0bfc375a54 check: Don't use nodist headers on gir scanner
Just creates noise and bogus symbols
2013-08-14 07:21:06 +02:00
Edward Hervey
3c49b5d23b baseparse: Add a property to disable passthrough
In some specific cases (like transmuxing) we want to force the element
to actually parse all incoming data even if the element deems it is not
necessary.

This property simply ignores requests from the element to enable passthrough
mode which results in processing always being enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=705621
2013-08-13 17:11:35 +02:00
Thiago Santos
581c4297d0 dataqueue: add gst_data_queue_push_force
Adds a variant of the _push function that doesn't check the queue limits
before adding the new item. It is useful when pushing an element to the
queue shouldn't lock the thread.

One particular scenario is when the queue is used to serialize buffers
and events that are going to be pushed from another thread. The
dataqueue should have a limit on the amount of buffers to be stored to
avoid large memory consumption, but events can be considered to have
negligible impact on memory compared to buffers. So it is useful to be
used to push items into the queue that contain events, even though the
queue is already full, it shouldn't matter inserting an item that has
no significative size.

This scenario happens on adaptive elements (dashdemux / mssdemux) as
there is a single download thread fetching buffers and putting into the
dataqueues for the streams. This same download thread can als generate
events in some situations as caps changes, eos or a internal control
events. There can be a deadlock at preroll if the first buffer fetched
is large enough to fill the dataqueue and the download thread and the
next iteration of the download thread decides to push an event to this
same dataqueue before fetching buffers to other streams, if this push
locks, the pipeline will be stuck in preroll as no more buffers will be
downloaded.
There is a somewhat common practice in dash streams to have a single
very large buffer for audio and one for video, so this will always
happen as the download thread will have to push an EOS right after
fetching the first buffer for any stream.

API: gst_data_queue_push_force

https://bugzilla.gnome.org/show_bug.cgi?id=705694
2013-08-13 12:00:48 -03:00
Nicolas Dufresne
de75bca9b3 bytereader: Accelerate MPEG/H264 start code scanning
Accelerate MPEG/H264 start code scanning using Boyer-Moor bad character
heuristic.

https://bugzilla.gnome.org/show_bug.cgi?id=702357
2013-08-10 18:54:34 -04:00
Adrian Pardini
d4f6c8e0e6 controller: fixes int overflow with properties that span +-INT_MAX
When the range for a property is defined as -INT_MAX-1 .. INT_MAX, like
the xpos in a videomixer the following expression in the macro
definitions of convert_g_value_to_##type (and the equivalent in
convert_value_to_##type)

v = pspec->minimum + (g##type) ROUNDING_OP ((pspec->maximum - pspec->minimum) * s);

are converted to:

v = -2147483648 + (g##type) ROUNDING_OP ((2147483647 - -2147483648) * s);

(2147483647 - -2147483648) overflows to -1 and the net result is:

v = -2147483648 + (g##type) ROUNDING_OP (-1 * s);

so v only takes the values -2147483648 for s == 0 and 2147483647
for s == 1.

Rewriting the expression as minimum*(1-s) + maximum*s gives the correct
result in this case.

https://bugzilla.gnome.org//show_bug.cgi?id=705630
2013-08-08 12:31:49 +02:00
Kjartan Maraas
280f557380 docs: some small gtk-doc markup fixes
https://bugzilla.gnome.org/show_bug.cgi?id=705156
2013-07-30 23:33:28 +01:00
Edward Hervey
991d6462a8 typefindhelper: Avoid using buffer_get_size in tight loops
Calling gst_buffer_get_size represented 2/3 of the cost of helper_find_peek
which was called whenever a typefindfunction wanted to peek at data.

We already know the size (from the GstMapInfo), so just use that.
2013-07-30 06:59:44 +02:00
Sebastian Dröge
ef8455d395 base: Fix handling of SEGMENT query
The values should be in stream-time, and start/stop should not
be swapped for negative rates.
2013-07-29 12:10:45 +02:00
Sebastian Dröge
eb67ca7625 baseparse: Implement SEGMENT query 2013-07-29 10:49:18 +02:00
Thiago Santos
aa5ea6d80e baseparse: fix seqnum handling for seeks
Use the same seqnum as the seek for flushes/segments that are
caused by the seek. Also do the same for segment events

Fixes #676242
2013-07-25 15:19:35 -03:00
Sebastian Dröge
bfb6844399 basesink: Don't shadow variables that are set inside our scope and then used outside our scope
Fixes uninitialized use of these variables.
2013-07-24 11:21:27 +02:00
Thibault Saunier
259e7c30a0 libcheck: Escape strings in the generated xml files
This is copy pasted from upstream libcheck
2013-07-23 16:02:01 -04:00
Sebastian Dröge
0a41beaa56 basesink: Print some debug output if a stream-start event without group-id arrives
Ideally all elements would implement handling of that to get proper
stream-start message handling and other things.
2013-07-23 18:53:44 +02:00
Sebastian Dröge
6363216e43 base: Use new group-id field in stream-start event and message 2013-07-22 15:30:10 +02:00
Olivier Crête
915f418cc4 adapter: Take account of the skip in gst_adapter_take_buffer_fast()
Include regression test
2013-07-16 15:38:11 -04:00
Olivier Crête
5920491597 adapter: Add function to return buffer composed of multiple memories
API: gst_adapter_take_fast()
2013-07-16 14:07:48 -04:00
Tim-Philipp Müller
98c1342614 timeprovider: g-i: allow None as address for gst_net_time_provider_new() 2013-07-16 14:48:18 +01:00
Sebastian Dröge
d60c2c2864 basesrc: Leave the loop function faster if we're flushing
Especially don't even try to send stream-start event or try
to negotiate.

https://bugzilla.gnome.org/show_bug.cgi?id=704100
2013-07-15 11:32:10 +02:00
Thibault Saunier
6cc39f42a9 basesrc: Do not lock a mutex that does not exist
The GST_LIVE_LOCK is on GstBaseSrc, not on its source pad.
2013-07-04 20:56:19 -04:00
Wim Taymans
97b1e17b09 baseparse: reset PTS after seek
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702778
2013-07-03 21:26:18 +02:00
Nicolas Dufresne
4656d18fd5 Add few missing allow-none annotation 2013-07-03 14:25:07 -04:00
Olivier Crête
75aa2bd86f check: Change stream_id parameter name to match GtkDoc 2013-07-01 20:07:03 -04:00
Jonas Holmberg
0ea8748c6b check: Added gst_check_setup_events_with_stream_id()
Added a new function gst_check_setup_events_with_stream_id(), since
gst_check_setup_events() does not work with multiple pads.

https://bugzilla.gnome.org/show_bug.cgi?id=703377
2013-07-01 15:54:11 +02:00
Sjoerd Simons
12a72d2b08 basetransform: optimize default acceptcaps implementation
Pass the fixed caps we're asked to accept as a filter for the caps
query, so we don't get a fully-expanded set of caps back (which we don't
need and can take a lot of time for intersection).

This reduces the time for camerabin to produce a second frame on a
logitech C910 camera from around 52 seconds to a bit less then 16
seconds on my system.

https://bugzilla.gnome.org/show_bug.cgi?id=702632
2013-06-19 15:11:57 +02:00
Wim Taymans
124b8e38af basesink: call state change in all cases
When we asynchronously go from READY to PLAYING, also call the
state change function so that subclasses can update their state for PLAYING.
Because the PREROLL lock is not recursive, we can't make this without
races and we must assume for now that the subclass can handle concurrent calls
to PAUSED->PLAYING and PLAYING->PAUSED. We can make this assumption because not
many elements actually do something in those state changes and the ones that
did would be broken even more without this change.

https://bugzilla.gnome.org/show_bug.cgi?id=702282
2013-06-17 10:36:34 +02:00
Sebastian Dröge
bab1122a93 basesrc: Only force-update the duration for dynamic sources when doing the DURATION query
Doing it after every single create() is not very efficient and not necessary.
Especially on network file systems fstat() is not cached and causes network
traffic, making the source possibly unusable slow.

https://bugzilla.gnome.org/show_bug.cgi?id=652037
2013-06-06 16:46:12 +02:00
Wim Taymans
cf4334fbfb basesink: improve position reporting without clock
When no base time or when sync is disabled, use the same logic as
in paused to report position. The logic in PLAYING assumes we use the
clock.
2013-05-30 06:51:24 +02:00
Tim-Philipp Müller
4d1cb14c68 basetransform: remove 0.10-ism from docs
gst_buffer_pad_alloc() never existed, and gst_pad_alloc_buffer()
doesn't exist any more either, so don't mention it in the docs.

https://bugzilla.gnome.org/show_bug.cgi?id=694714
2013-05-24 23:01:09 +01:00
Sebastian Dröge
3e515099ec basetransform: Return GST_FLOW_ERROR if the allocator did not allow to allocate a buffer 2013-05-24 14:37:37 +02:00
Sebastian Dröge
516611bc33 check: Fix event handling in gst_check_element_push_buffer_list() 2013-05-15 11:22:25 +02:00
Nicolas Dufresne
a1866e64c5 check: Add helper that sends initial events
https://bugzilla.gnome.org/show_bug.cgi?id=700033
2013-05-10 09:23:28 +02:00
Sebastian Dröge
1319196349 basesrc: Add FIXME comment for unused assignment results 2013-05-08 08:52:25 +02:00