niimaqdx: show attributes via DEBUG instead of printf
This commit is contained in:
parent
881a75b1f8
commit
5970685580
@ -941,12 +941,13 @@ error:
|
||||
}
|
||||
|
||||
void
|
||||
listAttributes (IMAQdxSession session)
|
||||
gst_niimaqdxsrc_list_attributes (GstNiImaqDxSrc * niimaqdxsrc)
|
||||
{
|
||||
IMAQdxAttributeInformation *attributeInfoArray = NULL;
|
||||
uInt32 attributeCount;
|
||||
int i;
|
||||
IMAQdxError rval;
|
||||
IMAQdxSession session = niimaqdxsrc->session;
|
||||
char *attributeTypeStrings[] = { "U32", "I64",
|
||||
"F64",
|
||||
"String",
|
||||
@ -960,12 +961,11 @@ listAttributes (IMAQdxSession session)
|
||||
rval =
|
||||
IMAQdxEnumerateAttributes2 (session, NULL, &attributeCount, "",
|
||||
IMAQdxAttributeVisibilityAdvanced);
|
||||
GST_DEBUG ("Found %d attributes", attributeCount);
|
||||
attributeInfoArray = g_new (IMAQdxAttributeInformation, attributeCount);
|
||||
rval =
|
||||
IMAQdxEnumerateAttributes2 (session, attributeInfoArray, &attributeCount,
|
||||
"", IMAQdxAttributeVisibilityAdvanced);
|
||||
GST_DEBUG ("Enumerating %d attributes", attributeCount);
|
||||
GST_DEBUG_OBJECT (niimaqdxsrc, "Enumerating %d attributes", attributeCount);
|
||||
for (i = 0; i < attributeCount; i++) {
|
||||
IMAQdxAttributeInformation *info = attributeInfoArray + i;
|
||||
g_assert (info);
|
||||
@ -975,19 +975,17 @@ listAttributes (IMAQdxSession session)
|
||||
IMAQdxGetAttribute (session, info->Name, IMAQdxValueTypeString,
|
||||
attributeString);
|
||||
if (rval != IMAQdxErrorSuccess) {
|
||||
GST_WARNING ("Failed to read value of attribute %s", info->Name);
|
||||
GST_WARNING_OBJECT (niimaqdxsrc,
|
||||
"Failed to read value of attribute %s", info->Name);
|
||||
continue;
|
||||
}
|
||||
} else
|
||||
attributeString[0] = 0;
|
||||
|
||||
printf ("%s, %s/%s, %s, %s\n", info->Name, info->Readable ? "R" : "-",
|
||||
info->Writable ? "W" : "-", attributeTypeStrings[info->Type],
|
||||
attributeString);
|
||||
//gchar *newOutput = g_strconcat(output, line, NULL);
|
||||
//g_free (output);
|
||||
//g_free (line);
|
||||
//output = newOutput;
|
||||
GST_DEBUG_OBJECT (niimaqdxsrc, "%s, %s/%s, %s, %s\n",
|
||||
info->Name, info->Readable ? "R" : "-",
|
||||
info->Writable ? "W" : "-",
|
||||
attributeTypeStrings[info->Type], attributeString);
|
||||
}
|
||||
g_free (attributeInfoArray);
|
||||
}
|
||||
@ -1019,8 +1017,6 @@ gst_niimaqdxsrc_get_cam_caps (GstNiImaqDxSrc * niimaqdxsrc)
|
||||
|
||||
GST_LOG_OBJECT (niimaqdxsrc, "Retrieving attributes from IMAQdx device");
|
||||
|
||||
listAttributes (niimaqdxsrc->session);
|
||||
|
||||
rval = IMAQdxGetAttribute (niimaqdxsrc->session, IMAQdxAttributePixelFormat,
|
||||
IMAQdxValueTypeString, &pixel_format);
|
||||
gst_niimaqdxsrc_report_imaq_error (rval);
|
||||
@ -1134,6 +1130,8 @@ gst_niimaqdxsrc_start (GstBaseSrc * src)
|
||||
goto error;
|
||||
}
|
||||
|
||||
gst_niimaqdxsrc_list_attributes (niimaqdxsrc);
|
||||
|
||||
GST_LOG_OBJECT (niimaqdxsrc, "Creating ring with %d buffers",
|
||||
niimaqdxsrc->ringbuffer_count);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user