Commit graph

294 commits

Author SHA1 Message Date
Mathieu Duponchelle
3d780c5c6d videomixer: Check if the pad needs reconfiguration in collected
https://bugzilla.gnome.org/show_bug.cgi?id=709384
2013-10-04 10:53:26 +02:00
Tim-Philipp Müller
7a76595b22 videomixer: link to libm for maths stuff
Fixes undefined references to rint and pow on ubuntu
build bot.
2013-09-17 22:02:04 +01:00
Sebastian Dröge
d646a34681 videomixer: Update orc generated files
https://bugzilla.gnome.org/show_bug.cgi?id=708131
2013-09-16 11:03:06 +02:00
Thibault Saunier
9f4a8ccdf4 videomixer: Do not check if caps are empty when they are NULL
In the case the caps are actually NULL, we should just concider it the
same way as empty caps in that case.
2013-09-11 14:33:31 -03:00
Seán de Búrca
268058eb37 videomixer: fix build if orc is not installed
https://bugzilla.gnome.org/show_bug.cgi?id=707886
2013-09-11 00:17:44 +01:00
Mathieu Duponchelle
8db40a8c7f videomixer: Add colorspace conversion
https://bugzilla.gnome.org/show_bug.cgi?id=704950
2013-09-10 10:37:23 +02:00
Mathieu Duponchelle
707e39fe7a videomixer: Don't send reconfigure event when formats or PAR are different
It is racy with multiple pads.

https://bugzilla.gnome.org/show_bug.cgi?id=704950
2013-09-10 10:36:48 +02:00
Mathieu Duponchelle
8db3648544 videomixer: Bundle private copies of videoconvert code
Ideally, this would be part of libgstvideo.
Prefixes videoconvert symbols with videomixer_.

https://bugzilla.gnome.org/show_bug.cgi?id=704950
2013-09-10 10:36:30 +02:00
Mathieu Duponchelle
b68f419b6f videomixer: Don't set EOS to FALSE when the collectpad *is* EOS
https://bugzilla.gnome.org/show_bug.cgi?id=707238
2013-09-04 11:09:04 +02:00
Mathieu Duponchelle
5d21f8f2e3 videomixer: don't send flush_stop twice.
If we get flush start and a seek we need to only send flush_stop once.

More info at #706441
2013-08-23 20:17:11 -04:00
Thibault Saunier
e47ffb203b videomixer: Do not send flush_stop ourself after a flush_start
When we receive a flush_start, we should wait for the next flush_stop
and foward it, not create a flush_stop ourself.
2013-08-17 11:40:27 +02:00
Thibault Saunier
6c349d6ec3 videomixer: Send EOS if buf_end >= segment.stop
That means the whole segment is already played, and we are sure we
are EOS at that point.

Also handle segment seeks, and do not send EOS in that case.
2013-08-11 19:05:18 +02:00
Thibault Saunier
c5fa4666b7 videomixer: Make sure to send EOS if the buffer end time equals the segment end time
Otherwize EOS never gets sent in that particular case.
2013-08-06 12:21:33 +02:00
Mathieu Duponchelle
d67a671bfb videomixer: use gst_util_uint64_scale*_round.
There could be a case where:
      1) you do a new set_caps after buffers have been processed.
      2) ts_offset gets set to a different value, eg 0.033333333
      3) your pads get EOS, but the check dor that doesn't work
         because you use ts_offset + a truncated value < segment.stop
      4) so in the next collected, you end up comparing for example:
      0.9999999999 > 1., which is false and means you don't send EOS.

Also adds scale_round in two other places where it potentially could
have caused problems.
2013-07-21 19:21:57 -04:00
Sebastian Dröge
3d0988f46f videomixer: Fix handling of buffers without a duration
We'll have to pop buffer from collectpads and store it
internally only to get the timestamp of the next buffer.
If we continue to keep it in collectpads, no new buffer
to calculate the end time will ever arrive.

https://bugzilla.gnome.org/show_bug.cgi?id=703743
2013-07-09 12:42:17 +02:00
Sebastian Dröge
9e9d2ce098 videomixer: Fix negotiation with 0/1 framerates
https://bugzilla.gnome.org/show_bug.cgi?id=703743
2013-07-09 11:53:28 +02:00
Sebastian Dröge
01cc493944 Revert "videomixer: When all sinkpads are eos, update output segment stop and forward it"
This reverts commit 2d3910fc79.

It's not solving any problem and instead causes code to fall apart.

https://bugzilla.gnome.org/show_bug.cgi?id=701519
2013-06-12 18:25:59 +02:00
Mathieu Duponchelle
6e23f1fec4 videomixer: check last end_time after conversion to running segment
The last end_time was saved after conversion, so the comparison
had to be made after conversion for it to make sense.

https://bugzilla.gnome.org/show_bug.cgi?id=701385
2013-06-11 21:03:35 +02:00
Mathieu Duponchelle
4243714301 videomixer: add mix->segment.start to output_end_time
When the segment start is not 0, this created a situation where
the output_end_time is inferior to output_start_time, and the duration
of the next buffer ended up underflowing.

https://bugzilla.gnome.org/show_bug.cgi?id=701385
2013-06-11 21:03:03 +02:00
Sebastian Dröge
048866f1b1 Release 1.1.1 2013-06-05 18:31:40 +02:00
Sebastian Dröge
e2e1d1a158 videomixer: Add FIXME comment about the DURATION query from adder
Currently the code just takes with maximum upstream duration, which
is wrong. It should be the maximum upstream duration in running time.
2013-05-30 23:56:38 +02:00
Mathieu Duponchelle
5223868caa videomixer: Set a reference to mix->current_caps as the QUERY_CAPS result. 2013-05-30 15:36:48 -04:00
Nicolas Dufresne
cd30a81ee3 videomixer: Maintain z-order when new pad are added
https://bugzilla.gnome.org/show_bug.cgi?id=701109
2013-05-27 22:43:25 -04:00
Thibault Saunier
7a3df1ab31 videomixer: Always handle flush_stop_pending atomically
It is not protected with the COLLECT_PADS_STREAM_LOCK anymore
2013-05-25 12:20:08 -04:00
Thibault Saunier
608bd3e2db videomixer: Do not take COLLECT_PADS_STREAM_LOCK when unnecessary
Collectpad takes the lock itself when receiving serialized events
and we should not take it for not serialized ones
2013-05-25 11:03:31 -04:00
Nicolas Dufresne
d8c5e31657 videomixer: Don't hold stream-lock while pushing non-serialized events
https://bugzilla.gnome.org/show_bug.cgi?id=700868
2013-05-23 09:20:04 -04:00
Nicolas Dufresne
a7e0f251ca videomixer: Don't hold object lock while sending events
https://bugzilla.gnome.org/show_bug.cgi?id=700868
2013-05-23 09:20:04 -04:00
Thibault Saunier
18ef4f18d0 videomixer: Send a reconfigure event upstream if sinkpad caps are not usable
https://bugzilla.gnome.org/show_bug.cgi?id=684237
2013-05-21 12:15:36 -04:00
Mathieu Duponchelle
2d3910fc79 videomixer: When all sinkpads are eos, update output segment stop and forward it
https://bugzilla.gnome.org/show_bug.cgi?id=699793
2013-05-20 21:06:56 +02:00
Mathieu Duponchelle
521c9a7b5d videomixer: Don't reset the output segment on flush stop
Only init it when getting from READY to PAUSED, and change it on seek events.

https://bugzilla.gnome.org/show_bug.cgi?id=699793
2013-05-20 21:03:03 +02:00
Thibault Saunier
86b106091c videomixer: Send caps event from the streaming thread
This way we avoid races in caps negotiation and we make sure
that the caps are sent after stream-start.

https://bugzilla.gnome.org/show_bug.cgi?id=684237
2013-05-19 09:28:04 -04:00
Thibault Saunier
718f9004d0 videomixer: Do not send flush_stop when receiving a seek
There is no reason to send a flush-stop when receiving a seek event.
In the case of a flushing seek, we could eventually want to, but in
the code path were we check if the seek is "flushing", we have the
following comment that makes sense:

"we can't send FLUSH_STOP here since upstream could start pushing data
after we unlock mix->collect.
We set flush_stop_pending to TRUE instead and send FLUSH_STOP after
forwarding the seek upstream or from gst_videomixer_collected,
whichever happens first."

https://bugzilla.gnome.org/show_bug.cgi?id=684237
2013-05-19 09:28:04 -04:00
Thibault Saunier
85b6852deb videomixer2: Protect flush_stop_pending with the collectpad stream lock
And make sure to expect a flush-stop after a flush-start

https://bugzilla.gnome.org/show_bug.cgi?id=684237
2013-05-19 09:28:04 -04:00
Sebastian Dröge
3110b7cc31 Revert "videomixer2: Take into account new segments"
This reverts commit 84ae670ab4.

Actually this is not how it is supposed to work. videomixer
creates a [0,-1] segment and then puts frames of the different
streams there based on their running times in their own segments.
2013-05-09 16:26:19 +02:00
Mathieu Duponchelle
84ae670ab4 videomixer2: Take into account new segments
Also forward the event downstream on the next opportunity.

https://bugzilla.gnome.org/show_bug.cgi?id=699793
2013-05-09 16:18:54 +02:00
Sebastian Dröge
1588cda9a1 videomixer2: Send stream-start before caps event
https://bugzilla.gnome.org/show_bug.cgi?id=699895
2013-05-08 16:02:46 +02:00
Mathieu Duponchelle
6b153ce385 videomixer: send stream-start event. 2013-04-25 16:09:34 -03:00
Olivier Crête
24bb263d54 videomixer: Don't unref query, we don't own it
Fixes double-unref bug. Bug found by Youness Alaoui
2013-04-16 19:29:48 -04:00
Sebastian Dröge
b0b0557c48 gst: Add better support for static plugins 2013-04-15 15:54:11 +02:00
Tim 'mithro' Ansell
3a5d17e852 videomixer2: avoid caps leak
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=693307
2013-02-07 11:40:35 +01:00
Matthew Waters
b9151a9c28 videomixer: fix eos timestamp check
fixes hang in videotestsrc num-buffers=20 ! videomixer ! fakesink

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=692935
2013-01-31 16:45:38 +01:00
Tim-Philipp Müller
230cf41cc9 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:07:18 +00:00
Douglas Bagnall
0b898ab911 videoconvert: Compare y offset with height, not width, when testing for overlap
This could have prevented images showing that should have when the
source height is greater than its width.

When width exceeds height, as is common, it probably only caused a
miniscule amount of unnecessary work.  I haven't tested.
2012-11-02 09:29:30 +01:00
Douglas Bagnall
e3c77ba709 videomixer: get height via GST_VIDEO_FRAME_HEIGHT, not _WIDTH
https://bugzilla.gnome.org/show_bug.cgi?id=687330
2012-11-01 13:03:44 +00:00
Youness Alaoui
13328bc129 videomixer2: Fix race condition where a src setcaps is ignored
If both pads receive data at the same time, they will both get their
sink_setcaps called which will call the src_setcaps, but there is
a race condition where the second one might not be called.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=683842
2012-10-19 12:10:31 +02:00
Tim-Philipp Müller
f5e0321dfc videomixer: clear video frame more correctly
Make sure not to touch memory that doesn't belong to
our frame, we might be one part of a side-by-side 3D
frame, or in a picture-in-picture scenario.
2012-09-26 09:28:59 +01:00
Tim-Philipp Müller
626e0258e3 videomixer: fix warnings when using transparent background
gst_video_frame_map() increases the refcount, which makes
the buffer not writable any more technically, so calling
gst_buffer_memset() on it will cause nasty warnings.

Unit test disabled because it very rarely (for me)
fails, possibly negotiation-related.

https://bugzilla.gnome.org/show_bug.cgi?id=684398
2012-09-25 23:31:34 +01:00
Edward Hervey
ac9394de29 videomixer: Fix leak 2012-09-25 14:18:35 +02:00
Mark Nauwelaerts
eda9c8b3cf videomixer: init videoinfo
... to prevent random bogus caps fields.
2012-09-18 12:15:17 +02:00
Mark Nauwelaerts
8c28a60eee videomixer: chain up to collectpads query function 2012-09-18 12:15:17 +02:00
Nicolas Dufresne
76da367ecd videomixer: Don't let GstCollectPad shadow custom sink pad query func
In the current implementation, the custom pad query function is not called.
This patch, set that query function on the GstCollectPads to avoid this
shadowing.

See https://bugzilla.gnome.org/show_bug.cgi?id=684237
2012-09-18 12:14:43 +02:00
Stefan Sauer
f874922e1c collectpads: remove gst_collect_pads_add_pad_full
Rename gst_collect_pads_add_pad_full() to gst_collect_pads_add_pad() and fix all
invocations.
2012-09-12 21:05:44 +02:00
Youness Alaoui
c3d619be67 videomixer2: Adding nv12 and nv21 support
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=683841
2012-09-12 10:46:22 +02:00
Tim-Philipp Müller
e4cb67fad8 docs: gst-launch-0.11 -> gst-launch-1.0 2012-08-27 21:20:29 +01:00
Michael Rubinstein
6ea5d31456 videomixer: fix endianness check on systems where non-glib endianness defines are not set
On Windows LITTLE_ENDIAN without the G_ in was not defined,  so the
test comes out wrong.
2012-08-24 19:45:11 +01:00
Sebastian Dröge
6f74b2afb7 gst: Set alignment at the correct place of GstAllocationParams 2012-08-08 17:41:31 +02:00
Tim-Philipp Müller
0e6b66a2a0 gst: update disted orc files 2012-08-08 15:10:37 +01:00
Wim Taymans
f44808338f videomixer: prefix orc functions with video_mixer_orc_ 2012-07-24 09:17:09 +02:00
Stefan Sauer
ea17c457f9 childproxy: update api use 2012-06-11 18:24:20 +02:00
Tim-Philipp Müller
2d249dcc29 videomixer: change sink pad template name from sink_%d to sink_%u 2012-05-01 18:58:03 +01:00
Mark Nauwelaerts
67e168aef4 collectpads2: rename to collectpads 2012-04-17 15:14:27 +02:00
Mark Nauwelaerts
04b4d30f2c misc: chain up to collectpads event handler 2012-04-16 16:37:49 +02:00
Sebastian Dröge
4784e83938 Release 0.11.90 2012-04-12 10:27:31 +02:00
Tim-Philipp Müller
e09ae5736d Use new gst_element_class_set_static_metadata() 2012-04-10 00:51:41 +01:00
Sebastian Dröge
aa2cd462da gst: Update for GST_PLUGIN_DEFINE() API changes 2012-04-05 17:36:38 +02:00
Sebastian Dröge
5cdd49bf25 gst: Update versioning 2012-04-04 14:37:47 +02:00
Wim Taymans
068ee88862 update for child proxy api change 2012-03-31 15:43:49 +02:00
Wim Taymans
ecaea36c3d update for memory api changes 2012-03-15 13:36:17 +01:00
Wim Taymans
a32d944a38 fix for caps api changes 2012-03-11 19:06:37 +01:00
Wim Taymans
9095f455d5 videomixer2: remove pad event function
We use the one from collectpads
2012-01-26 19:49:14 +01:00
Wim Taymans
33ae3fe047 videomixer: more fixes 2012-01-26 18:51:30 +01:00
Wim Taymans
85a96b3703 videomixer: make videomixer work somewhat 2012-01-26 18:43:06 +01:00
Wim Taymans
df260a2ec6 videomixer: port to 0.11
It builds and gst-inspect-0.11 works.. otherwise untested
2012-01-26 18:16:58 +01:00
Sebastian Dröge
d45d3ac721 videomixer2: Update for the new collectpads2 event handling API 2012-01-26 10:44:28 +01:00
Wim Taymans
8331bd7e10 videomixer: some more porting 2012-01-25 18:40:03 +01:00
Wim Taymans
3f1bccbb17 videomixer: port blend function 2012-01-25 18:02:13 +01:00
Wim Taymans
1584806634 port to new gthread API 2012-01-19 11:33:53 +01:00
Sebastian Dröge
93e3ed5a86 Merge branch 'master' into 0.11
Conflicts:
	ext/cairo/gsttextoverlay.c
	ext/pulse/pulseaudiosink.c
	gst/audioparsers/gstaacparse.c
	gst/avi/gstavimux.c
	gst/flv/gstflvmux.c
	gst/interleave/interleave.c
	gst/isomp4/gstqtmux.c
	gst/matroska/matroska-demux.c
	gst/matroska/matroska-mux.c
	gst/matroska/matroska-mux.h
	gst/matroska/matroska-read-common.c
	gst/multifile/gstmultifilesink.c
	gst/multipart/multipartmux.c
	gst/shapewipe/gstshapewipe.c
	gst/smpte/gstsmpte.c
	gst/udp/gstmultiudpsink.c
	gst/videobox/gstvideobox.c
	gst/videocrop/gstaspectratiocrop.c
	gst/videomixer/videomixer.c
	gst/videomixer/videomixer2.c
	gst/wavparse/gstwavparse.c
	po/ja.po
	po/lv.po
	po/sr.po
	tests/check/Makefile.am
	tests/check/elements/qtmux.c
	tests/check/elements/rgvolume.c
2012-01-10 14:32:32 +01:00
Sebastian Dröge
4cdacf4ca9 videomixer: Remove videomixer and register videomixer2 as videomixer 2012-01-09 14:53:27 +01:00
Wim Taymans
47a1da9076 GST_FLOW_UNEXPECTED -> GST_FLOW_EOS 2012-01-04 10:01:48 +01:00
Tim-Philipp Müller
b8b8454bcb Suppress deprecation warnings in selected files, for g_static_rec_mutex_* mostly
GStaticRecMutex is part of our API/ABI, not much we can do here
in 0.10 for most of these.
2011-12-12 09:46:27 +00:00
Tim-Philipp Müller
66f6e12888 Work around deprecated thread API in glib master
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We'll change these
over to the new API once we depend on glib >= 2.32.
2011-12-12 09:46:27 +00:00
Vincent Penquerc'h
c0e101e93f various: fix pad template leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
2011-11-28 13:30:27 +00:00
Stefan Sauer
8643d1caaf collectpads: port API changes 2011-11-17 08:44:45 +01:00
Stefan Sauer
fb162c8eb4 controller: port to new controller location and api 2011-11-04 20:15:48 +01:00
Wim Taymans
a95acb7122 make %u in all request pad templates 2011-11-04 11:58:22 +01:00
Sebastian Dröge
c603bf9891 videomixer2: Use the clip function instead of the prepare_buffer function 2011-10-28 10:40:36 +02:00
Sebastian Dröge
ae07ebedc9 videomixer2: Use collectpads2 from core 2011-10-28 09:36:17 +02:00
Arun Raghavan
cc7aeb3f33 videomixer2: Fix a leak
Buffers weren't being unref'ed in one case inside, causing memory usage
to blow up.
2011-10-14 13:10:49 +05:30
Arun Raghavan
4d3ee9005c videomixer2: Fix incorrect gst_buffer_replace() call
This got exposed when gst_buffer_replace() was changed from a macro to a
function.
2011-10-13 16:59:50 +05:30
Tim-Philipp Müller
9be707d54d gst: update disted orc backup code 2011-04-16 18:49:27 +01:00
Robert Swain
e757793b21 videomixer: Fix argb/rgba overlay orc code
Remove some redundant operations (convubw) and use the correct variable,
t2, in the orc_overlay_bgra function.
2011-04-16 13:00:49 +01:00
Robert Swain
fd6ac6aa8a videomixer: address unused but set variables
GCC 4.6.x spits warnings about variables that are set but unused. Such
variables have been removed in blend, collectpads2 and videomixer2.
2011-04-16 12:52:49 +01:00
Thibault Saunier
b541208b77 android: Make it ready for androgenizer
Remove the android/ top dir
Fixe the Makefile.am to be androgenized

To build gstreamer for android we are now using androgenizer which generates the needed Android.mk files.
Androgenizer can be found here: http://git.collabora.co.uk/?p=user/derek/androgenizer.git
2011-04-11 01:20:11 +02:00
Alessandro Decina
30ce2680dc videomixer: update orc dist files 2011-04-04 17:39:04 +02:00
Sebastian Dröge
ce66aea7b0 videomixer[2]: Use orc_memset() instead of memset() 2011-04-01 11:35:26 +02:00
Lane Brooks
ef5ac986f1 videomixer: Add transparent background option for alpha channel formats 2011-04-01 11:35:26 +02:00
Lane Brooks
69b5aedc58 videomixer2: Add transparent background option for alpha channel formats
This option allows the videomixer2 element to output a valid alpha
channel when the inputs contain a valid alpha channel. This allows
mixing to occur in multiple stages serially.

The following pipeline shows an example of such a pipeline:

gst-launch videotestsrc background-color=0x000000 pattern=ball ! video/x-raw-yuv,format=\(fourcc\)AYUV ! videomixer2 background=transparent name=mix1 ! videomixer2 name=mix2 ! ffmpegcolorspace ! autovideosink  videotestsrc ! video/x-raw-yuv,format=\(fourcc\)AYUV ! mix2.

The first videotestsrc in this pipeline creates a moving ball on a
transparent background. It is then passed to the first videomixer2.
Previously, this videomixer2 would have forced the alpha channel to
1.0 and given a background of checker, black, or white to the
stream. With this patch, however, you can now specify the background
as transparent, and the alpha channel of the input will be
preserved. This allows for further mixing downstream, as is shown in
the above pipeline where the a second videomixer2 is used to mix in a
background of an smpte videotestsrc. So the result is a ball hovering
over the smpte test source. This could, of course, have been
accomplished with a single mixer element, but staged mixing is useful
when it is not convenient to mix all video at once (e.g. a pipeline
where a foreground and background bin exist and are mixed at the final
output, but the foreground bin needs an internal mixer to create
transitions between clips).

Fixes bug #639994.
2011-04-01 11:35:26 +02:00
Edward Hervey
6e1c701502 Revert "Check that collectpads exists before removing pad"
This reverts commit 8e6b876e76.

Depends on a core commit that was reverted
2011-02-21 12:25:19 +01:00
David Schleef
8e6b876e76 Check that collectpads exists before removing pad
The core now calls release pad from finalize, at which point
the collectpads might have already been freed.
2011-02-20 23:46:01 -08:00