Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Thomas Gritzan via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Thomas Gritzan <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] libavdevice/decklink: Implement QueryInterface to support newer driver (PR #21002)
Date: Sun, 23 Nov 2025 23:40:24 -0000
Message-ID: <176394122451.39.3127059390218144420@2cb04c0e5124> (raw)

PR #21002 opened by Thomas Gritzan (Phygon)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21002
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21002.patch

Playback to a decklink device with a newer version of the
DeckLink SDK (14.3) stalls because the driver code calls
IDeckLinkVideoFrame::QueryInterface, which is not
implemented by ffmpeg.
This patch implements decklink_frame::QueryInterface,
so that playback works with both older (12.x) and
newer (>= 14.3) drivers.

Note: The patch still does not allow the code to compile
with DeckLink SDK 14.3 or newer, as the API has changed.


>From 22f08f1d0158d5064fa121d03b8330aa29ae8e28 Mon Sep 17 00:00:00 2001
From: Thomas Gritzan <phygon@gmx.de>
Date: Mon, 24 Nov 2025 00:26:33 +0100
Subject: [PATCH] libavdevice/decklink: Implement QueryInterface to support
 newer driver

Playback to a decklink device with a newer version of the
DeckLink SDK (14.3) stalls because the driver code calls
IDeckLinkVideoFrame::QueryInterface, which is not
implemented by ffmpeg.
This patch implements decklink_frame::QueryInterface,
so that playback works with both older (12.x) and
newer (>= 14.3) drivers.

Note: The patch still does not allow the code to compile
with DeckLink SDK 14.3 or newer, as the API has changed.
---
 libavdevice/decklink_enc.cpp | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp
index cb8f91730e..0e743348c6 100644
--- a/libavdevice/decklink_enc.cpp
+++ b/libavdevice/decklink_enc.cpp
@@ -47,6 +47,11 @@ extern "C" {
 #include "libklvanc/pixels.h"
 #endif
 
+static bool IsEqualGUID(const REFIID &iid1, const REFIID &iid2)
+{
+    return memcmp(&iid1, &iid2, sizeof(REFIID)) == 0;
+}
+
 /* DeckLink callback class declaration */
 class decklink_frame : public IDeckLinkVideoFrame
 {
@@ -111,7 +116,19 @@ public:
         _ancillary->AddRef();
         return S_OK;
     }
-    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; }
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv)
+    {
+        if (IsEqualGUID(iid, IID_IUnknown) || IsEqualGUID(iid, IID_IDeckLinkVideoFrame)) {
+            *ppv = static_cast<IDeckLinkVideoFrame*>(this);
+        } else {
+            *ppv = NULL;
+            return E_NOINTERFACE;
+        }
+
+        AddRef();
+        return S_OK;
+    }
+
     virtual ULONG   STDMETHODCALLTYPE AddRef(void)                            { return ++_refs; }
     virtual ULONG   STDMETHODCALLTYPE Release(void)
     {
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-11-23 23:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176394122451.39.3127059390218144420@2cb04c0e5124 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git