platform/upstream/gstreamer.git
9 years agovideo-scaler: add scaler optimization
Wim Taymans [Wed, 25 Feb 2015 14:33:26 +0000 (15:33 +0100)]
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.

9 years agovideo-scaler: remove unused case
Wim Taymans [Wed, 25 Feb 2015 14:32:57 +0000 (15:32 +0100)]
video-scaler: remove unused case

9 years agovideo-converter: don't overwrite border alpha
Wim Taymans [Wed, 25 Feb 2015 10:38:17 +0000 (11:38 +0100)]
video-converter: don't overwrite border alpha

Let border alpha and image alpha be independent.

9 years agovideo-converter: use 1.0 as default alpha
Wim Taymans [Tue, 24 Feb 2015 16:33:57 +0000 (17:33 +0100)]
video-converter: use 1.0 as default alpha

9 years agovideo-converter: add alpha handling
Wim Taymans [Tue, 24 Feb 2015 16:26:31 +0000 (17:26 +0100)]
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

9 years agovideo-converter: fix chroma subsampling
Wim Taymans [Tue, 24 Feb 2015 16:20:53 +0000 (17:20 +0100)]
video-converter: fix chroma subsampling

Also adjust the output line number with the offset.

9 years agovideo-converter: disable fastpath when scaling and gamma
Wim Taymans [Tue, 24 Feb 2015 09:01:18 +0000 (10:01 +0100)]
video-converter: disable fastpath when scaling and gamma

Disable the fastpath when scaling and doing gamma remap.

9 years agovideo-converter: don't do gamma on alpha channel
Wim Taymans [Tue, 24 Feb 2015 08:54:18 +0000 (09:54 +0100)]
video-converter: don't do gamma on alpha channel

The alpha channel is not supposed to be gamma encoded.

9 years agodecodebin: fix deadlock when resetting buffering
Vincent Penquerc'h [Tue, 24 Feb 2015 16:06:08 +0000 (16:06 +0000)]
decodebin: fix deadlock when resetting buffering

This function is static, and only ever called with the expose lock
taken. It thus has no reason to take this lock itself.

This was introduced by one of my locking fixes from 741355.

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

9 years agovideo-converter: minor docs fix
Tim-Philipp Müller [Tue, 24 Feb 2015 12:38:10 +0000 (12:38 +0000)]
video-converter: minor docs fix

9 years agoplaybin: forward template and ring buffer settings to existing decodebins
Vincent Penquerc'h [Tue, 27 May 2014 13:54:06 +0000 (13:54 +0000)]
playbin: forward template and ring buffer settings to existing decodebins

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

9 years agodecodebin: move null check
Luis de Bethencourt [Mon, 23 Feb 2015 17:24:52 +0000 (17:24 +0000)]
decodebin: move null check

Check if dbin->decode_chain is NULL before running drain_and_switch_chains()
because if it is, we shouldn't run that function or it will segfault.

CID #1271074

9 years agoaudiodecoder: Don't send pending events before decode
Jan Schmidt [Sun, 22 Feb 2015 14:32:14 +0000 (01:32 +1100)]
audiodecoder: Don't send pending events before decode

Make sure to update the output segment to track the segment
we're decoding in, but don't actually push it downstream until
after buffers are decoded.

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

9 years agovideodecoder: Add drain() vfunc
Jan Schmidt [Sat, 7 Feb 2015 18:19:25 +0000 (05:19 +1100)]
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

9 years agoRevert "videodecoder: drain current segment upon new one to ensure correct flow return"
Mark Nauwelaerts [Sun, 22 Feb 2015 15:57:57 +0000 (16:57 +0100)]
Revert "videodecoder: drain current segment upon new one to ensure correct flow return"

This reverts commit cc1b4eaf9ebe4568f9c2c64338cef1b2edbdca3f.

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

9 years agoRevert "audiodecoder: drain current segment upon new one to ensure correct flow return"
Mark Nauwelaerts [Sun, 22 Feb 2015 15:57:50 +0000 (16:57 +0100)]
Revert "audiodecoder: drain current segment upon new one to ensure correct flow return"

This reverts commit 696b8cdc40f033ff0a45ebe620279130152fb2f8.

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

9 years agovideodecoder: drain current segment upon new one to ensure correct flow return
Mark Nauwelaerts [Sat, 21 Feb 2015 16:42:08 +0000 (17:42 +0100)]
videodecoder: drain current segment upon new one to ensure correct flow return

See also https://bugzilla.gnome.org/show_bug.cgi?id=709224

9 years agoaudiodecoder: drain current segment upon new one to ensure correct flow return
Mark Nauwelaerts [Sat, 21 Feb 2015 16:41:50 +0000 (17:41 +0100)]
audiodecoder: drain current segment upon new one to ensure correct flow return

See also https://bugzilla.gnome.org/show_bug.cgi?id=709224

9 years agodecodebin: Only consider non-parser factories for generating the post-parser capsfilt...
Sebastian Dröge [Fri, 20 Feb 2015 10:34:11 +0000 (12:34 +0200)]
decodebin: Only consider non-parser factories for generating the post-parser capsfilter caps

Otherwise if there are multiple parsers we would most likely break negotiation
of the stream-format/alignment wanted by the decoders as parsers generally
support all possible stream-formats and alignments.

9 years agoaudio: video: fix a few GI annotations
Thiago Santos [Thu, 19 Feb 2015 18:51:19 +0000 (15:51 -0300)]
audio: video: fix a few GI annotations

transfer-full -> transfer full
@Since -> Since

9 years agodecodebin: fix deadlock between downward state change and pad addition
Vincent Penquerc'h [Thu, 5 Feb 2015 12:07:50 +0000 (12:07 +0000)]
decodebin: fix deadlock between downward state change and pad addition

If caps on a newly added pad are NULL, analyze_new_pad will try to
acquire the chain lock to add a probe to the pad so the chain can
be built later. This comes from the streaming thread, in response
to headers or other buffers causing this pad to be added, so the
stream lock is taken.

Meanwhile, another thread might be destroying the chain from a
downward state change. This will cause the chain to be freed with
the chain lock taken, and some elements are set to NULL here, which
can include the parser. This causes pad deactivation, which tries
to take the element's pad's stream lock, deadlocking.

Fix this by keeping track of which elements need setting to NULL,
and only do this after the chain lock is released. Only the chain
manipulation needs to be locked, not the elements' state changes.

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

9 years agodecodebin: guard against the decode chain going while a pad is added
Vincent Penquerc'h [Wed, 4 Feb 2015 11:46:09 +0000 (11:46 +0000)]
decodebin: guard against the decode chain going while a pad is added

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

9 years agodecodebin: possible fix for deadlock when spamming "next song"
Vincent Penquerc'h [Tue, 3 Feb 2015 17:06:43 +0000 (17:06 +0000)]
decodebin: possible fix for deadlock when spamming "next song"

There was a deadlock between a thread changing decodebin/demuxer
state from PAUSED to READY, and another thread pushing data
when starting.

From the stack trace at
https://bug741355.bugzilla-attachments.gnome.org/attachment.cgi?id=292471,
I deduce the following is happening, though I did not reproduce the
problem so I'm not sure this patch fixes it.

The streaming thread (thread 2 in that stack trace) takes the demuxer's
sink pad's stream lock in gst_ogg_demux_perform_seek_pull and will
activate a new chain. This ends up causing the expose lock being taken
in _pad_added_cb in decodebin.

Meanwhile, a state changed is triggered on thread 1, which takes the
expose lock in decodebin in gst_decode_bin_change_state, then frees
the previous chain, which ends up calling gst_pad_stop_task on the
demuxer's task, which in turn takes the demuxer's sink pad's stream
lock, deadlocking as both threads are now waiting for each other.

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

9 years agotagdemux: ensure tags have been fetched before pulling data
Thiago Santos [Wed, 18 Feb 2015 23:58:15 +0000 (20:58 -0300)]
tagdemux: ensure tags have been fetched before pulling data

Otherwise upstream can get confused about offsets as there will
be a jump once the tags have been parsed due to the stripped area.

If upstream pulls from 0 to 100, and then tagdemux does the
tag reading and finds out that the first 200 bytes are the tag, the
next pull from upstream will have an offset of 200 bytes. So
upstream will get the following data:

0 - 100, 300 - (EOS), as it will continue requesting from where
it has last stopped, but tagdemux will add an offset to skip the
tags.

This patch makes sure that the tags have been parsed and skipped
since the first pull range call.

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

9 years agouridecodebin: Reset the default query return value when the iterator has to resync
Sebastian Dröge [Wed, 18 Feb 2015 23:30:05 +0000 (01:30 +0200)]
uridecodebin: Reset the default query return value when the iterator has to resync

9 years agouridecodebin: Let the latency query fail if one of the source queries fails
Sebastian Dröge [Wed, 18 Feb 2015 23:21:47 +0000 (01:21 +0200)]
uridecodebin: Let the latency query fail if one of the source queries fails

9 years agopbutils: description: fix MPEG-2 video profiles in description
Tim-Philipp Müller [Wed, 18 Feb 2015 11:34:15 +0000 (11:34 +0000)]
pbutils: description: fix MPEG-2 video profiles in description

We would accidentally use the profile nick as profile name
in the description for MPEG video that's not version 4.

9 years agouridecodebin: Pass object, not GValue to debug print
Olivier Crête [Thu, 29 Jan 2015 23:49:45 +0000 (18:49 -0500)]
uridecodebin: Pass object, not GValue to debug print

9 years agoaudiovisualizer: don't use private GMutex implementation details
Tim-Philipp Müller [Mon, 16 Feb 2015 23:54:28 +0000 (23:54 +0000)]
audiovisualizer: don't use private GMutex implementation details

Don't use private GMutex implementation details to check
whether it has been freed already or not. Just turn dispose
function into finalize function which will only be called
once, that way we can just clear the mutex unconditionally.

9 years agostreamsynchronizer: Use the same waiting function for EOS and stream switches
Song Bing [Sun, 15 Feb 2015 05:51:36 +0000 (13:51 +0800)]
streamsynchronizer: Use the same waiting function for EOS and stream switches

Also improve the waiting condition for stream switches, which was assuming
before that the condition variable will only stop waiting once when it is
signaled. But the documentation says that there might be spurious wakeups.

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

9 years agostreamsynchronizer: Unit test for streamsynchronizer's EOS handling
Song Bing [Mon, 26 Jan 2015 03:14:13 +0000 (11:14 +0800)]
streamsynchronizer: Unit test for streamsynchronizer's EOS handling

Test that a pipeline can change from PLAYING to PAUSED and back in
the following scenarios:
1. One track reach EOS after pushed some buffers while another track
still pushes buffers
2. One track reach EOS without buffers while another track still pushes
buffers

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

9 years agostreamsynchronizer: Send GAP events from the pads' streaming threads
Song Bing [Mon, 12 Jan 2015 09:40:25 +0000 (17:40 +0800)]
streamsynchronizer: Send GAP events from the pads' streaming threads

Change the GAP events that are currently sent from the chain function of
the current pad to all other EOS pads. They should instead be sent from
their own streaming threads.

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

9 years agostreamsynchronizer: Send GAP event to finish preroll when change state from PLAYING...
Song Bing [Mon, 12 Jan 2015 08:08:33 +0000 (16:08 +0800)]
streamsynchronizer: Send GAP event to finish preroll when change state from PLAYING to PAUSED

Wait in the event function when EOS is received until all pads are EOS
and then forward the EOS event from each pads own event function.

Also send a new GAP event for EOS pads from the event function whenever
going from PLAYING->PAUSED by shortly waking up the GCond. This is needed
to allow sinks to pre-roll again, as they did not receive EOS yet because
we blocked that, but also will never get data again.

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

9 years agoRevert "codec-utils: Handle the two rext profiles for h265"
Sebastian Dröge [Mon, 16 Feb 2015 07:48:03 +0000 (09:48 +0200)]
Revert "codec-utils: Handle the two rext profiles for h265"

This reverts commit 19b93566801a56e7b043a670b7edcf8f2da06619.

These two "profiles" are actually a complete set of profiles, which we will
need to handle separately. Unfortunately it seems like we need information
from the SPS to detect the exact profile.

9 years agopbutils: description: move some code into utility function
Tim-Philipp Müller [Sun, 15 Feb 2015 20:08:36 +0000 (20:08 +0000)]
pbutils: description: move some code into utility function

9 years agopbutils: descriptions: add H.265 profile to description if available
Tim-Philipp Müller [Sun, 15 Feb 2015 20:05:13 +0000 (20:05 +0000)]
pbutils: descriptions: add H.265 profile to description if available

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

9 years agopbutils: descriptions: add MPEG-4 video profile to description if available
Tim-Philipp Müller [Sun, 15 Feb 2015 19:03:38 +0000 (19:03 +0000)]
pbutils: descriptions: add MPEG-4 video profile to description if available

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

9 years agopbutils: descriptions: add Dirac/VC-2 profile to description if available
Tim-Philipp Müller [Sun, 15 Feb 2015 18:37:38 +0000 (18:37 +0000)]
pbutils: descriptions: add Dirac/VC-2 profile to description if available

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

9 years agopbutils: descriptions: add H.264 profile to description if available
Tim-Philipp Müller [Sun, 15 Feb 2015 18:14:18 +0000 (18:14 +0000)]
pbutils: descriptions: add H.264 profile to description if available

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

9 years agoinstall-plugins: fix indentation and add Since marker
Tim-Philipp Müller [Fri, 13 Feb 2015 22:56:00 +0000 (22:56 +0000)]
install-plugins: fix indentation and add Since marker

Forgot to squash this into the actual patch before pushing.

9 years agoinstall-plugins: add new API to exports .def and to docs
Tim-Philipp Müller [Fri, 13 Feb 2015 22:49:04 +0000 (22:49 +0000)]
install-plugins: add new API to exports .def and to docs

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

9 years agoinstall-plugins: Add API to suppress confirmation before searching
Kalev Lember [Tue, 3 Feb 2015 09:47:11 +0000 (10:47 +0100)]
install-plugins: Add API to suppress confirmation before searching

The new gst_install_plugins_context_set_confirm_search() API can be used
to pass a hint to modify the behaviour of the external installer
process.

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

9 years agoinstall-plugins: Add API for passing desktop ID and startup ID
Kalev Lember [Mon, 2 Feb 2015 15:16:46 +0000 (16:16 +0100)]
install-plugins: Add API for passing desktop ID and startup ID

The new gst_install_plugins_context_set_desktop_id() and
gst_install_plugins_context_set_startup_notification_id() API can be
used to pass extra details to the external installer process.

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

9 years agovideo-orc: update with new methods
Wim Taymans [Thu, 12 Feb 2015 11:08:16 +0000 (12:08 +0100)]
video-orc: update with new methods

9 years agovideo-format: add orc function for RGB15/16 unpack
Wim Taymans [Thu, 12 Feb 2015 10:38:20 +0000 (11:38 +0100)]
video-format: add orc function for RGB15/16 unpack

9 years agoplaybin: improve debug log
Stefan Sauer [Wed, 11 Feb 2015 05:57:02 +0000 (21:57 -0800)]
playbin: improve debug log

Log the human readable pad_link_return desc as well.

9 years agocodec-utils: Handle the two rext profiles for h265
Sebastian Dröge [Wed, 11 Feb 2015 13:57:54 +0000 (15:57 +0200)]
codec-utils: Handle the two rext profiles for h265

These values are for now taken from x265 and need to be checked against
the spec. Especially we need to check if information from other fields
need to be taken into consideration too, e.g. the bit depth and chroma
index from the SPS.

This however makes 4:4:4 output of x265enc actually work.

9 years agoImprove and fix LATENCY query handling
Sebastian Dröge [Wed, 11 Feb 2015 12:43:11 +0000 (13:43 +0100)]
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

9 years agovideo-scaler: add 2d scaler
Wim Taymans [Wed, 11 Feb 2015 12:32:25 +0000 (13:32 +0100)]
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.

9 years agovideo-converter: Fix YUY2 formats and friends
Wim Taymans [Tue, 10 Feb 2015 15:43:03 +0000 (16:43 +0100)]
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.

9 years agovideo-scaler: Small performance tweaks
Wim Taymans [Tue, 10 Feb 2015 15:40:21 +0000 (16:40 +0100)]
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.

9 years agovideo-scaler: Guard against (impossible) bits!=16 && bits!=8 case to fix compiler...
Sebastian Dröge [Tue, 10 Feb 2015 15:44:38 +0000 (16:44 +0100)]
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

9 years agovideo-converter: Use correct enum type to fix compiler warnings with clang
Sebastian Dröge [Tue, 10 Feb 2015 15:38:05 +0000 (16:38 +0100)]
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,
    ~~~~~~~~~~~~~~~~~~~~~~~~~            ^~~~~~

9 years agovideo-converter: bits variable always set
Luis de Bethencourt [Tue, 10 Feb 2015 15:25:04 +0000 (15:25 +0000)]
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

9 years agovideo-converter: only enable backlog for interlaced video
Wim Taymans [Tue, 10 Feb 2015 10:15:22 +0000 (11:15 +0100)]
video-converter: only enable backlog for interlaced video

Skip lines we don't need.

9 years agovideo-converter: add fastpath for NV formats
Wim Taymans [Tue, 10 Feb 2015 08:30:44 +0000 (09:30 +0100)]
video-converter: add fastpath for NV formats

9 years agovideo-format: fix pstride of NV16 and NV24 formats
Wim Taymans [Tue, 10 Feb 2015 08:20:12 +0000 (09:20 +0100)]
video-format: fix pstride of NV16 and NV24 formats

9 years agortspmessage: map headers we know that are added by string to their enum
Tim-Philipp Müller [Mon, 9 Feb 2015 18:01:30 +0000 (18:01 +0000)]
rtspmessage: map headers we know that are added by string to their enum

That way we can look them up by their field enum later as well.

9 years agotests: rtsp: add some unit tests for new GstRTSPMessage API
Tim-Philipp Müller [Mon, 9 Feb 2015 17:49:12 +0000 (17:49 +0000)]
tests: rtsp: add some unit tests for new GstRTSPMessage API

9 years agortspmessage: add API to add and get custom headers
Tim-Philipp Müller [Mon, 9 Feb 2015 16:24:19 +0000 (16:24 +0000)]
rtspmessage: add API to add and get custom headers

Add API to add and get custom headers that are not
covered by our header fields enum. This is backwards
compatible in that it will also work for our defined
fields, so if we ever add a new header field to the
enum, get_header_by_name() for the same header string
will still work.

API: gst_rtsp_message_add_header_by_name()
API: gst_rtsp_message_take_header_by_name()
API: gst_rtsp_message_remove_header_by_name()
API: gst_rtsp_message_get_header_by_name()

9 years agovideo-converter: Add more fastpaths
Wim Taymans [Mon, 9 Feb 2015 16:51:00 +0000 (17:51 +0100)]
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.

9 years agovideo-converter: add generic planar scaler/converter
Wim Taymans [Mon, 9 Feb 2015 12:20:43 +0000 (13:20 +0100)]
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.

9 years agovideo-converter: Fix compiler warnings by using the correct enum type
Sebastian Dröge [Mon, 9 Feb 2015 09:20:37 +0000 (10:20 +0100)]
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))
             ~~~~~~~~~~~           ~~~~~~~~~~~~~~^~~~~~~

9 years agooggmux: Don't pass GstCollectData as a GstObject to GST_DEBUG
Jan Schmidt [Fri, 6 Feb 2015 16:56:05 +0000 (03:56 +1100)]
oggmux: Don't pass GstCollectData as a GstObject to GST_DEBUG

9 years agovideo-converter: add more scaler fastpaths
Wim Taymans [Fri, 6 Feb 2015 12:39:04 +0000 (13:39 +0100)]
video-converter: add more scaler fastpaths

9 years agovideo-orc: fix loading of param
Wim Taymans [Fri, 6 Feb 2015 12:25:51 +0000 (13:25 +0100)]
video-orc: fix loading of param

param loading ignores the x4, loading only part of the param.

9 years agovideo-converter: add border and crop to more fastpaths
Wim Taymans [Fri, 6 Feb 2015 11:35:01 +0000 (12:35 +0100)]
video-converter: add border and crop to more fastpaths

9 years agovideo-converter: fix border for YUY2 and friends
Wim Taymans [Fri, 6 Feb 2015 11:28:54 +0000 (12:28 +0100)]
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.

9 years agovideo-converter: support AYUV border
Ravi Kiran K N [Fri, 6 Feb 2015 10:09:14 +0000 (15:39 +0530)]
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

9 years agovideo-converter: fix swapped border width
Wim Taymans [Fri, 6 Feb 2015 09:57:14 +0000 (10:57 +0100)]
video-converter: fix swapped border width

And also do nothing when there is no border.

9 years agovideo-converter: actually draw the border in some fastpaths
Wim Taymans [Fri, 6 Feb 2015 09:56:21 +0000 (10:56 +0100)]
video-converter: actually draw the border in some fastpaths

Don't forget to draw the border after doing the fastpath conversion.

9 years agovideo-converter: clamp width and heigth
Wim Taymans [Fri, 6 Feb 2015 09:53:20 +0000 (10:53 +0100)]
video-converter: clamp width and heigth

Clamp the width and height based on the in and out offsets.

9 years agovideo-format: add unaligned fallbacks
Wim Taymans [Fri, 6 Feb 2015 09:50:09 +0000 (10:50 +0100)]
video-format: add unaligned fallbacks

Add fallback C implementations for when we can't call the ORC function
because of bad alignment.

9 years agoaudiodecoder: Where possible, skip decode for GST_SEGMENT_FLAG_TRICKMODE_NO_AUDIO
Jan Schmidt [Tue, 27 Jan 2015 18:20:19 +0000 (05:20 +1100)]
audiodecoder: Where possible, skip decode for GST_SEGMENT_FLAG_TRICKMODE_NO_AUDIO

If we have timestamps on input buffers and are in trickmode no-audio
mode, then don't pass anything to the subclass for decode and simply
send gap events downstream

Only for forward playback for now - reverse requires accumulating
GAP events and pushing out in reverse order.

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

9 years agoaudiobasesink: Re-work GAP buffer and trick-mode handling
Jan Schmidt [Thu, 5 Feb 2015 06:44:59 +0000 (17:44 +1100)]
audiobasesink: Re-work GAP buffer and trick-mode handling

In trickmode no-audio mode, or when receiving a GAP buffer,
discard the contents and render as a GAP event instead.

Make sure when rendering a gap event that the ring buffer will
restart on PAUSED->PLAYING by setting the eos_rendering flag.

This mostly reverts commit 8557ee and replaces it. The problem
with the previous approach is that it hangs in wait_preroll()
on a PLAYING-PAUSED transition because it doesn't commit state
properly.

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

9 years agooggdemux: Add a little timestamping debug output
Jan Schmidt [Tue, 3 Feb 2015 09:38:44 +0000 (20:38 +1100)]
oggdemux: Add a little timestamping debug output

9 years agotheora: If no header packets in stream, look for them in the caps
Jan Schmidt [Mon, 2 Feb 2015 14:19:05 +0000 (01:19 +1100)]
theora: If no header packets in stream, look for them in the caps

Makes theora work in cases where the header packets are only in the caps
(because theoradec was connected to oggdemux late and missed the
beginning of the stream)

9 years agotheora: Remove FIXME and return GST_CUSTOM_FLOW_DROP for header packet handling
Jan Schmidt [Mon, 2 Feb 2015 11:23:51 +0000 (22:23 +1100)]
theora: Remove FIXME and return GST_CUSTOM_FLOW_DROP for header packet handling

This FIXME is easily fixed :)

9 years agoaudiodecoder: Remove pointless else{} around some code
Jan Schmidt [Fri, 30 Jan 2015 18:12:10 +0000 (05:12 +1100)]
audiodecoder: Remove pointless else{} around some code

9 years agoaudiodecoder: Fix reverse playback when there's only one gather set.
Jan Schmidt [Fri, 30 Jan 2015 18:09:46 +0000 (05:09 +1100)]
audiodecoder: Fix reverse playback when there's only one gather set.

The decoder can fail to drain on EOS if there was only one gather
set, because it will never have sent the segment event downstream
and set the output segment, and fail to detect that the rate < 0.0

Make sure to send pending events before sending all the gather data
for decode.

9 years agovideo: Fix simple typo in GstVideoFrameMapFlags docs
Jan Schmidt [Wed, 8 Oct 2014 16:31:58 +0000 (03:31 +1100)]
video: Fix simple typo in GstVideoFrameMapFlags docs

9 years agovideo-converter: add crop and border to some fastpaths
Wim Taymans [Thu, 5 Feb 2015 16:49:55 +0000 (17:49 +0100)]
video-converter: add crop and border to some fastpaths

9 years agovideo-converter: add support for borders in scale fastpath
Wim Taymans [Thu, 5 Feb 2015 16:18:20 +0000 (17:18 +0100)]
video-converter: add support for borders in scale fastpath

Add support for borders and cropping in the scaler fastpaths.

9 years agovideo-converter: disable fastpath for crop and border
Wim Taymans [Thu, 5 Feb 2015 14:03:24 +0000 (15:03 +0100)]
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

9 years agovideo-converter: add fastpath for some gray formats
Wim Taymans [Wed, 4 Feb 2015 17:01:51 +0000 (18:01 +0100)]
video-converter: add fastpath for some gray formats

9 years agovideo-converter: add fastpath for some more RGB formats
Wim Taymans [Wed, 4 Feb 2015 16:44:31 +0000 (17:44 +0100)]
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.

9 years agovideo-converter: skip lines we don't need
Wim Taymans [Wed, 4 Feb 2015 15:37:22 +0000 (16:37 +0100)]
video-converter: skip lines we don't need

Make sure to skip unused lines instead of doing a useless horizontal
resampling.

9 years agovideoscale: fix memory leak
Luis de Bethencourt [Wed, 4 Feb 2015 12:08:21 +0000 (12:08 +0000)]
videoscale: fix memory leak

In gst_video_scale_fixate_caps () it can goto done without freeing the memory
of the tmp GstStructure. This makes it go out of scope and leak.

CID #1265766

9 years agovideo-resampler: make sure params.envelope is initialized
Luis de Bethencourt [Wed, 4 Feb 2015 11:25:54 +0000 (11:25 +0000)]
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

9 years agovideo{enc,dec}oder: Don't reset latency all the time and handle max=GST_CLOCK_TIME_NO...
Sebastian Dröge [Tue, 3 Feb 2015 11:23:06 +0000 (12:23 +0100)]
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.

9 years agoaudio{enc,dec}oder: Always directly post latency messages on the bus when the subclas...
Sebastian Dröge [Tue, 3 Feb 2015 11:15:25 +0000 (12:15 +0100)]
audio{enc,dec}oder: Always directly post latency messages on the bus when the subclass sets the latency

Instead of doing it only in setcaps for the encoder, and never at all for the
decoder.

9 years agoaudio{enc,dec}oder: Handle max_latency == GST_CLOCK_TIME_NONE
Sebastian Dröge [Tue, 3 Feb 2015 11:12:18 +0000 (12:12 +0100)]
audio{enc,dec}oder: Handle max_latency == GST_CLOCK_TIME_NONE

And initialize the latencies with 0 and NONE.

9 years agoaudiobasesink: Don't render a GAP silence buffer
Jan Schmidt [Tue, 27 Jan 2015 18:26:06 +0000 (05:26 +1100)]
audiobasesink: Don't render a GAP silence buffer

Don't render out silence samples to a buffer, just
start the clock running, since any buffer with the
GAP flag will be discarded in render() now anyway.

9 years agoaudiobasesink: Make sure the ringbuffer is started before waiting
Jan Schmidt [Wed, 28 Jan 2015 11:42:17 +0000 (22:42 +1100)]
audiobasesink: Make sure the ringbuffer is started before waiting

Don't call the basesink wait_event implementation until we're sure
the ringbuffer is running, because it might wait on a non-running
clock.

9 years agoaudiobasesink: drop GAP buffers, or all buffers in trickmode no-audio mode
Jan Schmidt [Mon, 26 Jan 2015 15:04:22 +0000 (02:04 +1100)]
audiobasesink: drop GAP buffers, or all buffers in trickmode no-audio mode

Make the base audio sink throw away buffers marked GAP, or all
incoming buffers when performing a trick play with
GST_SEGMENT_TRICKMODE_NO_AUDIO flag set, and make sure to start
the ringbuffer when that happens so the clock starts running.

Preserve the timing calculations when rendering, so state is all
updated the same, but just don't render samples.

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

9 years agooggdemux: do not throw a flow error on flushing
Vincent Penquerc'h [Thu, 29 Jan 2015 17:58:27 +0000 (17:58 +0000)]
oggdemux: do not throw a flow error on flushing

If the streaming task attempts to read a chain while the pipeline
is stopping (which can happen if the pipeline stops shortly after
start or a new URI being setup in gapless playback case), it will
see a flushing return from upstream, and should then also return
flushing to the caller, rather than emit a flow error.

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

9 years agovideo-converter: Fix compiler warnings
Sebastian Dröge [Wed, 28 Jan 2015 16:44:57 +0000 (17:44 +0100)]
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;

9 years agovideo: Update orc files
Sebastian Dröge [Wed, 28 Jan 2015 16:43:59 +0000 (17:43 +0100)]
video: Update orc files

9 years agodefs: update
Wim Taymans [Wed, 28 Jan 2015 16:37:35 +0000 (17:37 +0100)]
defs: update

9 years agovideo-converter: add fast-path scaler for some packed YUV formats
Wim Taymans [Wed, 28 Jan 2015 16:32:12 +0000 (17:32 +0100)]
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