gstreamer/subprojects/gst-plugins-bad/sys/aja
Xavier Claessens d86a6715e1 aja: Replace global semaphore with per-device flock()
The global semaphore was never closed/unlinked, causing permission
denied issue if the device is later used by another user. Properly
removing the semaphore when stopping the pipeline would still leave it
open in case of a crash.

With a GStreamer specific name, it was also not preventing other apps to access
the device concurrently.

Finally, if the system has multiple cards, the lock should be per card
and not global (to be confirmed).

Fixes: #3283.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6117>
2024-02-15 09:30:20 +00:00
..
.clang-format aja: Move clang-format configuration from the top-level to the plugin subdirectory 2023-10-27 11:44:36 +00:00
gstajacommon.cpp aja: Replace global semaphore with per-device flock() 2024-02-15 09:30:20 +00:00
gstajacommon.h aja: Replace global semaphore with per-device flock() 2024-02-15 09:30:20 +00:00
gstajadeviceprovider.cpp Prepare for merging into GStreamer 2023-10-26 09:27:46 +03:00
gstajadeviceprovider.h Prepare for merging into GStreamer 2023-10-26 09:27:46 +03:00
gstajasink.cpp aja: Replace global semaphore with per-device flock() 2024-02-15 09:30:20 +00:00
gstajasink.h ajasink: Add HANC/VANC ancillary data from GstAncillaryMeta 2024-02-08 15:28:39 +00:00
gstajasinkcombiner.cpp Prepare for merging into GStreamer 2023-10-26 09:27:46 +03:00
gstajasinkcombiner.h Prepare for merging into GStreamer 2023-10-26 09:27:46 +03:00
gstajasrc.cpp aja: Replace global semaphore with per-device flock() 2024-02-15 09:30:20 +00:00
gstajasrc.h ajasrc: Add GstAncillaryMeta for any HANC/VANC ancillary data that is captured 2024-02-08 15:28:39 +00:00
gstajasrcdemux.cpp Prepare for merging into GStreamer 2023-10-26 09:27:46 +03:00
gstajasrcdemux.h Prepare for merging into GStreamer 2023-10-26 09:27:46 +03:00
meson.build aja: suppress compiler warnings for aja ntv2 subproject 2024-02-10 10:10:06 +00:00
plugin.cpp aja: Add basic documentation 2023-10-26 09:36:10 +03:00
README.md aja: Add basic documentation 2023-10-26 09:36:10 +03:00

GStreamer AJA source/sink plugin

GStreamer plugin for AJA capture and output cards.

This plugin requires the AJA NTV2 SDK version 16 or newer.

The location of the SDK can be configured via the aja-sdk-dir meson option. If no location is given then the NTV2 SDK from GitHub is compiled as a meson subproject as part of the plugin.

Example usage

Capture 1080p30 audio/video and display it locally

gst-launch-1.0 ajasrc video-format=1080p-3000 ! ajasrcdemux name=d \
    d.video ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=1000000000 ! videoconvert ! autovideosink \
    d.audio ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=1000000000 ! audioconvert ! audioresample ! autoaudiosink

Output a 1080p2997 test audio/video stream

gst-launch-1.0 videotestsrc pattern=ball ! video/x-raw,format=v210,width=1920,height=1080,framerate=30000/1001,interlace-mode=progressive ! timeoverlay ! timecodestamper ! combiner.video \
    audiotestsrc freq=440 ! audio/x-raw,format=S32LE,rate=48000,channels=16 ! audiobuffersplit output-buffer-duration=1/30 ! combiner.audio \
    ajasinkcombiner name=combiner ! ajasink channel=0

Capture 1080p30 audio/video and directly output it again on the same card

gst-launch-1.0 ajasrc video-format=1080p-3000 channel=1 input-source=sdi-1 audio-system=2 ! ajasrcdemux name=d \
    d.video ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=1000000000 ! c.video \
    d.audio ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=1000000000 ! c.audio \
    ajasinkcombiner name=c ! ajasink channel=0 reference-source=input-1