pixcisrc: only use format-file if specified, ignoring format-name
This commit is contained in:
parent
9142674df2
commit
cde7de8b97
@ -504,26 +504,30 @@ gst_pixcisrc_start (GstBaseSrc * bsrc)
|
|||||||
{
|
{
|
||||||
GstPixciSrc *src = GST_PIXCI_SRC (bsrc);
|
GstPixciSrc *src = GST_PIXCI_SRC (bsrc);
|
||||||
int pxerr;
|
int pxerr;
|
||||||
GEnumClass *video_format_enum_class;
|
|
||||||
GEnumValue *video_format_enum_value;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (src, "start");
|
GST_DEBUG_OBJECT (src, "start");
|
||||||
|
|
||||||
if (strlen (src->format_file)
|
/* open with either a format name or config file */
|
||||||
&& !g_file_test (src->format_file, G_FILE_TEST_EXISTS)) {
|
if (strlen (src->format_file)) {
|
||||||
|
if (!g_file_test (src->format_file, G_FILE_TEST_EXISTS)) {
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
|
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
|
||||||
("Format file does not exist: %s", src->format_file), (NULL));
|
("Format file does not exist: %s", src->format_file), (NULL));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* open XCLIB library and driver */
|
pxerr = pxd_PIXCIopen (src->driver_params, NULL, src->format_file);
|
||||||
|
} else {
|
||||||
|
GEnumClass *video_format_enum_class;
|
||||||
|
GEnumValue *video_format_enum_value;
|
||||||
video_format_enum_class = g_type_class_ref (GST_TYPE_PIXCI_VIDEO_FORMAT);
|
video_format_enum_class = g_type_class_ref (GST_TYPE_PIXCI_VIDEO_FORMAT);
|
||||||
video_format_enum_value =
|
video_format_enum_value =
|
||||||
g_enum_get_value (video_format_enum_class, src->format_name);
|
g_enum_get_value (video_format_enum_class, src->format_name);
|
||||||
pxerr =
|
pxerr =
|
||||||
pxd_PIXCIopen (src->driver_params, video_format_enum_value->value_name,
|
pxd_PIXCIopen (src->driver_params, video_format_enum_value->value_name,
|
||||||
src->format_file);
|
NULL);
|
||||||
g_type_class_unref (video_format_enum_class);
|
g_type_class_unref (video_format_enum_class);
|
||||||
|
}
|
||||||
|
|
||||||
if (pxerr) {
|
if (pxerr) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
pxd_mesgFaultText (src->unitmap, buf, 1024);
|
pxd_mesgFaultText (src->unitmap, buf, 1024);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user