Commit graph

3173 commits

Author SHA1 Message Date
Haihao Xiang 3110f3791f msdk: don't reset the external frame allocator
In gst-msdk, a mfx session may be shared between different gst
elements, each element tries to set the frame allocator. However, per
the MSDK documation[1], the behavior is undefined if reset the frame
allocator while the previous allocator is in use. Fortunately all
elements use the same frame allocator, so we can avoid to call
MFXVideoCORE_SetFrameAllocator again.

[1]: https://software.intel.com/en-us/node/628430#MFXVideoCORE3
2019-01-08 09:11:47 +00:00
Haihao Xiang a0943aec69 msdkvpp: don't use NV12 as default output in normal mode
If so, BGRA is the preferred output format hence BGRA will be selected
as input format by default, e.g. in the pipleline below, BGRA instead of
NV12 is selected without renegotiation, so we can avoid the NV12 issue
(see commit 3f2314a) by default.

gst-launch-1.0 videotestsrc ! msdkvpp ! glimagesink
2019-01-08 10:08:43 +08:00
Haihao Xiang 7681566f29 msdkvpp: close the current VPP session if this session has been initialized
Otherwise MFXVideoVPP_Init will fail because it is called twice without
a close.

Example pipeline:

gst-launch-1.0 videotestsrc ! msdkvpp ! glimagesink

Sometimes glimagesink emits GST_EVENT_RECONFIGURE event which results
in that MFXVideoVPP_Init is called twice, then get the negotiation
failure below:

0:00:00.093715518 21218 0x558ef56231e0 ERROR                msdkvpp
gstmsdkvpp.c:995:gst_msdkvpp_initialize:<msdkvpp0> Init failed
(undefined behavior)
WARNING: from element /GstPipeline:pipeline0/GstMsdkVPP:msdkvpp0: not
negotiated

After applying this commit, the pipeline above may run without
negotiation failure, however NV12 layout in dmabuf mode is selected in
renegotiation, the display image is corrupted due to the NV12 issue which
was mentioned in commit 3f2314a. Some other fixes are needed to avoid
renegotiation by default
2019-01-08 10:08:43 +08:00
Haihao Xiang e8d2f58e23 msdkvpp: don't update pads' info if nothing have changed 2019-01-08 10:08:43 +08:00
U. Artie Eoff e91a53f693 msdkenc: break out of flush frames loop on error
In general, we should assume any unhandled error is
non-recoverable.

In the flush frames loop, some error states can cause us
to never increment the task and therefore we get stuck
in an infinite loop and generate GST_ELEMENT_ERROR
over and over again.  This eventually consumes all
system memory and triggers OOM.  Thus, assume the worst
and break out of the loop upon the first "unhandled" error.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/859
2019-01-06 19:07:35 -08:00
Nirbheek Chauhan 8249763f6c wasapi: Fix double call to Start when resetting the element
When either the source or sink goes from PLAYING -> NULL -> PLAYING,
we call _reset() which sets client_needs_restart, and then we call
prepare() which calls IAudioClient_Start(), so we don't need to call
it again in src_read() or sink_write(). Unlike when we're just going
PLAYING -> PAUSED -> PLAYING.
2019-01-04 18:47:07 +05:30
Sebastian Dröge 2f05ee9ba9 wasapisink: Don't call CoUninitialize() twice in unprepare()
It has to be symmetric with CoInitialize(), otherwise everything else
will fail.
2019-01-03 15:21:39 +00:00
Sebastian Dröge 822abde8a4 decklinkvideosink: Don't forget to unref clock after usage
And don't unref a clock that is potentially NULL.
2019-01-02 17:39:19 +02:00
Seungha Yang 373580c7be msdk: Fix invalid return type build warning
void function cannot have return value

gst-plugins-bad/sys/msdk/gstmsdkbufferpool.c(332): warning C4098:
'gst_msdk_buffer_pool_release_buffer': ...
2018-12-25 16:14:36 +09:00
Sebastian Dröge c47fac42cd decklinkvideosink: Fix support for raw CEA608 input and add support for raw CEA708 input
The former was only considering the first byte pair, for the latter we
have to convert raw CEA708 cc_data into CDP.
2018-12-19 00:20:26 +02:00
Xavier Claessens f49da047dc Fix build when we have tinyalsa but not its header 2018-12-18 21:08:10 +00:00
Nicolas Dufresne 5b372a9707 kmssink: Accept underscore in property
Otherwise sdi_mode and similar properties would be canonicalised to
sdi-mode.
2018-12-18 16:36:57 +01:00
Guillaume Desmottes cbff147f71 kmssink: fix tmp_kmsmem leaks
configure_mode_setting() keeps a ref on tmp_kmsmem which is released in
gst_kms_sink_show_frame().
But if for some reason configure_mode_setting() is re-called before
showing a frame or if none is showed this memory was leaked.
2018-12-18 15:44:23 +01:00
Tim-Philipp Müller 6ca10c633d Remove acmmp3dec and acmenc plugins
ACM is an ancient legacy API, and there's no point in
keeping it around for a licensed mp3 decoder now that
mp3 patents have expired and we have a decoder in -good.

We didn't ship this in cerbero anyway. If there's a good
case for the AAC encoder (which is LC only anyway) someone
should write a new plugin based on current APIs, that can
actually be built out of the box.

Fixes #850
2018-12-18 10:06:59 +00:00
Tim-Philipp Müller f102c61397 meson: build vdpau plugin 2018-12-17 09:12:53 +00:00
Tim-Philipp Müller 97cc93d621 meson: build tinyalsa plugin 2018-12-17 09:12:53 +00:00
Tim-Philipp Müller 807227cef2 meson: build vcdsrc plugin 2018-12-17 09:12:53 +00:00
Sebastian Dröge 48f48cc4ba closedcaption: Replace GST_VIDEO_CAPTION_TYPE_CEA608_IN_CEA708_RAW with CEA608_S334_1A
As a side-effect we can now actually store the line offset in the
line21dec element, and have to perform fewer transformations in the
decklink elements (which were also buggy as they assumed a single byte
triplet per meta).
2018-12-15 21:31:28 +00:00
Justin Kim 18c8557836 sys: applemedia: meson: Add dependencies by using appleframeworks
gst-build#13
2018-12-14 12:22:51 +09:00
Matthew Waters 0842187e6e nvdec: Rely on upstream's value for interlace-mode with hevc
The nvdec API doesn't seem to produce interlacing information with hevc
streams so rely on upstreams value for interlace-mode
2018-12-12 21:21:57 +00:00
Haihao Xiang 88586b4149 msdk: change the wait time for encoder and vpp
In MSDK samples, the wait time for encoder, decoder and vpp is
300000. Let's set the wait time to the same value in msdk plugin
2018-12-12 17:24:00 +00:00
Haihao Xiang 51dc388783 msdk: correct the error message
It is VPP session instead of Encoder session
2018-12-12 17:24:00 +00:00
Haihao Xiang 718b7d0b5d msdk: check the created context against NULL pointer
gst_msdk_context_new_with_parent() may return NULL
2018-12-12 17:24:00 +00:00
Haihao Xiang 801189c02f msdk: decrease the reference count of object
Otherwise there are reference leaks if failed to clone or join a
mfx session
2018-12-12 17:24:00 +00:00
Haihao Xiang 43e5eaeda1 msdk: assign the returned value to status variable
Othervise the subsequent check will use the stale value of status
variable
2018-12-12 17:24:00 +00:00
Xiang, Haihao 9a9e01a1a5 msdkh265enc: output main-10 bitstream if the input is P010_10LE
Tested on KBL using the following command:
gst-launch-1.0 videotestsrc num_buffers=100 ! video/x-raw,format=P010_10LE ! \
msdkh265enc ! filesink location=a.hevc

This fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/829
2018-12-12 09:00:13 +00:00
Xiang, Haihao 9711a21008 msdkh265enc: add P010_10LE to the sink pad template 2018-12-12 09:00:13 +00:00
Xiang, Haihao ba1f162401 msdkh265enc: re-add the sink pad template
We will add more profiles in the sink caps of msdkh265enc, so let
msdkh265enc re-add the sink pad template. Note this change doesn't
impact any capability
2018-12-12 09:00:13 +00:00
Xiang, Haihao f45d5dc8bc msdkenc: handle P010_10LE input format
Note it is up to each codec to support P010_10LE format
2018-12-12 09:00:13 +00:00
Xiang, Haihao 506835a484 msdkenc: use macro GST_VIDEO_INFO_FORMAT if possible 2018-12-12 09:00:13 +00:00
Matthew Waters 59c5ae2817 decklink: calculate the decklink output time from the internal clock
Fixes the time calculations when dealing with a slaved clock (as
will occur with more than one decklink video sink), when performing
flushing seeks causing stalls in the output timeline, pausing.

Tighten up the calculations by relying solely on the internal time
(from the internal clock) for determining when to schedule display
frames instead attempting to track pause lengths from the external
clock and converting to internal time.  This results in a much easier
offset calculation for choosing the output time and ensures that the
clock is always advancing when we need it to.

This is fixup to the 'monotonically increasing output timestamps' goal
in: bf849e9a69
2018-12-12 13:29:32 +11:00
Matthew Waters b907187ade androidmedia: also install java sources
As needed by our ndk-build integration
2018-12-07 07:46:27 +00:00
Naveen Cherukuri 936f89a0d5 kmssink: Avoiding get_property to take ownership of object members
Double free will happen if application frees string retuned by _get_property
2018-12-04 12:23:48 +01:00
Xiang, Haihao 0e7e425bb9 msdk: add missing breaks 2018-12-03 07:09:56 +00:00
Xiang, Haihao a1aae3fd92 msdk: fix the wrong operator
The condition is for video memory only, so the operator should be
& instead of |
2018-12-03 07:09:56 +00:00
Tim-Philipp Müller 2b8659a3ef meson: build opencv and ipcpipeline examples
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/576
2018-11-29 12:29:50 +00:00
Jordan Petridis 1f562870ee Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 14:18:26 +00:00
Xiang, Haihao b0d22f8cb4 msdk: remove unnecessary assignment
CodecProfile will be set in MFXVideoDECODE_DecodeHeader() to match
the input stream. Setting the hard-coded profile here will mislead
user that msdkh265dec supports a special profile only.
2018-11-26 16:47:17 +00:00
Xiang, Haihao b38f8d301c msdk: update the sink and src caps of msdkh265dec
Now hevc 10bit video can be decoded correctly, so update the sink
and src caps accordingly.

This fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/720
2018-11-26 16:47:17 +00:00
Xiang, Haihao 2b0923842a msdk: set right BitDepth and Shift for P010 mfx frame
BitDepth is 10 and Shitf must be set to 1 when creating P010 mfx
frame in MSDK
2018-11-26 16:47:17 +00:00
Xiang, Haihao fda4918cc8 msdk: don't use hard-coded video format
Some codecs may support varied formats, e.g. HEVC may support NV12
and P010_10LE etc
2018-11-26 16:47:17 +00:00
Xiang, Haihao 27ab7fb40f msdk: adjust the RT format for P010 surface
According to VA API, VA_RT_FORMAT_YUV420_10 is expected for P010
surface
2018-11-26 16:47:17 +00:00
Xiang, Haihao eeb58f64c2 msdk: create VA_FOURCC_P010 surface from dmabuf 2018-11-26 16:47:17 +00:00
Xiang, Haihao 7d58424611 msdk: VA_FOURCC_P010 frame lock
P010 and NV12 have the same layout, so we may reuse the code in
gst_msdk_frame_lock()
2018-11-26 16:47:17 +00:00
Xiang, Haihao f72c825194 msdk: map MFX_FOURCC_P010 to VA_FOURCC_P010 2018-11-26 16:47:17 +00:00
Xiang, Haihao dc070a8306 msdk: make sure the surface data is set for GST_VIDEO_FORMAT_P010_10LE
P010_10LE and NV12 have the same layout, so we may reuse the code.
2018-11-26 16:47:17 +00:00
Haihao Xiang 54451b7303 msdk: map GST_VIDEO_FORMAT_P010_10LE to MFX_FOURCC_P010 2018-11-26 16:47:17 +00:00
Xiang, Haihao 1d97a6f00e msdk: add an assert in gst_msdk_frame_lock() for unhandled formats
We will add support for more formats, e.g. P010, Adding an assert
here may catch the error early
2018-11-26 16:47:17 +00:00
Haihao Xiang 1c0160513b msdk: use separate src caps for msdkh265dec
We will add more formats in the src caps of msdkh265dec, so let
msdkh265dec uses separate src caps. Note it doesn't change any
capability
2018-11-26 16:47:17 +00:00
Xiang, Haihao 1bfd1b2bf9 msdk: Make sure a variable is initialized when it is used
Previously alloc_info is initialized when both thiz->initialized
and thiz->allocation_caps are true, but only thiz->initialized is
checked when alloc_info is used.
2018-11-26 16:13:44 +00:00