Commit graph

1253 commits

Author SHA1 Message Date
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
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
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
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
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
Song Bing
8baf1ec500 videopool: update buffer size after video alignment
Update the new buffer size after alignment in the pool configuration
before calling the parent set_config. This ensures that the parent knows
about the buffer size that we will allocate and makes the size check
work in the release_buffer method.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741420
2014-12-16 12:14:53 +01:00
Edward Hervey
ff57f69134 video: Fix non-default usage of gst_video_sink_center_rect
Make sure we take into account non-0 x/y destination rectangles
2014-12-15 14:11:07 +01:00
Sebastian Dröge
ee2418effd video: Update disted orc source files 2014-12-12 10:02:43 +01:00
Sebastian Dröge
3fc5791b3f Revert "video-converter: Fix compiler warning because of missing prototype of non-static function"
This reverts commit 406f32a946.

The problem was apparently that my video-orc.h was not updated and did not
include the prototype for that function. Only a "make clean" caused it to
be regenerated.
2014-12-12 10:01:36 +01:00
Sebastian Dröge
406f32a946 video-converter: Fix compiler warning because of missing prototype of non-static function
video-converter.c:838:1: error: no previous prototype for function
      '_custom_video_orc_matrix8' [-Werror,-Wmissing-prototypes]
2014-12-12 09:51:05 +01:00
Thiago Santos
2034e5c153 videodecoder: do not use fixed caps on source pad
decoders can change the caps on their source pads, so they don't
use fixed caps. Having fixed caps can cause renegotiation issues.
2014-12-11 17:35:03 -03:00
Wim Taymans
903ba19593 video-orc: make RGB pack/unpack faster
Avoid all the merging and splitting and use a pair of shifts and or
2014-12-10 16:43:34 +01:00
Jan Schmidt
6e492304dd videodecoder: Add GST_VIDEO_DECODER_CAST macro
It's used in some macros already, so let's make it exist.
2014-12-11 01:53:15 +11:00
Wim Taymans
a0b8e96b77 video-converter: set bits and format after conversion
Update the current format, bits and pstride.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741187
2014-12-06 21:05:00 +01:00
Thiago Santos
5db596495b video-converter: free dither_lines
Avoid a memory leak
2014-12-05 22:23:55 -03:00
Wim Taymans
4ffd723c95 video-converter: use custom backup function
Use the new orc feature to set a custom backup function.
2014-12-05 14:51:28 +01:00
Wim Taymans
04e9a8dcc5 video-converter: improve matrix8 function
Avoid using a constant.
Avoid doing saturated adds, results are not supposed to overflow here.
Rework the C backup function a little in preparation for custom backup
functions in ORC.

See https://bugzilla.gnome.org/show_bug.cgi?id=741015
2014-12-05 12:20:26 +01:00
Wim Taymans
e2a693656b video-converter: fix chroma resampling check
Decide if we need chroma resampling by checking if we have a progressive
or interlaced chroma resampler.
2014-12-03 10:17:29 +01:00
Wim Taymans
6757296386 video-converter: only do dithering when needed
Only do dithering when one of the quantizers is > 1.
2014-12-03 10:17:29 +01:00
Wim Taymans
fc1d24ec45 video-scaler: add where orc functions could go
Add the disabled orc functions in #if 0 lines for when we can enable
them.
2014-12-02 15:11:12 +01:00
Wim Taymans
d03136f1ea video-converter: add dithering
Use the new dither object to perform dithering.
Add option to select dithering method.
Add option to quantize to a specific value
2014-12-02 15:10:49 +01:00
Wim Taymans
dfb202a117 video-converter: add palette when needed 2014-12-02 15:10:49 +01:00
Wim Taymans
0f2be22e76 video-dither: add video dither helper object
Add a new object that implements various dithering methods.
2014-12-02 15:10:43 +01:00
Sebastian Dröge
90eb93c2ef Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.
2014-12-01 09:51:12 +01:00
Sebastian Dröge
afcc0b3c50 video-frame: Mapping a frame with inconsistent values between GstVideoMeta and GstVideoInfo is a bug
It will cause the frame to be initialized with inconsistent values that then
later can cause crashes or any other kind of interesting and hard to debug
bugs.
2014-11-28 10:27:28 +01:00
Tim-Philipp Müller
57811331de video-blend: make use of x offset when unpacking overlay image pixels
Now that it's implemented we can use it, which is a minor
optimisation when the image to overlay gets cropped on the
left.
2014-11-27 15:29:48 +00:00
Tim-Philipp Müller
60d18149e5 video-format: sprinkle some 'restrict' keywords in pack/unpack functions
In cases where we just call orc directly this is somewhat
superfluous, but let's do it anyway for consistency. In
other cases the compiler can hopefully use this to optimise
memory access a little.
2014-11-27 15:04:12 +00:00
Wim Taymans
52d4dd1cb0 video-format: handle x offset in unpack
Add support for x offset in almost all unpack methods.
Fix naming of source and dest pixels.
Add const to source pixels.
2014-11-27 13:01:03 +01:00
Wim Taymans
a3da634db6 video-format: improve unpack i420
unpack_i420 does not need extra code to handle odd widths, the orc code
already handles it fine.
2014-11-27 10:51:58 +01:00
Wim Taymans
0e3bfbd996 video-scale: combine adds when max_taps equals combine size
When the amount of pixels/lines matches the amount we can combine,
combine the adds and multiplies and do the scale as a separate
operation.
2014-11-25 17:42:07 +01:00
Wim Taymans
74e63fa660 video-scaler: combine scaling operations
Combine add and scale of multiple lines/pixels to reduce the amount of
read and writes to temporary memory.
2014-11-25 17:27:07 +01:00
Wim Taymans
b1eb3b7d81 video-resampler: remove print 2014-11-25 10:36:13 +01:00
Wim Taymans
1d55bde5bb video-resampler: improve variable taps
Improve quality of variable taps on all methods by reusing the lanczos
parameters where possible.
2014-11-25 10:34:02 +01:00
Wim Taymans
721bbcad34 video-resampler: Fix lanczos parameters for variable taps
when using variable taps and when we are limiting the number of taps,
recalculate the lanczos parameters to match the clamped value.
Set the max number of taps to 128
2014-11-25 10:34:02 +01:00
Wim Taymans
db304a446b video-converter: keep track of required temp lines
Make a small object to hold a pool of allocated temp lines.
Keep track of how many temp lines each conversion stage needs and use
this to allocate just enough temp lines from the temp lines object. from
the temp lines object.
2014-11-24 12:52:26 +01:00
Wim Taymans
e182abcf79 video-converter: use err line in fastpath
Use the error line for temporary storage in the fastpath so that we
don't have to allocate any other temp lines.
2014-11-24 12:52:26 +01:00
Matej Knopp
9d349d8831 videoencoder: don't complain about PTS != DTS on keyframes
It is valid for streams with b-frames

https://bugzilla.gnome.org/show_bug.cgi?id=740556
2014-11-22 16:12:16 -05:00
Wim Taymans
b9bee1af8c video-converter: handle mixed interlaced
When dealing with mixed interlaced, setup a scaler and chroma-resampler
for both interlaced and progressive frames and switch between them
depending on the interlace mode of the input frame.
2014-11-21 16:06:54 +01:00
Wim Taymans
0358e23baf video-converter: Cleanup options parsing
Cleanup option parsing
Add some debug
2014-11-21 16:04:11 +01:00
Wim Taymans
d001b10f29 video-converter: there is no need to apply x offset to temp lines 2014-11-21 15:59:47 +01:00
Wim Taymans
1a3e8395bb video-scaler: ensure both fields have the same number of taps 2014-11-21 15:58:34 +01:00
Wim Taymans
eefdba6dbd video-converter: rework the options a little
Rework the options a little to make it nicer to set defaults.
2014-11-21 11:15:04 +01:00
Wim Taymans
7b7270ecff video-resampler: add option to limits taps
Add an option to limit the number of taps to use in automatic mode. The
problem is that for lanczos, we might use more taps than what we can
handle with the current precision.
Rework the other options a little to make it nicer to set defaults.
2014-11-21 11:12:50 +01:00
Wim Taymans
6620ab9d31 video: update orc files 2014-11-20 18:20:28 +01:00
Sebastian Dröge
823f170fac video-converter: Use correct enum, GstVideoFormat instead of GstFormat 2014-11-19 14:38:03 +01:00
Wim Taymans
9647a8ca78 video-converter: fix size check
Add some debug, fix size check that decides what scaling to do first and
when to do conversion.
2014-11-19 13:25:13 +01:00
Wim Taymans
23adc12e02 video-converter: avoid primaries conversion when asked
Don't do conversion between primaries when the option is disabled.
Only do some matrix code when needed.
2014-11-19 12:55:03 +01:00
Wim Taymans
f6683b8f14 video-info: add a note about subsampled formats
Add a note about gst_video_info_set_format() and interlaced formats.
2014-11-19 12:55:03 +01:00
Wim Taymans
24989b53fc video-info: handle interlaced size correctly
Refactor GstVideoInfo init, make function to set default colorimetry.
Call fill_planes after we configure the GstVideoInfo with parameters
from the caps.
The size of the chroma planes for interlaced vertically subsampled
formats needs to be rounded up to 2, we have 2 fields with each
the same anount of chroma lines.
2014-11-19 12:55:03 +01:00
Wim Taymans
8f43cc67d5 video-color: return FALSE on unparsable colorimetry 2014-11-19 12:55:02 +01:00
Wim Taymans
5c043f3d50 video-format: handle unpack interlaced subsampled formats
For interlaced vertically subsampled formats the check for even lines
needs to take into account the two fields.
2014-11-19 12:55:02 +01:00
Wim Taymans
588fdeb834 video-scaler: fix interlaced shift 2014-11-19 12:55:02 +01:00
Wim Taymans
ac756ba0d9 video-converter: keep a small backlog of lines
Allow lines to jump backwards slightly, usefull for interlaced content.
2014-11-19 12:55:02 +01:00
Wim Taymans
b911434716 video-chroma: Fix interlaced chroma resampling
Use the interlaced flag to select the right resampler.
2014-11-19 12:55:02 +01:00
Wim Taymans
d6ed383c6f video: add some more debuging 2014-11-19 12:55:02 +01:00
Wim Taymans
7d0cef3bcb video-scaler: fix interlacing some more
Use the right phase.
Take the right lines from interlaced content.
2014-11-19 12:55:02 +01:00
Wim Taymans
73349f14b9 video-converter: fix dither method 2014-11-19 12:55:02 +01:00
Wim Taymans
c116da93f1 video-converter: fix some leaks
And remove some unused fields.
2014-11-19 12:55:02 +01:00
Wim Taymans
cfc173e96b video-converter: add support for gamma and primaries
Keep only 1 structure with all matrix information.
Add structure to hold gamma information.
Add more options to control gamma, primaries and color matrix handling.
Add functions to compute transformations to and from XYZ and use this
to convert between primaries.
Merge gamma into the convert to and from RGB stage.
Fix border val.
Simplify the fastpath table, remove unused fields, add some more checks.
2014-11-19 12:55:02 +01:00
Wim Taymans
7c02acc544 video-color: add method to get primaries info 2014-11-19 12:55:02 +01:00
Wim Taymans
943e1319a2 video-color: fix default 601 primaries 2014-11-19 12:55:02 +01:00
Wim Taymans
d03bad7761 video-scaler: fix interlaced taps setup 2014-11-19 12:55:02 +01:00
Wim Taymans
c98bc6fdc6 video-color: make sRGB colorimetry the default for RGB 2014-11-19 12:55:02 +01:00
Wim Taymans
63012a07c5 video-converter: split YUV to and from RGB conversions
Prepare for doing full gamma corrected conversion and scaling by first
splitting the conversions from and to RGB into separate steps.
split scaling in downscaling and upscaling steps to be performed before
and after conversion respectively.
2014-11-19 12:55:02 +01:00
Wim Taymans
f51bed2a3b video-converter: don't convert too much
because we do conversion after downscaling we only need to convert the
smallest width.
2014-11-19 12:55:02 +01:00
Wim Taymans
fc5dd035fa video-converter: add orc splat functions to draw border 2014-11-19 12:55:02 +01:00
Tim-Philipp Müller
5339e4507a video-blend: minor optimisation
Only need to run matrix on those pixels which
will actually be used.
2014-11-16 23:26:45 +00:00
Tim-Philipp Müller
9396d843d6 video-blend: fix clipping of overlay images on the left
Fix clipping of images that are partially left of the video
surface, they would get clipped on the right side instead of
the left side, because the video unpack functions currently
ignore the x offset parameter. Work around that until that
is implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=739281
2014-11-16 16:44:43 +00:00
Tim-Philipp Müller
2fae23c318 video-blend: fix allocation of temp src line for wide sources
Fix allocation of temporary source line buffers for source
images that are wider than the video overlay surface.
2014-11-16 16:44:36 +00:00
Vineeth T M
9032c12e69 video-blend: fix blending of rectangles partially or fully outside of the video
In case of overlay being completely or partially outside
the video frame, the offset calculations are not right,
which resulted in the overlay not being displayed as
expected, or crashes due to invalid memory access.

When the overlay rectangle is completely outside,
we need not render the overlay at all.

For partial display of overlay rectangles, src_yoff
was not being calculated, hence it was always clipping
the bottom half of the overlay, By calculating the
src_yoff, now the overlay is clipped properly.

https://bugzilla.gnome.org/show_bug.cgi?id=739281
2014-11-16 13:55:22 +00:00
Wim Taymans
61e84bc435 video-converter: take offset into account when unpacking
When we can directly take the input line from the source frame when
unpacking, also take into account the x offset.
2014-11-12 09:57:38 +01:00
Wim Taymans
bb4863111b video-converter: add some notes 2014-11-12 09:57:12 +01:00
Wim Taymans
b73096ce8c video-color: add gamma encode/decode functions
Add functions to encode and decode gamma.
Add unit test to check that encode and decode are eachothers inverse
and that the limits are respected.
2014-11-11 16:11:15 +01:00
Wim Taymans
c5271a2eae video-orc: update disted file
and disable one failing function
2014-11-10 12:01:48 +01:00
Wim Taymans
70cdd9195f video-orc: use faster saturating conversions
saturating conversions are generally faster.
2014-11-10 11:45:52 +01:00
Wim Taymans
dcd02cd323 video-chroma: add ORC version of UP_H2_CS
It is however slower than the C version and thus disabled.
2014-11-10 11:45:52 +01:00
Wim Taymans
39662d0393 video-chroma: ORCify 2x vertical upsampling
Make an ORC version of the 2x vertical upsampling code.
Improve unit tests, test chroma up and down sampling.
memset buffer in conversion to make valgrind happy.
2014-11-07 12:13:28 +01:00
Wim Taymans
780df29cb1 video-info: use h-cosited chroma for HD video by default 2014-11-06 18:19:44 +01:00
Wim Taymans
7690d97189 video-converter: clamp lines 2014-11-06 18:19:44 +01:00
Wim Taymans
87d59ac66d video-orc: update disted files 2014-11-06 16:29:16 +01:00
Wim Taymans
d35c5fd75c video-converter: ORCify 8<->16 conversion 2014-11-06 16:26:24 +01:00
Wim Taymans
da6f66e550 video-converter: unpack into the destination when needed
Make sure we write into the destination line when we can propose the
dest allocator.
2014-11-06 16:26:24 +01:00
Wim Taymans
d148963c7a video-converter: add more debug 2014-11-06 16:26:24 +01:00
Sebastian Dröge
860dfa93c9 video: Update disted orc files 2014-11-06 15:01:27 +01:00
Wim Taymans
21f57317bb video-chroma: optimize chroma subsampling a little
Combine multiplies in 4x filters.
Rename conversion functions to make them nicer in orc.
Add ORC versions for various downsampling algorithms
Add unit test chroma resampler
2014-11-06 13:08:42 +01:00
Wim Taymans
57b9ea8f54 video-format: update some docs and add a FIXME(2.0) 2014-11-06 10:45:13 +01:00
Wim Taymans
0f64126919 video-format: add range extension to BGR_10XE format 2014-11-06 10:45:13 +01:00
Wim Taymans
cecb900704 video-format: fix pack of 4:2:0 formats
When packing 4:2:0 formats, we need to take the chroma from the even
lines, for the odd lines we only take luminance.
2014-11-06 10:45:13 +01:00
Wim Taymans
1f14077b41 video-format: fix range extension of UYVP
We need to shift the top 6 bits to the lower 6 bits
2014-11-06 10:45:13 +01:00
Wim Taymans
3f44aaf810 video-chroma: do h subsampling after v subsampling
We only need to do the horizontal subsampling on 1 line if we do it
after vertical subsampling and we also avoid doing vertical subsampling
on unused pixels.
2014-11-06 10:45:13 +01:00
Wim Taymans
7888b4f9fa video-converter: keep separate lines with border
Make separate with a border around them so that we can avoid a memcpy.
2014-11-05 11:55:22 +01:00
Wim Taymans
cf970376df video-scaler: avoid memcpy when not needed 2014-11-05 11:55:22 +01:00
Wim Taymans
0980dfcb99 video-converter: pass output line correctly 2014-11-05 11:55:21 +01:00
Wim Taymans
3dd059baf3 video-converter: rework the converter to allow more optimizations
Rework the converter, keep track of the conversion steps by chaining the
cache objects together. We can then walk the chain and decide the
optimal allocation pattern.
Remove the free function, we're not going to need this anytime soon.
Keep track of what output line we're constructing so that we can let the
allocator return a line directly into the target image when possible.
Directly read from the source pixels when possible.
2014-11-04 17:38:11 +01:00
Wim Taymans
3286320297 video-scaler: fix temp line allocation
We need to allocate the templine with the amount of pixels we are going
to handle, which we only know for the vertical resampler when we are
asked to resample.
2014-11-04 17:38:11 +01:00
Wim Taymans
67a4702b19 video-scaler: fix taps in interlaced mode 2014-11-04 17:38:11 +01:00
Wim Taymans
562416bb94 video-scaler: fix phases in interlaced mode 2014-11-04 17:38:11 +01:00
Wim Taymans
9cc353ce7c video-orc: fix v_2tap_u16 2014-11-04 17:36:49 +01:00
Wim Taymans
7a56ec1186 video-converter: add extra pixels for the border
We need extra pixels for the border.
2014-11-03 16:19:25 +01:00
Wim Taymans
bd6d2b40d1 video-scaler: add support for 16bits formats
Add scaler functions for 16 bits formats.
Rename the scaler functions so that 16bits versions don't look too
weird.
Remove old unused h_2tap functions
Fix v_ntap functions, it was using 1 tap too little.
2014-11-03 15:41:02 +01:00
Wim Taymans
e72a01e949 video-converter: Add support for 16 bits formats
Rework the way we track the current state of the video through the
different conversion phases and use this to make sure we use the right
format and pstride where needed.
2014-11-03 15:41:02 +01:00
Wim Taymans
2f38f83c08 video-orc: comment out unused function
A faster version of 4tap horizontal scaling causes segfaults in ORC
presumably because it uses too many registers so disable it to avoid
crashing in the ORC tests.
2014-11-03 10:07:56 +01:00
Sebastian Dröge
b4ee10f616 video-scaler: Fix compiler warning
video-scaler.c:151:58: error: implicit conversion from enumeration type
      'GstVideoScalerFlags' to different enumeration type
      'GstVideoResamplerFlags' [-Werror,-Wenum-conversion]
    gst_video_resampler_init (&scale->resampler, method, flags, out_size,
    ~~~~~~~~~~~~~~~~~~~~~~~~                             ^~~~~
2014-11-03 08:12:44 +01:00
Tim-Philipp Müller
c409d134de video: fix some g-i / gtk-doc warnings 2014-11-01 14:58:13 +00:00
Tim-Philipp Müller
d2e364ff7a video: update disted orc backup functions
Fixes build without orc.
2014-11-01 14:47:26 +00:00
Tim-Philipp Müller
f04a9589d4 video: add video blend helper functions to docs
I don't think those were ever meant to be made public,
but they are, so we might as well document them.
2014-11-01 14:30:07 +00:00
Wim Taymans
ceee8d5d40 video-scaler: ORCify vertical ntap function 2014-11-01 13:15:29 +01:00
Wim Taymans
45462d2ea4 video-scaler: handle 4tap interlaced 2014-11-01 13:15:29 +01:00
Wim Taymans
cfa1f73f45 video-orc: update dist files 2014-10-31 16:53:06 +01:00
Wim Taymans
524d30a168 video-scaler: add ORC optimized ntap horizontal scalers 2014-10-31 16:50:49 +01:00
Jan Schmidt
691f020c57 video: Update disted orc files for new functions.
Fixes the build when building without ORC
2014-10-31 22:52:43 +11:00
Wim Taymans
b3ff9c030f video-converter: align offsets to subsampling
Only apply an offset that is a multiple of the subsampling. To handle
arbitrary offsets in the future, we need to be able to chroma-resample
part of the borders.
2014-10-31 11:23:21 +01:00
Wim Taymans
308d21c71f video-converter: clamp output lines 2014-10-31 11:23:21 +01:00
Wim Taymans
b2eb5f02fc video-format: add alignment checks
Some of the ORC functions need specific alignment
2014-10-31 11:23:21 +01:00
Wim Taymans
19cd171035 video-scaler: fix offset check 2014-10-31 11:23:21 +01:00
Wim Taymans
5c3c42b95d video-converter: also chroma up/downsample when scaling 2014-10-31 11:23:21 +01:00
Wim Taymans
6a529cb1dd video-converter: clamp input lines correctly 2014-10-31 11:23:21 +01:00
Tim-Philipp Müller
ef98393b0d video-scaler: fix build without orc
https://bugzilla.gnome.org/show_bug.cgi?id=739433
2014-10-30 23:53:39 +00:00
Wim Taymans
5cf4aa358d video-converter: add border color 2014-10-30 17:34:48 +01:00
Wim Taymans
ce2d4d40a1 video-converter: add support for src/dest regions
Add support for cropping the source and placing the converted image
into a rectangle in the destination frame.
Add an option to add a border and border color.
2014-10-30 17:34:48 +01:00
Wim Taymans
49d909dabf video-scaler: add more ORC functions
Add the old ORC functions for nearest and linear. Label them as Low
quality because they are not as accurate but ORC lacks opcodes to
express this for now.
2014-10-30 11:48:00 +01:00
Wim Taymans
ca2bd1cc6b video-scaler: rename resampler to video-resampler
Prefix the resampler with video-. It we would like to reuse the
resampler for audio later, we can copy/move it and deprecate this
one.
2014-10-30 11:48:00 +01:00
Wim Taymans
daf20d5e09 video-scaler: remove color range argument
We just need to clip to the format limits, if there is extra headroom in
the range we can use that without problems.
2014-10-29 17:38:33 +01:00
Wim Taymans
21ba193dd6 video-scaler: add ORC optimized versions
Add ORC optimized versions of 2 and 4tap vertical scaling. Provide
a high quality 12 bits and a low quality 6 bits version.
2014-10-29 16:26:19 +01:00
Wim Taymans
84176843c1 video-scaler: add precision to make_s16_taps 2014-10-29 16:26:19 +01:00
Wim Taymans
72b30ac5ed video-converter: copy config fields
When setting a new config, copy all the fields into our own config and
not only the ones we know about.
2014-10-29 16:26:19 +01:00
Wim Taymans
28e5ed00de resampler: make offset/phase/n_taps uint32
Make various resizer fields uint32 so that we can use them in ORC
functions later.
2014-10-29 16:26:19 +01:00
Wim Taymans
9591e22fee video-converter: don't convert too much
Always convert the smallest width.
2014-10-29 16:26:10 +01:00
Wim Taymans
fcc7fbd460 resampler: make shift easier to use 2014-10-29 16:26:10 +01:00
Wim Taymans
716b91d86e resampler: add parameters to cubic filter
Improve cubic filter and add parameters. Switch to mitchell filter
by default.
2014-10-29 16:26:10 +01:00
Wim Taymans
32047eaac0 video-scaler: add extra options 2014-10-29 16:26:10 +01:00
Wim Taymans
c409a45d13 video-converter: define some options 2014-10-29 16:26:10 +01:00
Wim Taymans
ad0e0006b2 resampler: add some options 2014-10-29 16:26:10 +01:00
Wim Taymans
b4a5001e3c resampler: limit max number of taps
Don't use more taps than the input size.
2014-10-29 16:26:10 +01:00
Wim Taymans
a81d450b7e video-converter: add scaling support
Add scaling support for the video-converter object
2014-10-29 16:26:10 +01:00
Wim Taymans
199fab4b06 video-scaler: add video scaler helper object
Add a video scaler object build on top of the resampler. It has
implementation to deal with interlaced video as well as horizontal and
vertical scaling functions.
2014-10-29 16:26:10 +01:00
Wim Taymans
c9c9e8158d video: add generic resampler
Add an object that can generate a set of resample filter coefficients.
2014-10-29 16:26:10 +01:00
Wim Taymans
549bdd4ece video-converter: rework the generic converter function
Use a LineCache object to track and process lines between unpack,
upsample, convert, downsample and pack stages. This simplifies the
main core processing function a lot and allows for future additions
easily.

Add support for interlaced formats in chroma up and downsampling.
2014-10-29 16:26:10 +01:00
Wim Taymans
71efeaaa6f video-convert: swap src and dest
It is more natural and consistent with other uses.
2014-10-29 16:26:10 +01:00
Wim Taymans
6547985f27 video-chroma: fix typo 2014-10-29 16:26:10 +01:00
Vineeth T M
2847a8108c video-blend: segfault when xpos >= video size
When the xpos is given as greater than or equal to the video size,
we get a segfault, due to improper condition.
Hence adding proper conditions.

https://bugzilla.gnome.org/show_bug.cgi?id=738984
2014-10-27 10:29:15 +00:00
Luis de Bethencourt
3f5b9c4c8b videoblend: Avoid assigning a negative value to a guint
There are some few but certain conditions where it is possible for the
dest_width to be smaller than x. So we check this before assigning a negative
value to src_width, which is a unsigned and would be promoted to a number that
can segfault videoblend.

https://bugzilla.gnome.org/show_bug.cgi?id=738242
2014-10-11 19:10:46 +01:00
Wim Taymans
e115e5059b video-chroma: improve 4x downsampling coefficients 2014-10-08 11:36:15 +02:00
Sebastian Dröge
2c4bd2296a videoconverter: Free the converter config in free() 2014-10-06 10:11:05 +03:00
Sebastian Dröge
7b428a8bcb videoencoder: Stop storing if we received EOS
This was never reset when going from PAUSED->READY and resulted
in encoders being not reusable after EOS. They just rejected any
buffer because they received EOS in their previous life.

The flag wasn't used anywhere except for rejecting buffers after
EOS, and this is now handled by GstPad directly.
2014-10-04 23:09:19 +03:00
Aurélien Zanelli
9297fe9ba0 videoencoder: release frame in finish_frame when no output state is configured
Otherwise, frame is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=737706
2014-10-01 12:53:45 +03:00
Wim Taymans
b5f3e5261a video-converter: add orc optimized matrix8 function
Add an ORC implementation of the matrix8 function.
Regenerate video-orc-dist.[ch]
2014-09-29 17:28:06 +02:00
Rico Tzschichholz
c9f4ebf495 video: Make sure to link against libm 2014-09-27 19:09:08 +01:00
Wim Taymans
07d1d7ba38 video: improve YUV -> RGB conversion
Reorganize orc instructions to free up some registers.
We can reuse the ORC code to implement the generic AYUV->ARGB matrix.
2014-09-26 18:14:11 +02:00
Tim-Philipp Müller
70d729aa8c video: update disted orc backup files 2014-09-25 15:19:46 +01:00
Wim Taymans
98c42dc5e4 video: convertor -> converter 2014-09-24 16:19:30 +02:00
Wim Taymans
b2fd20c416 video: move videoconvert code to video library
Move the conversion code used in videoconvert to the video library
and expose a simple but generic API to do arbitrary conversion. It can
currently do colorspace conversion but the plan is to add videoscale to
it as well.

See https://bugzilla.gnome.org/show_bug.cgi?id=732415
2014-09-24 15:59:39 +02:00
Wim Taymans
0c40b83ed4 video-color: add gst_video_color_matrix_get_Kr_Kb()
Move the function to get the color matrix coefficients from
videoconvert to the video library.
2014-09-24 15:59:39 +02:00
Ognyan Tonchev
00b43badc7 videopool: add missing annotation for gst_video_buffer_pool_new()
https://bugzilla.gnome.org/show_bug.cgi?id=737072
2014-09-24 11:02:42 +03:00
Stefan Sauer
cabe5746fb videoencoder: log the timestamps if we are unhappy about them
When complaining about the DTS!=PTS on keyframes log the actualy timestamps.
2014-09-22 20:16:31 +02:00
Ognyan Tonchev
29f548a7cd videodecoder: do not leak events when flushing them
https://bugzilla.gnome.org/show_bug.cgi?id=736796
2014-09-18 12:40:15 +03:00
Ognyan Tonchev
d8260cdb89 videoencoder: do not leak events when flushing them
https://bugzilla.gnome.org/show_bug.cgi?id=736796
2014-09-18 12:40:08 +03:00
Sebastian Dröge
269f642c45 video-frame: Don't ref buffers twice when mapping 2014-09-16 01:07:18 +03:00
Ognyan Tonchev
787b3fa7ec videodecoder: do not leak pool and allocator in error case
https://bugzilla.gnome.org/show_bug.cgi?id=736679
2014-09-15 10:43:23 -04:00
Sebastian Dröge
3a7cdcdfc9 videofilter: Use new GST_VIDEO_FRAME_MAP_FLAG_NO_REF
https://bugzilla.gnome.org/show_bug.cgi?id=736118
2014-09-12 14:41:01 +03:00
Sebastian Dröge
40a293d44d video-frame: Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF
This makes sure that the buffer is not reffed another time when
storing it in the GstVideoFrame, keeping it writable if it was
writable.

https://bugzilla.gnome.org/show_bug.cgi?id=736118
2014-09-12 14:39:16 +03:00
Sebastian Dröge
f711288c7c videofilter: Unref buffers before calling the transform_frame functions
GstVideoFrame has another reference, so the buffer looks unwriteable,
meaning that we can't attach any metas or anything to it

https://bugzilla.gnome.org/show_bug.cgi?id=736118
2014-09-12 14:27:44 +03:00
Sebastian Dröge
0a19783291 videodecoder: Fix broken boolean expression
We can seek with end_type==NONE and end_type==SET && end_position=-1. The
check for end_type!=NONE made the second condition impossible.

CID 1226440
2014-08-28 17:06:22 +03:00
Jan Schmidt
c98f051548 video: Add gst_video_guess_framerate() function
Takes a nominal frame duration and returns a standard
FPS if it matches closely enough (< 0.1%), or else
calculates a framerate that'll do.
2014-08-15 01:08:22 +10:00
Jan Schmidt
2a37534129 video: Various simple docs fixes 2014-08-15 01:08:12 +10:00
Jan Schmidt
946dc6b09f videodecoder: Reset last_timestamp_out on new segment
Reset last_timestamp_out when applying the output segment
change, to avoid decoder confusion over new timestamp timelines when
a seamless segment change happens.

Move some locks/unlocks to later when they're actually needed.

https://bugzilla.gnome.org/show_bug.cgi?id=734617
2014-08-14 17:59:06 +10:00
Jan Alexander Steffens (heftig)
8a1f8623fa videodecoder: Don't set decoding timestamps on raw video
https://bugzilla.gnome.org/show_bug.cgi?id=733720
2014-08-11 10:29:33 +02:00
George Kiagiadakis
a4d97f49e2 videodecoder: In reverse playback, flush the output queue after decoding each keyframe chain
This fixes the reverse playback scenario when upstream is not fully
parsing the stream and does not send every keyframe chain separately
with the DISCONT flag on the keyframe.

To explain this, let's suppose we have this stream:
 0 1 2 3 4 5 6 7 8
 K     K     K

In most circumstances, the upstream parser will chain in the
decoder the buffers in the following order:

 6 7 8 3 4 5 0 1 2
 D     D     D

In this case, GstVideoDecoder will flush the parse queue every time
it receives discont (D) and we will eventually get in the output queue:

  (flush here) 8 7 6  (flush here) 5 4 3 (flush here) 2 1 0

In case the upstream parser doesn't do this work, though,
GstVideoDecoder will receive the whole stream at once and will flush
the parse queue afterwards:

 0 1 2 3 4 5 6 7 8
 D

During the flush, it will look backwards for keyframes and will
decode in this order:

 6 7 8 3 4 5 0 1 2

This is the same order that it would receive from upstream if
upstream was parsing and looking for the keyframes, only that now
there is no flushing of the output queue in between keyframes,
which will result in the output queue looking like this:

 2 1 0 6 5 3 8 7 6

This will confuse downstream obviously and will play incorrectly.
This patch forces the decoder to flush the output queue every time
it picks a new keyframe to decode, so it will end up decoding 6 7 8
and then flushing before picking 3 for decoding, so the output will
get 8 7 6 before 6 5 3 and the video will play back correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=734441
2014-08-11 10:22:55 +02:00
Nicolas Dufresne
ce50fc221e videoencoder: Don't delay set_format
This prevent implementing allocation query, as the format need to be
known in order to determin the size and number of buffers needed.

Note: This may lead to few regressions that will need fixing

https://bugzilla.gnome.org/show_bug.cgi?id=732288
2014-07-25 14:12:02 -04:00
Sebastian Dröge
11ef208736 videodecoder: Handle CAPS events immediately instead of delaying them
https://bugzilla.gnome.org/show_bug.cgi?id=733147
2014-07-21 09:35:37 +02:00
Gwenole Beauchesne
fb44ec9615 videodecoder: parse any source data that is still available.
Fix gst_video_decoder_parse_available() to really parse any pending
source data that is still available in the adapter. This is a memory
optimization to avoid expansion of video packed added to the adapter,
but also a fix to EOS condition when the subclass parse() function
ultimately only needed to call into gvd_have_frame() and no additional
source bytes were consumed, i.e. gvd_add_to_frame() is not called.

This situation can occur when decoding H.264 streams in byte-stream/nal
mode for instance. A decoder always requires the next NAL unit to be
parsed so that to determine picture boundaries. When a new picture is
found, no byte is consumed (i.e. gvd_add_to_frame() is not called)
but gvd_have_frame() is called (i.e. priv->current_frame is gone).

Also make sure to avoid infinite loops caused by incorrect subclass
parse() implementations. This can occur when no byte gets consumed
and no appropriate indication (GST_VIDEO_DECODER_FLOW_NEED_DATA) is
returned.

https://bugzilla.gnome.org/show_bug.cgi?id=731974

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-07-03 09:47:20 +02:00
Evan Nemerson
7b791749a0 docs: Assorted documentation and introspection fixes for new 1.4 API
https://bugzilla.gnome.org/show_bug.cgi?id=732595
2014-07-02 09:09:44 +02:00
Thiago Santos
fb3a9d1bc5 video: avoid overflows when doing int operations for size
size is a gsize, so cast the operands to it to avoid overflows
and setting wrong value to the video size.

Includes tests.

https://bugzilla.gnome.org/show_bug.cgi?id=731195
2014-06-09 23:38:39 -03:00
Thibault Saunier
d2ea3260e9 videodecoder: Keep still meaningfull pending events on FLUSH_STOP
Only EOS and segment should be deleted in that case.

+ Add a testcase

https://bugzilla.gnome.org/show_bug.cgi?id=709868
2014-06-03 13:03:49 +02:00
Thibault Saunier
2843f358d9 videoencoder: Keep still meaningfull pending events on FLUSH_STOP
Only EOS and segment should be deleted in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=709868
2014-06-03 13:03:19 +02:00
Thiago Santos
0cb5ea4396 videodecoder: actually return the push result in backwards playback
It was always returning _OK regardless of what downstream returned
2014-05-26 23:24:56 -03:00
Thiago Santos
ff9e37ea66 videodecoder: return EOS when segment is over
if a buffer is clipped by being completely out of segment, check if this
buffer is after the end of the segment and return EOS upstream

https://bugzilla.gnome.org/show_bug.cgi?id=709224
2014-05-26 19:26:45 -03:00
Nicolas Dufresne
e0cfd6e26b video-info: Also check the stride and offset are equal
gst_video_info_is_equal() was not checking if stride and offset
had changed.

https://bugzilla.gnome.org/show_bug.cgi?id=729896
2014-05-12 18:22:32 -04:00
Edward Hervey
ec95963b1f videodecoder: Free data after removing it from the list
While it wouldn't have caused any failures (g_list_remove doesn't dereference
the provided pointer), it does make the code cleaner.

CID #1212174
2014-05-12 17:17:07 +02:00
Nicolas Dufresne
64d58b80c0 videodecoder: Retry setting configuration with modified config
Buffer pool set_config() may return FALSE if requested configuration needed small
changes. Reget the config and try setting it again. This ensure we have a configured
pool if possible.
2014-05-08 15:09:47 -04:00
Sebastian Dröge
68f5350c66 Release 1.3.1 2014-05-03 17:50:10 +02:00
Thiago Santos
5ac9476b40 videodecoder: do not parse caps for not using it
Saving some cpu
2014-05-01 19:31:25 -03:00
Sebastian Dröge
9398207101 videoframe: Initialise GstVideoFrame to zeroes if mapping fails
This should allow for more meaningful errors. Dereferencing NULL
is more useful information than dereferencing a random address
happened to be on the stack.
2014-04-16 19:53:46 +02:00
Vincent Penquerc'h
3d1fdf8dd8 video-overlay-composition: guard against NULL pointer dereference on error
If gst_video_overlay_rectangle_apply_global_alpha is called with
a rectangle with unsuitable alpha, expanding the alpha plane will
fail, and thus lead to dereferencing a NULL src pointer. It's not
certain this will happen in practice, as the function is static
and callers might ensure suitable alpha before calling, but there
is no apparent explicit such check.
Add prologue asserts for proper alpha to explicitely prevent this.

Coverity 1139707
2014-04-10 12:35:03 +01:00
Vincent Penquerc'h
4a401adf38 videometa: fix texture_type memcpy size
Coverity 1139589, 1139588
2014-04-10 12:35:03 +01:00
Sebastian Dröge
8c7cbeed5b video-event: Update the running times in the force-keyunit events from the pad offsets 2014-04-10 09:18:05 +02:00
Thiago Santos
05e957106f videodecoder: do not deactivate the bufferpool, just unref
Videodecoder does late renegotiation, it will wait for the next
buffer before renegotiating its caps and bufferpool. It might happen
that downstream element switched from passthrough to non-passthrough
and sent a reconfigure upstream (that caused this renegotiation).
This downstream element will ask the video sink below for the bufferpool
with an allocation query and will get the same bufferpool that
videodecoder is holding, too.

When renegotiating, if videodecoder deactivates its bufferpool it
might be deactivating the bufferpool that some element downstream
is using and cause the pipeline to fail.

https://bugzilla.gnome.org/show_bug.cgi?id=727498
2014-04-04 13:50:03 -03:00
Sebastian Dröge
6189847ed0 videodecoder: Always drain the decoder after a discont group in reverse playback mode 2014-03-30 18:26:59 +02:00
Sebastian Dröge
5a4fbb1638 videodecoder: Flush the decoder once per discont group, not once per keyframe 2014-03-30 18:00:53 +02:00
Sebastian Dröge
f1f8731ff5 videodecoder: Handle reverse playback with multiple GOPs per discont group properly
baseparse will reverse each GOP for us already, so the segment events can
be after our keyframe. Make sure to get it and all other relevant sticky
events before starting to decode.
2014-03-30 17:59:55 +02:00
Sebastian Dröge
50c2218d4d videodecoder: Log event types of events that are pushed downstream 2014-03-29 10:33:01 +01:00
Sebastian Dröge
1c26e5734c videodecoder: In reverse playback mode we need to finish the subclass after passing all frames to it 2014-03-29 10:33:01 +01:00
Matthieu Bouron
a8951c16da video-overlay-composition: add GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION 2014-03-05 20:38:45 +01:00
Sebastian Rasmussen
900c204eb9 videoformat: Remove duplicate/incorrect section
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725521
2014-03-02 23:41:51 +00:00
Sebastian Rasmussen
35bb1b3328 docs: Add annotations for return values
Rephrase and clarify some return value descriptions

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725521
2014-03-02 23:41:18 +00:00
Sebastian Rasmussen
5b4f2ba20b docs: Fix argument and annotation typos
* colorbalance: Fix misspelled annotation
 * rtsp: Replace incorrectly documented function argument
 * sdp: Escape @ character to avoid gtk-doc warning
 * video-*: Add missing annotation colon
 * videodecoder/video-color: Fix function argument typos
 * videoutils: Remove unknown annotation field

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725521
2014-03-02 23:22:51 +00:00
Tim-Philipp Müller
6442e76e9f docs: add GstVideoPool to docs 2014-02-23 14:42:12 +00:00
Nicolas Dufresne
6b77971097 video: Fix NV12_64Z32 default offset and size
This was a regression introduced by f52fd7a68, where we started using
the stride to encode the dimensions in tiles. This patch simply updates
offset and size calculation as described in the documentation,
part-mediatype-video-raw.txt.
2014-02-18 13:09:21 -05:00
Thiago Santos
da54836a33 videoencoder: push tags and events before eos
if any tags or events are pending, push them before pushing eos
2014-01-29 12:33:59 -03:00
Wim Taymans
8ac3dbc4f3 video-chroma: don't crash on NULL resamplers
Make dummy resamplers for all cases and only execute the horizontal
resampler instead of crashing.

See https://bugzilla.gnome.org/show_bug.cgi?id=722742
2014-01-23 10:45:00 +01:00
Sebastian Dröge
87829debe4 videodecoder: Add API to get the currently pending frame size for parsing
https://bugzilla.gnome.org/show_bug.cgi?id=719890
2014-01-18 13:54:22 +01:00
Thiago Santos
47f720a8f0 videodecoder: plug leak when frames are released on subclass stop
They end up stored in the 'pending_events' list and should be
freed after calling stop
2014-01-17 11:21:33 -03:00
Sebastian Dröge
335e6e888d videoverlay: Don't mention gconf elements and add a sentence about playbin/playsink
playbin/playsink now implement the video overlay interface
2014-01-14 13:20:48 +01:00
Wim Taymans
ecac298e4e videodecoder: only copy chroma_site when known
Only overwrite the chroma-site if we have a valid value in the reference
format.
2014-01-13 17:24:01 +01:00
Wim Taymans
fba783a5fe videoutils: add some debug 2014-01-13 17:24:01 +01:00
Nicolas Dufresne
595bcfb4d7 video: Generate types for tile enumeration
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:47:23 -05:00
Nicolas Dufresne
f52fd7a68b video: Don't use extra plane and componenent for tile format
Instead of using extra plane, we encode the number of tiles in x and y in the stride of
each planes (i.e. y_tiles << 16 | x_tiles) and introduce tile_mode, tile_width and
tile_height into GstVideoFormatInfo structure.

https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:47:03 -05:00
Wim Taymans
d899e6df5a video: rename NV12T -> NV12_64Z32
Is a bit more descriptive and allows us to add more tiled types
later.

https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:52 -05:00
Nicolas Dufresne
c8597330a9 video-frame: scale vertical tiles based on subsampling
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:45 -05:00
Nicolas Dufresne
53605e35f4 video-frame: fix tiled pixel stride
Pixel stride is per component, not per plane. We get the tile mode from
the pixelstride of the TILE component.

https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:37 -05:00
Wim Taymans
61cbdf379b format: improve docs
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:31 -05:00
Wim Taymans
f3e989179b video-format: fix off-by-one for tiled coordinates
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:17 -05:00
Wim Taymans
fb0fecbf48 video-tile: improve docs
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:07 -05:00
Wim Taymans
33c486e5c1 video-format: use shifts when possible
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:46:01 -05:00
Wim Taymans
980811c120 video-frame: fix copy of tiled formats
Add code to copy tiled planes.

https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:45:50 -05:00
Wim Taymans
3ceb7dfe22 video-tile: add tile mode and helper functions
Move the tile helper functions to their own file. Make it possible to
make other tiling modes later.

https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:45:37 -05:00
Wim Taymans
f8d3b9b4fc video: add NV12T support
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:45:26 -05:00
Wim Taymans
67a2717235 Add tiled color format support
https://bugzilla.gnome.org/show_bug.cgi?id=707361
2014-01-13 10:45:02 -05:00
Thiago Santos
672cda66db videodecoder: do not lose events when dropping frames
Events must be persisted after a frame is dropped to avoid
losing obligatory information for the stream.

https://bugzilla.gnome.org/show_bug.cgi?id=721835
2014-01-13 06:11:09 -03:00
Thiago Santos
5b8e1925b5 videodecoder: use new segment earlier for reverse playback
For reverse playback, the segment event will only be pushed when
the first buffer is actually pushed. But for decoding frames and storing
those into the list to be pushed the output_segment.rate value is used
to determine if it is forward or reverse playback.

In case a previous segment event (or none) is in use it will mistakenly
think it is doing forward playback and push the buffers immediatelly and
try to clip buffers based on an old segment (or an uninitialized one, leading
to an assertion)

This patch fixes this by copying the segment earlier if on reverse playback

https://bugzilla.gnome.org/show_bug.cgi?id=721666
2014-01-13 06:11:09 -03:00
Sebastian Dröge
58592a2af3 audio/video-info: Properly initialize the info structures in set_format()
And don't assume in other code that set_format() preserves any fields at
all. These assumptions were already made here for fields that were changed
by set_format().
2013-12-30 10:53:24 +01:00
Sebastian Dröge
65732d9c97 audio/video-info: Initialize the complete struct to 0 in the beginning
Instead of only initializing some parts in some code paths. Also
makes it easier to use the reserved bits of the structs later.

https://bugzilla.gnome.org/show_bug.cgi?id=720810
2013-12-30 10:15:20 +01:00
Wim Taymans
f8e3a25415 video-frame: fix plane copy for index plane
Move the code to handle the index plane in the _copy_plane.
2013-12-25 10:54:55 +01:00
Lionel Landwerlin
aedca7acfc colorbalance: add missing annotation for list_channels()
https://bugzilla.gnome.org/show_bug.cgi?id=720999
2013-12-24 09:25:53 +00:00
Edward Hervey
b97c711def audio/video: Initialize all {audio|video}info fields
Fixes "Unitialized Scalar Variable" issues reported by Coverity.

Has the added advantage of detecting whether somebody *does* use those
fields (ending up with a invalid address).

https://bugzilla.gnome.org/show_bug.cgi?id=720810
2013-12-20 14:47:22 +01:00
Sebastian Dröge
27c1261c72 video-format: Document usage of GST_VIDEO_FORMAT_ENCODED
This must only ever be used in caps in combination with a non-system
memory GstCapsFeatures, and where it does not make sense to specify
any of the other video formats. Examples of this would be in gst-vaapi.
2013-12-17 17:25:07 +01:00
Sebastian Dröge
8499a0e35a Revert "video: specify/restrict usage of GST_VIDEO_FORMAT_ENCODED"
This reverts commit 5fcdabd907.

Instead of making it impossible to use the ENCODED format we should
just document that it must not be used for capsfeature-less caps.

Also this commit broke API/ABI.
2013-12-17 17:23:19 +01:00
Sebastian Dröge
3e61449c86 videoencoder: Release the allocator on hard resets 2013-12-17 17:10:19 +01:00
Julien Isorce
2e38741b94 videodecoder: release buffer pool and allocator on full reset
It allows to release the buffer pool sooner (i.e. when going
to GST_STATE_READY). Previously it was released in finalize.

Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=720389
2013-12-16 16:07:05 +00:00
Sebastian Dröge
b5d26f3907 videodecoder: gst_video_decoder_release_frame() is available since 1.2.2 2013-12-13 14:37:24 +01:00
Edward Hervey
5fcdabd907 video: specify/restrict usage of GST_VIDEO_FORMAT_ENCODED
GST_VIDEO_FORMAT_ENCODED was added to support *extracting* video-related
information (like width, height, framerate,...) from caps.

It is __NOT__ intended to be used as a format field on video/x-raw caps.
2013-12-11 16:51:42 +01:00
Sebastian Dröge
9ec4eaa866 convertframe: Fix indention 2013-12-09 16:34:22 +01:00
Sebastian Dröge
729e3c8a10 videoencoder: Add sink_query() src_query() virtual functions
Based on the videodecoder change by Nicolas Dufresne and applied
here for consistency.

https://bugzilla.gnome.org/show_bug.cgi?id=720103
2013-12-09 16:34:19 +01:00
Nicolas Dufresne
09a6ca97d2 videodecoder: Add sink_query() src_query() virtual
https://bugzilla.gnome.org/show_bug.cgi?id=720103
2013-12-09 09:41:46 -05:00
Olivier Crête
d273d0c156 videocodecframe: Correct function name in doc 2013-12-06 19:27:08 -05:00
Olivier Crête
779e360352 videoencoder: Remove gst_video_encoder_set/get_discont
They've never existed outside the header file.
2013-12-06 16:24:46 -05:00
Julien Isorce
79ef75888c videodec/enc: clear reconfigure flag if negotiate succeeds
So that it avoids to send an allocation query twice.
One from an early call to gst_video_encoder_negotiate from a
subclass, then one from gst_video_encoder_allocate_output_frame.
Which means that previously gst_video_encoder_negotiate was not
clearing the GST_PAD_FLAG_NEED_RECONFIGURE even on success.

Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=719684
2013-12-05 15:19:16 +00:00
Sebastian Dröge
5acc099479 videodecoder: Add API to allow subclasses to specify that they needs caps before any buffers 2013-12-05 11:36:54 +01:00
Sebastian Dröge
820d7d7798 videoencoder: Return not-negotiated if we don't have caps when the first buffer arrives
Otherwise things like filesrc ! jpegenc ! fakesink just crash with
a segmentation fault because subclasses expect caps to be there.
2013-12-05 11:26:55 +01:00
Justin Joy
4a81e22607 convertframe: Fix trivial memory leak in debug statement
gst_element_get_name() requires the caller to g_free() the return value

https://bugzilla.gnome.org/show_bug.cgi?id=719850
2013-12-04 18:03:25 +01:00
Mark Nauwelaerts
40fc306017 videodecoder: make _release_frame external API
... so subclasses can release a frame all the way (also from frame list)
without having to pass through _finish_frame or _drop_frame.
The latter may not be applicable, or may or may not have already
been called for the frame in question.

See https://bugzilla.gnome.org/show_bug.cgi?id=693772
2013-12-01 12:06:37 +01:00
Mark Nauwelaerts
614d35d795 videodecoder: fix spelling error in debug message 2013-12-01 12:06:36 +01:00
Matthew Waters
2e84acce58 videometa: add GstVideoGLTextureUploadMeta buffer pool option
allows configuration of whether GstVideoGLTextureUploadMeta is
added to buffers resulting from a buffer pool.  This is sperate
to the caps feature in that an element may want to add the upload
meta itself rather than allowing the buffer pool to.

https://bugzilla.gnome.org/show_bug.cgi?id=712798
2013-11-26 14:04:38 +01:00
Thiago Santos
81471099d2 videodecoder: error out if no frames are decoded before eos
Raise an error in case no frames are decoded before EOS and we
have input, meaning that data was received but it was somehow invalid.

https://bugzilla.gnome.org/show_bug.cgi?id=711094
2013-11-25 10:53:25 -03:00
Thiago Santos
0765962fbc videodecoder: allow using -1 for infinite tolerated errors
Allows using -1 to make videodecoder never post an error message
after decoding errors.

https://bugzilla.gnome.org/show_bug.cgi?id=711094
2013-11-25 10:53:14 -03:00
Mark Nauwelaerts
ee86a91957 videodecoder: avoid descending output timestamps
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=712796
2013-11-23 19:39:52 +01:00
Sreerenj Balachandran
cd52ff313e videodecoder: try to negotiate the buffer pool even though there is no o/p format
We could have allocation query before caps event and even without caps inside
the query. In such cases , the downstream can return a bufferpool object with
out actually configuring it. This feature is helpful to negotiate the bufferpool
with out knowing the output video format. For eg: some hardware accelerated
decoders can interpret the o/p video format only after it finishes the decoding
of one buffer at least.

https://bugzilla.gnome.org/show_bug.cgi?id=687183
2013-11-11 13:28:11 +01:00
Stephan Sundermann
2b45196042 navigation: Add missing out parameter annotations to GstNavigation
https://bugzilla.gnome.org/show_bug.cgi?id=709938
2013-10-11 23:06:55 +02:00
Stefan Sauer
9269bee9bd videodecoder: don't overflow in bytes<->time conversion
fps_n and _d values can be large and this can overflow a uint. Also fix
copy'n'paste mistake in comments.
2013-10-08 09:15:21 +02:00
Wim Taymans
30a0cccbf6 video-frame: copy offsets from metadata
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708606
2013-09-23 11:55:07 +02:00
Olivier Crête
c10311ba70 videodecoder: If there is no PTS at all, assume it starts from the segment start
This is to make the multifilesrc ! pngdec case work

https://bugzilla.gnome.org/show_bug.cgi?id=688043
2013-09-19 09:52:48 +02:00
Sebastian Dröge
35ee4b056b videodecoder/videoencoder: Mark pads as requiring reconfiguration again if negotiation fails
Otherwise we might end up in non-optimal configuration, especially
when a flush happened during reconfiguration.
2013-09-12 09:35:00 +02:00
Wim Taymans
d3641943b3 docs: fix some doc blocks 2013-09-09 15:52:05 +02:00
Mathieu Duponchelle
1664468eaa videofilter: implement transform_meta virtual method.
If tags of the meta only contain "video", let it be copied.
2013-09-09 15:37:02 +02:00
Mathieu Duponchelle
d1cb9c994b video/audio: #define metadata strings.
For instance "orientation" becomes GST_VIDEO_ORIENTATION_METADATA.
2013-09-09 15:37:02 +02:00
Tim-Philipp Müller
d7775cffb9 video: fix build without orc or older or versions
./.libs/libgstvideo-1.0.so: undefined reference to `video_orc_unpack_NV24'
./.libs/libgstvideo-1.0.so: undefined reference to `video_orc_pack_NV24'
2013-09-06 13:28:00 +01:00
Wim Taymans
fae9d82515 video-format: fix NV24 pack/unpack function
We can't reuse the NV12 functions, we need to make new ones.
2013-09-06 12:45:36 +02:00
Wim Taymans
26d04c7582 video-format: handle odd width in more pack/unpack functions 2013-09-06 12:45:36 +02:00
Tim-Philipp Müller
2f6f0ee214 video-format: minor pack_YVYU optimisation
Re-use already calculated line offset.
2013-09-05 18:34:21 +01:00
Wim Taymans
e55ff1e374 video-format: fix chroma offsets 2013-09-05 17:06:36 +02:00
Wim Taymans
bbeac11e74 video-format: fix unpack functions for odd formats 2013-09-05 16:16:12 +02:00
Wim Taymans
d33e73e00f video-format: clean up pack/unpack functions 2013-09-05 15:02:17 +02:00
Wim Taymans
6508c738ff video-format: handle odd width in various pack functions 2013-09-05 14:13:24 +02:00
Wim Taymans
9b01d9a1d9 video-format: don't overrun the arrays on UYVP 2013-09-05 12:44:32 +02:00
Matej Knopp
d03feedf4c videoencoder: Check for invalid stop position before calculating a duration from it
https://bugzilla.gnome.org/show_bug.cgi?id=707332
2013-09-03 09:50:56 +02:00
Andoni Morales Alastruey
688505de88 videoencoder: fix forwarding of GstForceKeyUnit events
Use the frame id to match the output forced keyframe with
the event that forced it.

https://bugzilla.gnome.org/show_bug.cgi?id=706885
2013-08-27 15:11:33 +02:00
Sebastian Dröge
b0e4b5f69a videoencoder: Make sure to return TRUE if the same caps are set again 2013-08-25 10:26:30 +02:00
Sebastian Dröge
f678411c6e videoencoder: Only set the caps when they actually changed 2013-08-23 19:20:03 +02:00
Edward Hervey
d1cf4b2b9a videocoder: Don't push out identical caps
This avoids triggering plenty of extra code/methods/overhead downstream when
we can just quickly check whenever we want to set caps whether they are
identical or not

https://bugzilla.gnome.org/show_bug.cgi?id=706600
2013-08-23 15:22:43 +02:00
Rico Tzschichholz
cb3e2fd218 videometa: fix syntax error 2013-08-21 11:20:28 +01:00
Tim-Philipp Müller
2f05268517 video: make direct includes work again
Not nice to break people's code if we can avoid it. Could
add a warning in the next cycle, and then require single
includes in the cycle after.

https://bugzilla.gnome.org/show_bug.cgi?id=695889
2013-08-16 14:14:15 +01:00
Sebastian Dröge
c4d7ffddb5 videodecoder: Don't reset too much if we're resetting because of a soft-flush
Fixes reverse playback with Ogg/Theora.
2013-08-15 14:33:18 +02:00
Sebastian Dröge
695675ab7e videodecoder: Don't reset decoder on segment events
Either there was a flush before that resets everything anyway,
or resetting would make us lose information we might need if
it's just a segment update.
2013-08-15 13:26:39 +02:00
Sebastian Dröge
146bb1a153 video{en,de}coder: Add new flush vfunc as a replacement for reset 2013-08-15 13:26:39 +02:00