Add more debugging statements
This commit is contained in:
parent
6883b2083d
commit
db54d20753
@ -736,6 +736,8 @@ gst_niimaqsrc_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
|||||||
GST_CLOCK_DIFF (gst_element_get_base_time (GST_ELEMENT (niimaqsrc)), gst_clock_get_time (clock));
|
GST_CLOCK_DIFF (gst_element_get_base_time (GST_ELEMENT (niimaqsrc)), gst_clock_get_time (clock));
|
||||||
gst_object_unref (clock);*/
|
gst_object_unref (clock);*/
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT(niimaqsrc, "Creating buffer");
|
||||||
|
|
||||||
*buffer = gst_buffer_new ();
|
*buffer = gst_buffer_new ();
|
||||||
|
|
||||||
GST_BUFFER_DATA (*buffer) = data;
|
GST_BUFFER_DATA (*buffer) = data;
|
||||||
@ -744,6 +746,8 @@ gst_niimaqsrc_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
|||||||
GST_BUFFER_OFFSET (*buffer) = copied_number;
|
GST_BUFFER_OFFSET (*buffer) = copied_number;
|
||||||
GST_BUFFER_OFFSET_END (*buffer) = copied_number;
|
GST_BUFFER_OFFSET_END (*buffer) = copied_number;
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT(niimaqsrc, "Associating time with buffer");
|
||||||
|
|
||||||
/* search linked list for frame time */
|
/* search linked list for frame time */
|
||||||
g_mutex_lock (niimaqsrc->frametime_mutex);
|
g_mutex_lock (niimaqsrc->frametime_mutex);
|
||||||
{
|
{
|
||||||
@ -942,7 +946,7 @@ gst_niimaqsrc_get_cam_caps (GstNiImaqSrc * niimaqsrc)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve caps from IMAQ interface */
|
GST_DEBUG_OBJECT (niimaqsrc, "Retrieving attributes from IMAQ interface");
|
||||||
rval = imgGetAttribute (niimaqsrc->iid, IMG_ATTR_BITSPERPIXEL, &val);
|
rval = imgGetAttribute (niimaqsrc->iid, IMG_ATTR_BITSPERPIXEL, &val);
|
||||||
gst_niimaqsrc_report_imaq_error (rval);
|
gst_niimaqsrc_report_imaq_error (rval);
|
||||||
bpp = val;
|
bpp = val;
|
||||||
@ -972,15 +976,19 @@ gst_niimaqsrc_get_cam_caps (GstNiImaqSrc * niimaqsrc)
|
|||||||
("attempt to set caps %dx%dx%d (%d) failed", width, height, depth, bpp));
|
("attempt to set caps %dx%dx%d (%d) failed", width, height, depth, bpp));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hard code framerate to 30Hz as IMAQ doesn't tell us anything about it */
|
/* hard code framerate to 30Hz as IMAQ doesn't tell us anything about it */
|
||||||
|
GST_DEBUG_OBJECT (niimaqsrc, "Setting framerate to 30 fps");
|
||||||
gst_structure_set (gs, "framerate", GST_TYPE_FRACTION, 30, 1, NULL);
|
gst_structure_set (gs, "framerate", GST_TYPE_FRACTION, 30, 1, NULL);
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (gs, "is the basic structure");
|
||||||
|
|
||||||
gst_caps_append_structure (gcaps, gst_structure_copy (gs));
|
gst_caps_append_structure (gcaps, gst_structure_copy (gs));
|
||||||
|
|
||||||
/* if (8 < bpp < 16), then append structure with bpp=16 so ffmpegcolorspace
|
/* if (8 < bpp < 16), then append structure with bpp=16 so ffmpegcolorspace
|
||||||
* and other elements can work directly with this src */
|
* and other elements can work directly with this src */
|
||||||
if (bpp > 8 && bpp < 16) {
|
if (bpp > 8 && bpp < 16) {
|
||||||
|
GST_DEBUG_OBJECT (niimaqsrc, "Adding 16bpp caps for compatibility");
|
||||||
gst_niimaqsrc_set_caps_color (gs, 16, 16);
|
gst_niimaqsrc_set_caps_color (gs, 16, 16);
|
||||||
gst_caps_append_structure (gcaps, gst_structure_copy (gs));
|
gst_caps_append_structure (gcaps, gst_structure_copy (gs));
|
||||||
}
|
}
|
||||||
@ -1017,7 +1025,7 @@ gst_niimaqsrc_start (GstBaseSrc * src)
|
|||||||
niimaqsrc->iid = 0;
|
niimaqsrc->iid = 0;
|
||||||
niimaqsrc->sid = 0;
|
niimaqsrc->sid = 0;
|
||||||
|
|
||||||
GST_LOG_OBJECT (niimaqsrc, "Opening IMAQ interface: %s", niimaqsrc->interface_name);
|
GST_DEBUG_OBJECT (niimaqsrc, "Opening IMAQ interface: %s", niimaqsrc->interface_name);
|
||||||
|
|
||||||
/* open IMAQ interface */
|
/* open IMAQ interface */
|
||||||
rval=imgInterfaceOpen(niimaqsrc->interface_name,&(niimaqsrc->iid));
|
rval=imgInterfaceOpen(niimaqsrc->interface_name,&(niimaqsrc->iid));
|
||||||
@ -1028,7 +1036,7 @@ gst_niimaqsrc_start (GstBaseSrc * src)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (niimaqsrc, "Opening IMAQ session: %s", niimaqsrc->interface_name);
|
GST_DEBUG_OBJECT (niimaqsrc, "Opening IMAQ session: %s", niimaqsrc->interface_name);
|
||||||
|
|
||||||
/* open IMAQ session */
|
/* open IMAQ session */
|
||||||
rval=imgSessionOpen(niimaqsrc->iid, &(niimaqsrc->sid));
|
rval=imgSessionOpen(niimaqsrc->iid, &(niimaqsrc->sid));
|
||||||
@ -1044,6 +1052,8 @@ gst_niimaqsrc_start (GstBaseSrc * src)
|
|||||||
niimaqsrc->caps = NULL;
|
niimaqsrc->caps = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (niimaqsrc, "Getting caps from camera");
|
||||||
|
|
||||||
/* get caps from camera and set to src pad */
|
/* get caps from camera and set to src pad */
|
||||||
niimaqsrc->caps = gst_niimaqsrc_get_cam_caps (niimaqsrc);
|
niimaqsrc->caps = gst_niimaqsrc_get_cam_caps (niimaqsrc);
|
||||||
if (niimaqsrc->caps == NULL) {
|
if (niimaqsrc->caps == NULL) {
|
||||||
@ -1163,4 +1173,4 @@ plugin_init (GstPlugin * plugin)
|
|||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "niimaq",
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "niimaq",
|
||||||
"NI-IMAQ source element", plugin_init, VERSION, GST_LICENSE, PACKAGE_NAME,
|
"NI-IMAQ source element", plugin_init, VERSION, GST_LICENSE, PACKAGE_NAME,
|
||||||
GST_PACKAGE_ORIGIN)
|
GST_PACKAGE_ORIGIN)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user