Commit graph

3225 commits

Author SHA1 Message Date
Haihao Xiang
6287016a74 msdkdec: release the occupied surface for MFX_WRN_DEVICE_BUSY
When MFXVideoDECODE_DecodeFrameAsync () returns MFX_WRN_DEVICE_BUSY with
an output surface, a new input surface is required when retrying
MFXVideoDECODE_DecodeFrameAsync ().

This fixes the out-of-surface issue mentioned in
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/890
2019-02-24 19:13:57 +00:00
Haihao Xiang
fffb3f628d msdk: don't destroy an image twice
This gets rid of annoying message in the log, e.g. run the pipeline
below:

gst-launch-1.0 videotestsrc num-buffers=100 ! \
video/x-raw,format=NV12,width=352,height=288 ! msdkh264enc ! filesink \
location=test.h264

[LIBVA]:CRITICAL - DdiMedia_DestroyImage:4357: Invalid image
2019-02-24 17:59:43 +00:00
Haihao Xiang
348a4b570d msdk: move the comment to the correct place 2019-02-24 17:59:43 +00:00
Tim-Philipp Müller
bdd64e1e3f decklink: add Hardware tag to element metadata 2019-02-19 23:45:35 +00:00
Tim-Philipp Müller
d669f89665 wasapi: add Hardware tag to element metadata 2019-02-19 23:45:34 +00:00
Tim-Philipp Müller
7b00184cb9 winks: add Hardware tag to element metadata 2019-02-19 23:45:34 +00:00
Tim-Philipp Müller
c39fd4d898 androidmedia: add Hardware tag to element metadata 2019-02-19 23:45:34 +00:00
Tim-Philipp Müller
a7ff751a2a applemedia: add Hardware tag to element metadata 2019-02-19 23:45:32 +00:00
Tim-Philipp Müller
16426b3928 msdk: add Hardware tag to element metadata 2019-02-19 23:44:42 +00:00
Tim-Philipp Müller
d5b03bfed8 nvenc, nvdec: add Hardware tag to element metadata 2019-02-19 23:44:42 +00:00
Haihao Xiang
8213d0b858 msdkvpp: allow UYVY in DMABuf mode in the sink pad
Tested with the pipeline below:

gst-launch-1.0 videotestsrc num-buffers=1 ! msdkvpp ! \
video/x-raw\(memory:DMABuf\),format=UYVY ! msdkvpp ! video/x-raw, \
format=YUY2 ! filesink location=a.yuv
2019-02-19 11:04:47 +00:00
Haihao Xiang
56cada6902 msdkvpp: allow UYVY in the src pad
This make the pipeline below works:

gst-launch-1.0 videotestsrc num-buffers=1 ! msdkvpp ! \
video/x-raw,format=UYVY ! filesink location=a.yuv

Once https://github.com/intel/media-driver/pull/526 in the media-driver
is merged, the pipeline below also works:

gst-launch-1.0 videotestsrc num-buffers=1 ! msdkvpp ! \
video/x-raw\(memory:DMABuf\),format=UYVY ! filesink location=a.yuv
2019-02-19 11:04:47 +00:00
Haihao Xiang
ac9423facb msdk: map GST_VIDEO_FORMAT_UYVY to VA_FOURCC_UYVY 2019-02-19 11:04:47 +00:00
Haihao Xiang
ea6789fec8 msdkvpp: allow BGRx in DMABuf mode in the src pad
Tested with the pipeline below:

gst-launch-1.0 videotestsrc ! msdkvpp ! \
video/x-raw\(memory:DMABuf\),format=BGRx ! glimagesink
2019-02-19 11:04:47 +00:00
Bastien Nocera
2d5ed45913 vcdsrc: Remove unusable VCD source
The VCD source was ported in 2014 (commit 89eb1e9), but the necessary
"cdxaparse" plugin, which is used to "Parse a .dat file (VCD) into
raw mpeg1" was never ported.

This means that the probable main user for the feature, totem, hasn't
actually been able to play back VCDs, since 2012, when it switched to
using GStreamer 1.0.

Note that even if cdxaparse was finally ported, a lot of work would
still be necessary before it is considered usable. Notably, it is
missing disc image support [1] and some VCDs just cannot be opened for
reading [2].

[1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/898
[2]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/899
2019-02-18 15:39:43 +01:00
Sebastian Dröge
8171560053 decklinkvideosink: Use S334_EIA_608 instead of S334_EIA_708 for CEA608 output 2019-02-12 14:38:40 +02:00
Sebastian Dröge
173f11e73f decklinkvideosink: S334 1A CEA608 closed captions have the first bit set for the first field
And not for the second field. The logic was inverted here.
2019-02-12 14:38:40 +02:00
Haihao Xiang
028338ff44 msdkdec: set decode_only for output only
MSDK may return MFX_ERR_MORE_DATA but without output surface

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/887
2019-02-12 11:39:04 +00:00
Haihao Xiang
5f2f289b7e msdk: verify the driver name
We need to make sure the Intel graphics card is used in a dual GPU
system.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/895
2019-02-12 12:13:31 +08:00
Josh Matthews
6eda644303 Add device provider for AVFoundation capture devices. 2019-02-08 15:25:34 +00:00
Nirbheek Chauhan
fffb2aa12f misc: Fix warnings on Cerbero MinGW
gstladspa.c:360:5: error: zero-length ms_printf format string [-Werror=format-zero-length]

vad_private.c:108:3: error: this decimal constant is unsigned only in ISO C90 [-Werror]

gstdecklinkvideosink.cpp:478:32: error: comparison between 'BMDTimecodeFormat {aka enum _BMDTimecodeFormat}' and 'enum GstDecklinkTimecodeFormat' [-Werror=enum-compare]

win/DeckLinkAPI_i.c:72:8: error: extra tokens at end of #endif directive [-Werror]

win/DeckLinkAPIDispatch.cpp:35:10: error: unused variable 'res' [-Werror=unused-variable]

gstwasapiutil.c:733:3: error: format '%x' expects argument of type 'unsigned int', but argument 8 has type 'DWORD' [-Werror=format]
gstwasapiutil.c:733:3: error: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'guint64' [-Werror=format]

kshelpers.c:446:3: error: missing braces around initializer [-Werror=missing-braces]
kshelpers.c:446:3: error: (near initialization for 'known_property_sets[0].guid.Data4') [-Werror=missing-braces]
2019-02-06 00:10:28 +05:30
Haihao Xiang
6c953438f5 msdkdec: Release occupied surface for MFX_ERR_MORE_DATA
An output surface is returned but without sync point when when
MFXVideoDECODE_DecodeFrameAsync () returns MFX_ERR_MORE_DATA, this
surface should be released too, otherwise the surface is occupied
and it is easy to exhaust all pre-allocated mfx surfaces.

Example pipeline (input_vp8.webm contains lots of frame with show_frame
set to 0):

gst-launch-1.0 filesrc location=input_vp8.webm ! matroskademux !
msdkvp8dec ! msdkvpp ! fakesink

0:00:05.995959693 19866 0x563f30f14590 ERROR                default
gstmsdkvideomemory.c:77:gst_msdk_video_allocator_get_surface: failed to
get surface available
ERROR: from element
/GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: Internal data
stream error.
2019-02-03 13:44:56 +08:00
Víctor Manuel Jáquez Leal
f974246647 msdkdec: explain the the extra ref of input buffer 2019-02-02 17:52:58 +01:00
Haihao Xiang
74f297f31b msdkdec: avoid releasing the input buffer when it is still in use
The input buffer is released in gst_msdkdec_finish_task () when decoding
some special clips however this buffer is still in use, so ref the input
buffer before gst_msdkdec_finish_task () and unref it at the end of
gst_msdkdec_handle_frame ().

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/862
2019-02-02 16:32:02 +00:00
Haihao Xiang
cd55f8635f msdkvp9dec: output P010_10LE buffer if possible 2019-01-31 10:30:22 +08:00
Haihao Xiang
edc0edc960 msdkvp9dec: use separate src caps
We will add more formats in the src caps of msdkvp9dec, so let
msdkvp9dec uses separate src caps. Note it doesn't change any
capability
2019-01-31 10:30:22 +08:00
Aaron Boxer
68ae46ae14 d3dhelpers.c: fix typo in debug output 2019-01-30 11:27:42 -05:00
Nirbheek Chauhan
f9c04f3987 meson: Fix building of the nvdec plugin on Windows
Have to use the Nvidia Video Codec SDK when building with a newer CUDA
toolkit.
2019-01-28 13:28:01 +00:00
VaL Doroshchuk
9f03ade11f avfvideosrc: add device-name property
This property is readonly and should show the name of selected capture device.
2019-01-25 22:20:49 +01:00
Haihao Xiang
546797cecf msdkdec: set the mfx picture structure to MFX_PICSTRUCT_PROGRESSIVE if it is unknown
The picture structure in the output parameters from
MFXVideoDECODE_Query is set to MFX_PICSTRUCT_UNKNOWN for some codecs, so
the structure of the corresponding mfx surfaces created for decoding are
unknown. The pipeline will be broken when these surfaces are used as the
input for msdkvpp.

Example pipeline:

gst-launch-1.0 filesrc location=input_vp8.webm ! matroskademux !
msdkvp8dec ! msdkvpp ! fakesink

Error message:

0:00:00.031568911 14259 0x55b79dc684a0 ERROR                msdkvpp
gstmsdkvpp.c:728:gst_msdkvpp_transform:<msdkvpp0> MSDK Failed to do VPP
ERROR: from element
/GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: Internal data
stream error.

This is a workaround for the above issue
2019-01-25 12:45:43 +08:00
Haihao Xiang
920062cafc msdkh265enc: enable low power mode
Low power mode is disabled by default, set the value of low-power to
true to enable this mode.
2019-01-24 09:59:37 +00:00
Víctor Manuel Jáquez Leal
6b6ed2cad8 msdk: bufferpool: refactor memory type decision
The memory type was used as bitwise enum, but the enum was not
defined in that way.

Nonetheless, most of the usage of the memory type was as mutually
exclusive options, rather than option composition.

This patch refactor how the memory type is defined, so it is kept
the mutual exclusion among options.
2019-01-24 08:49:39 +00:00
Víctor Manuel Jáquez Leal
5d030ed776 msdk: fix some comments typos 2019-01-24 08:49:39 +00:00
Víctor Manuel Jáquez Leal
5f67b4946e msdk: decoder: fatal failure if negotiations fails
Otherwise it crashes when no parser is used placed upstream, v.gr.

gst-launch-1.0 filesrc location=file.264 ! msdkh264dec ! fakesink
2019-01-24 08:49:39 +00:00
Víctor Manuel Jáquez Leal
f238066288 msdk: decoder: comment to explain array reset 2019-01-24 08:49:39 +00:00
Víctor Manuel Jáquez Leal
882befb5db msdk: decoder: fix an usage-after-free pointer bug 2019-01-24 08:49:39 +00:00
Haihao Xiang
697d41c923 msdkvpp: add P010_10LE to sink and src caps
example pipelines:

gst-launch-1.0 videotestsrc num-buffers=100 ! \
video/x-raw,format=P010_10LE,width=352,height=288 ! msdkvpp ! \
video/x-raw,format=NV12! fakesink

gst-launch-1.0 videotestsrc num-buffers=100 ! \
video/x-raw,format=NV12,width=352,height=288 ! msdkvpp ! \
video/x-raw,format=P010_10LE ! fakesink
2019-01-21 17:32:17 +00:00
Haihao Xiang
5e3f94ce28 msdkh265dec: support P010_10LE in DMABuf mode 2019-01-21 17:32:17 +00:00
Jacek Tomaszewski
60146e3097 wasapi: Fixed corner-cases in mapping of channel mask
'channel-mask' field should not be put in caps if channel mask is 0x0

Mapping WASAPI channel mask to GST equivalent was going only over
first nChannels elements of wasapi_to_gst_pos array, translating, for
example, WASAPI's 0x63f to GST's 0x3f instead of 0xc3f.

When 'channel-mask' is specified as NULL, it signifies that there's
need to do downmix or upmix and it makes caps negotiation with
audioconvert element impossible. Just omit it.

Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com>
2019-01-21 21:10:55 +05:30
Nirbheek Chauhan
f710b36ac4 meson: Fix automagic build of msdk plugin
When building the msdk plugin even if libmfx is found, unless the
plugin is explicitly enabled we should not error out if msdk
dependencies are not found.

Also give an error message when we don't build the plugin on Windows
because we're not building with MSVC.
2019-01-19 18:28:42 +00:00
Nirbheek Chauhan
7ffcab3478 build: Don't forget to add windows files to EXTRA_DIST 2019-01-18 13:13:09 +05:30
Nirbheek Chauhan
d56aec8b0c wasapi: Fix infinite loop when the device disappears
When the audio device goes away during playback or capture, we were
going into an infinite loop of AUDCLNT_E_DEVICE_INVALIDATED. Return -1
and post an error message so the ringbuffer thread exits with an error.
2019-01-15 03:29:58 +05:30
Haihao Xiang
9aa68dea51 msdk: set the right BRCParamMultiplier
BRCParamMultiplier in mfxInfoMFX is a parameter which specifies a
multiplier for bitrate control parameters [1], it impacts TargetKbps,
MaxKbps, BufferSizeInKB and InitialDelayInKB.

[1]: https://software.intel.com/en-us/node/628473
2019-01-11 09:57:44 +00:00
Haihao Xiang
5fc160fa59 msdk: set the upper bound of max-vbv-bitrate to 2048000 kbps
The upper bound of bitrate is also 2048000 kbps which should be large
enough in practice.

Fix https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/863
2019-01-11 09:57:44 +00:00
Nirbheek Chauhan
0b94ed81a4 meson: Fix building of MSDK plugin on Windows
Variable name was typoed in 604c8d5232
2019-01-10 15:34:51 +05:30
Haihao Xiang
d7ad665d1c msdk: needn't call MFXJoinSession after MFXCloneSession
According to the MSDK documation[1], MFXCloneSession is a light-weight
equivalent of MFXJoinSession after MFXInit, so MFXJoinSession call isn't
needed in the msdk plugin, otherwise the cloned session is joined to the
parent session twice, and we will get a MFX error when closing the
parent session

example pipeline:

gst-launch-1.0 videotestsrc num-buffers=100 ! \
video/x-raw,format=NV12,width=352,height=288 ! msdkh264enc ! msdkh264dec ! \
msdkh264enc ! fakesink

Error message:

0:00:00.211948518 21733 0x5586ee741c60 ERROR                   msdk
msdk.c:148:msdk_close_session: Close failed (undefined behavior)

[1]: https://software.intel.com/en-us/node/628429#MFXCloneSession
2019-01-09 15:52:27 +08:00
Haihao Xiang
6c887f982e msdk: check whether mfx function call fails
And log the failures for debugging
2019-01-09 12:43:56 +08:00
Haihao Xiang
d7606a7667 msdkenc: return NULL instead of FALSE
The returned type is a pointer
2019-01-09 09:50:49 +08:00
Haihao Xiang
ba7f4de298 msdk: release resources if failing to create the buffer pool
Needn't check the pointers against NULL because the pointers are
non-NULL
2019-01-09 09:42:56 +08:00
Víctor Manuel Jáquez Leal
a301150002 msdk: meson: compile vp9dec if available
based on the patches provided by Haihao Xiang <haihao.xiang@intel.com>
2019-01-08 12:59:45 +00:00