Commit graph

1566 commits

Author SHA1 Message Date
Vivia Nikolaidou
8d8384f20a videometa: Added video time code meta
It attaches a GstVideoTimeCodeMeta (SMPTE timecode) as metadata to a buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=766419
2016-08-04 18:59:48 +03:00
Vivia Nikolaidou
ab35d7394e videotimecode: Added support for SMPTE time code metadata
Can be attached as GstMeta into a video frame.

https://bugzilla.gnome.org/show_bug.cgi?id=766419
2016-08-04 18:59:40 +03:00
Xabier Rodriguez Calvar
9f594d1562 videoorientation: Use G_DEFINE_INTERFACE instead of a manually written get_type()
https://bugzilla.gnome.org/show_bug.cgi?id=768687
2016-07-12 09:05:32 +03:00
Sebastian Dröge
02a88077fc video: Fix some compiler warnings for out-of-range enum values
https://bugzilla.gnome.org/show_bug.cgi?id=767816
2016-07-12 00:14:13 +03:00
Nirbheek Chauhan
9b7d248982 Fix various gboolean vs GstFlowReturn problems
Caught by building with MSVC which gave warnings for these
2016-07-11 15:02:06 +01:00
Wim Taymans
9144a787df video-converter: fix compilation on big-endian 2016-07-07 17:29:34 +02:00
Edward Hervey
cfc36ba586 videodecoder: More trickmode fix
We need to take into account the input segment flags to know whether
we should drain the decoder after a new keyframe in trick mode.

Otherwise we would have to wait for the next frame to be outputted (and
the segment to be activated) which ... well ... kind of beats the whole
point of this draining :)
2016-07-07 17:12:31 +02:00
Sebastian Dröge
08f993d090 Release 1.9.1 2016-07-06 13:06:06 +03:00
Philippe Normand
6338146c06 videodecoder: Take stream lock one time only on drain
When the drain is triggered from the chain function the lock is already
taken so there is no need to take it one more time.

https://bugzilla.gnome.org/show_bug.cgi?id=767641
2016-07-05 19:38:40 +03:00
Sebastian Dröge
e18a9d9b5f videodecoder: fix criticals fixating a non existent field
https://bugzilla.gnome.org/show_bug.cgi?id=766970
2016-07-04 11:16:55 +02:00
Sebastian Dröge
66342c5c86 videodecoder: Use the object lock to protect bytes/time tracking
And especially don't use the stream lock for that, as otherwise non-serialized
queries (CONVERT) will cause the stream lock to be taken and easily causes the
application to deadlock.

https://bugzilla.gnome.org/show_bug.cgi?id=768361
2016-07-04 10:55:07 +02:00
Sebastian Dröge
3cabd3fe55 videoencoder: Use the object lock to protect bytes/time tracking 2016-07-04 10:52:24 +02:00
Sebastian Dröge
d8111778bd videoencoder/decoder: Move conversion utility functions to a common header and use consistently in encoder/decoder 2016-07-04 10:47:36 +02:00
Wim Taymans
5e752f4eda video-converter: fix interlaced scaling some more
Fix problem with the line cache where it would forget the first line in
the cache in some cases.
Keep as much backlog as we have taps. This generally works better and we
could do even better by calculating the overlap in all taps.
Allocated enough lines for the line cache.
Use only half the number of taps for the interlaced lines because we
only have half the number of lines.
The pixel shift should be relative to the new output pixel size so scale
it.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=767921
2016-06-22 16:21:13 +02:00
Víctor Manuel Jáquez Leal
8b8708f946 videodecoder: handle buffer's flags at offset
For reverse playback it is important to handle correctly the frame sync
points, which is set when the input buffer doesn't have the DELTA_UNIT flag.

This is handled correctly when decoder is packetized, but when it is not the
frame's sync point is not copied, and the reverse playback never decodes frame
batches.

The current patch adds the buffer's flags to the Timestamp list, where the
timestamp and duration of the input buffers are hold.
2016-06-09 19:13:46 +03:00
Víctor Manuel Jáquez Leal
75906f53d1 videodecoder: squash two message logs into one
There were two consecutive log messages in gst_video_decoder_decode_frame().
Given the information they provide, it is more efficient to squash them into a
single one.
2016-06-09 19:08:08 +03:00
Víctor Manuel Jáquez Leal
779e739142 videodecoder: playback rate is in input_segment
The playback rate is hold in the input_segment member variable, not in the
output_segment, and the parse_gather list was never filled because of that.

This patch changes the comparison with input_segment.
2016-06-09 19:05:41 +03:00
Sebastian Dröge
0bd3f2352c videodecoder: Use input segment rate instead of output segment rate to decide whether the drain on keyframes
The output segment is only set up after data is output, which might be far in
the future for reverse playback. Also we are here interested in the state at
the current *input* frame (which is the keyframe), not any possible output.
2016-06-09 19:02:49 +03:00
Sebastian Dröge
0c7022d681 videodecoder: Only drain in KEY_UNITS trick mode after a keyframe in forwards playback mode
For reverse playback the same behaviour was already implemented in
flush_parse().

For reverse playback, chain_forward() is only used to gather frames and not
for decoding, and it is actually called by the draining logic, causing an
infinite recursion.
2016-06-09 18:57:49 +03:00
Edward Hervey
8bee96c4a2 videodecoder: Don't push late frames
While it's a bit tricky to discard frames *before* decoding (because
we might not be sure which data is needed or not by the decoder), we
can discard them after decoding if they are too late anyway.

Any following basetransform based element or similar would drop the frame too.
2016-06-09 17:21:45 +03:00
Edward Hervey
5bef865f9f videodecoder: Avoid recursive drain/flush calls
_chain_forward() can also be called with reverse playback. Blindly
calling drain_out() on DISCONT buffers would end up in a recursive
call.
2016-06-07 10:31:59 +02:00
Edward Hervey
183e94b2d3 videodecoder: Drain out keyframes in TRICK_MODE_KEY_UNITS
When asked to just decode keyframe, if we got a keyframe drain out
the decoder straight away.
This avoids having to wait for the next frame and reduces delay even
more.

https://bugzilla.gnome.org/show_bug.cgi?id=767232
2016-06-07 09:50:08 +02:00
Edward Hervey
eb1ebf226f videodecoder: Drain decoder on DISCONT buffers
This ensures the decoder is properly drained out when receiving a
DISCONT buffer. The optimal way of doing this would have been to
receive a GAP event before hand but it is not always possible.

Fixes big delays with some decoders (ex gst-libav) that will not
drain out data when only decoding keyframes.

https://bugzilla.gnome.org/show_bug.cgi?id=767232
2016-06-07 09:49:56 +02:00
Guillaume Desmottes
f2c0e89021 gst-libs: gl, video: use MAY_BE_LEAKED flag
https://bugzilla.gnome.org/show_bug.cgi?id=767162
2016-06-03 00:59:12 +01:00
Stian Selnes
1335ccd228 video-color: Fix colorimetry IS_UNKNOWN
Fix issue with colorimetry default indicies not being in sync with the
actual table causing IS_UNKNOWN() to sometimes fail.

https://bugzilla.gnome.org/show_bug.cgi?id=767163
2016-06-02 17:14:50 +01:00
Edward Hervey
fb21fc3af1 videodecoder: Make sure the DISCONT flag is set on the outgoing buffer
The base class was setting the DISCONT flag before checking whether the buffer
would be in segment or not.

Fix issues with DISCONT flags not being properly propagated downstream when
decoders buffers were out of segment.

https://bugzilla.gnome.org/show_bug.cgi?id=766800
2016-06-02 10:50:58 +03:00
Joan Pau Beltran
abb88801e7 video: add IYU2 format
This existed in 0.10 and is needed by dc1394src.

IYU2 format is a YUV fully-sampled packed format similar to v308
but with different component order (U-Y-V instead of Y-U-V).

http://www.fourcc.org/yuv.php#IYU2

https://bugzilla.gnome.org/show_bug.cgi?id=763026#c5
2016-06-01 12:07:05 +01:00
Tim-Philipp Müller
d52a74f32e g-i: pass compiler env to g-ir-scanner
It's what introspection.mak does as well. Should
fix spurious build failures on gnome-continuous.
2016-05-24 00:44:21 +01:00
Olivier Crête
0934af6cce videoaggregator: Don't wait if input buffer is after output
If the input buffer is after the end of the output buffer, then waiting
for more data won't help. We will never get an input buffer for this point.

This fixes compositing of streams from rtspsrc.

https://bugzilla.gnome.org/show_bug.cgi?id=766422
2016-05-20 10:58:46 -04:00
Guillaume Desmottes
8fc42f12f0 videosink: ensure the debug category is always initialized
gst_video_sink_center_rect() can be called without a GstVideoSink
having been instantiated so we can't relly on the video sink
class_init function to init the category.

Fix a warning when running:
GST_CHECKS=test_video_center_rect GST_DEBUG=6 G_DEBUG=fatal_warnings make libs/video.check-norepeat

https://bugzilla.gnome.org/show_bug.cgi?id=766510
2016-05-18 19:44:52 +01:00
Tim-Philipp Müller
b89a47ed66 videoaggregator: canonicalise function names
Had to be done at some point:
gst_videoaggregator_* -> gst_video_aggregator_*
Also fix up some function names with typos.
2016-05-16 12:27:50 +01:00
Matthew Waters
1e3f5e0ecf video/affinetransformationmeta: define the coordinate space used
Based on the expected output from the already existing usage by androidmedia
and the opengl plugins.

https://bugzilla.gnome.org/show_bug.cgi?id=764667
2016-05-15 10:53:55 +03:00
Sebastian Dröge
5be3c5f6b2 videodecoder/encoder: Correct GST_IS_*CODER_CLASS macros
They are currently not used, but would result in a compiler error due to wrong
variable name usage.

https://bugzilla.gnome.org/show_bug.cgi?id=766203
2016-05-10 10:01:12 +03:00
Wim Taymans
a12f51c3de video-converter: add more fastpaths for I420 -> RGB
Use the I420->BGRA and a new I420->ARGB to speed up any I420 to RGB
operation.
2016-04-22 15:30:19 +02:00
Thiago Santos
14c9e37fdd videoaggregator: plug caps leak
It was losing ref of the original 'ret' caps that would be returned
or returning it with 2 references to it.
2016-04-18 13:46:55 -03:00
Thiago Santos
cf6a36721b videoaggregator: properly handle interlace-mode restrictions
videoaggregator can't handle interlace-mode changes so it must
always restrict itself to the first interlacing mode it receives.

Tests included

https://bugzilla.gnome.org/show_bug.cgi?id=754495
2016-04-18 13:46:48 -03:00
Sebastian Dröge
a82ef8983e videometa: Initialize all fields of all metas with default values
The metas are not allocated with all fields initialized to zeroes.

https://bugzilla.gnome.org/show_bug.cgi?id=764902
2016-04-13 10:10:51 +03:00
Arjen Veenhuizen
c5ed98a35b videometa: Explicitly initialize GstVideoCropMeta on init
It is not allocated with all fields initialized to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=764902
2016-04-13 10:10:46 +03:00
Matthew Waters
92245ec05f videoaggregator: repect the result of find_best_format in the default update_caps
We weren't using the result of find_best_format at all.

Also, move the find_best_format usage to the default update_caps() to make
sure that it is also overridable.

https://bugzilla.gnome.org/show_bug.cgi?id=764363
2016-04-07 20:30:25 +10:00
Víctor Manuel Jáquez Leal
b4a695cd11 libs: video: split allocation query caos and pad caps
Since the allocation query caps contains memory size and the pad's caps
contains the display size, a video encoder or decoder might need to allocate
a different frame size than the size negotiated in the caps.

This patch splits this logic distinction for videodecoder and videoencoder.

The user if needs a different allocation caps, should set the allocation_caps
in the GstVideoCodecState before calling negotiate() vmethod. Otherwise the
allocation_caps will be the same as the caps set in the src pad.

https://bugzilla.gnome.org/show_bug.cgi?id=764421
2016-04-05 11:32:50 +02:00
Tim-Philipp Müller
9e311960cd video: fix example code in gst_video_frame_map() docs
GST_VIDEO_FRAME_PLANE_PSTRIDE() does not exist.

https://bugzilla.gnome.org/show_bug.cgi?id=764414
2016-04-02 15:19:44 +01:00
Nicolas Dufresne
a7809ecc8f video-format: Fix macro documentation
The parameter type was wrongly documenting that a GstVideoInfo structure
pointer was needed, while it needs a GstVideoFormatInfo structure
pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=764414
2016-03-31 13:32:32 -04:00
Scott D Phillips
079ceb894c video: add P010 format support
P010 is a YUV420 format with an interleaved U-V plane and 2-bytes per
component with the the color value stored in the 10 most significant
bits.

https://bugzilla.gnome.org/show_bug.cgi?id=761607
---
Changes since v2:
- Set bits=16 in DPTH10_10_10_HI
Changes since v1:
- Fixed x-offset calculation in uv.
- Added 6-bit shifts to FormatInfo.
2016-03-29 11:16:42 +03:00
Tim-Philipp Müller
b424712644 video: update disted orc backup file
https://bugzilla.gnome.org/show_bug.cgi?id=761851
2016-02-27 00:13:03 +00:00
Göran Jönsson
babcf4d30c video-converter: add direct UYVY to GRAY8 conversion function
https://bugzilla.gnome.org/show_bug.cgi?id=761851
2016-02-26 23:56:51 +00:00
Tim-Philipp Müller
c64dae3e1d video: flesh out docs for gst_video_frame_map() 2016-02-25 17:46:31 +00:00
Thiago Santos
86d21e9455 videoaggregator: fix caps queries to allow proper renegotiation
When caps are already negotiated it should be possible to
select formats other than the one that was negotiated. If downstream
allows alpha video caps and it has already negotiated to a non-alpha
format, caps queries should still return the alpha caps as a possible
format as caps renegotiation can happen.

Includes tests (for compositor) to check that caps queries done after
a caps has been negotiated returns complete results

https://bugzilla.gnome.org/show_bug.cgi?id=757610
2016-02-25 11:43:43 -03:00
Tim-Philipp Müller
a62c7bd54c Fix use of undeclared core debug category symbols
libgstreamer currently exports some debug category
symbols GST_CAT_*, but those are not declared in any
public headers.

Some plugins and libgstvideo just use GST_DEBUG_CATEGORY_EXTERN()
to declare and use those, but that's just not right at
all, and it won't work on Windows with MSVC. Instead look
up the categories via the API.
2016-02-20 11:31:43 +00:00
Tim-Philipp Müller
ddfe7a2808 win32: remove outdated build cruft
This hasn't been touched for generations, doesn't work,
and is just causing confusion. We also don't want to
maintain these files manually.
2016-02-20 10:05:17 +00:00
Stian Selnes
85f297d648 videoencoder: Fix leak when pre_push does not return OK
https://bugzilla.gnome.org/show_bug.cgi?id=761951
2016-02-13 10:09:45 -03:00
HoonHee Lee
dfa2f49523 audio/videodecoder: Minor cleanup of last commit
https://bugzilla.gnome.org/show_bug.cgi?id=761218
2016-01-28 13:21:49 +01:00
HoonHee Lee
15df3c812b audio/videodecoder: use gst_pad_peer_query_caps to make output caps
gst_pad_get_allowed_caps() will return NULL if the srcpad has no peer.
In that case, use gst_pad_peer_query_caps() with template caps as filter
to have negotiated output caps properly before forwarding GAP event.

https://bugzilla.gnome.org/show_bug.cgi?id=761218
2016-01-28 11:34:22 +01:00
Matthew Waters
f1323fb6df videoaggregator: don't do caps processing that is not overridable
Allows the subclass to completely override the chosen src caps.

This is needed as videoaggregator generally has no idea exactly
what operation is being performed.

- Adds a fixate_caps vfunc for fixation
- Merges gst_video_aggregator_update_converters() into
  gst_videoaggregator_update_src_caps() as we need some of its info
  for proper caps handling.
- Pass the downstream caps to the update_caps vfunc

https://bugzilla.gnome.org/show_bug.cgi?id=756207
2016-01-27 20:36:25 +11:00
Aurélien Zanelli
43db5e5ebd video-format: fix GstVideoFormatInfo documentation warnings
Add missing ':' to tile_ws and tile_hs fields documentation to avoid
bad render of these two fields, mark reserved bytes as private to hide
field and avoid gtkdoc warning and add parameters description to
documented macro to avoid gtkdoc warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=761132
2016-01-26 14:48:19 -05:00
Wim Taymans
c99caa6b37 video-color: add Adobe RGB primaries and transfer function 2016-01-21 10:45:40 +01:00
Wim Taymans
773e2476e6 video-info: enfore RGB matrix for RGB formats
In gst_video_info_to_caps(), make sure we end up with an RGB matrix for
RGB formats and warn when the GstVideoInfo colorimetry is wrong.
In gst_video_info_from_caps(), fix the GstVideoInfo with an RGB matrix
for RGB formats and warn about inconsistent caps.

See https://bugzilla.gnome.org/show_bug.cgi?id=759624
2016-01-20 10:19:34 +01:00
Wim Taymans
83fe1c7705 video-converter: ignore matrix for RGB formats
For RGB formats, the matrix in the colorimetry (conversion from YUV to
RGB) is irrelevant and we should ignore it and assume the identity
transform for everything we do.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=759624
2016-01-20 10:02:20 +01:00
Thibault Saunier
1bf18f6f44 videoencoder: Deprecate GST_VIDEO_ENCODER_FLOW_DROPPED
It was never actually supported or used

https://bugzilla.gnome.org/show_bug.cgi?id=760666
2016-01-20 09:51:09 +02:00
Thibault Saunier
7d35a07f1a Revert "videoencoder: Release video frame when ->handle return ERROR or DROPPED"
This reverts commit 63517d0ed3.

It was wrong ref counting wise and we decided to deprecated DROPPED
return value

https://bugzilla.gnome.org/show_bug.cgi?id=760666
2016-01-20 09:50:17 +02:00
Thibault Saunier
63517d0ed3 videoencoder: Release video frame when ->handle return ERROR or DROPPED
https://bugzilla.gnome.org/show_bug.cgi?id=760666
2016-01-16 08:53:35 +01:00
Sebastian Dröge
0da2709d0c audio/video: Use G_GNUC_INTERNAL for internal functions 2016-01-08 17:50:50 +02:00
Aurélien Zanelli
c119715e25 videopool: store videoinfo after choosing the biggest buffer size
Otherwise, pool could be negotiated with a size which will be different
from the one used in allocation which is the GstVideoInfo.

https://bugzilla.gnome.org/show_bug.cgi?id=760222
2016-01-06 11:29:42 -05:00
Tim-Philipp Müller
7ffd9ce291 docs: remove dummy function declarations with G_INLINE_FUNCTION for gtk-doc
gtk-doc can handle static inline functions just fine these days,
there's no need for this stuff any more.
2016-01-03 17:21:18 +00:00
Reynaldo H. Verdejo Pinochet
e61f5b2138 videoblend: special case 1x1 src dims on increment computation
Fix crash with 1x1 overlay pixmap

https://bugzilla.gnome.org/show_bug.cgi?id=757290
2015-12-28 14:16:41 -08:00
Sebastian Dröge
3ba59f0b62 videoaffinetransformmeta: Add (transfer none) annotation for return value 2015-12-26 09:43:51 +01:00
Xavier Claessens
429860e51f base: Add g_autoptr() support to all types
https://bugzilla.gnome.org/show_bug.cgi?id=754464
2015-12-14 13:39:43 -05:00
Julien Isorce
4f396ae61c videodecoder: add some debug around pool negotiation
It lets us know easily which pool is activated or
inactivated during the negotiation.

https://bugzilla.gnome.org/show_bug.cgi?id=720597
2015-12-11 14:55:46 +00:00
Song Bing
a476145797 video/convertframe: Add crop meta support via videocrop
https://bugzilla.gnome.org/show_bug.cgi?id=759329
2015-12-11 16:14:59 +02:00
Edward Hervey
d34aaf9e9b videodecoder: Avoid pushing buffers before segment start
In the case where the stream doesn't have a framerate set and the frames
don't have a duration set, we still want to use the clipping path to
make sure we don't push buffers outside of the segment.

The problem was the previous iteration was setting a duration of 2s, which
meant that any buffer which was less than 2s before the segment start would
end up getting pushed.

Instead, use a saner 40ms (25fps single frame duration) to figure out whether
the frame could be within the segment or not
2015-12-03 16:42:50 +01:00
Reynaldo H. Verdejo Pinochet
4ed7b0a0e6 Drop usage of deprecated g-ir-scanner --strip-prefix flag 2015-12-02 20:19:43 -08:00
Matthew Waters
0b98ed32ce videometa: add GstVideoAffineTransformationMeta
Adds a simple 4x4 affine transformations meta for passing arbitrary
transformations on buffers.

Based on patch by Matthieu Bouron

https://bugzilla.gnome.org/show_bug.cgi?id=731791
2015-11-11 00:19:25 +11:00
Arnaud Vrac
dfe250d17d video: blend using OVER operation
Also support all premultiplied/non-premultiplied source/destination
configurations

https://bugzilla.gnome.org/show_bug.cgi?id=681447
2015-11-04 21:58:32 +01:00
Luis de Bethencourt
227f1d1e0f videodecoder: Print GstClockTimeDiff as a signed integer in debug logs 2015-11-03 13:44:39 +00:00
Luis de Bethencourt
73977da3f9 videoaggregator: use GST_STIME_ARGS for GstClockTimeDiff
No need to manually handle negative values of diff, GST_STIME_ARGS does
exactly this.
2015-11-02 17:00:22 +00:00
Luis de Bethencourt
b81b3f07ec videodecoder: subtract time difference with GST_CLOCK_DIFF
To ensure the subtraction of two GstClockTime values (which are guint64)
can be negative. Use GST_CLOCK_DIFF which returns a gint64.

CID 1338049
2015-11-02 12:09:45 +00:00
Sebastian Dröge
1da79c76a7 videodecoder: Print another time difference as a signed integer instead of a huge unsigned one 2015-10-29 16:52:49 +02:00
Sebastian Dröge
f17758d9e3 videodecoder: Print GstClockTimeDiff as a signed integer in debug logs 2015-10-29 16:01:26 +02:00
Pavel Bludov
8051434c03 video: overlay-composition: fix rectangle and composition cast macros
Closing parenthesis was missing in two cases.

https://bugzilla.gnome.org/show_bug.cgi?id=756893
2015-10-22 09:24:01 +01:00
Sebastian Dröge
df0d5aa4d5 video: Add out annotations to the out parameters of gst_video_calculate_display_ratio()
https://bugzilla.gnome.org/show_bug.cgi?id=754567
2015-10-17 20:37:22 +03:00
Tim-Philipp Müller
b66af464df videoaggregator: fix compilation with older glib version
Remove weird use of private gtype defines and fix compilation
with older glib versions such as 2.36.

https://bugzilla.gnome.org/show_bug.cgi?id=755754
2015-09-29 14:40:26 +01:00
Sebastian Dröge
e49c492a53 Release 1.6.0 2015-09-25 23:15:20 +02:00
Sebastian Dröge
8239da2311 video-dither: Use saturated add when adding ordered dither for > 8 bit targets
Otherwise our 16 bit integers are going to overflow in intermediate
calculations, causing video to become mostly black.

https://bugzilla.gnome.org/show_bug.cgi?id=755392
2015-09-24 23:01:58 +02:00
Sebastian Dröge
1fb85733f5 video-frame: Fix gst_video_frame_copy() for formats with pstride==0
v210, UYVP and IYU1 are complex formats for which pixel stride does not really
have a meaning. If we copy width*pstride bytes per line, it's not going to do
the right thing. As a fallback, copy stride bytes per line. This might copy
uninitialized bytes at the end of each line, but at least copies the frame.

https://bugzilla.gnome.org/show_bug.cgi?id=755392
2015-09-24 17:39:43 +02:00
Tim-Philipp Müller
8b96b52a62 videopool: ensure allocation alignment is consistent with video alignment requirements
Make sure GstAllocationParams alignment is not less than
any alignment requirement specified via GstVideoAlignment.

https://bugzilla.gnome.org/show_bug.cgi?id=754120
2015-09-15 10:20:37 +01:00
Sebastian Dröge
895e71e810 videoaggregator: Fix mixup of running times and segment positions
We have to queue buffers based on their running time, not based on
the segment position.

Also return running time from GstAggregator::get_next_time() instead of
a segment position, as required by the API.

Also only update the segment position after we pushed a buffer, otherwise
we're going to push down a segment event with the next position already.

https://bugzilla.gnome.org/show_bug.cgi?id=753196
2015-09-14 19:56:43 +02:00
Thiago Santos
ac503aee7d videoaggregator: fix caps query to properly handle alpha formats
Only accept alpha if downstream has alpha as well. It could
theoretically accept alpha unconditionally if blending is
properly implemented for handle it but at the moment this
is a missing feature.

Improves the caps query by also comparing with the template
caps to filter by what the subclass supports.

https://bugzilla.gnome.org/show_bug.cgi?id=754465
2015-09-11 18:03:26 -03:00
Thiago Santos
df931fb0b8 video-format: add missing alpha flag for some formats
Some formats didn't have the alpha flag marked, use the correct
macro so they get it right.

https://bugzilla.gnome.org/show_bug.cgi?id=754808
2015-09-10 07:28:21 -03:00
Tim-Philipp Müller
86a1092e59 video: improve GstVideoFormatUnpack docs
https://bugzilla.gnome.org/show_bug.cgi?id=754650
2015-09-07 00:19:09 +01:00
Kouhei Sutou
3e41e784be libs: Fix build error on MinGW where "%ll" is not available
"ll" isn't available on MinGW. We can use G_GINT64_MODIFIER for portable
64bit size data modifier.

https://bugzilla.gnome.org/show_bug.cgi?id=754630
2015-09-06 18:32:16 +03:00
Thiago Santos
4eea087f68 videoaggregator: lift restriction of changing pixel-aspect-ratio
The videoaggregator can convert PAR, there is no reason for
restricting it.

https://bugzilla.gnome.org/show_bug.cgi?id=754291
2015-09-03 11:18:22 -03:00
Ben Browitt
708936de49 videoaggregator: Always set the pad's buffer_vinfo when storing a buffer
Otherwise it might be unset, and then the buffer is used and
gst_video_frame_map() will crash because of invalid video-info.

https://bugzilla.gnome.org/show_bug.cgi?id=753805
2015-08-20 14:22:49 +03:00
Sebastian Dröge
64301f1005 video(en|de)coder: Return TRUE when we consumed a tag event without creating a new event
Fixes spurious flow errors that especially break gst-validate.
2015-08-18 16:28:42 +03:00
Tim-Philipp Müller
c21a972421 videoencoder: fix tag handling
Merge upstream tags with encoder tags and update whenever
any of those changes.

https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-18 12:44:04 +01:00
Tim-Philipp Müller
30b7cc6670 videodecoder: fix tag handling
Before we just merged everything in pretty much random ways
ad-hoc instead of keeping state properly. In 0.10 that was
how it worked, but in 1.x the tag events sent should always
reflect the latest state and replace any previous tags.

So save the upstream (stream) tags, and save the tags set
by the decoder subclass with merge mode, and then update
the merged tags whenever either of those two changes.

This slightly changes the behaviour of gst_video_decoder_merge_tags()
in case it is called multiple times, since now any call replaces
the previously-set tags. However, it leads to much more predictable
outcomes, and also we are not aware of any subclass which sets this
multiple times and expects all the tags set to be merged.

If more complex tag merging scenarios are required, we'll have
to add a new vfunc for that or the subclass has to intercept
the upstream tags itself and send merged tags itself.

https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-16 18:23:07 +01:00
Thiago Santos
c63db0e104 Revert "videodecoder: expose default query handling function"
Apparently I forgot how gobject works, there is no need to expose
it directly as one can call it from the parent_class pointer

This reverts commit ea9b6a7e3c.
2015-08-15 13:44:35 -03:00
Thiago Santos
4982188cf7 videodecoder: add option to use default pad accept-caps handling
Add gst_video_decoder_set_use_default_pad_acceptcaps() to allow
subclasses to make videodecoder use the default pad acceptcaps
handling instead of resorting to the caps query that is, usually,
less efficient and unecessary

API: gst_video_decoder_set_use_default_pad_acceptcaps
2015-08-15 13:44:34 -03:00
Thiago Santos
ea9b6a7e3c videodecoder: expose default query handling function
Subclasses can use it to select what queries they want to handle
and forward the rest to the default handling function.

API: gst_video_decoder_sink_query_default

https://bugzilla.gnome.org/show_bug.cgi?id=753623
2015-08-14 13:41:58 -03:00
Thiago Santos
d259a233a5 videoencoder: remove empty line to make g-i-scanner happy
gstvideoencoder.h:228: Warning: GstVideo: "@transform_meta"
parameter unexpected at this location:
 * @transform_meta: Optional. Transform the metadata on ...
2015-08-10 10:40:19 -03:00
Thiago Santos
a1c3276159 videodecoder: documentation cleanup
Remove some whitespace and break lines longer than 80 columns
2015-08-10 10:40:07 -03:00
Thiago Santos
e59d1308cc videodecoder: push pending events before gap
Push all pending events before pushing the gap. This ensures the
segment is pushed before the gap so it can be properly translated
to the running time

Includes unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=753360
2015-08-10 00:21:37 -03:00
Olivier Crête
db0a5ece02 videoaggregator: Remove broken _clip vfunc
It never does anything.

https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-07-30 14:00:05 -04:00
Sebastian Dröge
bd66c6b665 aggregator: Add property to select how to decide on a start time
Before aggregator based elements always started at running time 0,
now it's possible to select the first input buffer running time or
explicitly set a start-time value.

https://bugzilla.gnome.org/show_bug.cgi?id=749966
2015-07-29 14:35:50 +01:00
Wim Taymans
14083178b8 video: improve logging
Add logging categories for most video objects.
Remove some useless debug lines in video-info and videotestsrc.
Add a performance debug line in the video scaler.
2015-07-15 12:47:42 +02:00
Nicolas Dufresne
8be88f0364 doc/build: Fix doc typos
This minor update should workaround a build system bug. While the
makefile has been updated to generate more enum type, there is nothing
that updates the header and would lead to the generated code to be
produced again. This minor doc fix should ensure no one get a build with
missing symbols.
2015-07-09 10:47:20 -04:00
Hyunjun Ko
9dc463346e video/audio meta: transform_func: return FALSE if not supported or failed
https://bugzilla.gnome.org/show_bug.cgi?id=751778
2015-07-07 16:41:23 +03:00
Sebastian Dröge
a1f8fb32cb video: Add some more GTypes for enums 2015-07-07 14:32:56 +03:00
Tobias Mueller
190c7f1928 GstVideoScaler: Initialised scaling functions to get rid of compiler messages
E.g.

video-scaler.c: In function 'gst_video_scaler_horizontal':
video-scaler.c:1332:3: error: 'func' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   func (scale, src, dest, dest_offset, width, n_elems);
   ^

video-scaler.c: In function 'gst_video_scaler_vertical':
video-scaler.c:1373:3: error: 'func' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   func (scale, src_lines, dest, dest_offset, width, n_elems);
   ^

GCC's analyses seem to be correct, for the simple fact that if you pass
get_functions a known format, but no hscale or vscale, it'll return
True without having done anything.
Some callers check for the scale values to be not NULL, but then
hscale->resampler.max_taps could return 0.
A different approach to the one presented in this patch is to check
for those max_taps, too, before calling get_functions.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=752051
2015-07-07 13:06:34 +02:00
Thibault Saunier
df274deb0b videoaggregator: Remove pixel-aspect-ratio field from the caps returned by getcaps
Avoiding not negotiated error while negotiating as we anyway force 1/1
as output
2015-07-06 18:53:38 +02:00
Sebastian Dröge
b495dfa5e6 {audio,video}info: Add GST_TYPE_{AUDIO,VIDEO}_INFO macros 2015-07-06 12:53:15 +03:00
Marcin Kolny
95fa0c58a2 video-info: implement GstVideoInfo as boxed type
GstVideoInfo usually is created on the stack, but boxed type can be useful
for bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=752011
2015-07-06 12:52:51 +03:00
Stian Selnes
008a228865 videodecoder: Fix setting default pixel-aspect-ratio
It's needed to check if pixel-aspect-ratio exists before fixating.
It does not exist if input caps is not set yet and allowed caps
does not contain pixel-aspect-ratio (e.g. when using GST_VIDEO_CAPS_MAKE)

https://bugzilla.gnome.org/show_bug.cgi?id=751932
2015-07-06 11:59:38 +03:00
Sebastian Dröge
f5eebb27a2 {audio,video}{en,de}oder: Also copy POOL metas and make sure to copy over metas when creating subbuffers
POOL meta just means that this specific instance of the meta is related to a
pool, a copy should be made when reasonable and the flag should just not be
set in the copy.
2015-07-01 10:58:07 +02:00
Sebastian Dröge
d2cc76b228 videodecoder: Add transform_meta() vfunc with default implementation
The default implementation copies all metadata without tags, and metadata
with only the video tag. Same behaviour as in GstVideoFilter.

This currently does not work if the ::parse() vfunc is implemented as all
metas are getting lost inside GstAdapter.

https://bugzilla.gnome.org/show_bug.cgi?id=742385
2015-06-30 10:40:09 +02:00
Sebastian Dröge
ceef2cc12d videoencoder: Add transform_meta() vfunc with default implementation
The default implementation copies all metadata without tags, and metadata
with only the video tag. Same behaviour as in GstVideoFilter.

https://bugzilla.gnome.org/show_bug.cgi?id=742385
2015-06-30 10:40:09 +02:00
Luis de Bethencourt
6e263cc5f6 videoscaler: remove check for below zero for unsigned value
CLAMP checks both if value is '< 0' and '> max'. Value will never be a negative
number since it is a division of an unsigned integer (i). Removing that check
and only checking if it is bigger than max and setting it appropriately.

CID #1308950
2015-06-29 16:18:49 +01:00
Sebastian Dröge
4bb9548026 videofilter: Also copy metas if their API has no tags attached to it
This is the default basetransform behaviour, being more strict than that
is not really useful.
2015-06-29 13:05:54 +02:00
Mathieu Duponchelle
fc49a1b508 videoaggregator: simplifies and improves sink_get_caps.
The problem here was that after removing the formats and
all the things we could convert, we then intersected these
caps with the template caps.

Hence if a subclass offered permissive sink templates
(eg all the possible formats videoconvert handles), but only
one output format, then at negotiation time getcaps returned
caps with the format restricted to that format, even though
we do handle conversion.

https://bugzilla.gnome.org/show_bug.cgi?id=751255
2015-06-23 00:57:59 +02:00
Jan Schmidt
95cd8dc4f1 multiview: Add gst_video_multiview_guess_half_aspect()
Add a utility function that, given a video size and a
packed stereoscopic mode, attempts to guess if the video
is packed at half resolution per view or not, since
very few videos provide the information.
2015-06-19 02:05:37 +10:00
Wim Taymans
c0b0fd52f3 video-converter: make sure we draw enough border for YUY2 formats
Round width up to 2 so that we draw all border pixels for YUY2 formats
2015-06-17 17:09:46 +02:00
Wim Taymans
f4a5277340 video-scaler: fix scaling of odd width for YUY2 formats
We need to scale groups of 4 bytes for YUY2 formats so round up to 4.
It's possible that there is no Y byte for the last pixel so make sure
we clamp correctly.
2015-06-17 16:43:03 +02:00
Nicolas Dufresne
c101452a4a gi: Use INTROSPECTION_INIT for --add-init-section
This new define was added to common. The new init section fixed
compilation warning found in the init line that was spread across
all files.
2015-06-16 18:04:57 -04:00
Nicolas Dufresne
65b7b9954a gi: Skip Scaler, Chroma, Conveter, Dither constructor
Please box these types before removing the skip mark.
2015-06-16 16:08:39 -04:00
Nicolas Dufresne
3d594ad57f gi: Add (transfer none) for various video meta
These method chains gst_buffer_add_meta() which is also transfer
none.
2015-06-16 16:07:27 -04:00
Sebastian Dröge
723eba3760 videoaggregator: Print some debug output if we change the timestamp offset 2015-06-15 14:29:04 +02:00
Sebastian Dröge
8352e069ff videoaggregator: Add some more debug output 2015-06-15 14:25:43 +02:00
Sebastian Dröge
2f3735f3ec videoaggregator: Don't update the ts-offset before updating the actual configured caps 2015-06-15 14:19:05 +02:00
Sebastian Dröge
4f3adad607 videoaggregator: Remember if the last LATENCY query returned live or not and use the in the QoS messages 2015-06-15 14:18:39 +02:00
Mathieu Duponchelle
27ebae85f3 videoaggregator: No need to artificially bound the zorder.
It is an unsigned integer so the upper bound is G_MAXUINT.
2015-06-14 23:15:25 +02:00
Tim-Philipp Müller
5df6cc074f videoencoder: fix gtk-doc chunk for new function 2015-06-13 13:41:35 +01:00
Matej Knopp
dc7b254805 videoencoder: Add gst_video_encoder_set_min_pts()
For streams with reordered frames this can be used to ensure that there
is enough time to accomodate first DTS, which may be less than first PTS

https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-06-12 17:17:25 -04:00
Nirbheek Chauhan
86705fbbca videoaggregator: add "ignore-eos" property for input pads
When set, it causes videoaggregator to repeatedly aggregate the last buffer on
an EOS pad instead of skipping it and outputting silence. This is useful, for
instance, while playing back files seamless one after the other, to avoid
videoaggregator ever outputting silence (the checkerboard pattern).

It is to be noted that if all the pads on videoaggregator have this property set
on them, the mixer will never forward EOS downstream for obvious reasons. Hence,
at least one pad with 'ignore-eos' set to FALSE must send EOS to the mixer
before it will be forwarded downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=748946
2015-06-12 19:44:50 +01:00
Jan Schmidt
4b373d4c97 videodecoder: Copy multiview-mode, flags and view count from ref info
When copying info from the reference input state, duplicate
all the fields of the video info. The sub-class will have the
chance to override them later.
2015-06-13 01:36:45 +10:00
Wim Taymans
b31c805a56 video-scaler: enforce same taps when combining scalers 2015-06-12 16:58:10 +02:00
Wim Taymans
1fbbff491a video-scaler: make sure to clamp to max width
When estimating the area that should first be vertically scaled, make
sure we clamp to the max input size or else we get invalid reads.
2015-06-12 16:58:10 +02:00
Wim Taymans
f4f3894836 video-scaler: Enforce same taps on Y and UV scalers for merged formats
Make sure we have the same number of taps for the Y and UV scalers so
that the scalers can be merged correctly.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=749764
2015-06-12 16:58:10 +02:00
Jan Schmidt
7c1da700c4 video: Add multiview/stereo support
Add flags and enums to support multiview signalling in
GstVideoInfo and GstVideoFrame, and the caps serialisation and
deserialisation.

videoencoder: Copy multiview settings from reference input state

Add gst_video_multiview_* support API and GstVideoMultiviewMeta meta

https://bugzilla.gnome.org/show_bug.cgi?id=611157
2015-06-11 12:05:00 +10:00
Nicolas Dufresne
cb49acf158 video: Allow using bt2020 by name in colorimetry
As the lookup stops at the first element in the array with a NULL
name, bt2020 could not be used by name. Moving up this entry
fixes the issue.
2015-06-08 13:01:43 -04:00
Thiago Santos
71328df56f videoaggregator: simplify aggregate returning
Rework special handling with goto/labels to only have one case
and otherwise just return normally.
2015-06-08 12:35:25 -03:00
Thiago Santos
dd14495332 videoaggregator: refactor caps reconfigure to its own function
Makes the aggregation code shorter and easier to read
2015-06-08 12:34:23 -03:00
Thiago Santos
958c59f35f videoaggregator: fixing types in aggregate function
Correctly use boolean and GstFlowReturn types in the function.
2015-06-08 12:33:40 -03:00
Thiago Santos
34ffdbeee0 videoaggregator: use macro to access aggregator src pad
Makes code a bit more readable
2015-06-08 12:09:51 -03:00
Jan Schmidt
03aec73bd4 videoaggregator: Add class property to disable caps scaling
Add preserve_update_caps_result boolean on the class to allow
sub-classes to disable videoaggregator removing sizes and framerate
from the update_caps() return result.
2015-05-30 01:33:49 +10:00
Jan Schmidt
70bae08cdd videoaggregator: Catch errors, and allow sub-class to return NULL from get_output_buffer()
A return value of GST_FLOW_OK with a NULL buffer from get_output_buffer()
means the sub-class doesn't want to produce an output buffer, so
skip it.

If gst_videoaggregator_do_aggregate() generates an error, make sure
to propagate it - don't just ignore and discard the error by
over-writing it with the gst_pad_push() result.
2015-05-30 01:33:49 +10:00
Jan Schmidt
4882cb9f37 video-format: Fix minor docs typo 2015-05-30 01:11:47 +10:00
Jan Schmidt
d18aa5b741 video: Make gst_buffer_get_video_meta() a real function, Return lowest id
Instead of returning the first video meta found on a buffer, return the
one with the lowest id (which is usually the same thing, except on
multi-view buffers)
2015-05-30 01:11:47 +10:00
Stefan Sauer
b3c136eb4f docs: a random set of trivial fixes for the library docs
Warnings down to 35, unused symbols doen to 112.
2015-05-18 21:16:41 +02:00
Stefan Sauer
b364f5576d docs: a random set of trivial fixes for the library docs
All those where super straight forward from the warnings gtkdoc prints. It kind
of makes sense to apply them before the list of warnings is >100 and people
complain that gtkdoc is noisy.
2015-05-18 20:45:45 +02:00
Matthew Waters
b2eea8873c compositor: implement proper par handling
We were previously failing on different input and output par
2015-05-14 14:58:07 +10:00
Vivia Nikolaidou
c9cfd0196f video-converter: Change some implicit string enums to real enums
GST_VIDEO_CONVERTER_OPT_ALPHA_MODE, GST_VIDEO_CONVERTER_OPT_CHROMA_MODE,
GST_VIDEO_CONVERTER_OPT_MATRIX_MODE, GST_VIDEO_CONVERTER_OPT_GAMMA_MODE and
GST_VIDEO_CONVERTER_OPT_PRIMARIES_MODE were G_TYPE_STRING with only a few valid
options. Changed those to real enums.

https://bugzilla.gnome.org/show_bug.cgi?id=749104
2015-05-08 15:13:54 +02:00
Sebastian Dröge
f74524b58d videodecoder: Also negotiate with downstream if needed before handling a GAP event 2015-05-08 15:07:56 +02:00
Sebastian Dröge
21b5741251 videodecoder: Try to be smarter when clipping buffers without duration/framerate to the segment
2 second frame duration is rather unlikely... but if we don't clip
away buffers that far before the segment we can cause the pipeline to
lockup. This can happen if audio is properly clipped, and thus the
audio sink does not preroll yet but the video sink prerolls because
we already outputted a buffer here... and then queues run full.

In the worst case we will clip one buffer too many here now if no
framerate is given, no buffer duration is given and the actual
framerate is less than 0.5fps.

Fixes seeking on HLS/DASH streams, when seeking into the middle of
fragments and having no framerate/buffer duration.
2015-05-06 12:42:33 +02:00
Guillaume Desmottes
f90bb8140d navigation: fix structure leak if subclass doesn't implement send_event()
The send_event() implementation is supposed to consume @structure.

https://bugzilla.gnome.org/show_bug.cgi?id=748903
2015-05-05 13:54:08 -03:00
Aurélien Zanelli
c52adc8fcc video: add NV61 format support
https://bugzilla.gnome.org/show_bug.cgi?id=746466
2015-05-04 20:37:59 +01:00
Jan Schmidt
62bdb117ac video: check colorimetry and chroma_site equality in gst_video_info_is_equal()
Add VideoInfo accessors for colorimetry and chroma_site and use them
when checking the equality of two GstVideoInfo
2015-05-04 13:16:27 +10:00
Jan Schmidt
14fafc74a3 video-color: Add gst_video_colorimetry_is_equal()
Add a function for comparing the equality of 2 colorimetry
structures.
2015-05-04 13:16:27 +10:00
Ravi Kiran K N
955dc5258f video-converter: Remove unused macro
Remove unused macro GET_TMP_LINE

https://bugzilla.gnome.org/show_bug.cgi?id=748687
2015-04-30 20:24:32 +01:00
Tim-Philipp Müller
44e571c5e9 navigation: sprinkle some since markers and add new API to .def file
https://bugzilla.gnome.org/show_bug.cgi?id=747245
2015-04-29 15:30:26 +01:00
Edward Hervey
01e2a2152d video: Add a new "event" navigation message type
This will be useful for elements that wish to post unhandled navigation
events on the bus to give the application a chance to do something with
it

https://bugzilla.gnome.org/show_bug.cgi?id=747245
2015-04-29 15:47:49 +02:00
Wim Taymans
b3db5883e1 video-info: expose InterlaceMode conversion to/from string
Expose the methods used to convert a GstVideoInterlaceMode to and
from a string.
2015-04-28 12:01:02 +02:00
Tim-Philipp Müller
c680e324bc Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:42:34 +01:00
Ravi Kiran K N
0ff9b1e276 video-converter: n_lines member should be a guint not a boolean
https://bugzilla.gnome.org/show_bug.cgi?id=748348
2015-04-23 13:30:45 +01:00
Wim Taymans
0588c9a53f video-scaler: fix YUY2 scaling some more
Take into account the different steps between Y and UV when calculating
the line size for vertical resampling or else we might not resample
enough pixels and leave bad lines.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=747790
2015-04-21 13:31:44 +02:00
Wim Taymans
8f82ee70f9 video-scaler: scale enough pixels in YUY2 (and friends) mode
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=747790
2015-04-21 13:16:29 +02:00
Ravi Kiran K N
e78d44ac0b video-converter: Remove unused variables
Remove unused variables n_taps, max_taps in setup_scale()

https://bugzilla.gnome.org/show_bug.cgi?id=748021
2015-04-17 19:12:00 +01:00
Thiago Santos
befafccf35 video: add missing part of documentation text 2015-04-17 14:17:44 -03:00
Guillaume Desmottes
f5f632a503 videoaggregator: fix caps leak when early returning
https://bugzilla.gnome.org/show_bug.cgi?id=747993

Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2015-04-17 14:45:05 +01:00
Sebastian Dröge
6539d1da29 videodecoder: Break instead of return if default negotiation on GAP events fails
Otherwise we're going to leak the event.
2015-04-11 19:52:50 +02:00
Sebastian Dröge
f268f2be92 videodecoder: Try to invent default caps instead of setting none at all when getting a GAP event before CAPS
Otherwise we would forward the GAP event without ever providing any caps,
which then would make decodebin expose a srcpad without any caps set. That's
confusing for applications and can lead to all kinds of interesting bugs.

Instead do the same as already is done in GstAudioDecoder, and try to invent
caps based on the sinkpad caps and the caps allowed by downstream and the
srcpad template caps.

https://bugzilla.gnome.org/show_bug.cgi?id=747190
2015-04-08 20:49:39 -07:00
Sebastian Dröge
63c776adee videoaggregator: Remove broken timestamps-going-backwards check
This would've also triggered if for some reason the segment was updated
in such a way that PTS went backwards, but the running time increased. Like
what happens when non-flushing seeks are done.

We're doing a proper buffer-from-the-past check a few lines below based on the
running time, which is the only time we should care about here.
2015-04-08 19:31:43 -07:00
Sebastian Dröge
0c72d0acdf {audio,video}decoder: Forward SEGMENT_DONE events immediately and drain decoders
Otherwise we're going to wait with draining until the next data comes, which
is a bit suboptimal and might take a long time... or maybe never happens.
2015-04-06 19:20:51 -07:00
Vincent Penquerc'h
2954813b86 audio,video: use gst_segment_is_equal instead of memcmp
memcmp will blindly compare the reserved fields, as well as any
padding the compiler may choose to sprinkle in GstSegment.

Fixes valgrind complaints in unit tests, as well as some found via
https://bugzilla.gnome.org/show_bug.cgi?id=738216
2015-04-03 12:09:41 +01:00
Olivier Crête
26d3057d98 aggregator: Query latency on first incoming buffer.
And keep on querying upstream until we get a reply.

Also, the _get_latency_unlocked() method required being calld
with a private lock, so removed the _unlocked() variant from the API.
And it now returns GST_CLOCK_TIME_NONE when the element is not live as
we think that 0 upstream latency is possible.

https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-04-01 22:39:26 -04:00
Edward Hervey
3eb35c77cc introspection: Don't use g-ir-scanner cache at compile time
It pollutes user directories and we don't need to cache it

https://bugzilla.gnome.org/show_bug.cgi?id=747095
2015-03-31 11:21:43 +02:00
Song Bing
992101f82a videoencoder: Keep sticky events around when doing a soft reset
The current code will first discard all frames, and then tries to copy
all sticky events from the (now discarded) frames. Let's change the order.

https://bugzilla.gnome.org/show_bug.cgi?id=746865
2015-03-27 09:46:28 +01:00
Nirbheek Chauhan
af17a2cd4f videoaggregator: Check if there's a previous buffer to 'keep'
If we want to keep a previous buffer but there's no previous buffer, we actually
need more data instead.
2015-03-24 14:54:33 +01:00
Wim Taymans
9f0b9eeb58 video-convert: fix clamping for 16 bits alpha mult 2015-03-19 13:31:21 +01:00
Tim-Philipp Müller
5d456c7adc video-frame: fix height/width assertions
As commit 274984e8 states:
When doing CROP META it is expected that the width and/or height
in the GstVideoMeta is bigger or equal to the caps negotiated size.

https://bugzilla.gnome.org/show_bug.cgi?id=741030
2015-03-18 20:40:42 +00:00
Nicolas Dufresne
274984e83b video-frame: Relax width/height assertion
When doing CROP META it is exepcted that the width and/or height in the
GstVideoMeta is bigger or equal to the caps negotiated size.
2015-03-13 10:30:43 +00:00
Nicolas Dufresne
c5824f1b43 videopool: Choose the biggest buffer size
We should respect what has been negotiated.
2015-03-13 10:29:00 +00:00
Jan Schmidt
3d60fb654b docs: Add new video functions and objects. Cleanup a little.
Add GstVideoChroma, GstVideoDither, GstVideoScaler and friends to the docs.

Remove and clean up a few obsolete/deleted refs and typos
2015-03-13 01:08:25 +11:00
Nirbheek Chauhan
e387604d66 videoaggregator: While aggregating, sync values for all pads before converting frames 2015-03-12 09:47:50 +00:00
Wim Taymans
3cd2eb5847 video-converter: fix border handling of YUY2 and friends
Don't draw the border in groups of 4 pixels for YUY2 but instead in
groups of 2 with alternating U and V. This avoids a crash on odd width
borders.
2015-03-11 09:48:20 +01:00
Wim Taymans
757669481c video-converter: force yuv conversion for border
Make sure we always do yuv conversion for the border.
2015-03-11 09:47:23 +01:00
Wim Taymans
dd5fa311a1 video-format: fix A422 subsampling description 2015-03-10 17:29:51 +01:00
Wim Taymans
0d333d8d44 video-converter: add table based matrix8 implementation
Based on patch from Mozzhuhin Andrey <nopscmn at gmail.com>

Add a table based matrix8 multiplication implementation. The algorithm
does not do any clipping so we need to make sure we never call this on
input that might need to be clipped. In general, this algorithm is
2 times faster than the orc optimized one and would be chosen for all
RGB -> YUV conversions and some YUV->YUV and RGB->RGB conversions.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732186
2015-03-10 15:22:17 +01:00
Sebastian Dröge
06fd6f2f63 video: Add support for 10 bit planar AYUV formats 2015-03-10 10:31:28 +01:00
Wim Taymans
62ff9b8bca video-info: validate parsed colorimetry
Validate the parsed colorimetry and reset to defaults when we get RGB
with a matrix or YUV without a matrix.
2015-03-09 16:28:02 +01:00
Wim Taymans
6ee67a8aa1 video-converter: detect identity matrix
Do nothing if we have an identity matrix conversion.
2015-03-09 16:02:17 +01:00
Wim Taymans
cf572ae2cb video-info: use default colorimetry on error
When we fail to parse the colorimetry property, fall back to the default
colorimetry for the format and dimension instead of leaving things
undefined.
2015-03-09 16:02:17 +01:00
Luis de Bethencourt
fedc1dba1a videoencoder: unused value
Value set in ret is immediately overwritten in the next line outside of the if
block. Run reset but don't store return.

CID #1226470
2015-03-09 11:25:47 +00:00
Wim Taymans
8296cdbfd5 video-converter: only convert to/from rgb when needed
Only use the YUV->RGB matrix when we have YUV as input and only use the
matrix when we need to make YUV output.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=745780
2015-03-09 12:16:56 +01:00
Mark Nauwelaerts
f134072c66 videodecoder: only return EOS upon clipping if applicable
See also https://bugzilla.gnome.org/show_bug.cgi?id=709224
2015-03-07 20:12:23 +01:00
Sebastian Dröge
13a93575e1 video: Update orc generated C files 2015-03-07 16:49:07 +01:00
Sebastian Dröge
5dfa3c8009 Revert "videoaggregator: Create new caps from the video-info"
This reverts commit 78215be0df.

because it broke glvideomixer with custom caps features.
2015-03-06 18:53:13 +01:00
Sebastian Dröge
3555c7bcd9 videoaggregator: Create new caps from the video-info
In case the original caps were missing some optional fields like
interlace-mode. We assume default values for those everywhere,
but they can still cause negotiation to fail if a downstream element
expects the field to be there and at a specific value.
2015-03-06 14:36:26 +01:00
Wim Taymans
7b6278b7e4 video-converter: add transfer full annotation for config 2015-03-06 12:54:56 +01:00
Ravi Kiran K N
6bd458abc1 video-converter: correct right-border location for YUY2, YVYU, UYVY
Remove 'r_border /= 2' in convert_fill_border(). It doesn't
take the right border to correct location.

https://bugzilla.gnome.org/show_bug.cgi?id=745719
2015-03-06 12:27:18 +01:00
Wim Taymans
31a3e6c9f1 video-converter: avoid scaler when size is unchanged 2015-03-05 09:52:18 +01:00
Wim Taymans
6602861d00 video-scaler: add horizontal 2tap u16 orc function
Add slightly faster u16 horizontal resampler orc function.
2015-03-04 16:45:35 +01:00
Wim Taymans
e0a192d3dd video-converter: don't reuse the input line when adding borders
When we need to add borders, we need a writable input line, so
don't reuse the source memory directly.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=745207
2015-03-04 12:29:45 +01:00
Wim Taymans
4643d34a7a video-converter: avoid making scalers for outsize == 0 2015-03-02 16:42:23 +01:00
Wim Taymans
b2a7ac2766 video-converter: v-resample enough pixels
When we are using the fast linear resampler, use the ->inc to calculate
the first and last pixel we need so that we can do vertical resampling
on the right amount of pixels.
2015-03-02 16:33:09 +01:00
Wim Taymans
0062dadc35 video-orc: fix unpack functions for RGB/RGB15 on BE
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=745337
2015-03-02 15:07:34 +01:00
Wim Taymans
d1a9eacb75 video-format: more fixes for big endian 2015-03-02 13:27:23 +01:00
Wim Taymans
569ca5770c video-format: add big-endian versions of RGB/BGR 15/16 pack/unpack
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=745337
2015-03-02 12:27:24 +01:00
Luis de Bethencourt
7175417f7e video-converter: remove check for below zero for unsigned int
CLAMP checks both if value is '< 0' and '> max'. Value will never be a negative
number since it in an unsigned integer. Removing that check and only checking
if it is bigger than max and setting it appropriately.

CID #1271606
2015-02-26 14:48:51 +00:00
Wim Taymans
621292e754 video-converter: we can use the scaler without scalers to copy 2015-02-25 17:00:34 +01:00
Wim Taymans
e1715f7728 video-converter: only make a scaler when we are scaling
Only make a scaler when we are actually doing any scaling. Without
scalers, the scale function will simply do a copy.
2015-02-25 16:50:02 +01:00
Wim Taymans
330fb44a6f video-scaler: add support for copy
When no scalers are given, simply do a copy of the requested area.
2015-02-25 16:49:20 +01:00
Wim Taymans
3046935e03 video-converter: activate scaler fastpath depending on method
Only activate the scaler fastpath for x2 up and downscale when the
scaler method is respectively nearest and linear because that is what
those fastpaths really implement.
2015-02-25 16:15:52 +01:00
Wim Taymans
9e8799924b video-scaler: add scaler optimization
If we are vertically downscaling, it is better to first downscale and
then do the horizontal scaling in most cases.
2015-02-25 15:33:26 +01:00
Wim Taymans
4d8c277656 video-scaler: remove unused case 2015-02-25 15:32:57 +01:00
Wim Taymans
495873298c video-converter: don't overwrite border alpha
Let border alpha and image alpha be independent.
2015-02-25 11:39:20 +01:00
Wim Taymans
c4f071546d video-converter: use 1.0 as default alpha 2015-02-24 17:33:57 +01:00
Wim Taymans
5077a5e3af video-converter: add alpha handling
Add support for alpha. Make it possible to copy, set and multiply the
alpha value of a frame during conversion.
Set the border alpha to 0xff by default.
Go over some of the fastpaths and add alpha handling.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=745006
2015-02-24 17:29:18 +01:00
Wim Taymans
5744b7995c video-converter: fix chroma subsampling
Also adjust the output line number with the offset.
2015-02-24 17:29:18 +01:00
Wim Taymans
cb5ec197da video-converter: disable fastpath when scaling and gamma
Disable the fastpath when scaling and doing gamma remap.
2015-02-24 17:29:18 +01:00
Wim Taymans
bf916a244d video-converter: don't do gamma on alpha channel
The alpha channel is not supposed to be gamma encoded.
2015-02-24 17:29:18 +01:00
Tim-Philipp Müller
0b0c667e57 video-converter: minor docs fix 2015-02-24 12:38:10 +00:00
Jan Schmidt
af26201429 videodecoder: Add drain() vfunc
drain() is a new vfunc which does what finish() does, while
explicitly requiring the decoder be able to continue processing
data afterward.

https://bugzilla.gnome.org/show_bug.cgi?id=734617
2015-02-24 01:36:44 +11:00
Mark Nauwelaerts
ccee86a7dd Revert "videodecoder: drain current segment upon new one to ensure correct flow return"
This reverts commit cc1b4eaf9e.

See https://bugzilla.gnome.org/show_bug.cgi?id=734617
2015-02-22 16:59:08 +01:00
Mark Nauwelaerts
cc1b4eaf9e videodecoder: drain current segment upon new one to ensure correct flow return
See also https://bugzilla.gnome.org/show_bug.cgi?id=709224
2015-02-22 13:23:44 +01:00
Thiago Santos
7e39a51a50 audio: video: fix a few GI annotations
transfer-full -> transfer full
@Since -> Since
2015-02-19 15:51:42 -03:00
Tim-Philipp Müller
8b87f3f2fe videoaggregator: use new gst_aggregator_pad_drop_buffer() 2015-02-13 16:25:52 +00:00
Wim Taymans
1caf1ae1fd video-orc: update with new methods 2015-02-12 12:08:16 +01:00
Wim Taymans
45e408735c video-format: add orc function for RGB15/16 unpack 2015-02-12 11:39:33 +01:00
Sebastian Dröge
8547594727 Improve and fix LATENCY query handling
This now follows the design docs everywhere, especially the maximum latency
handling.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 17:53:49 +02:00
Sebastian Dröge
d9a267f030 Improve and fix LATENCY query handling
This now follows the design docs everywhere, especially the maximum latency
handling.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 14:16:21 +01:00
Wim Taymans
cdd86d025a video-scaler: add 2d scaler
Make a convenience function that combines 2 scalers to perform a 2d
scale. This removes quite a bit of overhead in method calls when doing a
typical scale and it also can reuse a piece of unused memory in the
vertical scaler.
Use the 2d scaler in video-converter and remove the other scalers and
temp memory.
2015-02-11 13:32:25 +01:00
Wim Taymans
80249d4bea video-converter: Fix YUY2 formats and friends
Only merge scalers for selected formats.
Use nearest neighbour scaling for chroma when doing nearest neighbour
for the luma.
Also fastpath GRAY16_OE in nearest neighbour.
configure parameters correctly for packed fastpath.
2015-02-10 16:45:38 +01:00
Wim Taymans
4313970678 video-scaler: Small performance tweaks
Small performance tweaks for RGB and friends.
Add, but ifdef out, alternative nearest neighbour scaling, it is slower
than the current table based version.
Use memcpy instead of orc_memcpy because it is measurably faster.
Fix YUY2 and friends vertical scaling.
2015-02-10 16:45:38 +01:00
Sebastian Dröge
13643870bf video-scaler: Guard against (impossible) bits!=16 && bits!=8 case to fix compiler warning with clang
video-scaler.c:1331:14: error: variable 'func' is used uninitialized whenever 'if' condition is false
      [-Werror,-Wsometimes-uninitialized]
  } else if (bits == 16) {
             ^~~~~~~~~~
video-scaler.c:1348:3: note: uninitialized use occurs here
  func (scale, src_lines, dest, dest_offset, width, n_elems);
  ^~~~
video-scaler.c:1331:10: note: remove the 'if' if its condition is always true
  } else if (bits == 16) {
         ^~~~~~~~~~~~~~~~
video-scaler.c:1260:27: note: initialize the variable 'func' to silence this warning
  GstVideoScalerVFunc func;
                          ^
                           = NULL
2015-02-10 16:44:38 +01:00
Sebastian Dröge
b680671374 video-converter: Use correct enum type to fix compiler warnings with clang
video-converter.c:3406:12: error: implicit conversion from enumeration type 'GstVideoFormat' to different
      enumeration type 'GstFormat' [-Werror,-Wenum-conversion]
  format = convert->fformat[plane];
         ~ ^~~~~~~~~~~~~~~~~~~~~~~
video-converter.c:3413:44: error: implicit conversion from enumeration type 'GstFormat' to different enumeration
      type 'GstVideoFormat' [-Werror,-Wenum-conversion]
    gst_video_scaler_horizontal (h_scaler, format,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~
video-converter.c:3471:12: error: implicit conversion from enumeration type 'GstVideoFormat' to different
      enumeration type 'GstFormat' [-Werror,-Wenum-conversion]
  format = convert->fformat[plane];
         ~ ^~~~~~~~~~~~~~~~~~~~~~~
video-converter.c:3487:42: error: implicit conversion from enumeration type 'GstFormat' to different enumeration
      type 'GstVideoFormat' [-Werror,-Wenum-conversion]
    gst_video_scaler_vertical (v_scaler, format, lines, d + out_x, i,
    ~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~
video-converter.c:3551:12: error: implicit conversion from enumeration type 'GstVideoFormat' to different
      enumeration type 'GstFormat' [-Werror,-Wenum-conversion]
  format = convert->fformat[plane];
         ~ ^~~~~~~~~~~~~~~~~~~~~~~
video-converter.c:3569:46: error: implicit conversion from enumeration type 'GstFormat' to different enumeration
      type 'GstVideoFormat' [-Werror,-Wenum-conversion]
      gst_video_scaler_horizontal (h_scaler, format,
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~
video-converter.c:3577:42: error: implicit conversion from enumeration type 'GstFormat' to different enumeration
      type 'GstVideoFormat' [-Werror,-Wenum-conversion]
    gst_video_scaler_vertical (v_scaler, format, lines, d + out_x, i,
    ~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~
2015-02-10 16:38:05 +01:00
Luis de Bethencourt
4fb0095898 video-converter: bits variable always set
In function gst_video_scaler_vertical() the bits variable is always
set to either 8 or 16 in every possible format. No need to initialize it.

If the format isn't valid it goes to no_func, so there is no need to
handle the case of bits not being 8 or 16.

CID #1268401
2015-02-10 15:25:04 +00:00
Wim Taymans
622fa74a07 video-converter: only enable backlog for interlaced video
Skip lines we don't need.
2015-02-10 11:15:53 +01:00
Sebastian Dröge
0d89c672e8 videoaggregator: When receiving timeout before caps, make sure to also advance our frame counter
Otherwise we will directly go EOS on the next non-timeout.
2015-02-10 10:57:38 +01:00
Wim Taymans
c15dfc30e5 video-converter: add fastpath for NV formats 2015-02-10 09:30:44 +01:00
Wim Taymans
c6fcb5575a video-format: fix pstride of NV16 and NV24 formats 2015-02-10 09:22:50 +01:00
Matthew Waters
b4ee792fc2 videoaggregator: fix buffer selection when duration=-1
If the src framerate and videoaggreator's output framerate were
different, then we were taking every single buffer that had duration=-1
as it came in regardless of the buffer's start time.  This caused the src
to possibly run at a different speed to the output frames.

https://bugzilla.gnome.org/show_bug.cgi?id=744096
2015-02-10 14:44:21 +11:00
Wim Taymans
72bb2d8637 video-converter: Add more fastpaths
Add fastpaths for all planar conversion and scaling.
Improve gray and alpha handling.
Add option to specify the chroma resampler method and set to linear as
default.
2015-02-09 17:56:37 +01:00
Wim Taymans
2566675a78 video-converter: add generic planar scaler/converter
Add code to convert and scale between any planar format and use it in
the fastpaths of some planare converters.
2015-02-09 17:55:49 +01:00
Sebastian Dröge
dc8181c12e video-converter: Fix compiler warnings by using the correct enum type
video-converter.c:3645:24: error: implicit conversion from enumeration type
      'GstFormat' to different enumeration type 'GstVideoFormat'
      [-Werror,-Wenum-conversion]
    convert->fformat = fformat;
                     ~ ^~~~~~~
video-converter.c:3667:24: error: implicit conversion from enumeration type
      'GstFormat' to different enumeration type 'GstVideoFormat'
      [-Werror,-Wenum-conversion]
    convert->fformat = fformat;
                     ~ ^~~~~~~
video-converter.c:3963:50: error: implicit conversion from enumeration type
      'const GstVideoFormat' to different enumeration type 'GstFormat'
      [-Werror,-Wenum-conversion]
        if (!setup_scale (convert, transforms[i].fformat))
             ~~~~~~~~~~~           ~~~~~~~~~~~~~~^~~~~~~
2015-02-09 10:20:37 +01:00
Tim-Philipp Müller
bde4292e90 videoaggregator: don't set element factory details
This is an abstract base class, not an element.
2015-02-08 14:32:22 +00:00
Wim Taymans
80ca1462cd video-converter: add more scaler fastpaths 2015-02-06 13:39:04 +01:00
Wim Taymans
72076e9521 video-orc: fix loading of param
param loading ignores the x4, loading only part of the param.
2015-02-06 13:25:51 +01:00
Wim Taymans
bca801492b video-converter: add border and crop to more fastpaths 2015-02-06 12:35:58 +01:00
Wim Taymans
a78ae80909 video-converter: fix border for YUY2 and friends
Convert as many pixels as the max subsampling so that we convert a
complete group of pixels.
2015-02-06 12:33:18 +01:00
Ravi Kiran K N
bd836e12a1 video-converter: support AYUV border
Convert the border color from ARGB to AYUV, using
colorimetry matrix when output format is YUV.

https://bugzilla.gnome.org/show_bug.cgi?id=741640
2015-02-06 11:43:49 +01:00
Wim Taymans
c78bdbfecb video-converter: fix swapped border width
And also do nothing when there is no border.
2015-02-06 11:43:49 +01:00
Wim Taymans
86c96e09cc video-converter: actually draw the border in some fastpaths
Don't forget to draw the border after doing the fastpath conversion.
2015-02-06 11:43:49 +01:00
Wim Taymans
8fe9299b00 video-converter: clamp width and heigth
Clamp the width and height based on the in and out offsets.
2015-02-06 11:43:49 +01:00
Wim Taymans
7b3bff644c video-format: add unaligned fallbacks
Add fallback C implementations for when we can't call the ORC function
because of bad alignment.
2015-02-06 11:43:49 +01:00
Jan Schmidt
7d4d63be21 video: Fix simple typo in GstVideoFrameMapFlags docs 2015-02-06 04:02:48 +11:00
Wim Taymans
b5aa23697c video-converter: add crop and border to some fastpaths 2015-02-05 17:49:55 +01:00
Wim Taymans
6985511fc9 video-converter: add support for borders in scale fastpath
Add support for borders and cropping in the scaler fastpaths.
2015-02-05 17:18:20 +01:00
Wim Taymans
36a50778af video-converter: disable fastpath for crop and border
Add crop and border properties to the fastpath table and only select
fastpath functions when it can handle the cropping or borders.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=744028
2015-02-05 15:03:24 +01:00
Wim Taymans
3dfbd11fc8 video-converter: add fastpath for some gray formats 2015-02-04 18:01:51 +01:00
Wim Taymans
0737316e7e video-converter: add fastpath for some more RGB formats
Add fastpath for RGB and BGR.
Add fastpath for nearest resampling for RGB15 and RGB16 formats.
2015-02-04 17:44:31 +01:00
Wim Taymans
750909abce video-converter: skip lines we don't need
Make sure to skip unused lines instead of doing a useless horizontal
resampling.
2015-02-04 16:39:48 +01:00
Luis de Bethencourt
d8308d5a8f video-resampler: make sure params.envelope is initialized
In gst_video_resampler_init () if method is GST_VIDEO_RESAMPLER_METHOD_NEAREST
then params.envelope is not initialized but still used later in line 382.
Make sure this variable is initiliazed to avoid undefined behaviour.

CID #1256568
2015-02-04 11:25:54 +00:00
Sebastian Dröge
aa645b11f1 video{enc,dec}oder: Don't reset latency all the time and handle max=GST_CLOCK_TIME_NONE correctly
max=NONE means that *this* element has no maximum latency. If upstream had a
maximum latency we must not override it with NONE.
2015-02-03 12:24:01 +01:00
Thibault Saunier
490444637f aggregator: More fixes around locking when accessing protected private fields
In some more places we were accessing GstAggregator->segment
and GstAggregator->seqnum without holding the GST_OBJECT_LOCK

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Thibault Saunier
83e1895dbf aggregator: Hide GstAggregatorPad buffer and EOS fileds
And add a getter for the EOS.

The user should always use the various getters to access
those fields

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
008de39d3f aggregator: Document locking for gst_aggregator_get_latency_unlocked()
Renamed it to _unlocked() to make it clear.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
f5d63b031d videoaggregator: Lock access to members of GstAggregatorPad
Take the pad's object lock before accessing members of the
GstAggregatorPad structure.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Nirbheek Chauhan
4527811b1f videoaggregator: If getting a timeout before having caps, just advance our position
This can happen if this is a live pipeline and no source produced any buffer
and sent no caps until an output buffer should've been produced according to the
latency.

This fix is similar in spirit to commit be7034d1 by Sebastian for audiomixer.
2015-01-29 09:47:32 +01:00
Sebastian Dröge
4e44f37abd video-converter: Fix compiler warnings
video-converter.c:3073:48: error: implicit conversion from enumeration type 'GstFormat' to different enumeration type 'GstVideoFormat'
      [-Werror,-Wenum-conversion]
        gst_video_scaler_horizontal (h_scaler, format,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~
video-converter.c:3081:44: error: implicit conversion from enumeration type 'GstFormat' to different enumeration type 'GstVideoFormat'
      [-Werror,-Wenum-conversion]
      gst_video_scaler_vertical (v_scaler, format, lines, d, i, out_w);
      ~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~
video-converter.c:3137:24: error: implicit conversion from enumeration type 'const GstVideoFormat' to different enumeration type 'GstFormat'
      [-Werror,-Wenum-conversion]
    convert->fformat = GST_VIDEO_INFO_FORMAT (in_info);
                     ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../gst-libs/gst/video/video-info.h:125:43: note: expanded from macro 'GST_VIDEO_INFO_FORMAT'
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../gst-libs/gst/video/video-format.h:361:59: note: expanded from macro 'GST_VIDEO_FORMAT_INFO_FORMAT'
                                                  ~~~~~~~~^~~~~~
video-converter.c:3157:24: error: implicit conversion from enumeration type 'GstVideoFormat' to different enumeration type 'GstFormat'
      [-Werror,-Wenum-conversion]
    convert->fformat = GST_VIDEO_FORMAT_GRAY8;
2015-01-28 17:44:57 +01:00
Sebastian Dröge
46e141067f video: Update orc files 2015-01-28 17:43:59 +01:00
Wim Taymans
f29b966c79 video-converter: add fast-path scaler for some packed YUV formats
Add fast path scaling for YUY2 and other packed YUV formats. Add a new
method to merge the scalers of the Y and UV components into one scaler.
Add faster horizontal 2tap scaler.

See https://bugzilla.gnome.org/show_bug.cgi?id=741987
2015-01-28 17:32:12 +01:00
Wim Taymans
ea3dcdc0da video-converter: the default is BAYER dithering 2015-01-28 17:30:14 +01:00
Wim Taymans
620dc30d0f video-converter: don't do dither when set to NONE 2015-01-28 17:29:45 +01:00
Wim Taymans
e16377c0c8 video-scaler: fix taps calculation for pstride == 1
Take pstride into consideration when calculating the scaler taps.
2015-01-28 11:39:41 +01:00
Luis de Bethencourt
783204824d orc: update orc files 2015-01-27 13:39:14 +00:00
Wim Taymans
e2864494fe video-converter: add fastpath for planar scaling
Add fastpaths for scaling of planar subsampled formats.

See https://bugzilla.gnome.org/show_bug.cgi?id=741987
2015-01-27 10:52:29 +01:00
Wim Taymans
ba98d06767 video-scaler: add support for monochroma formats
Add support for scaling of images with pstride == 1. This can be used
to scale individual planes later.
Rework some of the scaling code to take the pstride as a parameter.
2015-01-27 10:52:29 +01:00
Wim Taymans
4ab23677a9 video-format: fix GBR unpack 2015-01-27 10:52:29 +01:00
Tim-Philipp Müller
38a06d0a33 videoaggregator: fix crash when receiving buffer without timestamps
Unset out buffer in clip function when we unref the buffer to be
clipped, otherwise aggregator will continue to use the already-
freed buffer. Fixes crash when buffers without timestamps are
being fed to aggregator. Partly because aggregator ignores the
error flow return.

https://bugzilla.gnome.org/show_bug.cgi?id=743334
2015-01-26 09:24:40 +00:00
Edward Hervey
5e69a0f898 video: Fix leaked dither object in error cases
Coverity CID : 1256564
2015-01-23 12:46:41 +01:00
Sebastian Dröge
2bd4ea6e8e Constify some static arrays everywhere 2015-01-21 09:49:47 +01:00
Alessandro Decina
5fd4e3e0b6 videoutils: keep caps features in account when building the downstream filter
See 00c2ce6 and https://bugzilla.gnome.org/show_bug.cgi?id=741263 for reference.
2015-01-15 13:59:10 +11:00
Mark Nauwelaerts
04d447a825 videoencoder: fix comment typo 2015-01-10 13:02:59 +01:00
Luis de Bethencourt
6992da94b0 video-dither: remove check for below zero for unsigned value
CLAMP checks both if value is '< 0' and '> max'. Value will never be a negative
number since it is an unsigned integer. Removing that check and only checking if
it is bigger than max and setting it appropriately.

CID 1256559
2015-01-09 15:38:09 +00:00
Luis de Bethencourt
23880ec874 video-resampler: remove check for below zero for unsigned value
CLAMP checks both if n_taps is '< 0' and '> max_taps'. n_taps will never be a
negative number because it is an unsigned integer. Removing that check and only
making sure it isn't set bigger than max.

CID 1256558
2015-01-09 15:28:06 +00:00
Sebastian Dröge
7a35321710 video: Add support for BT2020 colorspace (UHD) 2015-01-08 10:45:46 +01:00
Wim Taymans
ff8129267e video-scaler: remove useless debug 2015-01-07 15:54:58 +01:00
Wim Taymans
fff41f06be video-converter: add options to control chroma resampling
Add an option to disable chroma resampling.
Improve the matrix option values so that you can choose to use the input
or output matrix or disable conversion.
2015-01-07 15:52:57 +01:00
Tim-Philipp Müller
b8e97659fe videoaggregator: update for aggregator start/stop vfunc change 2014-12-30 17:56:35 +00:00
Tim-Philipp Müller
7d22da9510 aggregator: make padding larger
Esp. the class structures, can't have enough
spare space for virtual functions.
2014-12-28 01:13:33 +00:00
Sebastian Dröge
b9312fe9a2 videoaggregator: Use the src query implementation of aggregator as the default case 2014-12-22 22:12:02 +01:00
Song Bing
e9c6c833c9 videopool: update video alignment after applying
Video buffer pool will update video alignment to respect stride alignment
requirement. But haven't updated it to video alignment in configure.
Which will cause user get wrong video alignment.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741501
2014-12-22 09:25:04 -05:00
Sebastian Dröge
87d6c265a8 video{en,de}coder: Call reset() before the start() vfunc
This makes sure that the element is in the same state before start() is called
the very first time and every future call after the element was used already.

Also it ensure that we always have a clean state before start(), cleaned the
same way in every case.
2014-12-22 11:38:20 +01:00
Sebastian Dröge
098b42f36b video{en,de}coder: Reset the codec after calling the stop() vfunc
The stop() vfunc might mess with some of our fields we have just
reset, which could cause memory leaks or invalid state taken over
to later.

Also the stop() vfunc, or anything called until it from another thread,
might want to be able to use the fields that were just resetted and
become confused because of that.

In the decoder we already had a workaround for things like this happening,
this workaround is not needed anymore.
2014-12-22 11:33:14 +01:00
Sebastian Dröge
5c9472f78c videoaggregator: Don't try to map NULL buffers 2014-12-18 22:04:38 +01:00
Sebastian Dröge
ccd24a3577 videoaggregator: Make sure to always update the pad's videoinfo together with buffers
Otherwise the videoinfo and the buffer content can go out of sync.
2014-12-18 22:03:04 +01:00
Thiago Santos
17a7fac1a1 video: audio: fix GI annotations for proxy caps function
Add the annotations to parameters that can be null and also for stating
the ownership of the returned caps
2014-12-17 19:15:24 -03:00
Thiago Santos
8085352fb3 videodecoder: expose getcaps virtual function
Allows subclasses to do custom caps query replies.

Also exposes the standard caps query handler so subclasses can just
extend on top of it instead of reimplementing the caps query proxying.

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Thiago Santos
4956800549 videodecoder: accept-caps should only require fields from the template
With the new caps query results the caps returned might have extra fields
that are not required by the decoder (framerate for image decoders) and it
causes a regression making, for example, jpegdec reject caps that don't
have framerates.

The accept-caps implementation will do 2 checks:

1) Do subset check with the template caps, making sure all the required
fields that are present on the template are present on the received caps.
2) Do a intersection check with the result of a caps query, making sure
that downstream can accept the fields in the received caps.

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Thiago Santos
00c2ce60c3 videoutils: proxy filter when doing a caps query downstream
Allows downstream to use the filter and possibly reduce caps complexity
to speed up negotiation

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Thiago Santos
f492085552 videoutils: return empty if the element has no possible allowed caps
Instead of returning the template caps and having a failure happen
later because there are no possible caps

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00
Thiago Santos
f24075887f videodecoder: implement caps query
Refactor the encoder's caps query proxying function to a common place
and use it in the videodecoder to proxy downstream restrictions.

The new function is private to the gstvideo lib.

https://bugzilla.gnome.org/show_bug.cgi?id=741263
2014-12-17 19:15:23 -03:00