Commit graph

2327 commits

Author SHA1 Message Date
Luis de Bethencourt
43ae5a17ce oggmux: push eos event when empty pad data
If gst_ogg_mux_queue_pads returns NULL it means we are at EOS, because we get a
NULL buffer and this function never sets bestpad.

https://bugzilla.gnome.org/show_bug.cgi?id=729315
2014-05-06 16:21:18 -04:00
Tim-Philipp Müller
bcb8068e27 docs: remove outdated and pointless 'Last reviewed' lines from docs
They are very confusing for people, and more often than not
also just not very accurate. Seeing 'last reviewed: 2005' in
your docs is not very confidence-inspiring. Let's just remove
those comments.
2014-04-26 23:28:57 +01:00
Sebastian Dröge
3e2a693ca9 pango: Make static caps actually static to fix a memory leak 2014-04-15 13:57:08 +02:00
Sebastian Dröge
02e613b6e3 oggmux: Clear Ogg streams before initing them
They might've been inited before, in which case we leak
memory when initing them again without clearing.
2014-04-15 13:39:39 +02:00
Josep Torra
40c2d3c088 textrender: push segment event after caps event
Fixes warning "Sticky event misordering, got 'segment' before 'caps'".
2014-04-11 10:43:39 +02:00
Vincent Penquerc'h
1791799d71 oggstream: use G_GUINT64_CONSTANT instead of ll suffix
Thanks slomo for pointing out it's not standard.
2014-04-10 16:08:29 +01:00
Vincent Penquerc'h
e7c261ff31 theoraenc: fix comparison to unset timestamp
Also rejects negative timestamps that aren't GST_CLOCK_TIME_NONE.

Coverity 1139797
2014-04-10 11:06:00 +01:00
Vincent Penquerc'h
55f98974a8 oggstream: fix a few left shifts operations on 32 bits cast to 64 bits
This should not cause any actual bug since Theora and Daala have
a maximum shift of 31, and a packet duration of 2^31 seems very
implausible. But it fixes:

Coverity 1139804, 1139803, 1139802
2014-04-10 11:06:00 +01:00
Vincent Penquerc'h
2c07c54b8a oggstream: remove NULL test after dereference
And add NULLness asserts at top of function. The only call
to this passes local variable pointers, so non NULL.

Coverity 206375
2014-04-10 11:06:00 +01:00
Vincent Penquerc'h
1b0f13ebf2 oggmux: test for failure to return tag
It should really not happen unless the tag list it corrupt,
but the API returns a failure code so we may as well use it.

Coverity 1139595
2014-04-10 11:06:00 +01:00
Vincent Penquerc'h
54f38edd15 oggdemux: do not dereference NULL pad in warning message
Coverity 1197695
2014-04-10 11:06:00 +01:00
Thiago Santos
a2633b7cf1 oggmux: implement vp8 granulepos function
Add an extra function to the oggstream map to inform it about
the incoming buffers. This way oggmux can keep a count on the
vp8 invisible frames and calculate the granulepos correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=722682
2014-03-11 12:28:49 -03:00
Thiago Santos
e00c306571 oggmux: create vp8 header data if not provided in caps
vp8 stream header shouldn't be assumed to be provided in caps always
as this would repeat the same code in all demuxers/encoders. Instead,
make oggmux generate them if they are not supplied.

https://bugzilla.gnome.org/show_bug.cgi?id=722682
2014-03-11 12:28:49 -03:00
Adrien Schwartzentruber
a9d98c57a4 pango: demote debug WARNING to LOG for variable framerate video input
No need why we need to warn about that, it's perfectly allowed.

https://bugzilla.gnome.org/show_bug.cgi?id=725837
2014-03-06 17:51:11 +00:00
Matthieu Bouron
ed8e7d4275 pango: basetextoverlay: handle video/x-raw(ANY) if downstream supports the GstVideoOverlayCompositionMeta API
https://bugzilla.gnome.org/show_bug.cgi?id=721953
2014-03-05 20:38:53 +01:00
Thiago Santos
b0985365af oggdemux: allow file to go until the end in push mode
When seeking back to original state after duration seeks, let
upstream know that we want the whole file, including the last
byte that wasn't requested on the duration seeks.

https://bugzilla.gnome.org/show_bug.cgi?id=724633
2014-02-20 00:24:02 -03:00
Thiago Santos
ef547c3eb5 oggdemux: remove unused instance variable event
It is never set to anything
2014-02-20 00:23:49 -03:00
Thiago Santos
a6890ec7ef oggmux: properly flush when seeking at the beginning
Reset all internal status when collect pads forwards a flush-stop
from the pads to be able to start the stream again.
2014-02-13 16:03:01 -03:00
Sebastian Dröge
437d11f5a0 oggmux: Fix typo in header include guard
clang does not like this.
2014-02-08 17:02:45 +01:00
Sebastian Dröge
d3e0381d3d alsa: Make clang happy with our g_strdup_vprintf() wrapper 2014-02-08 17:01:38 +01:00
Thiago Santos
ec7724c095 basetextoverlay: use correct segment for text
video time uses the 'segment' and the text time should use
the 'text_segment'.

If different segments are used for video and text it would
lead to out of sync video/subtitles.
2014-02-07 02:14:52 -03:00
Vincent Penquerc'h
b532ce16a5 oggdemux: fix broken seeking reading the whole file
A change in gst_ogg_demux_do_seek caused oggdemux to wait for
a page for each of the streams, including a skeleton stream if
one was present. Since Skeleton only has header pages, that
was never going to end well.

Also, the code was skipping CMML streams when looking for pages,
so would also have broken on CMML streams.

Thus, we change the code to disregard Skeleton streams, as well
as discontinuous streams (such as CMML and Kate). While it may
be desirable to consider Kate streams too (in order to avoid
losing a subtitle starting near the seek point), this may be
a performance drag when seeking where no subtitles are. Maybe
one could add a "give up" threshold for such discontinuous
streams, so we'd get any page if there is one, but do not end
up reading preposterous amounts of data otherwise.

In any case, it is important that the code that determines
the amount of streams to look pages for remains consistent with
the "early out" conditions of the code that actually parses
the incoming pages, lest we never decrease the pending counter
to zero.

This fixes seeking on a file with a skeleton track reading all
the file on each seek.

https://bugzilla.gnome.org/show_bug.cgi?id=719615
2014-01-14 12:48:45 +00:00
Vincent Penquerc'h
25bf5a13f0 oggdemux: use an adaptive chunksize for performance reasons
Ogg data is read chunk by chunk, and the chunk size used was
originally taken from libvorbisfile. However, this value leads
to poor performance when used on an Ogg file with large pages
(Ogg pages can be close to 64 KB).

We can't just use a larger chunk size, since this will decrease
performance on small page streams, so we use an adaptive scheme
where the chunk size is twice the largest page size we've seen
so far in the stream. For "typical" Ogg/Vorbis, this gives us
almost the same chunk size (a bit lower), and this lets us get
better performance on streams with large pages.
2014-01-14 12:48:45 +00:00
Tim-Philipp Müller
448c006b02 textoverlay: don't leak GAP events 2014-01-10 11:17:04 +00:00
Sebastian Dröge
4a37d90e9d theoradec: Use new gst_video_decoder_set_needs_format() API 2013-12-05 11:39:07 +01:00
Sebastian Dröge
1d4cf74e0b theoraparse: Fix event handling
Send CAPS event before any SEGMENT events or any other events
that must come in order after the CAPS event.
2013-11-29 13:33:45 +01:00
Tim-Philipp Müller
b1ff48c1a1 docs: remove old 0.10 Since markers
They're just confusing.
2013-11-16 16:10:07 +00:00
Stefan Sauer
2055f2b7de oggdemux: fix copy'n'paste in comment 2013-10-15 09:53:30 +02:00
Thibault Saunier
508245dfa6 theoraenc: Do nothing when flushing the encoder when no caps were set
In case we receive a flush event before having our caps set, we will
end up trying to create a theora encoder even though we are not ready.
Avoid that situation making sure we are initialized before accepting to
be flushed.

https://bugzilla.gnome.org/show_bug.cgi?id=709858
2013-10-14 17:49:59 -03:00
Takashi Iwai
76d807893c alsa: Add channel map API support
The initial support for the new ALSA chmap API.
Just translate the current chmap to GstAudioChannelPosition during the
setup.  No function to specify the channel map manually yet, so still
impossible to assign any non-standard positions or to configure in a
different order even if the hardware allows.

https://bugzilla.gnome.org/show_bug.cgi?id=709755
2013-10-09 19:05:53 +02:00
Thiago Santos
1618084bc8 oggdemux: check for full eos after a pad goes eos in push mode
After a pad is on EOS, verify if all pads are EOS and return
upstream, avoiding keeping the buffer flow without having more
data to push
2013-09-10 12:14:47 -03:00
Thiago Santos
7ecd5b1108 oggdemux: properly handle stop position at seeks in push mode
Store the seek stop and seqnum and properly restore them when
receiving the corresponding Segment from upstream. Also fixes
seqnum for converted seek events.
2013-09-10 12:14:47 -03:00
Tim-Philipp Müller
80fca3b4e3 vorbisenc: remove unused variables 2013-08-26 11:44:06 +01:00
Alessandro Decina
48b8e61334 vorbisenc: implement flushing 2013-08-26 08:09:11 +02:00
Sebastian Dröge
02c6766c8a oggdemux: Update segment.base with the chain's start time too
Fixes playback of chained ogg files.

https://bugzilla.gnome.org/show_bug.cgi?id=706569
2013-08-22 17:33:45 +02:00
Sebastian Dröge
5bd27953b4 theora: Use new video codec base classes' flush vfunc 2013-08-15 13:26:39 +02:00
Sjoerd Simons
76647f2710 oggdemux: Prevent seeks when _SCHEDULING_FLAG_SEQUENTIAL is set
Don't go into pull mode when the upstream scheduling flags indicate
seeks should be avoided by setting GST_SCHEDULING_FLAG_SEQUENTIAL.

https://bugzilla.gnome.org/show_bug.cgi?id=704929
2013-07-29 16:04:07 +02:00
Sebastian Dröge
246e1781c7 oggdemux: Don't swap start/stop for negative rates in the SEGMENT query 2013-07-29 12:11:38 +02:00
Sebastian Dröge
31763d3c20 oggdemux: Implement SEGMENT query 2013-07-29 10:46:01 +02:00
Edward Hervey
9dd0e6cccc ext/gst: Ensure default query/event handlers are used
And in some cases, just remove our implementation that does nothing
2013-07-26 16:08:35 +02:00
Sebastian Dröge
239b623a9c theoraenc: Clean up handling of reset/flushing/start/stop 2013-07-25 13:31:07 +02:00
Sebastian Dröge
775aa4100b theoradec: Clean up handling of reset/flushing/start/stop 2013-07-25 13:29:22 +02:00
Sebastian Dröge
fc79a688f5 ogg: Add support for group-id in the stream-start event 2013-07-22 15:24:29 +02:00
Mathieu Duponchelle
905fe0f4ca oggdemux: Make bisecting fully accurate
When bisecting after an earliest time has been found, we need
to only consider the stream for which the earliest time was found.

Before, the following scenario could be and was encountered:

a) Find the earliest time for stream X
b) bisect and find a page which granuletime is indeed < target, but
   contains another stream.
c) decide to seek at the wrong offset, sometimes inferior to
   the real one, in which case the error was undected or
d) the offset was superior, and thus the actual target keyframe was
   not processed, and packets were skipped waiting
   for a granulepos.

https://bugzilla.gnome.org/show_bug.cgi?id=700537
2013-07-15 10:34:00 +02:00
Mathieu Duponchelle
affd9f37aa Revert "oggdemux: fix seeking with negative rate with skeleton"
This reverts commit b41cd04289.
2013-07-15 10:31:08 +02:00
Sebastian Dröge
748cbbd76e ogg: The Daala headers are little endian, not big endian 2013-06-23 12:07:41 +02:00
Sebastian Dröge
3f9872abaa ogg: Add Daala support 2013-06-23 11:28:40 +02:00
Sebastian Dröge
4180581ce9 alsasrc: Dump some more debug output about the device configuration 2013-05-29 16:41:14 +02:00
Sebastian Dröge
639e2d4346 alsasink: Update internal buffer/period times with the values that were configured on the device 2013-05-29 16:41:06 +02:00
Sebastian Dröge
e39fa41d74 theoradec: Require caps to be set before data flow happens 2013-05-27 13:04:25 +02:00
Alexander Schrab
a049b102da alsasrc: Make using driver timestamps possible
https://bugzilla.gnome.org/show_bug.cgi?id=699744
2013-05-20 11:25:17 +02:00
Sebastian Dröge
0bc25f0325 alsa: Dump min/max period time and buffer time in alsasrc too 2013-05-20 11:23:06 +02:00
Sebastian Dröge
36470a4aa8 libvisual: Update visualizer baseclass from gst-plugins-bad 2013-05-15 11:04:35 +02:00
Sebastian Dröge
027654e71e vorbisparse: Fix event handling
Internal state should only be reset on FLUSH_STOP, not FLUSH_START.

Also forward pre-caps events immediately and don't queue them.
2013-05-10 11:32:36 +02:00
Sebastian Dröge
1d20c0f4bb oggmux: Make sure to always set caps on the srcpad and always send a segment event
Even if the srcpad is not linked at this point, it might be linked as result of
setting the caps.
2013-05-10 11:24:46 +02:00
Mathieu Duponchelle
46aff49316 oggmux: don't send a segment event before the caps event
https://bugzilla.gnome.org/show_bug.cgi?id=699971
2013-05-10 09:28:52 +02:00
Sebastian Dröge
4f52ad38e4 theoradec: Set DECODE_ONLY flag on all header packets 2013-05-09 10:40:19 +02:00
Mathieu Duponchelle
4c362768fc oggmux: The best pad can't be EOS
The problem experienced is that the EOS was never emitted by oggmux during a
rendering with GES. The proposed patch checks if the pad is EOS before deciding
it's the "best pad".

https://bugzilla.gnome.org/show_bug.cgi?id=699792
2013-05-08 14:26:17 +02:00
Sebastian Dröge
ef6a2a6c14 theoraenc: Don't call gst_buffer_fill() for empty Theora packets
gst_buffer_fill() does not like a NULL source data pointer.
2013-05-07 10:16:48 +02:00
Sebastian Dröge
f3b6548f09 theoraenc: Fix error handling when reading or writing multipass cache data fails 2013-05-07 10:13:18 +02:00
Sebastian Dröge
abdfb8d452 vorbis: Fix compilation after function rename 2013-05-03 15:49:50 +02:00
Andoni Morales Alastruey
35b3d805ed vorbis: prefix get_copy_sample_func and fix duplicated symbols 2013-05-03 14:30:03 +02:00
Andoni Morales Alastruey
595c49c40d ivorbisdec: fix duplicated symbols with vorbisdec 2013-05-03 14:29:52 +02:00
Tim-Philipp Müller
f9befdecfe textrender: actually fixate output caps when fixating output caps 2013-05-02 23:41:02 +01:00
Andoni Morales Alastruey
47cbbe6514 ogg: fix duplicated symbols with schroedinger 2013-05-02 14:02:19 +02:00
Stefan Sauer
cdfc05ec4d oggmux: add more logging and fix the object param for some logging
Use data->pad instead of pad for 'object'. Reduce indentation depth in a helper
with an early return.
2013-04-17 21:47:11 +02:00
Sebastian Dröge
948a4a3632 gst: Add better support for static plugins 2013-04-15 15:52:58 +02:00
Sebastian Dröge
6e01d1869b ogg: Prevent some symbol conflicts between the ogg plugin and schroedinger 2013-04-15 08:38:34 +02:00
Olivier Crête
48208c61a8 audiovisualizer: Don't try to sync controller values to invalid timestamp 2013-04-05 00:43:41 +01:00
Wim Taymans
461d58795a oggdemux: don't push on NOT_LINKED pads
If our previous flow return was NOT_LINKED, don't try to push on the pads some
more. If we get a RECONFIGURE event on the pad, try to push on it again.
2013-04-04 18:18:54 +02:00
Nicolas Dufresne
e58f838ca3 oggdemux: Allow EOS on timestamp equal to stop/start
Changed the check to a current_time equal to the stop will produce
EOS instead of the next one. Also, segment.start can't be NONE, so removing
this check.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=696899
2013-04-04 10:09:26 +02:00
Matthew Waters
4f1ba51c4b visualizer: handle non-existant pool in the default allocation query
gst_query_set_nth_allocation_pool() requires there to be a pool in the
query already. This is not always the case when we get the query from
upstream.  Use gst_query_add_allocation_pool() instead in such case.

https://bugzilla.gnome.org/show_bug.cgi?id=681719
2013-04-01 21:13:38 +01:00
Wim Taymans
564f720c40 oggdemux: mark keyframes
Use the mapper to set the delta-unit flag.
2013-03-31 18:57:13 +02:00
Wim Taymans
f15bc6835b theoradec: handle empty adapter
Should not be empty but might be when we actually pass and decode the 0 packets
later.
2013-03-31 18:31:36 +02:00
Vincent Penquerc'h
da673880eb theoraenc: do not reset the encoder when we need a keyframe
Instead, remember we need a keyframe, and we will force the encoder
to emit one next time we submit a new frame.
Since libtheora does not have an API to request a keyframe, we reset
the max keyframe interval to 1 temporarily.

This has the advantage that the rate control keeps its history,
and that the encoder won't choose different quant tables or
somesuch, thus requiring new streamheaders (although this is
probably only a theoretical possibility). Should also be a
bit faster than resetting the encoder.

https://bugzilla.gnome.org/show_bug.cgi?id=663350
2013-03-31 15:45:26 +01:00
Greg Rutz
c480bac5b7 libvisual: fix improper video frame clear operation
The current code is memsetting the GstVideoFrame.data address to 0s (which
causes a segfault). This member is actually an array of data buffers (one for
each plane).  This fix iterates over each data plane to clear them all.

https://bugzilla.gnome.org/show_bug.cgi?id=695655
2013-03-13 00:51:55 +00:00
Stefan Sauer
28d09d43e5 oggmux: don't keep a static string beyond the ref of the owning object
Also move down the ref for the caps a bit, so tha we don't leak it in the branch that calls continue.
2013-03-05 22:31:26 +01:00
Stefan Sauer
ce626fc3d8 oggmux: don't crash on caps being NULL
Also avoid unused variables if debugging is disabled.
2013-03-03 20:51:43 +01:00
Tim-Philipp Müller
4e1ccb2885 vorbis: small GValue optimisation
No need to copy buffers we put into the streamheader any more
now that we don't put caps on buffers any more, so there's no
danger of a refcount cycle.
2013-03-03 17:42:50 +00:00
Tim-Philipp Müller
13b8b35373 theora: small GValue optimisations
No need to copy buffers we put into the streamheader any more
now that we don't put caps on buffers any more, so there's no
danger of a refcount cycle.
2013-03-03 17:42:22 +00:00
Tim-Philipp Müller
d97dd36ae5 ogg: small GValue optimisation
No need to copy buffers we put into the streamheader any more
now that we don't put caps on buffers any more, so there's no
danger of a refcount cycle.
2013-03-03 17:40:21 +00:00
Tim-Philipp Müller
e045b6fb52 oggdemux: add audio-codec and video-codec tags for streams in more cases 2013-02-28 16:27:50 +00:00
Tim-Philipp Müller
8e4934820f pango: use new GST_VIDEO_OVERLAY_COMPOSITION_BLEND_FORMATS define
https://bugzilla.gnome.org/show_bug.cgi?id=665751
2013-02-19 12:54:40 +00:00
Jan Schmidt
fb102419c7 pango: 3rd time's the charm. Fix attribute list handling.
Really really fix attribute list handling by taking a
copy of the original attributes that pango_attr_list_filter
can mutate, but keep the original around intact to restore
later.
2013-02-08 00:05:24 +11:00
Jan Schmidt
bc42d382e2 pango: Don't modify the original attributes list.
Take a copy of the original attributes list instead of just
a ref, since pango_attr_list_filter can remove elements from it.
2013-02-07 23:45:26 +11:00
Jan Schmidt
2528baf2c2 pango: Remove extra pango_attr_list_copy() from basetextoverlay
Fixes a per-buffer memory leak of the attribute list.
2013-02-07 23:06:57 +11:00
Wim Taymans
ef8e17f993 visualizer: improve allocation
Based on patch by Matthew Waters

Add private data
Add decide_allocation vmethod
Refactor bufferpool negotiation

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681719
2013-01-29 10:18:06 +01:00
yanghuolin
67a7b5a993 alsasink: don't use 100% CPU
The root cause is that alsa-lib is not thread safe for the same handle.
There are two threads in the gstreamer accessing alsa-lib not serilized.
The race condition happens when one thread holds the old framebuffer app_ptr
position in the kernel, another thread advances the framebuffer app_ptr.
when the former thread is scheduled to run again, it overwrites the app_ptr
to old value by copying from kernel.Thus,the app_ptr in the upper
alsa-lib(pcm_rate) become one period size more advanced than the lower
alsa-lib(pcm_hw & kernel).

gstreamer uses noblock and poll method to communicate with the alsa-lib.
The app_ptr unsync situation as described above makes the poll return immediately because
it concludes there is enough space for the ring-buffer via the low-level alsa-lib.
The write function returns immediately because it concludes there is not enough
space for the ring-buffer from the upper-level alsa-lib. Then the loop of poll
and write runs again and again until another period size is available for
ring-buffer.This leads to the cpu 100 problem.

delay_lock  is used to avoid the race condition.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=690937
2013-01-24 15:08:31 +01:00
Vincent Penquerc'h
658195e6de oggdemux: fix incorrect testing of invalid granpos values
Positive granulepos is valid, -1 granulepos is unset, and all
other negative granulepos are invalid.

Reported by Tim-Philipp Müller
2013-01-07 18:03:52 +00:00
Tim-Philipp Müller
76c0cca765 textoverlay: minor clean-up
Remove some macros that aren't needed any more.
2012-12-22 21:19:51 +00:00
Tim-Philipp Müller
df8e7f14a8 textoverlay: support shaded background for A420 format
https://bugzilla.gnome.org/show_bug.cgi?id=687817
2012-12-22 21:18:11 +00:00
Thijs Vermeir
dc9f19cbba vorbis: fix unused variable 2012-12-18 15:34:42 +01:00
Tim-Philipp Müller
df6031f7c6 alsasrc: return negative value on read error
Otherwise baseaudiosrc won't go into the error code path.

https://bugzilla.gnome.org/show_bug.cgi?id=690197
2012-12-17 20:50:33 +00:00
Tim-Philipp Müller
3d5a78e67a alsa: post error message when audio device disappears
Don't loop forever if an USB audio device gets disconnected
while in use. Post an error message instead. This is not
enough yet though, we still need to make the base class
and/or the ring buffer bail out.

https://bugzilla.gnome.org/show_bug.cgi?id=690197
2012-12-16 01:00:43 +00:00
Sebastian Dröge
d9b25afe71 ext: Fix some compilation errors caused by circular header includes 2012-12-12 17:22:31 +00:00
Tim-Philipp Müller
71e46b2478 gst_adapter_prev_timestamp -> gst_adapter_prev_pts
https://bugzilla.gnome.org/show_bug.cgi?id=675598
2012-11-14 00:03:15 +00:00
Sebastian Dröge
c09f503f72 Revert "vorbisdec: Fix GType name conflict if tremor and libvorbis decoder are used in the same process"
This reverts commit 858392f88a.

A similar, cleaner fix was already in place.
2012-11-13 16:11:42 +01:00
Sebastian Dröge
858392f88a vorbisdec: Fix GType name conflict if tremor and libvorbis decoder are used in the same process 2012-11-13 15:41:34 +01:00
Tim-Philipp Müller
ba255fbac6 textoverlay: implement background shading for IYU1
https://bugzilla.gnome.org/show_bug.cgi?id=687817
2012-11-07 13:59:53 +00:00
Tim-Philipp Müller
bd578c1dd4 textoverlay: also draw shaded backgrounds for RGB and BGR
https://bugzilla.gnome.org/show_bug.cgi?id=687817
2012-11-07 13:25:13 +00:00