Commit graph

3062 commits

Author SHA1 Message Date
Christoph Reiter
3b1c7ef8e4 wasapisink: recover from low buffer levels in shared mode
In case the wasapi buffer levels got low in shared mode we would still wait until
more buffer is available until writing something in it, which means we could never
catch up and recover.

Instead only wait for a new buffer in case the existing one is full and always write
what we can. Also don't loop until all data is written since the base class can handle
that for us and under normal circumstances this doesn't happen anyway.

This only works in shared mode, as in exclusive mode we have to exactly
fill the buffer and always have to wait first.

This fixes noisy (buffer underrun) playback with the wasapisink under load.

https://bugzilla.gnome.org/show_bug.cgi?id=796354
2018-05-25 19:06:37 +05:30
Christoph Reiter
0aed64426b wasapisink: fix a rounding error when calculating the buffer frame count
The calculation for the frame count in the non-aligned case resulted in
a one too low buffer frame count.

This resulted in:
1) exclusive mode not working as the frame count has to match
   exactly there.
2) Buffer underruns in shared mode as the current write() code doesn't
   handle catching up to low buffer levels (fixed in the next commit)

To fix just use the wasapi API to get the buffer size which will always
be correct.

https://bugzilla.gnome.org/show_bug.cgi?id=796354
2018-05-25 19:06:16 +05:30
Christoph Reiter
ffb8476a38 wasapisink: fix missing unlock in case IAudioClient_Start fails
https://bugzilla.gnome.org/show_bug.cgi?id=796354
2018-05-25 19:05:57 +05:30
Christoph Reiter
2d98a5c1d7 wasapi: use FAILED to detect errors
S_FALSE is a valid return value which does not indicate an error.
For example IAudioClient_Stop() returns S_FALSE when it is already stopped.
Use the FAILED macro instead which just checks if an error occured or not.

This fixes spurious warnings when using the wasapisink element.

https://bugzilla.gnome.org/show_bug.cgi?id=796280
2018-05-23 13:24:00 +05:30
Christoph Reiter
adb1df3bc1 wasapi: Don't pass CoTaskMemFree to g_clear_pointer
CoTaskMemFree has a different calling convention than GDestroyNotify
and things crash at least with MinGW.

https://bugzilla.gnome.org/show_bug.cgi?id=796280
2018-05-23 13:24:00 +05:30
Edward Hervey
07a3bf0e8f dvb: Fix string copy wiht strlen() argument
This is a new warning introduced by gcc 8

We already check just before that we have enough space, just do a regular
memcpy with the full string size.

camswclient.c:87:3: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
2018-05-19 11:03:08 +02:00
Seungha Yang
535adfee37 nvenc: Fix build warning error
'cuDeviceComputeCapability' was deprecated as of CUDA 5.0

gstnvenc.c: In function ‘gst_nvenc_create_cuda_context’:
gstnvenc.c:290:9: error: ‘cuDeviceComputeCapability’ is deprecated [-Werror=deprecated-declarations]
         && cuDeviceComputeCapability (&maj, &min, cdev) == CUDA_SUCCESS) {
         ^

https://bugzilla.gnome.org/show_bug.cgi?id=796203
2018-05-18 10:43:39 +01:00
Sreerenj Balachandran
0bdcf51baf msdk: Add conditional build for vp9 decoder
https://bugzilla.gnome.org/show_bug.cgi?id=796119
2018-05-15 16:33:00 -08:00
Sreerenj Balachandran
955c927189 msdk: dec: Add VP9 decoder
https://bugzilla.gnome.org/show_bug.cgi?id=796119
2018-05-15 16:32:22 -08:00
Sreerenj Balachandran
dec0953517 msdk: allow building against open sourced msdk
Building against mfx_dispatcher is used to search for
headers in PREFIX/include/mfx/ only (commit: 62f04e801b),
but it is just PREFIX/include with open source msdk version.

https://bugzilla.gnome.org/show_bug.cgi?id=796118
2018-05-15 16:31:02 -08:00
Vivia Nikolaidou
31aafdbea5 decklink: Fix crash with closed-captions signal and 10-bit input
Only free the parser if there is one. If the format hadn't changed but
had always been 10-bit, there might genuinely be no parser.

https://bugzilla.gnome.org/show_bug.cgi?id=796030
2018-05-11 17:39:35 +03:00
Vivia Nikolaidou
752d2bb6e3 decklinkvideosrc: Don't check for closed captions when there's no signal
Otherwise the gst_decklink_video_format_from_type() call spams the logs
with one "Unknown pixel format 0x0" line per frame.
2018-05-11 16:42:08 +03:00
Sreerenj Balachandran
54482a54d8 msdk:dec: Add new propery to dump frames in decoded order
The new property "output-order" can be set to either "display" order
which is the default where frames will be outputting in display order,
or "decoded-order" which will be outputting the frames in decoded order.

The "decoded order" output is generally useful for debugging. But there
are few
customers who use it for low-latency streaming. For eg if the customer
already knows that the stream doesn't have b-frames (which means no
algorithm requires for display order calculation), then they can use
"decoded-order"
output to skip some of the DPB logic to avoid the frame accumulation at
start-up.

The root cause of the above issue is a bit of unclarity in h264 spec +
lazy implementation of many H264 encoders; This is well handled in
gstreamer-vaapi using "low-latency" property:
https://bugzilla.gnome.org/show_bug.cgi?id=762509

https://bugzilla.gnome.org/show_bug.cgi?id=795783
2018-05-07 14:12:10 -08:00
Sreerenj Balachandran
a372c05f06 msdk: dec: inform msdk if the buffer contains a complete frame
For packetized input, inform the msdk that the buffer has
a complete frame or complementary field pairs. For decoding,
this means that the decoder can proceed with this buffer without
waiting for the start of the next frame, which effectively reduces
decoding latency.

https://bugzilla.gnome.org/show_bug.cgi?id=795783
2018-05-07 14:11:34 -08:00
Sreerenj Balachandran
978bcf8aa6 msdk: dec: reset async depth to one
Currently we use an async depth of 4 as default (based on
recommendations
in msdk apps), which indicates how many asynchronous operations an
application performs
before the application explicitly synchronizes the result. As a result,
we
queue four frames in decoder which might not be good approach for
live streaming.

This patch reset the async-depth to 1 as default so that we do sync for
each frame we decode without queuing. Customer can play with already
exposed "async-depth" property for other use cases

https://bugzilla.gnome.org/show_bug.cgi?id=795783
2018-05-07 14:11:14 -08:00
Seungha Yang
3e5378163a nvdec: Add support VP8/VP9 decoding
NVIDIA video decoder supports VP8 and VP9 decoding

https://bugzilla.gnome.org/show_bug.cgi?id=795823
2018-05-05 18:13:00 +10:00
Sreerenj Balachandran
cb1eb650c6 msdk: enc: Add dmabuf-export support
Current implementation is only supporting dmabuf-export
through DMABufCapsfeatures.
MSDK dmabuf fds are not mappable and dmabuf-import
is not yet supported too (#794817).

https://bugzilla.gnome.org/show_bug.cgi?id=795707
2018-05-02 14:52:24 -08:00
Sreerenj Balachandran
e1a90f1ec9 msdkvpp: Disable passthrough if memory capsfeature changes
So far msdk produced dmabuf fds are non-mappable.
If user wants to download the content of underlined surfaces,
dmabufcapsfeature negotiated pipeline will fail. So if the input surface
is dmabuf and downstream doesn't have support for dmabuf capsfeatures,
we do the vpp (no passthrough) and produce the mappable videomemory
buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=794946
2018-04-30 12:40:32 -08:00
Sreerenj Balachandran
ef6e186801 msdk: vpp: Add dmabuf-export support
Currenly, the dmabuf buffer pool can be negotiated
only through DMABuf capsfeatures.
This will not allow to negotiate dmabuf support with
v4l2src (v4l2src ! msdkvpp) where v4l2src always export
the dmabuf based memory with out using the DMABuf capsfeatures.
So it requires fix based on:
https://bugzilla.gnome.org/show_bug.cgi?id=794817

https://bugzilla.gnome.org/show_bug.cgi?id=794946
2018-04-30 12:39:52 -08:00
Jan Schmidt
7cebaa4fb4 nvdec: Add colorimetry info to the caps
Output any colorimetry information extracted from the stream
into the caps.
2018-04-28 23:11:15 +10:00
Jan Schmidt
de1b0e3447 nvdec: Use gst_video_info_to_caps to build caps.
Don't build caps directly, as that won't add any GstVideoInfo
newer fields (such as colorimetry) automatically.
2018-04-27 16:10:12 +10:00
Nicolas Dufresne
673e7a74d5 kmssink: Add 24bit RGB support
https://bugzilla.gnome.org/show_bug.cgi?id=794186
2018-04-26 10:35:09 -04:00
Sreerenj Balachandran
76bbefe3b0 msdk: vpp: Add YV12, YUY2 and BGRx formats to template 2018-04-25 12:33:16 -08:00
Sreerenj Balachandran
96c6a04d7a msdk: Add more video format mapping
BGRx format can be supported with Msdk's RGB4
2018-04-25 12:33:08 -08:00
Sreerenj Balachandran
5184f85d77 msdk: vpp: Allocation query fixes
prpose_allocation:
-- always instantiate a pool for for upstream
-- use async_depth + 1 as min buffer count

decide_allocation:
-- always create a new bufferpool for source pad.
Each of the msdk element has to create it's own mfxsurfacepool
which is an msdk contraint. For eg: Each Msdk component (vpp, dec and
enc)
will invoke the external Frame allocator for video-memory usage
So sharing the pool between gst-msdk elements might not be a good idea.

https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-25 12:33:00 -08:00
Xavier Claessens
83d0623293 Meson: Generate pc file for all plugins in bad
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:08:09 +01:00
Jan Schmidt
e496f398ec nvenc: Remove GST_USE_UNSTABLE_API defines
GstGL is no longer unstable API since moving to -base
2018-04-25 02:44:14 +10:00
Jan Schmidt
02c2b0b275 nvenc: Use the HAVE_NVENC_GST_GL define instead of HAVE_GST_GL
Fix compiling against the GL interop by gating includes
on the right header
2018-04-25 02:44:14 +10:00
Seungha Yang
3f318ecb96 nvh265enc: Add Nvidia GPU based HEVC encoder
https://bugzilla.gnome.org/show_bug.cgi?id=795037
2018-04-25 01:59:30 +10:00
Seungha Yang
5f95094f39 nvencbase: Define sinkpad template in subclass
https://bugzilla.gnome.org/show_bug.cgi?id=795037
2018-04-25 01:59:30 +10:00
Seungha Yang
6242dae832 nvenc: Add debug catagory for nvh264enc
https://bugzilla.gnome.org/show_bug.cgi?id=795037
2018-04-25 01:59:30 +10:00
Edward Hervey
44390d9d1d decklinkvideosrc: Add support for extracting Closed Caption
If the "output-cc" property is set to TRUE and there is CC present
in the VBI Ancillary Data, they will be extracted and set on the
outgoing buffer as GstVideoCaptionMeta.

Only CDP packets are supported.

https://bugzilla.gnome.org/show_bug.cgi?id=773863
2018-04-23 16:16:06 +02:00
Tim-Philipp Müller
79c13988e4 Fix code indentation 2018-04-22 18:27:37 +01:00
Tim-Philipp Müller
595392d187 dx9screenscapsrc: consolidate UNLOCK 2018-04-22 18:25:34 +01:00
Tim-Philipp Müller
5e372f71b6 meson: fbdev: fix 'invalid keyword argument' meson warnings
Required is not a valid kwarg for cc.has_header()
2018-04-20 11:46:07 +01:00
Devarsh Thakkar
d0575a0bd1 kmssink: Add new entry for Xilinx DRM Driver
This adds entry for new DRM driver from xilinx
called "xlnx" which supports atomic modesetting.

We have kept entry for older DRM driver "xilinx_drm"
for backward compatility with a note describing
deprecation.

Signed-off-by: Devarsh Thakkar <devarsht@xilinx.com>

https://bugzilla.gnome.org/show_bug.cgi?id=795228
2018-04-18 21:15:04 +02:00
Nirbheek Chauhan
9118cc7a19 wasapisrc: Don't provide a clock based on WASAPI's clock
The clock seems to have a lot of drift (or we're using it incorrectly)
which causes buffers to be late on the sink and get dropped.

Disable till someone can investigate whether our usage of the API is
incorrect (it looked correct to me) or if something is wrong.
2018-04-18 15:05:29 +05:30
Snir Sheriber
73cd1aa9dc nvdec/nvenc: Support CUDA Toolkit 9
Since cuda-tools 9.0, nvcuvid.h is replaced by dynlink_nvcuvid.h.
This patch changes nvdec to use run-time dynamic linking if
cuda-tools version >= 9.
nvenc does not require any change since its necessary headers are
still available.

https://bugzilla.gnome.org/show_bug.cgi?id=791724
2018-04-17 23:33:04 +10:00
Sreerenj Balachandran
142ad9dbad msdk: jpegdec: Fix non-interleaved sample decode
Using the default value (InterleavedDec == MFX_SCANTYPE_UNKNOWN)
causing issues with non-interleaved sample decode. Ideally the usage
of MFXVideoDECODE_DecodeHeader should fix these type of issue, but
it seems to be not. But hardcoding the InterleaveDec to
MFX_SCANTYPE_NONINTERLEAVED
is fixing the problem and fortunately msdk seems to be taking care of
Interleaved samples
too .So let's hardcode it for now.

https://bugzilla.gnome.org/show_bug.cgi?id=793787
2018-04-16 14:37:21 -08:00
Nirbheek Chauhan
ff17a404b3 wasapi: Call CoIn/Uninitialize() around prepare()
Seems to be required for exclusive mode and also for all
initialization on Windows 7

https://bugzilla.gnome.org/show_bug.cgi?id=795274
2018-04-16 19:35:07 +05:30
Garima Gaur
8e6375c08b resindvd, uvch264src, dx9screencapsrc: fix clock ref leaks in error paths
https://bugzilla.gnome.org/show_bug.cgi?id=776376
2018-04-12 19:07:19 +01:00
Garima Gaur
70fbcf9c0f bluez: avdtpsrc: fix caps leak in error code paths
https://bugzilla.gnome.org/show_bug.cgi?id=776085
2018-04-12 18:19:32 +01:00
Nirbheek Chauhan
5409cd4920 wasapi: Handle return value of WaitForSingleObject
The wait could've failed for whatever reason, we should handle that.
2018-04-10 05:16:54 +05:30
Nirbheek Chauhan
0a518c9be1 wasapi: Call _Start if the client was _Reset
Otherwise we will wait forever in WaitForSingleObject because we forgot
to start the client again after _Stop is called in reset().

https://bugzilla.gnome.org/show_bug.cgi?id=795114
2018-04-10 05:16:54 +05:30
Nirbheek Chauhan
c427860a20 wasapi: Don't open the device in get_caps()
We can just return the template caps till the device is opened when
going from READY -> PAUSED. This fixes a CRITICAL when calling
ELEMENT_ERROR before the ringbuffer is allocated.

Also fixes a couple of leaks in error conditions.

https://bugzilla.gnome.org/show_bug.cgi?id=794611
2018-04-09 17:28:11 +05:30
Nirbheek Chauhan
b7653925db wasapi: Only use audioclient3 when low-latency
Causes glitches on very slow CPU machines or VMs, and our
out-of-the-box experience should be good.

https://bugzilla.gnome.org/show_bug.cgi?id=794497
2018-04-06 23:11:18 +05:30
Nirbheek Chauhan
41a4a8fe0d wasapi: Don't derive device period from latency time
This seems to cause glitches on devices with low CPU availability,
such as virtual machines. Maybe even actual machines under high load.

https://bugzilla.gnome.org/show_bug.cgi?id=794497
2018-04-06 23:11:11 +05:30
U. Artie Eoff
275d754156 msdk: fix plugin load on implementations with only HW support
We can't assume that MSDK always supports SW implementation
on all platforms.  Thus, msdk_is_available should check for
ANY implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=794991
2018-04-04 17:31:14 -08:00
Nirbheek Chauhan
fc989ce544 wasapi: Squelch warning about %x and HRESULT
HRESULT is always a 32-bit value, as is guint.
2018-04-04 18:36:38 +05:30
Nirbheek Chauhan
affb0182c6 wasapisrc: Implement loopback recording
Now, when you set loopback=true on wasapisrc, the `device` property
should refer to a sink (render) device for loopback recording.

If the `device` property is not set, the default sink device is used.
2018-04-04 01:12:23 +05:30
Tim-Philipp Müller
f7352ecc5c msdk: fix meson syntax 2018-04-03 19:22:01 +01:00
Sreerenj Balachandran
e4b4f09496 msdk: vpp : Add frame rate control
https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 11:10:20 -08:00
Sreerenj Balachandran
c0ea4bdafb msdk: vpp : Add force-aspect-ratio property
https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 10:39:45 -08:00
Sreerenj Balachandran
fb8c536393 msdk: Add more scaling filter algorithms
https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 10:39:35 -08:00
Sreerenj Balachandran
51b6345dc4 msdk: vpp: Add support for horizontal and vertical mirroring
https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 10:39:24 -08:00
Sreerenj Balachandran
108c8fde7f msdk: vpp: Add detail/edge enhancement tuning
https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 10:39:13 -08:00
Sreerenj Balachandran
93c5dd2478 msdk: vpp: Add ProAmp(colorbalance) support
Added Hue, Saturation, Brightness and Contrast tuning support.

Fixme: Add GstColorBalanceInterface support

https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 10:39:02 -08:00
Sreerenj Balachandran
f5a3d3d799 msdk: vpp: Add deinterlacing support
https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 10:38:52 -08:00
Sreerenj Balachandran
36e81744d1 msdk: vpp:Add more filters
-- Add Denoise
-- Add Rotation

https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 10:38:41 -08:00
Sreerenj Balachandran
d3d89f02b3 msdk: Add VPP element
https://bugzilla.gnome.org/show_bug.cgi?id=793705
2018-04-03 10:38:19 -08:00
Hyunjun Ko
35b6411d4d msdk: dec: rename the function to what it means more exactly.
https://bugzilla.gnome.org/show_bug.cgi?id=793707
2018-04-02 15:55:55 -08:00
Hyunjun Ko
90491d889a msdk: allocator: libva: check if it's already using dmabuf when mapping
As long as we negotiate the "DMABuf" capsfeatures for now, map can't be
working. So we need to confirm not to do it if using DMABuf memory.

https://bugzilla.gnome.org/show_bug.cgi?id=793707
2018-04-02 15:49:32 -08:00
Daeseok Youn
faa892fb48 nvbaseenc: fix build warnings with HAVE_NVENC_GST_GL
fix following error:
gstnvbaseenc.c: In function ‘gst_nv_base_enc_set_context’:
gstnvbaseenc.c:451:17: error: unused variable ‘nvenc’ [-Werror=unused-variable]
   GstNvBaseEnc *nvenc = GST_NV_BASE_ENC (element);
                 ^

https://bugzilla.gnome.org/show_bug.cgi?id=794896
2018-04-02 19:42:15 +01:00
Nirbheek Chauhan
29c785ef28 decklink: Fix MinGW warnings due to MSVC-specific pragmas
https://bugzilla.gnome.org/show_bug.cgi?id=794652#c7
2018-03-31 11:16:38 +05:30
Hyunjun Ko
cdc591dbc0 msdkdec: use dmabuf if possible
https://bugzilla.gnome.org/show_bug.cgi?id=793707
2018-03-30 11:06:40 -08:00
Hyunjun Ko
ea92da6e54 msdk: dmabuf support
This patch includes:
1\ Implements MsdkDmaBufAllocator and allocation of msdk dmabuf memroy.
2\ Each msdk dmabuf memory include its own msdk surface kept by GQuark.
3\ Adds new option GST_BUFFER_POOL_OPTION_MSDK_USE_DMABUF

https://bugzilla.gnome.org/show_bug.cgi?id=793707
2018-03-30 11:06:05 -08:00
Hyunjun Ko
5df06545ef msdk: adds new function to get dmabuf information from surface.
https://bugzilla.gnome.org/show_bug.cgi?id=793707
2018-03-30 11:05:16 -08:00
Hyunjun Ko
bd8ffcb29d msdk: allocator: get dmabuf handle during allocation if required
https://bugzilla.gnome.org/show_bug.cgi?id=793707
2018-03-30 11:04:28 -08:00
Hyunjun Ko
c3438b5a0f msdk: generalize the parameter of msdk video memory functions
There needs to be generalized for the parameter from
GstVideoMsdkVideoMemory to GstMemory.

Thus we can call these functions if using DMABuf memory.

https://bugzilla.gnome.org/show_bug.cgi?id=793707
2018-03-30 11:03:00 -08:00
Hyunjun Ko
762eb97092 msdk: specify the way to find a proper cached response by request
The current way to find proper response by just comparing request's
value is wrong.  We need to compare the size of a frame and the
number of suggested frames.

Refer to the sample in https://github.com/Intel-Media-SDK/samples.

https://bugzilla.gnome.org/show_bug.cgi?id=793707
2018-03-30 11:02:26 -08:00
Paul Kocialkowski
a53019068d kmssink: Add support for the Allwinner DRM driver (sun4i-drm)
This adds the sun4i DRM driver to the list of DRM drivers in kmssink.
The driver allows displaying video in either the main plane or an
overlay plane.

https://bugzilla.gnome.org/attachment.cgi?bugid=794839
2018-03-30 09:16:39 -04:00
Sreerenj Balachandran
e40dc51fcd msdk: dec: remove framerate field from sink caps template
Removes unessential field framerate for decoder so that negotiation
works even if framerate is not provided from upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=789752
2018-03-29 13:06:41 -08:00
Hyunjun Ko
1955ffed3f msdk: dec: set framerate to the driver only if provided
For example, if framerate 0/1 is provided from upstream, the driver
fails to configure and complain about it.

We can let it go and make the driver assuming framerate itself.

https://bugzilla.gnome.org/show_bug.cgi?id=789752
2018-03-29 12:41:48 -08:00
Hyunjun Ko
0eaf3bdcd9 msdk: h265dec: remove framerate field from sink caps template
Removes unessential field framerate for decoder so that negotiation
works even if framerate is not provided from upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=789752
2018-03-29 12:40:34 -08:00
Sreerenj Balachandran
f1f148fe7c msdk: Don't set extended coding options for JPEG encode
MJPEG doesn't have support for extended coding options

https://bugzilla.gnome.org/show_bug.cgi?id=793873
2018-03-29 11:56:19 -08:00
Nirbheek Chauhan
90f6e6c097 decklink: Use g_thread_new instead of g_thread_create
It's deprecated, and causes a build failure in Cerbero because we pass
-DG_DISABLE_DEPRECATED.
2018-03-27 12:51:19 +05:30
Takeshi Sato
beab2ee4dc decklink: fix initialization fails in windows binary
There is no log of gst_decklink_com_thread () which initializes COM.
The initialization part is not valid with #ifdef MSC_VER.
Windows binaries are built with gcc.
As with other codes, it was avoidable by setting it to G_OS_WIN32
instead of MSC_VER.

https://bugzilla.gnome.org/show_bug.cgi?id=794652
2018-03-27 12:04:05 +05:30
Nirbheek Chauhan
a08d333e56 wasapi: Print the hresult hex value on error
This helps figure out precisely what error enum value was returned,
which can be necessary when the description is too generic
2018-03-27 12:02:21 +05:30
Sebastian Dröge
1b3b3677cc shmsink: Fix compilation with latest GLib
g_object_ref() forwards its arguments type.

gstshmsink.c: In function ‘gst_shm_sink_allocator_alloc_locked’:
/usr/include/glib-2.0/gobject/gobject.h:512:32: error: passing argument 3 of ‘gst_memory_init’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 #define g_object_ref(Obj)      ((__typeof__(Obj)) (g_object_ref) (Obj))
                                ^
gstshmsink.c:292:45: note: in expansion of macro ‘g_object_ref’
     gst_memory_init (memory, params->flags, g_object_ref (self), NULL,
                                             ^~~~~~~~~~~~
2018-03-20 16:16:19 +02:00
Tim-Philipp Müller
1da3cd56a0 wasapi: try to satisfy both mingw and msvc
Fix-up for previous commit, hopefully.
2018-03-18 14:13:52 +00:00
Nicolas Dufresne
9387a936b5 kmssink: Add Amlogic upstreamer DRM driver support
Amlogic Upstream driver is named meson, not to be confuse with the build
system.
2018-03-18 09:50:51 -04:00
Tim-Philipp Müller
ca4cbaef24 wasapi: fix indentation 2018-03-17 23:52:31 +00:00
Tim-Philipp Müller
ec5c3cb714 wasapi: fix unresolved symbol linker error with vs2017 on win10
ERROR: unresolved external symbol PKEY_AudioEngine_DeviceFormat

Apparently the order of the header includes matters, and initguid.h
must be included first. Let's hope this doesn't break anything on
the other toolchains.

https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/ceff4e2d-8f63-4ab6-b09b-fdac65d62a80/pkeyaudioenginedeviceformat-link-error?forum=windowspro-audiodevelopment
2018-03-17 23:48:13 +00:00
Hyunjun Ko
52f669bf43 msdk: libva: remove unnecessary code and comments
https://bugzilla.gnome.org/show_bug.cgi?id=794276
2018-03-13 14:21:40 -08:00
Hyunjun Ko
6547b638c5 msdk: adds new debug category
https://bugzilla.gnome.org/show_bug.cgi?id=794276
2018-03-13 14:20:50 -08:00
Hyunjun Ko
443b3c98fa msdk: fix typo
https://bugzilla.gnome.org/show_bug.cgi?id=794276
2018-03-13 14:18:23 -08:00
Wang,Fei
0c69867d52 msdk: Fix the I420 video format support
Make sure I420 surface mapping works as expected by using
YV12 format and swap U/V plane's offset and pitches.

https://bugzilla.gnome.org/show_bug.cgi?id=793865
2018-03-13 13:54:17 -08:00
Nirbheek Chauhan
16b9e1e444 wasapi: Minor fixes for debug logging 2018-03-10 18:54:59 +05:30
Nirbheek Chauhan
1019537344 meson: Add deviceprovider changes to directsoundsrc
These were missed when they were added to Makefile.am
2018-03-10 18:54:59 +05:30
Nirbheek Chauhan
a2f5485893 wasapi: Guard IAudioClient2 structs and enums
These are already defined in the audioclient.h provided by the latest
MinGW headers, and the existing #ifndef were obviously wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=794197
2018-03-10 18:54:59 +05:30
Tim-Philipp Müller
c2bcc2711a meson: fix build when msdk is not found 2018-03-09 23:59:16 +00:00
Sreerenj Balachandran
bdbc1d0bef msdk: Fix the misspelled file name in meson build 2018-03-09 10:33:22 -09:00
Emilio Pozuelo Monfort
898e01fe29 wasapi: ship audioclient3 header in tarballs
https://bugzilla.gnome.org/show_bug.cgi?id=794197
2018-03-09 11:42:13 +00:00
Hyunjun Ko
4918430858 msdk: enc: fix missing some frames to be encoded
There was not handling the end of encoding sequence in encoder.
This patch does drain any remaining internal streams while decoder
already does this.

Document says:
"To mark the end of the encoding sequence, call this function with a
NULL surface
pointer. Repeat the call to drain any remaining internally cached
bitstreams—one
frame at a time—until MFX_ERR_MORE_DATA is returned."

https://bugzilla.gnome.org/show_bug.cgi?id=793236
2018-03-08 11:39:25 -09:00
Hyunjun Ko
8a3630ffd7 msdk: dec: fix leaks when flushing
https://bugzilla.gnome.org/show_bug.cgi?id=793708
2018-03-08 11:38:52 -09:00
Hyunjun Ko
c9faf0d612 msdk: manage child sessions on parent GstMsdkContext
Sometimes parent context is released before its children get released.
In this case MFXClose of parent session fails.

To make sure that child sessions are closed before closing a parent
session,
Parent context needs to manage child sessions and close them first when
it's released.

https://bugzilla.gnome.org/show_bug.cgi?id=793412
2018-03-08 11:38:30 -09:00
Hyunjun Ko
37ef61586a msdk: dec: remove code to manage buffers with locked surface
https://bugzilla.gnome.org/show_bug.cgi?id=793413
2018-03-08 11:37:52 -09:00
Hyunjun Ko
b08b8ddae3 msdk: manage MSDK surfaces seperately
Currently a gst buffer has one mfxFrameSurface when it's allocated and
can't be changed.
This is based on that the life of gst buffer and mfxFrameSurface would
be same.
But it's not true. Sometimes even if a gst buffer of a frame is finished
on downstream,
mfxFramesurface coupled with the gst buffer is still locked, which means
it's still being used in the driver.

So this patch does this.
Every time a gst buffer is acquired from the pool, it confirms if the
surface coupled with the buffer is unlocked.
If not, replace it with new unlocked one.
In this way, user(decoder or encoder) doesn't need to manage gst buffers
including locked surface.

To do that, this patch includes the following:
1. GstMsdkContext
- Manages MSDK surfaces available, used, locked respectively as the
following:
  1\ surfaces_avail : surfaces which are free and unused anywhere
  2\ surfaces_used : surfaces coupled with a gst buffer and being used
now.
  3\ surfaces_locked : surfaces still locked even after the gst buffer
is released.

- Provide an api to get MSDK surface available.
- Provide an api to release MSDK surface.

2. GstMsdkVideoMemory
- Gets a surface available when it's allocated.
- Provide an api to get an available surface with new unlocked one.
- Provide an api to release surface in the msdk video memory.

3. GstMsdkBufferPool
- In acquire_buffer, every time a gst buffer is acquired, get new
available surface from the list.
- In release_buffer, it confirms if the buffer's surface is unlocked or
not.
  - If unlocked, it is put to the available list.
  - If still locked, it is put to the locked list.

This also fixes bug #793525.

https://bugzilla.gnome.org/show_bug.cgi?id=793413
https://bugzilla.gnome.org/show_bug.cgi?id=793525
2018-03-08 11:37:12 -09:00
Nirbheek Chauhan
c2956036b8 wasapi: Increase rank to prefer over directsoundsrc
Directsoundsrc/sink have multiple issues, most of which cannot be
fixed at all because the API is deprecated and is implemented as a
compatibility wrapper around WASAPI since Vista.

Users and developers should now use the wasapisrc/sink elements, and
future development efforts should go towards that.
2018-03-01 15:33:18 +05:30
Nirbheek Chauhan
05a37d3791 wasapi: Clarify usage of low-latency property, add myself as author
The low-latency property is *always* safe to enable, so applications
that do realtime communication should set it, and the elements will
automatically configure WASAPI to use the lowest possible device
period, and the audioringbuffer in audiobasesink will also be
configured accordingly.

Applications can also use exclusive mode during capture and playback
for the lowest possible latency if they know that the device will not
be used by any other application.

In this mode, the latency-time and buffer-time properties will be
completely ignored.
2018-02-26 16:23:11 +05:30