niimaqdxsrc: handle USB3 Vision as little-endian
This commit is contained in:
parent
ebe9271d5c
commit
62d1b1f6fd
@ -850,7 +850,7 @@ gst_niimaqdxsrc_get_cam_caps (GstNiImaqDxSrc * src)
|
|||||||
uInt32 val;
|
uInt32 val;
|
||||||
char pixel_format[IMAQDX_MAX_API_STRING_LENGTH];
|
char pixel_format[IMAQDX_MAX_API_STRING_LENGTH];
|
||||||
int endianness;
|
int endianness;
|
||||||
char bus_type[IMAQDX_MAX_API_STRING_LENGTH];
|
IMAQdxBusType bus_type;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
|
|
||||||
if (!src->session) {
|
if (!src->session) {
|
||||||
@ -864,7 +864,8 @@ gst_niimaqdxsrc_get_cam_caps (GstNiImaqDxSrc * src)
|
|||||||
IMAQdxValueTypeString, &pixel_format);
|
IMAQdxValueTypeString, &pixel_format);
|
||||||
gst_niimaqdxsrc_report_imaq_error (rval);
|
gst_niimaqdxsrc_report_imaq_error (rval);
|
||||||
rval &= IMAQdxGetAttribute (src->session, IMAQdxAttributeBusType,
|
rval &= IMAQdxGetAttribute (src->session, IMAQdxAttributeBusType,
|
||||||
IMAQdxValueTypeString, &bus_type);
|
IMAQdxValueTypeU32, &val);
|
||||||
|
bus_type = (IMAQdxBusType) val;
|
||||||
gst_niimaqdxsrc_report_imaq_error (rval);
|
gst_niimaqdxsrc_report_imaq_error (rval);
|
||||||
rval &= IMAQdxGetAttribute (src->session, IMAQdxAttributeWidth,
|
rval &= IMAQdxGetAttribute (src->session, IMAQdxAttributeWidth,
|
||||||
IMAQdxValueTypeU32, &val);
|
IMAQdxValueTypeU32, &val);
|
||||||
@ -884,10 +885,12 @@ gst_niimaqdxsrc_get_cam_caps (GstNiImaqDxSrc * src)
|
|||||||
|
|
||||||
g_strlcpy (src->pixel_format, pixel_format, IMAQDX_MAX_API_STRING_LENGTH);
|
g_strlcpy (src->pixel_format, pixel_format, IMAQDX_MAX_API_STRING_LENGTH);
|
||||||
|
|
||||||
if (g_strcmp0 (bus_type, "Ethernet") == 0)
|
/* confirmed FireWire is big-endian, GigE and USB3 are little-endian */
|
||||||
|
if (bus_type == IMAQdxBusTypeEthernet || bus_type == IMAQdxBusTypeUSB3Vision) {
|
||||||
endianness = G_LITTLE_ENDIAN;
|
endianness = G_LITTLE_ENDIAN;
|
||||||
else
|
} else {
|
||||||
endianness = G_BIG_ENDIAN;
|
endianness = G_BIG_ENDIAN;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_str_has_prefix (pixel_format, "Bayer") && src->bayer_as_gray) {
|
if (g_str_has_prefix (pixel_format, "Bayer") && src->bayer_as_gray) {
|
||||||
const ImaqDxCapsInfo *info =
|
const ImaqDxCapsInfo *info =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user