Commit graph

3222 commits

Author SHA1 Message Date
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
Xiang, Haihao
38cf42f90f msdk: Close fd handle
Otherwise it will result in resource leak if mem == NULL
2018-11-26 16:13:44 +00:00
Matthew Waters
d67d866eb9 decklink: fixup internal time tracking over buffering pauses
Instead of relying on buffers after a state change to PLAYING to always start
from 0, track the amount of time we have spent outside playing but not changed
state to PAUSED.
2018-11-26 17:57:45 +11:00
Seungha Yang
d2e87e6a31 meson: Fix Windows CUDA dependency check
Python returns 'None' string for unknown environment
2018-11-26 11:31:06 +09:00
Seungha Yang
d3a6eb7977 nvh265enc: Fix email address typo 2018-11-25 23:31:37 +00:00
Seungha Yang
c75907d23c nvenc: Fix undefined reference build error on MSVC and CUDA 9.1 2018-11-25 23:31:37 +00:00
Seungha Yang
3cd1d0c7bc nvenc: Fix MSVC build error C2121 2018-11-25 23:31:37 +00:00
Seungha Yang
6bf5ba993d nvenc: Add meson build with Windows support
Note that, since Nvidia does not provide nvEncodeAPI.lib file,
find_library() couldn't be used for build on Windows.
This patch changes to load nvEncodeAPI(64).dll or libnvidia-encode.so
in runtime
2018-11-25 23:31:37 +00:00
Seungha Yang
6051c47bfe nvdec: Add meson build with Windows support 2018-11-25 23:31:37 +00:00
Seungha Yang
4e314d6f80 nvdec: Drop dynlink interface and use NVIDIA CODEC SDK instead
dynlink_* was introduced since CUDA Toolkit 9.x but it's deprecated from 10.0.
Instead of using #ifdef hack, shipping nvidia headers of NVIDA CODEC SDK
can make build/code simple
2018-11-25 23:31:37 +00:00
Seungha Yang
67a84254ae nvdec/nvenc: Shipping NVIDA Codec SDK headers
Add cuvidec.h, nvcuvid.h and nvEncodeAPI.h of NVIDIA Codec SDK 8.2.16
2018-11-25 23:31:37 +00:00
Víctor Manuel Jáquez Leal
09dbe83e5d msdk: don't declare headers in meson
This partially reverts commit 0bae648353.

The compiler tells ninja the header dependency, then there is
no need to add them explicity.
2018-11-23 17:10:24 +01:00
Víctor Manuel Jáquez Leal
0bae648353 msdk: declare headers in meson 2018-11-23 13:50:20 +01:00
Wangfei
409d4ff30e msdkdec: move output-order out of decode bass class.
Since output-order is a deprecated attribute, move it out of decode
bass class and configure it in each sub decoder class who need it.

https://bugzilla.gnome.org/show_bug.cgi?id=796853
2018-11-23 12:26:40 +00:00
Víctor Manuel Jáquez Leal
eaa1bd93e8 msdk: add support for open sourced MediaSDK
MediaSDK has been released as open source [1], but the directories
where it installs its files, are different from the binary only
distribution.

This patch adds to the libraries path the directory /lib. Also it
is defined in meson if the include directory has the mfx/ prefix,
something that is already handled in autotools.

1. https://github.com/Intel-Media-SDK/MediaSDK
2018-11-22 17:31:58 +01:00
Seungha Yang
b44d2702ca meson: Fix invalid keyword warning
"required" keyword is not a valid argument for has_header()

WARNING: Passed invalid keyword argument "required".
WARNING: This will become a hard error in the future.
2018-11-13 09:02:21 +00:00
Sebastian Dröge
1d0d395b5c decklinkvideosink: Cast result of bitwise-or of multiple enum values to the enum again
In C++ the bitwise-or results in an int, and ints are not implicitely
cast to enums.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/25#note_78122
2018-11-13 10:02:57 +02:00
Nirbheek Chauhan
09f814a00a d3dvideosink: Remove unused variable
Fixes a compiler warning.
2018-11-13 09:55:56 +05:30
Sebastian Dröge
96490b83a4 decklinkvideosink: Add support for outputting closed captions 2018-11-12 14:10:03 +00:00
Jochen Henneberg
15fc39c296 avdtputil: Remove dead code
These function are not used at all, using them together with the
transport-volume property from avdtpsrc may end up in a binding loop so
we better remove the functions.
2018-11-12 08:00:26 +00:00
Jochen Henneberg
bac0e14eae avdtpsrc: Fix transport-volume write
If properties are proxied through GBinding this can work only if the
proxied property keeps it's own value. The previous implementation will
read the original value if the proxied property signals a change and
thus nothing will happen.
2018-11-12 08:00:26 +00:00
Joshua M. Doe
5b179991bc dshowsrcwrapper: add implementation of GstDeviceMonitor
Right now this only works for video. An attempt was made at adding
monitoring following the example winks, but it seems the only devices that
can be easily detected are KS sources, which winks already handles.
2018-11-09 09:52:40 +00:00
Joshua M. Doe
912ff02a21 dshowsrcwrapper: refactor device selection, filter creation, and caps retrieval
This allows a future GstDeviceProvider to more easily query devices and caps.
2018-11-09 09:52:40 +00:00
Joshua M. Doe
e70af38d4e dshowsrcwrapper: add get_property implementation to sources 2018-11-09 09:52:40 +00:00
Joshua M. Doe
8f7641bf3c dshowvideosrc: handle empty strings for device and device-name
The device and device-name properties should treat NULL and empty strings the same
2018-11-09 09:52:40 +00:00
Joshua M. Doe
73a84148d3 dshowvideosrc: delay selecting device until source is started
The previous behaviour had issues when setting one of the device properties
after _get_caps had been called. The device shouldn't be locked in until after
_start has been called.
2018-11-09 09:52:40 +00:00
Joshua M. Doe
4b4535b35c dshowvideosrc: fix template caps to reflect actual supported caps 2018-11-09 09:52:40 +00:00
Joshua M. Doe
659e5d08ac dshowsrcwrapper: add some helpful debug statements 2018-11-09 09:52:40 +00:00
Joshua M. Doe
1449411e39 ksvideosrc: initialize pointer to satisfy MSVC 2018-11-08 15:42:51 +00:00
Joshua M. Doe
ca90ecef9c ksvideosrc: support 'Y16 ' FOURCC as GRAY16_LE
The FLIR Boson USB provides 16-bit grayscale video using this FOURCC.
2018-11-08 15:42:51 +00:00
Joshua M. Doe
6c53d696dd ksvideosrc: gracefully handle device prop when empty string 2018-11-08 15:42:51 +00:00
Sebastian Dröge
2d0243fc68 decklinkvideosrc: Search from line 1 again if we didn't find closed captions at the same line as before 2018-11-07 16:07:25 +00:00
Jordan Petridis
1e887f9b12
meson: avoid unkown variables in the msdk tests 2018-11-06 23:48:58 +02:00
admin
8af8fd62dd decklinkvideosink: fix segfault when audiosink is closed before videosink 2018-11-06 17:19:16 +00:00
Florent Thiéry
23b0172ee9 msdk: fix intel sdk libdir path
the 2018.3.1 intel sdk release places libraries into /lib64 instead of
/lib/lin_x64 or /lib/x64, this commit adds /lib64 to the libdir
locations list

Fixes #815
2018-11-06 13:08:45 +00:00
Seungha Yang
f4dc780168 d3dvideosink: Fix calculating buffer size of packed format
The Pitch (i.e., stride) of D3DLOCKED_RECT structure is already
respecting required stride value.
2018-11-06 11:51:39 +00:00
Seungha Yang
6c6d351665 d3dvideosink: Set actual buffer size to buffer pool
If configured size of buffer pool and actual buffer size are mismatched,
pool will do unwanted buffer resize.

Fixes #801
2018-11-06 11:51:39 +00:00
Seungha Yang
dee5201392 d3dvideosink: Use lock/cond to wait internal window construction
We can save one (or possibly more) sleep time by using lock/cond
2018-11-06 11:51:39 +00:00
Seungha Yang
b3279c3fce d3dvideosink: Don't leak GThread object
Need to call g_thread_join() to avoid leak
2018-11-06 11:51:39 +00:00
Seungha Yang
c9b204ea87 d3dvideosink: Print lock/unlock log with trace debug level 2018-11-06 11:51:39 +00:00
Seungha Yang
2a3207bfc1 d3dvideosink: Remove white space 2018-11-06 11:51:39 +00:00
Matthew Waters
dff857463a applemedia: install plugin pkg-config file 2018-11-06 14:35:46 +11:00
Joshua M. Doe
1a360a1c65 decklinkvideosrc: respect pixel format property even if mode is set to auto
Before this patch, if mode=auto and video-format!=auto, video-format would
always be ignored, and get set to 8bit-yuv, or if detected to be RGB444, then
it would be set to 8bit-argb. This change respects video-format if it is set
to 10bit-yuv (v210) or 8bit-bgra, even when mode=auto.

Closes #772
2018-11-05 08:52:11 -05:00
Sebastian Dröge
3d8a0b8996 decklinkvideosrc: Add support for extracing CEA608 according to S334-1 Annex A
https://bugzilla.gnome.org/show_bug.cgi?id=797363
2018-11-01 19:21:47 +02:00
Nirbheek Chauhan
55134df54c meson: Add a feature option for the MSDK plugin 2018-10-28 14:54:52 +00:00
Joshua M. Doe
6c7ba14247 dshowsrcwrapper: add device-index property to sources
This allows users to more easily select different devices without having
to first get the device or device-name.

https://bugzilla.gnome.org/show_bug.cgi?id=797338
2018-10-27 21:58:30 +01:00
Joshua M. Doe
5caefc1e0c dshowsrcwrapper: update CMake build instructions
GStreamer 1.8 is minimum version, and remove paragraph about 32 vs 64-bit build

https://bugzilla.gnome.org/show_bug.cgi?id=797338
2018-10-27 21:58:30 +01:00
Joshua M. Doe
a6d193bb1e dshowsrcwrapper: support building 32- and 64-bit with CMake
https://bugzilla.gnome.org/show_bug.cgi?id=797338
2018-10-27 21:58:30 +01:00
Joshua M. Doe
1569264d1e dshowsrcwrapper: add debug category for general dshowsrcwrapper
https://bugzilla.gnome.org/show_bug.cgi?id=797338
2018-10-27 21:58:30 +01:00
Josep Torra
498dc9a84d shmsrc: delay fd removal until there's no uses
This fixes the remaining race condition with the fd by delaying
the removal until last pipe ref.

Unexpected critical/warning: gst_poll_fd_has_error: assertion 'fd->fd
>= 0' failed

Stack trace:
gst_debug_get_stack_trace (gstinfo.c:2788)
gst_check_log_critical_func (gstcheck.c:281)
g_logv (/lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2:0x7fdd4efa0a40)
g_log (/lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2:0x7fdd4efa0c6b)
gst_poll_fd_has_error (gstpoll.c:1217)
gst_shm_src_create (gstshmsrc.c:364)
gst_push_src_create (gstpushsrc.c:131)
gst_base_src_get_range (gstbasesrc.c:2521)
gst_base_src_loop (gstbasesrc.c:2845)
gst_task_func (gsttask.c:328)
default_func (gsttaskpool.c:69)

https://bugzilla.gnome.org/show_bug.cgi?id=797203
2018-10-10 13:42:05 -04:00
Josep Torra
eb1665ff22 shmsrc: fixes a crash when is-live is true due a race condition
There's a race condition when is-live is set to true and the shmsrc
element releases the pipe in the transition from PLAYING to PAUSED.
To avoid it this change ensures that _create method takes the pipe
and increases the use_count in one operation protected by object lock.
Also perform apropriate protections when releasing the pipe.

https://bugzilla.gnome.org/show_bug.cgi?id=797203
2018-10-10 13:42:05 -04:00
Olivier Crête
a3f395d921 shmsrc: Remove commented out code 2018-10-10 13:07:50 -04:00