pylonsrc: add YUV422_YUYV_Packed as YUY2 video format

This commit is contained in:
Joshua M. Doe 2020-04-07 06:54:04 -04:00
parent e43d708bec
commit 3d074be9a0

View File

@ -1022,6 +1022,8 @@ gst_pylonsrc_get_caps (GstBaseSrc * bsrc, GstCaps * filter)
format = "GRAY8\0";
} else if (strcmp (src->imageFormat, "yuv422packed") == 0) {
format = "UYVY\0";
} else if (strcmp (src->imageFormat, "yuv422_yuyv_packed") == 0) {
format = "YUY2\0";
}
}
@ -1521,6 +1523,16 @@ gst_pylonsrc_start (GstBaseSrc * bsrc)
("Camera doesn't support YUV422Packed"));
goto error;
}
} else if (strcmp (src->imageFormat, "yuv422_yuyv_packed") == 0) {
if (PylonDeviceFeatureIsAvailable (src->deviceHandle,
"EnumEntry_PixelFormat_YUV422_YUYV_Packed")) {
g_string_printf (pixelFormat, "YUV422_YUYV_Packed");
} else {
GST_ELEMENT_ERROR (src, RESOURCE, FAILED,
("Failed to initialise the camera"),
("Camera doesn't support YUV422_YUYV_Packed"));
goto error;
}
} else {
GST_ERROR_OBJECT (src,
"Invalid parameter value for imageformat. Available values are: bayer8, bayer10, bayer10p, rgb8, bgr8, ycbcr422_8, mono8. Value provided: \"%s\".",