Commit graph

1689 commits

Author SHA1 Message Date
Thiago Santos
d1c74779f9 oggmux: Use running time instead of timestamps
Theora and vorbis use running time (which is correct) for calculating
the granulepos for their ogg packets. Oggmux, however, used
timestamps to order the received buffers.

This patch makes it use the running time to compare buffer times
and also to timestamp pushed buffers.

Some bits of the code still use timestamps, but they are only
used to calculate durations, so it should be fine.

https://bugzilla.gnome.org/show_bug.cgi?id=643775
2011-04-01 10:56:16 +02:00
Thiago Santos
c3aae3dc17 oggmux: Keep track of pad's segments
https://bugzilla.gnome.org/show_bug.cgi?id=643775
2011-04-01 10:56:15 +02:00
Sebastian Dröge
026776ca23 textoverlay: Add support for xBGR and RGBx
Now all RGB variants are supported.
2011-04-01 10:39:31 +02:00
Lane Brooks
200ee96338 textoverlay: Added support for ARGB and other RGB alpha variants 2011-04-01 10:36:36 +02:00
Lane Brooks
e2150b11ff textoverlay: converted AYUV to use 'A OVER B' alpha compositing
'A OVER B' compositing is explained at
http://en.wikipedia.org/wiki/Alpha_compositing.

Previously, overlaying text on a transparent background image left the
text overlay also transparent. This pipeline shows such an example:

gst-launch videotestsrc pattern=white ! video/x-raw-yuv,format=\(fourcc\)AYUV ! alpha alpha=0.0 ! textoverlay text=Testing auto-resize=False font-desc=60px ! videomixer ! ffmpegcolorspace ! autovideosink

With this patch, text is composited "OVER" the background image and
thus is visible regardless of the alpha of the background image. The
overlay in the above pipeline works after applying this patch.
2011-04-01 10:35:08 +02:00
Tim-Philipp Müller
5aa02968c9 oggparse: fix list iteration code
Not that it really matters, but let's fix it before someone
notices and makes fun of us.
2011-03-26 19:38:17 +00:00
Tim-Philipp Müller
a7a305a18f oggparse: make sure buffer metadata is writable before setting caps on buffers 2011-03-26 11:59:54 +00:00
Mart Raudsepp
093a91eec8 textoverlay: Clean up alignment docs a bit and remove horiz top alignment enum 2011-03-16 15:03:51 +00:00
Blaise Gassend
185a8ddcaa alsamixer: Store return values of poll functions in a signed integer
Negative return values are used for errors and storing
them in an unsigned integer will make it impossible to
detect the errors.

Fixes bug #644845.
2011-03-15 19:48:21 +01:00
Sebastian Dröge
a38fd9f9ec oggmux: Increase the seen header packets count when seeing a header packet
This fixes muxing of Speex content and possibly other formats where the
header detection works by counting the packets.

Fixes bug #644745.
2011-03-14 19:44:41 +01:00
Stefan Kost
9ac74c59db textoverlay: use a class wide mutex to work around pango reentrance issues
Pango is not reentrant. Use a class wide mutex to protect pange use in
gst_text_overlay_render_pangocairo(). This works reliable in contrast to the
hack in my previous commit.

Fixes Bug #412678
2011-03-14 11:17:10 +02:00
Stefan Kost
3294ecda7d Revert "textoverlay: add a hack to init the pango engine"
This reverts commit fee3266056.
2011-03-14 11:17:10 +02:00
Stefan Kost
1d73ea887d textoverlay: drop trailing whitespaces 2011-03-14 10:43:42 +02:00
Stefan Kost
fee3266056 textoverlay: add a hack to init the pango engine
Layout a single char to pre-create all resources.
2011-03-14 10:43:42 +02:00
Sebastian Dröge
461d9f2f2c oggmux: Don't handle GstCollectData as GstObject, use the pad instead 2011-02-24 16:22:53 +01:00
Edward Hervey
3fe2777b54 Revert "oggmux,adder: Check if collectpads has been freed"
This reverts commit 6d150873e8.

Depends on a core commit that was reverted.
2011-02-21 12:04:09 +01:00
David Schleef
6d150873e8 oggmux,adder: Check if collectpads has been freed
Core now calls release_pad in finalize, which is usually after
the collectpads has been unreffed.
2011-02-20 23:49:54 -08:00
David Schleef
9745a41ea3 theoraenc: move debug category init earlier 2011-02-17 18:29:56 -08:00
David Schleef
15e23414d3 oggparse: better detection of delta unit flag 2011-02-17 18:29:56 -08:00
David Schleef
f499810bdc theoraenc: Set speed level while running 2011-02-17 18:29:56 -08:00
Ralph Giles
d467eb708a Set the theoraenc speed-level property from libtheora's defaults.
The speed-level property, which allows callers to trade of encoding
quality for speed in the libtheora api, has a version-dependent
maximum and default values. Instead of hardcoding the acceptable
range for the theoraenc element's presentation of this setting,
we query the library directly at class initialization time and
set the maximum and default values from that. If the query fails,
we fall back to the previous default setting.

To keep the values reported by gst-inspect (which I'm told use
the spec values from the class) with those available on an\
instantiated element, we remove to setting of enc->speed_level
from the initializer and instead pass G_PARAM_CONSTRUCT to
the property spec flags, asking g_object to set this property
when theoraenc objects are constructed.

NB in theory the maximum speed-level could depend on the actual
video caps. If later versions of libtheoraenc do this, a second
call will need to be made from theora_enc_reset to update the
property, since this function is mostly useful for realtime
adjustment of performance while the pipeline is running.
2011-02-17 18:29:56 -08:00
Sjoerd Simons
46f3e7c6fd theoraenc: Don't reset the video quality setting the bitrate
libtheora has two encoding modes, CBR, where it tries to hit a target
bitrate and VBR where it tries to achieve a target quality.

Internally if the target bitrate is set to anything other then 0 the
encoding-mode is CBR.

This means that the gstreamer element can leave the video_quality
setting alone as long as the user is tweaking the bitrate. Which has the
nice side-effect that if the user explicitely sets the bitrate to 0
(which is actually the default), the quality value doesn't get reset and
one ends up encoding VBR at quality-level 0...
2011-02-14 16:03:56 +01:00
Vincent Penquerc'h
96a1a9dec6 oggmux: ensure serialnos are unique
We do that by checking a newly generated one is not already used in
an existing stream, and doing it again if it is.

https://bugzilla.gnome.org/show_bug.cgi?id=640211
2011-02-03 09:29:28 +00:00
Tim-Philipp Müller
54c19ba6de oggmux: free stream map caps when done 2011-02-02 17:34:42 +00:00
Tim-Philipp Müller
2eac43bd73 oggmux: keep IN_CAPS flag check for header buffers as fallback
In case the ogg mapper doesn't handle all the accepted input formats
(although it really should). Saves us error handling for that case
though. Also log caps properly.

https://bugzilla.gnome.org/show_bug.cgi?id=629196
2011-02-02 17:34:41 +00:00
Vincent Penquerc'h
440002a137 oggmux: use oggstream for less brittleness in recognizing headers
Using the IN_CAPS flag for this is brittle, and will fail if either
vorbisparse or vorbistag (which is itself based on vorbisparse) is
inserted between oggdemux and oggmux. Possibly other elements too
(eg, theoraparse, etc).
Using oggstream ensures we Get It Right More Often Than Not.

https://bugzilla.gnome.org/show_bug.cgi?id=629196
2011-02-02 17:34:41 +00:00
Vincent Penquerc'h
b7664eae71 oggmux: do not skip a pageno at start
Discontinuities are automatically signalled by oggdemux at the start
of a new stream. When oggmux is yet to output actual data pages,
do not signal these discontinuities in the ogg stream.

This patch may miss some actual discontinuities at the very start of
a stream, but avoids the spurious missing pages when encoding happens
normally.

A better fix might involve finding a way to distinguish between actual
data discontinuities and discontinuities merely marking the start of
a new stream.

Fixes an issue with ogg page numbering (would skip a number for no
reason, which then looks like a packet was lost somewhere) when
re-muxing an ogg stream, e.g. when re-tagging in rhythmbox.

https://bugzilla.gnome.org/show_bug.cgi?id=629196
2011-02-01 17:25:43 +00:00
Tim-Philipp Müller
9805bdfcc8 theoraenc: clean up property descriptions
Remove "This property requires libtheora version >= 1.1" qualifiers
from property descriptions. They aren't needed any longer now that
we require libtheora >= 1.1.
2011-02-01 16:08:13 +00:00
Vincent Penquerc'h
d144f7a3a5 oggmux: cleanup
Remove a pointless string concatentation, and fix an off-by-one in
packetno in a log.

https://bugzilla.gnome.org/show_bug.cgi?id=640189
2011-01-24 20:01:24 +01:00
Sreerenj Balachandran
7cfa18545c oggdemux: Remove dead code 2011-01-24 19:40:00 +01:00
Yang Xichuan
cb9607632f oggparse: Make gst_ogg_parse_submit_buffer() safe
By not passing zero-sized buffers to ogg_sync_buffer()
and checking the return values of libogg functions.

Fixes bug #639136.
2011-01-24 19:39:59 +01:00
Lane Brooks
876bf233fb textoverlay: Add support for vertical center alignment
Fixes bug #639159.
2011-01-24 19:39:59 +01:00
Yang Xichuan
43553b4dcb oggdemux: remove outdated comment
https://bugzilla.gnome.org/show_bug.cgi?id=639121
2011-01-10 12:34:54 +00:00
Tim-Philipp Müller
b6ae695174 textoverlay: make text property controllable too
Because we can, and because it's the most interesting one
to control really, after xpos/ypos.
2011-01-06 23:08:34 +00:00
Lane Brooks
e674178331 textoverlay: make some properties controllable
https://bugzilla.gnome.org/show_bug.cgi?id=638859
2011-01-06 23:02:23 +00:00
David Schleef
3c4466b816 oggdemux: ignore header pages when looking for keyframe
This was causing keyframe_granule to be set to 0 for all streams
when seeking to the beginning of the stream, i.e., at the
beginning of playback.  Fixes #619778.
2011-01-06 12:34:32 -08:00
Vincent Penquerc'h
b03b223fb1 oggstream: when the last keyframe position is not known, do not use -1
Instead, use either 0 or 1, depending on bitstream version, which give
the correct result for streams which aren't cut off at start.
This allows that function to not return negative granpos.

https://bugzilla.gnome.org/show_bug.cgi?id=638276
2011-01-06 12:34:32 -08:00
Tim-Philipp Müller
542256fd55 ogg: fix typo in comment 2010-12-29 11:51:42 +00:00
Vincent Penquerc'h
a5533c21d9 oggstream: fix interpretation of Theora granule position
The offset part of the granpos is not a sign of the newer encoding.
Use the version number instead.

This fixes the criticals thrown by theoraparse, and (at last) the
remaining part of #553244.
2010-12-29 12:40:25 +01:00
Wim Taymans
68e64770a0 oggdemux: handle pads that are not added yet
Don't try to stream data on pads that are not added yet. This happens while we
discover the different streams.
2010-12-28 19:39:18 +01:00
Vincent Penquerc'h
85cafac6af oggstream: implement tag extraction for Kate streams
This will mainly allow Totem to know the language of those streams,
so the subtitle selection menu gets properly filled out.

https://bugzilla.gnome.org/show_bug.cgi?id=638005
2010-12-27 10:53:24 +00:00
Vincent Penquerc'h
dd135119d9 oggdemux: set headers on caps
This will allow switching from one stream to another without having to send
the headers for the new stream again.

https://bugzilla.gnome.org/show_bug.cgi?id=637927
2010-12-25 16:55:15 +01:00
David Schleef
0c4820914c oggstream: Fix parsing of theora size 2010-12-22 15:30:36 -08:00
Vincent Penquerc'h
e443ae6000 oggdemux: Don't use gst_pad_alloc_buffer()
allocate buffers using gst_buffer_new_and_alloc() instead of
gst_pad_alloc_buffer_and_set_caps(), as the first one will
cause the pad to block, and we don't want that since that will
prevent subsequent pads from being fed if a block occurs at
start, when all pads must be fed for playback to start.

This fixes autoplugging of the tiger element and other things.

https://bugzilla.gnome.org/show_bug.cgi?id=637822
2010-12-22 20:19:15 +01:00
Wim Taymans
1dafd7136d vorbisdec: keep timestamps when no decoded output
Keep track of the timestamps even when we didn't generate decodable output.
2010-12-21 13:39:27 +01:00
Wim Taymans
eac243bc01 vorbisdec: avoid using invalid timestamps 2010-12-21 13:39:27 +01:00
Vincent Penquerc'h
22aa87e98f ogg: implement packet duration query for kate streams
https://bugzilla.gnome.org/show_bug.cgi?id=637519
2010-12-18 20:33:09 +01:00
Vincent Penquerc'h
270bac8158 timeoverlay: add missing break
https://bugzilla.gnome.org/show_bug.cgi?id=637377
2010-12-16 11:41:02 +01:00
Mark Nauwelaerts
524b7c60f2 oggstream: additional tag extraction
... supporting theora, flac, speex, celt.

Fixes #629349.
2010-12-03 13:54:08 +01:00
Mark Nauwelaerts
d5055a9f23 oggstream: use separate tag extraction vfunction 2010-12-03 13:54:06 +01:00
Mark Nauwelaerts
cc3dfd31d0 oggstream: refactor vorbis comment tag extraction 2010-12-03 13:54:04 +01:00
Mark Nauwelaerts
a4aacb9d2c oggdemux: plug some oggstream leaks 2010-12-03 13:54:01 +01:00
Mark Nauwelaerts
515f33bd3b oggstream: streamline tag extraction and prevent some leaks 2010-12-03 13:53:59 +01:00
Mark Nauwelaerts
63ba9eafb1 oggdemux: send stream tags after newsegment and global tags 2010-12-03 13:53:56 +01:00
Sreerenj Balachandran
2319c85f46 oggdemux: perform more (vorbis comment header) tag extractions
In particular, move comment header parsing to gstoggstrem.c.
Thanks to Felipe Contreras.

Fixes #629349 (partially).
2010-12-03 13:53:54 +01:00
David Schleef
d421ccb440 oggstream: fix incorrect warning on skeleton headers 2010-12-02 17:36:33 -08:00
David Schleef
2b91bd1bad oggparse: Set DELTA_UNIT on buffers 2010-12-02 17:36:26 -08:00
Sebastian Dröge
1abb8257a0 gnomevfssrc: Remove dead assignment 2010-12-02 19:04:29 +01:00
Wim Taymans
e0d683f3ed oggdemux: fix wrong flowreturn handling
Oggdemux will currently try to pad alloc a buffer from the peer when it is
reading the header files. This is a relic from the time where we had an internal
parser and needs to be removed at some point in time.

The problem is that when there is no peer pad yet (which is normal when
collecting headers) we should still continue to parse all the packets of a
page instead of erroring out on NOT_LINKED.

Fixes #632167
2010-10-29 11:48:18 +01:00
Wim Taymans
6c14f6c970 ogg: add some more debug statements 2010-10-29 11:47:53 +01:00
Stefan Kost
83c14483ed various: add a missing G_PARAM_STATIC_STRINGS flag to object properties 2010-10-13 16:13:31 +03:00
Wim Taymans
fea50233bb oggdemux: only keep last valid granulepos
Only keep the last valid granulepos we see when scanning the last
pages. It is possible that the last page that we inspect has a -1 granulepos, in
which case we want to keep the previous valid time instead.

Fixes #631703
2010-10-12 16:06:57 +02:00
David Schleef
9dc59cff15 oggdemux: Fix check for last page 2010-10-12 16:06:57 +02:00
David Schleef
64dfad46f2 oggdemux: change checks from is_skeleton to is_sparse 2010-10-12 16:06:57 +02:00
David Schleef
5ae2f04856 oggdemux: move is_sparse into stream map 2010-10-12 16:06:56 +02:00
Tim-Philipp Müller
a044b62cf5 theoradec: expose telemetry properties only if libtheora was compiled with --enable-telemetry
Since this is just a debugging feature and libtheora will usually not be
compiled with that option enabled, we should maybe just hide these properties,
since they won't work anyway, and avoid confusing warnings.

Also rename properties to make them less cryptic.

https://bugzilla.gnome.org/show_bug.cgi?id=628488
2010-10-10 18:20:46 +01:00
Alexey Fisher
ab52e15e3d theoradec: add properties to enable debugging telemetry overlay
The theora decoder can overlay debugging information on the output
video. This functionality is only available if libtheora has been
compiled with --enable-telemetry. For more details see:

http://people.xiph.org/~xiphmont/demo/theora/demo2.html

Based on original patch by Michael Smith <msmith at xiph org>

https://bugzilla.gnome.org/show_bug.cgi?id=628488
2010-10-10 18:20:46 +01:00
Guillaume Emont
b41cd04289 oggdemux: fix seeking with negative rate with skeleton
Files with a skeleton, or other files with a stream that ends before the end of
the chain would start playing from the end of the chain when trying to seek with
a negative rate at a position between the end of any stream and the end of the
chain.

This is due to the loop in _do_seek() assuming that pages will be encountered
for all streams shortly after the place where we want to seek, as found by
do_binary_search().

In the first iteration of the loop, stream ends are now checked against the
time of the current page.
2010-10-10 18:26:13 +02:00
Mark Nauwelaerts
53b0c20c7c vorbisdec: reverse playback; decode pending buffers upon EOS 2010-10-06 12:05:27 +02:00
Wim Taymans
7fe3657d86 libvisual: only drop frames that are really too old
Also take the frame duration into account so that we don't drop frames that are
partially past the estimated QoS time.
2010-10-05 12:22:39 +02:00
Wim Taymans
cc470dfb68 libvisual: add latency query
Add our own latency to the latency query reply from upstream.
2010-10-05 12:22:39 +02:00
Wim Taymans
0e395146c3 libvisual: add some defines
Add some defines for width/height/fps and a define for the minimum amount of
samples we need to buffer.
2010-10-05 12:22:39 +02:00
Wim Taymans
88cf7a2156 parse: Don't error on discont
We don't need to error out when we detect a discontinuity.
2010-10-04 17:27:00 +02:00
Wim Taymans
3d26fc3d8f theoraparse: set caps on streamheader too 2010-10-04 17:09:39 +02:00
David Schleef
71f89ac092 theoraenc: ptalarbvorm speed level goes to 3 2010-09-24 21:30:44 -07:00
Olivier Crête
91f89f490c theoraenc: Make the bitrate/quality dynamically modifiable
https://bugzilla.gnome.org/show_bug.cgi?id=630303
2010-09-22 11:41:13 -04:00
Tristan Matthews
a351bf0702 gnomevfsrc: set GST_PARAM_MUTABLE_READY flag on the "handle" property
Fixes #629672
2010-09-15 17:07:16 +03:00
Sebastian Dröge
ca24ece36b textoverlay: Add support for AYUV 2010-09-01 17:52:31 +02:00
Rob Clark
54f4aa28c2 textoverlay: fix Cb/Cr inversion for colored text overlays
In case of odd values for xpos or ypos, the division by two in CbCr
plane would result in an off-by-one error, which in the case of NV12,
NV21, or UYVY would cause inversion of blue and red colors.  (And
would be not so easily noticed for I420 as it would just cause the
chroma to be offset slightly from the luma.)

This patch also fixes a silly typo from the earlier patch which
added NV12 support that broke UYVY support.
2010-08-30 22:53:26 +02:00
Sebastian Dröge
6357bdef63 oggdemux: Don't reset the pad when pushing resulted in NOT_LINKED
The pad might be linked later and after resetting it it will
only work after resetting all of oggdemux.
2010-08-30 15:50:26 +02:00
Sebastian Dröge
b899bca94d oggdemux: Don't use GST_FLOW_IS_FATAL()
And while we're at it, handle WRONG_STATE as error too
in oggdemux and WRONG_STATE and NOT_LINKED in oggaviparse.
2010-08-27 17:23:46 +02:00
Sebastian Dröge
faebf174fb textoverlay: Support NV21 too and minor cleanups 2010-08-24 10:12:53 +02:00
Chris Shoemaker
6bd90dc0cc clockoverlay: only rerender text if time string has changed
The textoverlay element will rerender the text string whenever
overlay sets the 'need_render' flag to TRUE.  Previously, we
lazily set the flag to TRUE every time the time string was requested.
Now, we save a copy of the previously given string, and only set
'need_render' to TRUE if the string has changed.

In my tests with a 30fps video stream, and a time string including
a seconds field, this change reduced the CPU usage of the clockoverlay
element from 60% to 5%.

Fixes bug #627780.
2010-08-24 09:29:33 +02:00
Rob Clark
1b6918709c textoverlay: add NV12 support
Fixes bug #627768.
2010-08-24 09:25:55 +02:00
Wim Taymans
7b310c6a03 alsasrc/sink: add property to get the card name
fixes #627203
2010-08-18 16:45:37 +02:00
Wim Taymans
693919ff87 alsa: add method to retrieve the card name
Reuse an existing method to retrieve the card name.
2010-08-18 16:42:13 +02:00
Stefan Kost
0fee4ed3d0 alsa: remove 'dir' out variable
Alsa seems to expect that we initialize it. Remove the variable and pass NULL
as we actually don't use it. In alsasink also #ifdef one section that is
grabing diagnostics to be disabled, when logging is disabled (the code was
using the out parameter as well).

Fixes #626125
2010-08-12 15:41:59 +03:00
Mark Nauwelaerts
90a79b4c60 textoverlay: configurable text color and position
Rather than only left, right, top, etc, allow for horizontal and vertical
positioning on a scale from 0 to 1.
Also cater for configuring rendered text color.

Fixes #624920.

API: GstTextOverlay:xpos
API: GstTextOverlay:ypos
API: GstTextOverlay:color
2010-08-09 09:49:12 +02:00
Sebastian Dröge
5fd9fc13d5 oggstream: static forward declarations are forbidden by the C standard
...and actually cause compiler errors on VC++. Change it to an extern
forward declaration and non-static definition.
2010-08-08 17:42:04 +02:00
Sebastian Dröge
c95d0034af theoraenc: Implement two pass encoding
Fixes bug #621349.
2010-07-16 17:40:12 +02:00
Sebastian Dröge
5318e71b4d configure: Require libtheora >= 1.1
It's more than a year old at the time of the next -base release,
has many encoder and decoder improvements and gets us rid of a lot
of #ifdefs
2010-07-16 17:39:22 +02:00
Sebastian Dröge
ecea88e0d2 theora: Use PROP_ instead of ARG_ for property enum values 2010-07-16 17:39:22 +02:00
Fredrik Söderquist
3c06cabb0b oggdemux: Handle errors from _get_next_page in _do_seek.
If the source element failed here, oggdemux would crash.

Fixes #623218.
2010-06-30 17:20:55 +01:00
Sebastian Dröge
9a971980b7 oggdemux: activate_chain must not be called with a NULL chain
It will crash later and shouldn't really happen anyway unless
something is really wrong.
2010-06-14 11:11:56 +02:00
Sebastian Dröge
9c570dbced gnomevfssrc: Fix possible NULL pointer dereference
It's always an error if gst_buffer_try_new_and_alloc() returns NULL
2010-06-14 11:08:10 +02:00
Sebastian Dröge
a34fe5df35 giostreamsrc: Fix copy&paste error in the docs 2010-06-14 09:53:31 +02:00
Tim-Philipp Müller
0f3ea721e4 ogg: fix debug message printf format some more
Just cast the pointer diff, so it works everywhere without
warnings. Can't use %tu, because that modifier is C99. Warning
was: "format '%li' expects type 'long int', but argument 8 has
type 'int'".
2010-06-14 00:33:04 +01:00
Philippe Normand
c25bf9777a oggdemux: Fix format string compiler warning on OS X 2010-06-12 13:04:43 +02:00
Tim-Philipp Müller
dab38bb8a0 cdparanoia: check for cdparanoia with pkg-config first
cdparanoia now has a .pc file in post-0.10.2 SVN, so use
that to check for cdparanoia before we try all the other
checks. Besides being generally nicer, this may help with
correctly detecting cdparanoia on OSX some day (see #609918).
2010-06-11 22:16:26 +01:00
Sebastian Dröge
4caee01a06 oggdemux: Handle SEEKING query in push mode too 2010-06-09 17:02:59 +02:00