Commit graph

3073 commits

Author SHA1 Message Date
Olivier Crête
a3f395d921 shmsrc: Remove commented out code 2018-10-10 13:07:50 -04:00
Aleix Conchillo Flaqué
5078116889 shmsink: do not keep locking if element is unlocked
https://bugzilla.gnome.org/show_bug.cgi?id=797260
2018-10-10 12:02:44 -04:00
Seungha Yang
f106a10994 msdk: Fix building on MSVC
And add missing #ifdef _WIN32 for MSVC build

https://bugzilla.gnome.org/show_bug.cgi?id=797211
2018-10-02 04:04:24 +05:30
Seungha Yang
44ecf53d1c msdk: Fix meson build
gst-plugins-bad\sys\msdk\meson.build:57:4: ERROR:  File msdk-enum.c does not exist.

https://bugzilla.gnome.org/show_bug.cgi?id=797211
2018-10-02 04:04:24 +05:30
Matthew Waters
17f0271aa0 decklinkvideosink: fix build
../sys/decklink/gstdecklinkvideosink.cpp:1006:11: error: ‘GstDecklinkVideoSink {aka struct _GstDecklinkVideoSink}’ has no member named ‘scheduled_stop_time’
     self->scheduled_stop_time = start_time;
           ^
2018-09-12 22:38:56 +10:00
Matthew Waters
946cbbccc1 decklink: wait for stop with a timeout
Decklink sometimes does not notify us through the callback that it has
stopped scheduled playback either because it was uncleanly shutdown
without an explicit stop or for unknown other reasons.

Wait on the cond for a short amount of time before checking if scheduled
playback has stopped without notification.

https://bugzilla.gnome.org/show_bug.cgi?id=797130
2018-09-12 21:17:13 +10:00
Matthew Waters
bf849e9a69 decklink: start scheduled playback in paused
This is part of a much larger goal to always keep the frames we schedule to
decklink be always increasing.  This also allows us to avoid using both the
sync and async frame display functions which aren't recomended to be used
together.

If the output timestatmsp is not always increasing decklink seems to hold
onto the latest frame and may cause a flash in the output if the played
sequence has a framerate less than the video output.

Scenario is play for N seconds, pause, flushing seek to some other position,
play again.  Each of the play sequences would normally start at 0 with
the decklink time.  As a result, the latest frame from the previous sequence
is kept alive waiting for it's timestamp to pass before either dropping
(if a subsequent frame in the new sequence overrides it) or displayed
causing the out of place frame to be displayed.

This is also supported by the debug logs from the decklink video sink
element where a ScheduledFrameCompleted() callback would not occur for
the frame until the above had happened.

It was timing related as to whether the frame was displayed based
on the decklink refresh cycle (which seems to be 16ms here),
when the frame was scheduled by the sink and the difference between
the 'time since vblank' of the two play requests (and thus start times
of scheduled playback).

https://bugzilla.gnome.org/show_bug.cgi?id=797130
2018-09-12 21:16:27 +10:00
Matthew Waters
87077d20de decklinkaudiosink: fix debug string copy-paste error
Stopping != Starting
2018-09-12 20:37:47 +10:00
Nirbheek Chauhan
f62b7fd712 wasapi: Remove code that sets thread priority
This is now handled directly in gstaudiosrc/sink, and we were setting
it in the wrong thread anyway. prepare() is not the same thread as
sink_write() or src_read().
2018-09-11 01:00:21 +05:30
Nirbheek Chauhan
0146ad219e meson: Fix applemedia dependencies on iOS
These were accidentally not being found because they were incorrectly
specified.
2018-09-01 21:48:54 +05:30
Matthew Waters
7dc7607475 androidmedia/meson: we also depend on gmodule and orc 2018-08-31 18:08:55 +10:00
Devarsh Thakkar
7d79378895 kmssink: Add "restore-crtc" property
This adds "restore-crtc" property using which one
can restore previous crtc mode.

By default it is enabled, if CRTC was already
active with a valid mode and kmssink set a new mode
on CRTC using force-modesetting.

This helps user restore previous crtc mode and get
the previous session back after running a kmssink
pipeline involving a force-modesetting.

For e.g. When running a kmssink pipeline on rpi
using force-modesetting on tty console, it was giving
a blank screen after pipeline, and now with help of restore-crtc
functionality, CRTC is set with previous crtc mode
previously active on tty console.

Edited-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

https://bugzilla.gnome.org/show_bug.cgi?id=797025
2018-08-29 14:17:51 -04:00
Nicolas Dufresne
531709e5bf kmssink: Document possible advance usage
This adds a mention about modetest command line tool and adds an example
on how to use the connector/plane-properties.

https://bugzilla.gnome.org/show_bug.cgi?id=797027
2018-08-29 12:03:52 -04:00
Nicolas Dufresne
2f30287b5f kmssink: Escape DRM property names
This allow setting properties that contains spaces. The spaces are
replaced with '-'. As an example, one can set the connector proper
"scaling mode" with the following:

  ... ! kmssink connector-properties="s,scaling-mode=1"

https://bugzilla.gnome.org/show_bug.cgi?id=797027
2018-08-29 12:03:52 -04:00
Nicolas Dufresne
63dca26fac kmssink: Add 'plane-properties' property
This is similar to 'connector-properties' but will change
selected plane properties instead.

https://bugzilla.gnome.org/show_bug.cgi?id=797027
2018-08-29 11:57:39 -04:00
Nicolas Dufresne
203b41b510 kmssink: Generalize setting DRM object properties
https://bugzilla.gnome.org/show_bug.cgi?id=797027
2018-08-29 11:57:37 -04:00
Guillaume Desmottes
71ab97cba6 kmssink: add 'connector-properties' prop
Can be used to pass custom connector properties to DRM. Properties can
be enumerated using modetest tool. These properties can then be applied
with the following gst-launch-1.0 syntax. Note that the name of the
structure is ignored.

  ... ! kmssink connector-properties="s,props1=value,props2=value"

https://bugzilla.gnome.org/show_bug.cgi?id=797027
2018-08-29 11:55:19 -04:00
Nirbheek Chauhan
4af7637012 meson: Add build files for androidmedia and opensles
Note that androidmedia requires Android gstgl
2018-08-29 14:58:19 +05:30
Vivia Nikolaidou
4ca76e0c12 decklink: Only use drop-frame flag for 29.97 and 59.94 FPS
Otherwise it can cause errors in gstvideotimecode.c because drop-frame
is not defined for any other frame rate (e.g. 24000/101)

https://blog.frame.io/2017/07/17/timecode-and-frame-rates/

https://bugzilla.gnome.org/show_bug.cgi?id=797037
2018-08-28 15:23:48 +03:00
Philipp Zabel
62a194c781 kmssink: configure mode setting from video info
drmModeGetFB returns -EINVAL for multi-planar framebuffers. Instead of
depending on the framebuffer dimensions to select the mode, use width
and height from GstVideoInfo, which was used to create the framebuffer
in the first place.  This enables kmssink to display multi-planar
formats such as I420 or NV12 with modesetting enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=796985
2018-08-21 11:49:55 -04:00
Jerome Laheurte
203d1825c5 ksvideosrc: fix device enumeration when hotplugging a camera
Since both audio and video capture devices declare the KSCATEGORY_CAPTURE interface,
plugging a camera that supports both could result in an audio device being mistaken
for a video one.

https://bugzilla.gnome.org/show_bug.cgi?id=796958
2018-08-19 16:58:22 -04:00
Nirbheek Chauhan
5177f7c7ee meson: host_system is 'ios' when building for iOS
The cross file sets this value, and we use 'ios' in Cerbero.
2018-08-17 04:07:24 +05:30
Nirbheek Chauhan
2a452f2a5d meson: Fix shm librt dep check on macOS, iOS, and *BSD 2018-08-15 19:34:56 +05:30
Nirbheek Chauhan
a93bb626c9 meson: Add an option for the applemedia plugin 2018-08-14 19:48:28 +05:30
Nirbheek Chauhan
10fcddedc2 wasapi: Fix build with Windows 8.1 SDK
With the Windows 8.1 SDK, the v1 of the AUDCLNT_STREAMOPTIONS enum is
defined which only has NONE and RAW, so it's not only defined when
AudioClient3 is available.

Add a meson check for the symbol. This is not needed for Autotools
because there we build against the MinGW audioclient.h which is still
at v1 of the AudioClient interface.
2018-08-08 01:03:53 +05:30
Alessandro Decina
c9226e6e80 meson: enable applemedia 2018-08-03 12:51:28 +10:00
Nirbheek Chauhan
fa03f81c64 wasapisrc: Correctly disable provide-clock
`#ifdef` will, of course, evaluate to 1 in this case. We want `#if`.
2018-08-02 18:27:46 +05:30
Christoph Reiter
5a1b37b1f3 wasapisink: fix regression in shared mode segment size
In commit fd806628a8 (839cc3926 in the stable branch) I changed the
segment size to match exactly the buffer size.  I missed that this is
only valid in exclusive mode and in shared mode the buffer size is
a multiple of the device period.

Revert the logic for the shared mode.

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

https://bugzilla.gnome.org/show_bug.cgi?id=796858
2018-08-02 17:00:03 +05:30
Nirbheek Chauhan
60542ec970 meson: Add option for winks plugin
This was accidentally missed.
2018-08-01 03:44:07 +05:30
Nicolas Dufresne
638677cca6 meson: Generate bluez.h instead of bluez-interface.h
This is a recent regression, the meson code was ported to use the meson
gnome module helpers, but the generated file was changed to
bluez-interface.h.
2018-07-27 22:17:56 -04:00
Nirbheek Chauhan
b55dfb5313 Add feature options for almost all plugins
The only plugins remaining are those that haven't been ported to Meson
yet, and msdk. Also, the tests are still automagic.

https://bugzilla.gnome.org/show_bug.cgi?id=795107
2018-07-27 19:04:38 +05:30
Gary Bisson
9a34dd8c2a kmssink: Add support for mxsfb-drm driver
The mxsfb-drm driver has been added to the kernel long ago and will now
be the default display driver for NXP i.MX28, i.MX6SX and i.MX7D
processors so now is a good time to add it to kmssink.

Also, this is used in the upcoming i.MX8MQ and i.MX8MM processors.

https://bugzilla.gnome.org/show_bug.cgi?id=796873
2018-07-25 07:53:45 -04:00
Matthew Waters
a9b40eebc0 decklink: keep the internal time we send to decklink always increasing
Otherwise decklink seems to hold onto the latest frame and may cause a
flash in the output if the played sequence has a framerate less than the
video output.

Scenario is play for N seconds, pause, flushing seek to some other position,
play again.  Each of the play sequences would normally start at 0 with
the decklink time.  As a result, the latest frame from the previous sequence
is kept alive waiting for it's timestamp to pass before either dropping
(if a subsequent frame in the new sequence overrides it) or displayed
causing the out of place frame to be displayed.

This is also supported by the debug logs from the decklink video sink
element where a ScheduledFrameCompleted() callback would not occur for
the frame until the above had happened.

It was timing related as to whether the frame was displayed based
on the decklink refresh cycle (which seems to be 16ms here),
when the frame was scheduled by the sink and the difference between
the 'time since vblank' of the two play requests (and thus start times
of scheduled playback).
2018-07-10 21:22:04 +10:00
Arun Raghavan
c43e74d885 bluez: Expose transport volume as a property on avdtpsrc
This can be handy if we want to track Bluetooth volume changes from the
device, or if we want to set it.

https://bugzilla.gnome.org/show_bug.cgi?id=787020
2018-07-09 06:40:24 +05:30
Sreerenj Balachandran
dd981d4953 msdkdec: Fix latency calculation
Use async_depth for latency calcuation instead of
the length of Tasks array which could be NULL since we
don't do the msdk decoder init in set_format().
2018-07-03 18:38:04 -08:00
Sreerenj Balachandran
84c33be0c0 msdk: Set 16 bit alignment for width
According to MediaSDK specification,
Width must be a multiple of 16 and Height must be a multiple
of 16 for progressive frame sequence and a multiple of 32 otherwise.

This patch sets a 16 bit alignment for width and 32 bit alignment
for height as default.

https://bugzilla.gnome.org/show_bug.cgi?id=796566
2018-07-02 16:50:46 -08:00
Sreerenj Balachandran
d63a1b4e3f msdkdec: avoid early destruction of frame in dynamic resolution change
In cases where we do hard resest, the current code destroys the frame
which has new resolution bit early and this causes buffer_unmap
warnings. Keep an extra ref to the frame internally to avoid this.
2018-07-02 16:50:02 -08:00
Sreerenj Balachandran
1250af8f09 msdkdec: vc1: Fix handling of advanced profile elementary stream
Advanced profile elementary streams may not have codec_data
always. So make sure we don't do anything with null buffer.
2018-07-02 16:49:23 -08:00
Sreerenj Balachandran
ad6162e99b msdkdec: Fix advanced profile vc1 decode when codec_data presents
The gst-msdk decoders only support packetized formats for
all codecs except VC1. For VC1, it supports codec_data for advanced
profiles and this codec_data wan't submitting to MSDK's DecodeHeader APIs.
Make sure the subclass deocders correctly configured so that
the codec_data buffers are in place in the internal adapter for
MediaSDK's DecoderHeader usage.
2018-07-02 16:48:11 -08:00
Sreerenj Balachandran
9efb4c9179 msdkdec: Fix the PTS of output frames
Currently we use the gst_video_decoder_get_oldest_frame()
to get the old pending frame to output. But this is not correct
if pts re-ordering required. This patch uses a custom made
get_old_frame() which accounts the PTS too similar to the
v4l2decoder.

https://bugzilla.gnome.org/show_bug.cgi?id=796699
2018-07-02 16:42:20 -08:00
Sreerenj Balachandran
5c88da4a4c msdkdec: Remove dead code
We are not using any ExtendedParams for decoding.
2018-07-02 16:41:58 -08:00
Sreerenj Balachandran
1e95c03c7d msdk: dec: Add dynamic-configuration change support
The patch adds a serios of changes to support dynamic resolution
change and efficient utilization of resources.
Major changes:

-- Use MSDK's apis to retrieve the headers instead of only relying
on upsteram notification. For eg: avc decoder requires SEI header
information for dpb count calculation which we don't get from caps.

-- For all codecs other than VP9, we force the reset of decoder
if resoultion changes to fit with gstreamer flow. VP9 enfource
the hard reset only if the new resolution is bigger.

-- delay the src caps setting till msdk api's invokation in
handle_frame to avoid caching multiple configuration values

-- ensure pool negotiation is based on decoder's allocation_caps.

--dynamic resoluttion change use an explicit allocation_query
to reclaim the buffers before closing the decoder (thanks to v4l2dec)

--In case if we don't get upstream notification of res change (for eg,
this can can happen for vp9 frames with ivfheader where ivfparse
is not able to notify the dynamic changes), we handle the the case
based on MFX_ERR_INCOMPATIBLE_VIDEO_PARAM which is the return value
of MFXVideoDECODE_DecodeFrameAsync

-- calculate the minimum surfaces to be preallocated based on
msdk suggestion, downstream requirement, async depth and scratch surface
count for smooth display.

https://bugzilla.gnome.org/show_bug.cgi?id=796566
2018-07-02 16:17:49 -08:00
Tim-Philipp Müller
22b885fd02 winks: Update for g_type_class_add_private() deprecation in recent GLib
Untested
2018-06-24 12:27:09 +02:00
Tim-Philipp Müller
65c5b9a4f6 msdk: Update for g_type_class_add_private() deprecation in recent GLib
Untested.
2018-06-24 12:22:27 +02:00
Tim-Philipp Müller
a992a3b48b uvch264src: get rid of unnecessary private struct 2018-06-24 00:07:59 +02:00
Nirbheek Chauhan
dd3e7325b0 decklink: Fix warning about HRESULT not being unsigned int 2018-06-20 11:38:17 +05:30
Jan Schmidt
39365948ff androidmedia: Invert the transform matrix from the decoder
The transform from mediacodec applies to the texture coords, but
GStreamer affine meta applies to the video geometry, which is the
opposite - so invert it to get display correct for decoders
that require transforming
2018-06-15 05:01:20 +10:00
Wang,Fei
10f57b73f3 msdk: vpp: remove mfxExtVPPDoUse from vpp filters.
According to msdk spec, there are two ways to enable filters:
1: Filters can be enabled by adding a filter ID
to mfxExtVPPDoUse. In this case, default filter parameters are used
2: Add filter configuration structures directly to mfxVideoParam.

Using 1 with 2 is optional but legal. Unfortunately it won't work
with some specific use cases like Detail/EdgeEnhancement.
Let's stick with option2 which works fine for all VPP operations.

https://bugzilla.gnome.org/show_bug.cgi?id=796468
2018-06-07 15:31:54 -08:00
Sreerenj Balachandran
c4809aa16c msdk: vpp: set passthrough from set_caps method for code clarity
Call passthrough setting method from set_caps so that
msdk initialize subroutine looks more clear.
2018-06-07 15:30:23 -08:00
Sreerenj Balachandran
665f4a140f mskd: vpp: error out gracefully instead of segfaulting if Init failed
Since we do the MSDK initializing in set_caps(), a FALSE
return may still cause the invokation of set_caps() again
and this will leads to buffer allocation and other mess-up.
So make sure the msdk initialized correctly before trying
to do any buffer allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=796465
2018-06-07 15:29:29 -08:00