mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
decklink: Add 10-bit support
This commit is contained in:
parent
5f580c3791
commit
8f8d7bf781
4 changed files with 18 additions and 3 deletions
|
@ -8,6 +8,7 @@ libgstdecklink_la_CPPFLAGS = \
|
|||
libgstdecklink_la_LIBADD = \
|
||||
$(GST_BASE_LIBS) \
|
||||
$(GST_LIBS) \
|
||||
-lgstvideo-@GST_MAJORMINOR@ \
|
||||
$(DECKLINK_LIBS) \
|
||||
$(LIBM)
|
||||
libgstdecklink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
|
|
|
@ -108,7 +108,7 @@ GstCaps * gst_decklink_mode_get_caps (GstDecklinkModeEnum e);
|
|||
GstCaps * gst_decklink_mode_get_template_caps (void);
|
||||
|
||||
#define GST_DECKLINK_MODE_CAPS(w,h,n,d,i) \
|
||||
"video/x-raw-yuv,format=(fourcc)UYVY,width=" #w ",height=" #h \
|
||||
"video/x-raw-yuv,format=(fourcc){ UYVY, v210 },width=" #w ",height=" #h \
|
||||
",framerate=" #n "/" #d ",interlaced=" #i
|
||||
|
||||
#define GST_DECKLINK_CAPS \
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/glib-compat-private.h>
|
||||
#include <gst/video/video.h>
|
||||
#include "gstdecklink.h"
|
||||
#include "gstdecklinksink.h"
|
||||
#include <string.h>
|
||||
|
@ -596,11 +597,24 @@ static gboolean
|
|||
gst_decklink_sink_videosink_setcaps (GstPad * pad, GstCaps * caps)
|
||||
{
|
||||
GstDecklinkSink *decklinksink;
|
||||
gboolean ret;
|
||||
GstVideoFormat format;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
decklinksink = GST_DECKLINK_SINK (gst_pad_get_parent (pad));
|
||||
|
||||
GST_DEBUG_OBJECT (decklinksink, "setcaps");
|
||||
|
||||
ret = gst_video_format_parse_caps (caps, &format, &width, &height);
|
||||
if (ret) {
|
||||
if (format == GST_VIDEO_FORMAT_v210) {
|
||||
decklinksink->pixel_format = bmdFormat10BitYUV;
|
||||
} else {
|
||||
decklinksink->pixel_format = bmdFormat8BitYUV;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gst_object_unref (decklinksink);
|
||||
return TRUE;
|
||||
|
@ -713,7 +727,7 @@ gst_decklink_sink_videosink_chain (GstPad * pad, GstBuffer * buffer)
|
|||
mode = gst_decklink_get_mode (decklinksink->mode);
|
||||
|
||||
decklinksink->output->CreateVideoFrame (mode->width,
|
||||
mode->height, mode->width * 2, bmdFormat8BitYUV,
|
||||
mode->height, mode->width * 2, decklinksink->pixel_format,
|
||||
bmdFrameFlagDefault, &frame);
|
||||
|
||||
frame->GetBytes (&data);
|
||||
|
@ -864,7 +878,6 @@ gst_decklink_sink_audiosink_setcaps (GstPad * pad, GstCaps * caps)
|
|||
|
||||
GST_DEBUG_OBJECT (decklinksink, "setcaps");
|
||||
|
||||
|
||||
gst_object_unref (decklinksink);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ struct _GstDecklinkSink
|
|||
IDeckLinkOutput *output;
|
||||
Output *callback;
|
||||
BMDDisplayMode display_mode;
|
||||
BMDPixelFormat pixel_format;
|
||||
gboolean video_enabled;
|
||||
gboolean sched_started;
|
||||
|
||||
|
|
Loading…
Reference in a new issue