decklink: Add subdevice property
This commit is contained in:
parent
cfd68a8e7a
commit
e246d92bd5
@ -125,7 +125,8 @@ enum
|
|||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_MODE,
|
PROP_MODE,
|
||||||
PROP_CONNECTION,
|
PROP_CONNECTION,
|
||||||
PROP_AUDIO_INPUT
|
PROP_AUDIO_INPUT,
|
||||||
|
PROP_SUBDEVICE
|
||||||
};
|
};
|
||||||
|
|
||||||
/* pad templates */
|
/* pad templates */
|
||||||
@ -157,7 +158,7 @@ gst_decklink_src_base_init (gpointer g_class)
|
|||||||
gst_static_pad_template_get (&gst_decklink_src_audio_src_template));
|
gst_static_pad_template_get (&gst_decklink_src_audio_src_template));
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_pad_template_new ("videosrc", GST_PAD_SRC, GST_PAD_ALWAYS,
|
gst_pad_template_new ("videosrc", GST_PAD_SRC, GST_PAD_ALWAYS,
|
||||||
gst_decklink_mode_get_template_caps ()));
|
gst_decklink_mode_get_template_caps ()));
|
||||||
|
|
||||||
gst_element_class_set_details_simple (element_class, "Decklink source",
|
gst_element_class_set_details_simple (element_class, "Decklink source",
|
||||||
"Source/Video", "DeckLink Source", "David Schleef <ds@entropywave.com>");
|
"Source/Video", "DeckLink Source", "David Schleef <ds@entropywave.com>");
|
||||||
@ -200,7 +201,14 @@ gst_decklink_src_class_init (GstDecklinkSrcClass * klass)
|
|||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_AUDIO_INPUT,
|
g_object_class_install_property (gobject_class, PROP_AUDIO_INPUT,
|
||||||
g_param_spec_enum ("audio-input", "Audio Input", "Audio Input Connection",
|
g_param_spec_enum ("audio-input", "Audio Input", "Audio Input Connection",
|
||||||
GST_TYPE_DECKLINK_AUDIO_CONNECTION, GST_DECKLINK_AUDIO_CONNECTION_AUTO,
|
GST_TYPE_DECKLINK_AUDIO_CONNECTION,
|
||||||
|
GST_DECKLINK_AUDIO_CONNECTION_AUTO,
|
||||||
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
|
G_PARAM_CONSTRUCT)));
|
||||||
|
|
||||||
|
g_object_class_install_property (gobject_class, PROP_SUBDEVICE,
|
||||||
|
g_param_spec_int ("subdevice", "Subdevice", "Subdevice",
|
||||||
|
0, 3, 0,
|
||||||
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
|
||||||
G_PARAM_CONSTRUCT)));
|
G_PARAM_CONSTRUCT)));
|
||||||
}
|
}
|
||||||
@ -244,9 +252,9 @@ gst_decklink_src_init (GstDecklinkSrc * decklinksrc,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
decklinksrc->videosrcpad = gst_pad_new_from_template (
|
decklinksrc->videosrcpad =
|
||||||
gst_element_class_get_pad_template(GST_ELEMENT_CLASS(decklinksrc_class),
|
gst_pad_new_from_template (gst_element_class_get_pad_template
|
||||||
"videosrc"), "videosrc");
|
(GST_ELEMENT_CLASS (decklinksrc_class), "videosrc"), "videosrc");
|
||||||
gst_pad_set_getcaps_function (decklinksrc->videosrcpad,
|
gst_pad_set_getcaps_function (decklinksrc->videosrcpad,
|
||||||
GST_DEBUG_FUNCPTR (gst_decklink_src_video_src_getcaps));
|
GST_DEBUG_FUNCPTR (gst_decklink_src_video_src_getcaps));
|
||||||
gst_pad_set_setcaps_function (decklinksrc->videosrcpad,
|
gst_pad_set_setcaps_function (decklinksrc->videosrcpad,
|
||||||
@ -281,6 +289,7 @@ gst_decklink_src_init (GstDecklinkSrc * decklinksrc,
|
|||||||
decklinksrc->mode = GST_DECKLINK_MODE_NTSC;
|
decklinksrc->mode = GST_DECKLINK_MODE_NTSC;
|
||||||
decklinksrc->connection = GST_DECKLINK_CONNECTION_SDI;
|
decklinksrc->connection = GST_DECKLINK_CONNECTION_SDI;
|
||||||
decklinksrc->audio_connection = GST_DECKLINK_AUDIO_CONNECTION_AUTO;
|
decklinksrc->audio_connection = GST_DECKLINK_AUDIO_CONNECTION_AUTO;
|
||||||
|
decklinksrc->subdevice = 0;
|
||||||
|
|
||||||
decklinksrc->stop = FALSE;
|
decklinksrc->stop = FALSE;
|
||||||
decklinksrc->dropped_frames = 0;
|
decklinksrc->dropped_frames = 0;
|
||||||
@ -327,6 +336,9 @@ gst_decklink_src_set_property (GObject * object, guint property_id,
|
|||||||
decklinksrc->audio_connection =
|
decklinksrc->audio_connection =
|
||||||
(GstDecklinkAudioConnectionEnum) g_value_get_enum (value);
|
(GstDecklinkAudioConnectionEnum) g_value_get_enum (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SUBDEVICE:
|
||||||
|
decklinksrc->subdevice = g_value_get_int (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;
|
||||||
@ -352,6 +364,9 @@ gst_decklink_src_get_property (GObject * object, guint property_id,
|
|||||||
case PROP_AUDIO_INPUT:
|
case PROP_AUDIO_INPUT:
|
||||||
g_value_set_enum (value, decklinksrc->audio_connection);
|
g_value_set_enum (value, decklinksrc->audio_connection);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SUBDEVICE:
|
||||||
|
g_value_set_int (value, decklinksrc->subdevice);
|
||||||
|
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;
|
||||||
@ -478,6 +493,7 @@ gst_decklink_src_start (GstElement * element)
|
|||||||
IDeckLinkConfiguration *config;
|
IDeckLinkConfiguration *config;
|
||||||
BMDVideoConnection conn;
|
BMDVideoConnection conn;
|
||||||
BMDAudioConnection aconn;
|
BMDAudioConnection aconn;
|
||||||
|
int i;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (decklinksrc, "start");
|
GST_DEBUG_OBJECT (decklinksrc, "start");
|
||||||
|
|
||||||
@ -492,6 +508,13 @@ gst_decklink_src_start (GstElement * element)
|
|||||||
GST_ERROR ("no card");
|
GST_ERROR ("no card");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
for (i = 0; i < decklinksrc->subdevice; i++) {
|
||||||
|
ret = iterator->Next (&decklinksrc->decklink);
|
||||||
|
if (ret != S_OK) {
|
||||||
|
GST_ERROR ("no card");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = decklinksrc->decklink->QueryInterface (IID_IDeckLinkInput,
|
ret = decklinksrc->decklink->QueryInterface (IID_IDeckLinkInput,
|
||||||
(void **) &decklinksrc->input);
|
(void **) &decklinksrc->input);
|
||||||
@ -573,7 +596,6 @@ gst_decklink_src_start (GstElement * element)
|
|||||||
GST_ERROR ("set configuration (audio input connection)");
|
GST_ERROR ("set configuration (audio input connection)");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
ret = decklinksrc->input->GetDisplayModeIterator (&mode_iterator);
|
ret = decklinksrc->input->GetDisplayModeIterator (&mode_iterator);
|
||||||
if (ret != S_OK) {
|
if (ret != S_OK) {
|
||||||
|
@ -74,6 +74,7 @@ struct _GstDecklinkSrc
|
|||||||
GstDecklinkModeEnum mode;
|
GstDecklinkModeEnum mode;
|
||||||
GstDecklinkConnectionEnum connection;
|
GstDecklinkConnectionEnum connection;
|
||||||
GstDecklinkAudioConnectionEnum audio_connection;
|
GstDecklinkAudioConnectionEnum audio_connection;
|
||||||
|
int subdevice;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
gboolean comInitialized;
|
gboolean comInitialized;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user