Commit graph

76 commits

Author SHA1 Message Date
Nirbheek Chauhan
ca8c63080f decklink: Fix format specifier warnings in logging v2
HRESULT is unsigned long on Windows, but the Decklink headers define
it to 'int' on Linux. Confusingly, the defines that talk about the
possible return values for it use long constants. The easy fix would
be to change the linux/LinuxCOM.h header, but that's copied from the
decklink SDK.

Change the logging to always upcast to unsigned long while printing
HRESULT for consistency across platforms.
2017-07-19 04:19:34 +05:30
Georg Lippitsch
f0c7fbb371 decklinkvideosrc: Add custom memory allocator
The default memory allocator of the decklink library allocates
a fixed pool of buffers, and the number of buffers is unknown.
This makes it impossible do useful queuing downstream. The new
memory allocator can create an unlimited number of buffers,
giving all queuing features one would expect from a live source.

https://bugzilla.gnome.org/show_bug.cgi?id=782556
2017-07-11 14:26:31 +03:00
Sebastian Dröge
c40b8a894d decklink: Sink the clock reference in the constructor
This is now needed as GstClock does not do that internally anymore,
because that broke bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-05-17 10:40:23 +03:00
Sebastian Dröge
4df6be45f0 decklinkaudiosrc: Consistently pass stream_time and stream_duration to audio/video src
It's the same value now, pass it consistently.
2017-05-12 11:36:27 +02:00
Sebastian Dröge
28a16b5e94 decklink: Always use the video stream time for audio too
The audio packet times can be completely unrelated to the video stream
time, depending on the card. While this looks like a bug in the driver,
just always using the video stream time (which is correct) works as a
workaround for now.
2017-05-10 17:02:28 +02:00
Nirbheek Chauhan
b63fb59a11 Revert "decklink: Fix debug logging warnings on Windows"
This reverts commit 845832263b.

The commit broke cross-mingw CI:
https://ci.gstreamer.net/job/GStreamer-master/8659/console

It seems that cross-mingw on Autotools and native-mingw on Meson
disagree about the size of HRESULT. Revert for now till I can
investigate the Meson side of things some more.
2017-05-05 18:52:24 +05:30
Nirbheek Chauhan
8865b440d9 decklink: Fix linking on MinGW
MinGW does not provide comsupp.lib, so there's no implementation of
_com_util::ConvertBSTRToString. Use a fallback implementation that
uses wcstombs() instead.

On MinGW we also truncate the name to 100 chars which should be fine.
2017-05-05 17:49:22 +05:30
Nirbheek Chauhan
845832263b decklink: Fix debug logging warnings on Windows
HRESULT is unsigned long int, not unsigned int
2017-05-05 17:49:22 +05:30
Sebastian Dröge
4cdd234add decklink: Fix indentation 2017-01-31 14:56:34 +02:00
Sebastian Dröge
861cb49895 decklink: Fix compilation on Windows by properly using COM strings there 2017-01-31 14:56:34 +02:00
Axel Menzel
f784fda162 decklink: Fix compilation with MSVC 2017-01-31 14:56:34 +02:00
Vivia Nikolaidou
f23277e55d decklinkaudiosrc: Option to use max channels supported by device
Query the device for the maximum number of channels supported and have
an option to use that. Default is still 2.

https://bugzilla.gnome.org/show_bug.cgi?id=777458
2017-01-26 16:18:57 +02:00
Sebastian Dröge
d6b75e5233 decklink: Fix compiler warning with clang
gstdecklink.cpp:821:11: warning: variable 'dtc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (m_input->videosrc) {
          ^~~~~~~~~~~~~~~~~
gstdecklink.cpp:837:41: note: uninitialized use occurs here
          stream_time, stream_duration, dtc, no_signal);
                                        ^~~
gstdecklink.cpp:821:7: note: remove the 'if' if its condition is always true
      if (m_input->videosrc) {
      ^~~~~~~~~~~~~~~~~~~~~~~
gstdecklink.cpp:810:29: note: initialize the variable 'dtc' to silence this warning
      IDeckLinkTimecode *dtc;
                            ^
                             = NULL
2017-01-25 20:48:58 +02:00
Vivia Nikolaidou
3cb43f35b8 decklinkvideosrc: Do not append a zero timecode if none is found on the source
If the source doesn't give us timecode information, do not append a zero
timecode to the frames.

https://bugzilla.gnome.org/show_bug.cgi?id=776900
2017-01-09 18:37:50 +02:00
Sebastian Dröge
e31714691a decklink: Fix indentation 2017-01-03 17:31:03 +02:00
Sebastian Dröge
e8e531ee12 decklinkaudiosrc: Add support for 8/16 channels via property
These are unpositioned channel layouts.
2017-01-03 17:30:07 +02:00
Sebastian Dröge
5725bad218 decklink: Fix compiler warning
gstdecklink.cpp: In member function ‘virtual HRESULT GStreamerDecklinkInputCallback::VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*)’:
gstdecklink.cpp:766:34: error: ‘base_time’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         capture_time -= base_time;
                                  ^
2016-11-29 15:35:09 +02:00
Sebastian Dröge
fdf1a57953 decklink: Correctly set top-field-first/bottom-field-first
First of all, all the HD and UHD modes should be top-field-first, as
also returned by the Decklink mode iterator API.

Then we should include the caps field "field-order" in the caps of the
source (not the sink due to negotiation problems with optional fields).

And finally we should set the TFF flag on interlaced buffers that are
top-field-first.
2016-11-28 17:19:26 +02:00
Sebastian Dröge
cf224a9990 decklinksrc: Set GAP flag on buffers that are captured without signal
https://bugzilla.gnome.org/show_bug.cgi?id=774850
2016-11-28 14:27:51 +02:00
Sebastian Dröge
881a08671e decklinksrc: Stop using the "hardware" timestamps and directly use the pipeline clock
The hardware timestamps have no relation to when frames were produced,
only when frames arrived somewhere in the hardware. Especially there is
no guarantee that audio and video will have the same hardware timestamps
although they belong together, and even more important: the rate with
which the hardware timestamps increase is completely unrelated to the
rate with which the frames are captured!

As such we can as well use the pipeline clock directly and stop doing
complicated calculations. Also as a side effect this allows now running
without any pipeline clock, by directly making use of the stream times
as reported by the driver.

https://bugzilla.gnome.org/show_bug.cgi?id=774850
2016-11-28 14:27:51 +02:00
Sebastian Dröge
f9a8b843df decklink: Print the Decklink API error return values in debug output in all places 2016-09-21 09:31:41 -04:00
Sebastian Dröge
6fdd4d8288 decklinkaudiosink: Add support for 8 and 16 channels 2016-08-26 15:49:40 +03:00
Vivia Nikolaidou
8faa36e105 decklinkvideosrc: Add support for GstVideoTimeCode
The timecode will be fetched from the decklink source and attached to the
video buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=766419
2016-08-04 19:08:27 +03:00
Vivia Nikolaidou
a4ae449434 decklink: Fix swapped name and nick in GEnumValues
https://bugzilla.gnome.org/show_bug.cgi?id=742878
2016-05-03 15:57:23 +03:00
Vivia Nikolaidou
832764d2fd decklink: Add initial 10bit support for YUV modes
https://bugzilla.gnome.org/show_bug.cgi?id=742878
2016-05-03 15:57:23 +03:00
Sebastian Dröge
87503ac174 decklink: Fix indentation 2016-05-03 15:57:23 +03:00
Sebastian Dröge
da999d7af8 decklink: Initialize capture_time to NONE so it can be used if no video frame is provided but audio is
CID 1358390
2016-04-08 14:08:31 +03:00
Sebastian Dröge
0004920c83 decklinkaudiosrc: Don't crash when receiving video frames but no audio
And mark these events as disconts to reset time tracking in the audio source.

https://bugzilla.gnome.org/show_bug.cgi?id=747633
2016-04-05 14:47:00 +03:00
Tim-Philipp Müller
8abff20185 decklinkvideosrc: don't crash if we get NULL video frames in the callback
For some reason we seem to sometimes get NULL video_frames in the
::VideoInputFrameArrived() callback, observed on Intensity Pro cards.

https://bugzilla.gnome.org/show_bug.cgi?id=747633
2016-04-05 14:46:22 +03:00
Julien Moutte
3ea431c5b5 decklinkvideosrc: implement RGB capture support
Combine mode and format to generate caps and support the flags from VideoChanged callback to support RGB capture.

https://bugzilla.gnome.org/show_bug.cgi?id=760594
2016-01-22 16:11:08 +01:00
Vivia Nikolaidou
fafc8e564c decklinkvideosink: Made "auto" mode work according to caps
When the mode of decklinkvideosink is set to "auto", the sink claims to
support the full set of caps that it can support for all modes. Then, every
time new caps are set, the sink will automatically find the correct mode for
these caps and set it.

Caveat: We have no way to know whether a specific mode will actually work for
your hardware. Therefore, if you try sending 4K video to a 1080 screen, it
will silently fail, we have no way to know that in advance. Manually setting
that mode at least gave the user a way to double-check what they are doing.

https://bugzilla.gnome.org/show_bug.cgi?id=759600
2015-12-18 16:08:02 +01:00
Sebastian Dröge
9764e22a5c decklink: Add a clock epoch that is used as offset whenever restarting the clock
Otherwise we're going to return times starting at 0 again after shutting down
an element for a specific input/output and then using it again later.

https://bugzilla.gnome.org/show_bug.cgi?id=755426
2015-09-24 09:32:36 +02:00
Heinrich Fink
6007829e77 decklink: Rename mode 2048p to 1556p
https://bugzilla.gnome.org/show_bug.cgi?id=749218
2015-05-11 13:20:11 +03:00
Heinrich Fink
1dabd7c5b8 decklink: Use correct frame rate for mode 2160p50
https://bugzilla.gnome.org/show_bug.cgi?id=749218
2015-05-11 13:14:39 +03:00
Heinrich Fink
e6d82dec32 decklink: Rename mode 3184p to 2160p
https://bugzilla.gnome.org/show_bug.cgi?id=749218
2015-05-11 13:14:15 +03:00
Josep Torra
6b70b848ee decklink: do not repeat first video format in caps template
The first entry in the modes array is used as default mode for autodetection.
There's no need to copy it into the caps template.
2015-04-22 17:20:21 +02:00
DanielD10
034ed48023 decklink: Incorrect frame rate for interlaced modes
https://bugzilla.gnome.org/show_bug.cgi?id=744386
2015-03-02 11:59:31 +01:00
Sebastian Dröge
b739cf8b7f decklink: Fix compiler warning with gcc
gstdecklink.cpp: In member function 'virtual HRESULT GStreamerDecklinkInputCallback::VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*)':
gstdecklink.cpp:498:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (capture_time > m_input->clock_start_time)
                      ^
gstdecklink.cpp:503:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (capture_time > m_input->clock_offset)
                      ^
2015-02-09 21:04:17 +01:00
Sebastian Dröge
f0e85023c2 decklink{audio,video}src: Implement clock slaving if the pipeline clock is not the decklink clock 2015-02-09 17:17:37 +01:00
Sebastian Dröge
22b0a4dad5 decklink{audio,video}src: Take the capture times from the pipeline clock
Not from the decklink clock. Both will return exactly the same time once the
decklink clock got slaved to the pipeline clock and received the first
observation, but until then it will return bogus values. But as both return
exactly the same values, we can as well use the pipeline clock directly.
2015-02-08 21:56:04 +01:00
Sebastian Dröge
00176a1ddf decklink: Make sure our clock never returns NONE, always advances and does not jump when going from PAUSED to PLAYING
It basically behaves the same as the audio clocks.
2015-01-28 16:13:16 +01:00
Sebastian Dröge
ab9ee34aba decklink: Use BT2020 colorspace for UltraHD resolutions 2015-01-13 19:56:45 +01:00
Sebastian Dröge
65119ae8b4 decklink: Fix indention once again 2015-01-13 19:56:45 +01:00
Sebastian Dröge
b79ece392c decklink: Initialize refcount of our C++ classes in the constructor
CID 1262288
CID 1262287
CID 1262289
2015-01-12 15:58:38 +01:00
Florian Langlois
9480d91ad4 decklinkvideosrc: Add automatic mode detection
https://bugzilla.gnome.org/show_bug.cgi?id=739284
2015-01-08 18:16:12 +01:00
Sebastian Dröge
7e7cabb422 decklink: Add a dummy value to the video connection mapping table for auto 2015-01-08 12:55:51 +01:00
Sebastian Dröge
34de6ad73b decklink: Add XLR and RCA audio connection enums 2015-01-08 12:23:53 +01:00
Sebastian Dröge
a35d5ae9b9 decklinkvideosrc: Add auto value for the connection property
This will use the default/auto connection for video capturing, and can
be set via the Decklink configuration tools.
2015-01-08 12:23:09 +01:00
Florian Langlois
81c1ef190d decklink: Add property for configuring the input connection of the video sources 2015-01-08 12:12:50 +01:00
Sebastian Dröge
196d9c4829 decklink: Add support for 4K / UHD modes 2014-12-29 17:58:37 +01:00