mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
decklink: Add audio-input property
This commit is contained in:
parent
70c3fea5ac
commit
2b5e8db968
4 changed files with 71 additions and 10 deletions
|
@ -86,6 +86,25 @@ gst_decklink_connection_get_type (void)
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gst_decklink_audio_connection_get_type (void)
|
||||||
|
{
|
||||||
|
static GType type;
|
||||||
|
|
||||||
|
if (!type) {
|
||||||
|
static const GEnumValue connections[] = {
|
||||||
|
{GST_DECKLINK_AUDIO_CONNECTION_AUTO, "auto", "Automatic"},
|
||||||
|
{GST_DECKLINK_AUDIO_CONNECTION_EMBEDDED, "embedded", "SDI/HDMI embedded audio"},
|
||||||
|
{GST_DECKLINK_AUDIO_CONNECTION_AES_EBU, "aes", "AES/EBU input"},
|
||||||
|
{GST_DECKLINK_AUDIO_CONNECTION_ANALOG, "analog", "Analog input"},
|
||||||
|
{0, NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
type = g_enum_register_static ("GstDecklinkAudioConnection", connections);
|
||||||
|
}
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
#define NTSC 10, 11, false, false
|
#define NTSC 10, 11, false, false
|
||||||
#define PAL 12, 11, true, false
|
#define PAL 12, 11, true, false
|
||||||
#define HD 1, 1, false, true
|
#define HD 1, 1, false, true
|
||||||
|
|
|
@ -63,6 +63,15 @@ typedef enum {
|
||||||
#define GST_TYPE_DECKLINK_CONNECTION (gst_decklink_connection_get_type ())
|
#define GST_TYPE_DECKLINK_CONNECTION (gst_decklink_connection_get_type ())
|
||||||
GType gst_decklink_connection_get_type (void);
|
GType gst_decklink_connection_get_type (void);
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
GST_DECKLINK_AUDIO_CONNECTION_AUTO,
|
||||||
|
GST_DECKLINK_AUDIO_CONNECTION_EMBEDDED,
|
||||||
|
GST_DECKLINK_AUDIO_CONNECTION_AES_EBU,
|
||||||
|
GST_DECKLINK_AUDIO_CONNECTION_ANALOG
|
||||||
|
} GstDecklinkAudioConnectionEnum;
|
||||||
|
#define GST_TYPE_DECKLINK_AUDIO_CONNECTION (gst_decklink_audio_connection_get_type ())
|
||||||
|
GType gst_decklink_audio_connection_get_type (void);
|
||||||
|
|
||||||
typedef struct _GstDecklinkMode GstDecklinkMode;
|
typedef struct _GstDecklinkMode GstDecklinkMode;
|
||||||
struct _GstDecklinkMode {
|
struct _GstDecklinkMode {
|
||||||
BMDDisplayMode mode;
|
BMDDisplayMode mode;
|
||||||
|
|
|
@ -119,7 +119,8 @@ enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_MODE,
|
PROP_MODE,
|
||||||
PROP_CONNECTION
|
PROP_CONNECTION,
|
||||||
|
PROP_AUDIO_INPUT
|
||||||
};
|
};
|
||||||
|
|
||||||
/* pad templates */
|
/* pad templates */
|
||||||
|
@ -191,6 +192,12 @@ gst_decklink_src_class_init (GstDecklinkSrcClass * klass)
|
||||||
GST_TYPE_DECKLINK_CONNECTION, GST_DECKLINK_CONNECTION_SDI,
|
GST_TYPE_DECKLINK_CONNECTION, GST_DECKLINK_CONNECTION_SDI,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
G_PARAM_CONSTRUCT)));
|
G_PARAM_CONSTRUCT)));
|
||||||
|
|
||||||
|
g_object_class_install_property (gobject_class, PROP_AUDIO_INPUT,
|
||||||
|
g_param_spec_enum ("audio-input", "Audio Input", "Audio Input Connection",
|
||||||
|
GST_TYPE_DECKLINK_AUDIO_CONNECTION, GST_DECKLINK_AUDIO_CONNECTION_AUTO,
|
||||||
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
|
G_PARAM_CONSTRUCT)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -267,6 +274,8 @@ gst_decklink_src_init (GstDecklinkSrc * decklinksrc,
|
||||||
|
|
||||||
decklinksrc->copy_data = TRUE;
|
decklinksrc->copy_data = TRUE;
|
||||||
decklinksrc->mode = GST_DECKLINK_MODE_NTSC;
|
decklinksrc->mode = GST_DECKLINK_MODE_NTSC;
|
||||||
|
decklinksrc->connection = GST_DECKLINK_CONNECTION_SDI;
|
||||||
|
decklinksrc->audio_connection = GST_DECKLINK_AUDIO_CONNECTION_AUTO;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,6 +296,10 @@ gst_decklink_src_set_property (GObject * object, guint property_id,
|
||||||
decklinksrc->connection =
|
decklinksrc->connection =
|
||||||
(GstDecklinkConnectionEnum) g_value_get_enum (value);
|
(GstDecklinkConnectionEnum) g_value_get_enum (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_AUDIO_INPUT:
|
||||||
|
decklinksrc->audio_connection =
|
||||||
|
(GstDecklinkAudioConnectionEnum) g_value_get_enum (value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -309,6 +322,9 @@ gst_decklink_src_get_property (GObject * object, guint property_id,
|
||||||
case PROP_CONNECTION:
|
case PROP_CONNECTION:
|
||||||
g_value_set_enum (value, decklinksrc->connection);
|
g_value_set_enum (value, decklinksrc->connection);
|
||||||
break;
|
break;
|
||||||
|
case PROP_AUDIO_INPUT:
|
||||||
|
g_value_set_enum (value, decklinksrc->audio_connection);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -379,6 +395,7 @@ gst_decklink_src_start (GstElement * element)
|
||||||
const GstDecklinkMode *mode;
|
const GstDecklinkMode *mode;
|
||||||
IDeckLinkConfiguration *config;
|
IDeckLinkConfiguration *config;
|
||||||
BMDVideoConnection conn;
|
BMDVideoConnection conn;
|
||||||
|
BMDAudioConnection aconn;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (decklinksrc, "start");
|
GST_DEBUG_OBJECT (decklinksrc, "start");
|
||||||
|
|
||||||
|
@ -416,21 +433,27 @@ gst_decklink_src_start (GstElement * element)
|
||||||
default:
|
default:
|
||||||
case GST_DECKLINK_CONNECTION_SDI:
|
case GST_DECKLINK_CONNECTION_SDI:
|
||||||
conn = bmdVideoConnectionSDI;
|
conn = bmdVideoConnectionSDI;
|
||||||
|
aconn = bmdAudioConnectionEmbedded;
|
||||||
break;
|
break;
|
||||||
case GST_DECKLINK_CONNECTION_HDMI:
|
case GST_DECKLINK_CONNECTION_HDMI:
|
||||||
conn = bmdVideoConnectionHDMI;
|
conn = bmdVideoConnectionHDMI;
|
||||||
|
aconn = bmdAudioConnectionEmbedded;
|
||||||
break;
|
break;
|
||||||
case GST_DECKLINK_CONNECTION_OPTICAL_SDI:
|
case GST_DECKLINK_CONNECTION_OPTICAL_SDI:
|
||||||
conn = bmdVideoConnectionOpticalSDI;
|
conn = bmdVideoConnectionOpticalSDI;
|
||||||
|
aconn = bmdAudioConnectionEmbedded;
|
||||||
break;
|
break;
|
||||||
case GST_DECKLINK_CONNECTION_COMPONENT:
|
case GST_DECKLINK_CONNECTION_COMPONENT:
|
||||||
conn = bmdVideoConnectionComponent;
|
conn = bmdVideoConnectionComponent;
|
||||||
|
aconn = bmdAudioConnectionAnalog;
|
||||||
break;
|
break;
|
||||||
case GST_DECKLINK_CONNECTION_COMPOSITE:
|
case GST_DECKLINK_CONNECTION_COMPOSITE:
|
||||||
conn = bmdVideoConnectionComposite;
|
conn = bmdVideoConnectionComposite;
|
||||||
|
aconn = bmdAudioConnectionAnalog;
|
||||||
break;
|
break;
|
||||||
case GST_DECKLINK_CONNECTION_SVIDEO:
|
case GST_DECKLINK_CONNECTION_SVIDEO:
|
||||||
conn = bmdVideoConnectionSVideo;
|
conn = bmdVideoConnectionSVideo;
|
||||||
|
aconn = bmdAudioConnectionAnalog;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,15 +472,24 @@ gst_decklink_src_start (GstElement * element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decklinksrc->connection == GST_DECKLINK_CONNECTION_COMPOSITE ||
|
switch (decklinksrc->audio_connection) {
|
||||||
decklinksrc->connection == GST_DECKLINK_CONNECTION_COMPONENT ||
|
default:
|
||||||
decklinksrc->connection == GST_DECKLINK_CONNECTION_SVIDEO) {
|
case GST_DECKLINK_AUDIO_CONNECTION_AUTO:
|
||||||
ret = config->SetInt (bmdDeckLinkConfigAudioInputConnection,
|
break;
|
||||||
bmdAudioConnectionAnalog);
|
case GST_DECKLINK_AUDIO_CONNECTION_EMBEDDED:
|
||||||
if (ret != S_OK) {
|
aconn = bmdAudioConnectionEmbedded;
|
||||||
GST_ERROR ("set configuration (audio input connection)");
|
break;
|
||||||
return FALSE;
|
case GST_DECKLINK_AUDIO_CONNECTION_AES_EBU:
|
||||||
}
|
aconn = bmdAudioConnectionAESEBU;
|
||||||
|
break;
|
||||||
|
case GST_DECKLINK_AUDIO_CONNECTION_ANALOG:
|
||||||
|
aconn = bmdAudioConnectionAnalog;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ret = config->SetInt (bmdDeckLinkConfigAudioInputConnection, aconn);
|
||||||
|
if (ret != S_OK) {
|
||||||
|
GST_ERROR ("set configuration (audio input connection)");
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -72,6 +72,7 @@ struct _GstDecklinkSrc
|
||||||
gboolean copy_data;
|
gboolean copy_data;
|
||||||
GstDecklinkModeEnum mode;
|
GstDecklinkModeEnum mode;
|
||||||
GstDecklinkConnectionEnum connection;
|
GstDecklinkConnectionEnum connection;
|
||||||
|
GstDecklinkAudioConnectionEnum audio_connection;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstDecklinkSrcClass
|
struct _GstDecklinkSrcClass
|
||||||
|
|
Loading…
Reference in a new issue