androidcamera: Fix debug output

This commit is contained in:
Nicolas Dufresne 2016-01-21 13:46:52 -05:00
parent 19e5238379
commit e3ba219494

View file

@ -206,7 +206,7 @@ gst_ahc_src_getcaps (GstBaseSrc * src)
sizes = g_list_sort (sizes, (GCompareFunc) _compare_sizes); sizes = g_list_sort (sizes, (GCompareFunc) _compare_sizes);
ranges = gst_ahc_parameters_get_supported_preview_fps_range (params); ranges = gst_ahc_parameters_get_supported_preview_fps_range (params);
ranges = g_list_sort (ranges, (GCompareFunc) _compare_ranges); ranges = g_list_sort (ranges, (GCompareFunc) _compare_ranges);
GST_WARNING_OBJECT (self, "Supported preview formats:"); GST_DEBUG_OBJECT (self, "Supported preview formats:");
for (i = formats; i; i = i->next) { for (i = formats; i; i = i->next) {
int f = GPOINTER_TO_INT (i->data); int f = GPOINTER_TO_INT (i->data);
@ -218,17 +218,17 @@ gst_ahc_src_getcaps (GstBaseSrc * src)
/* Can't use switch/case because the values are not constants */ /* Can't use switch/case because the values are not constants */
if (f == ImageFormat_NV16) { if (f == ImageFormat_NV16) {
GST_WARNING_OBJECT (self, " NV16 (%d)", f); GST_DEBUG_OBJECT (self, " NV16 (%d)", f);
format = gst_structure_new ("video/x-raw-yuv", format = gst_structure_new ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('N', 'V', '1', '6'), "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('N', 'V', '1', '6'),
NULL); NULL);
} else if (f == ImageFormat_NV21) { } else if (f == ImageFormat_NV21) {
GST_WARNING_OBJECT (self, " NV21 (%d)", f); GST_DEBUG_OBJECT (self, " NV21 (%d)", f);
format = gst_structure_new ("video/x-raw-yuv", format = gst_structure_new ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('N', 'V', '2', '1'), "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('N', 'V', '2', '1'),
NULL); NULL);
} else if (f == ImageFormat_RGB_565) { } else if (f == ImageFormat_RGB_565) {
GST_WARNING_OBJECT (self, " RGB565 (%d)", f); GST_DEBUG_OBJECT (self, " RGB565 (%d)", f);
format = gst_structure_new ("video/x-raw-rgb", format = gst_structure_new ("video/x-raw-rgb",
"bpp", G_TYPE_INT, 16, "bpp", G_TYPE_INT, 16,
"depth", G_TYPE_INT, 16, "depth", G_TYPE_INT, 16,
@ -237,12 +237,12 @@ gst_ahc_src_getcaps (GstBaseSrc * src)
"blue_mask", G_TYPE_INT, 0x001f, "blue_mask", G_TYPE_INT, 0x001f,
"endianness", G_TYPE_INT, G_LITTLE_ENDIAN, NULL); "endianness", G_TYPE_INT, G_LITTLE_ENDIAN, NULL);
} else if (f == ImageFormat_YUY2) { } else if (f == ImageFormat_YUY2) {
GST_WARNING_OBJECT (self, " YUY2 (%d)", f); GST_DEBUG_OBJECT (self, " YUY2 (%d)", f);
format = gst_structure_new ("video/x-raw-yuv", format = gst_structure_new ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'), "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'),
NULL); NULL);
} else if (f == ImageFormat_YV12) { } else if (f == ImageFormat_YV12) {
GST_WARNING_OBJECT (self, " YV12 (%d)", f); GST_DEBUG_OBJECT (self, " YV12 (%d)", f);
format = gst_structure_new ("video/x-raw-yuv", format = gst_structure_new ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('Y', 'V', '1', '2'), "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('Y', 'V', '1', '2'),
NULL); NULL);
@ -279,17 +279,17 @@ gst_ahc_src_getcaps (GstBaseSrc * src)
gst_structure_free (format); gst_structure_free (format);
} }
} }
GST_WARNING_OBJECT (self, "Supported preview sizes:"); GST_DEBUG_OBJECT (self, "Supported preview sizes:");
for (i = sizes; i; i = i->next) { for (i = sizes; i; i = i->next) {
GstAHCSize *s = i->data; GstAHCSize *s = i->data;
GST_WARNING_OBJECT (self, " %dx%d", s->width, s->height); GST_DEBUG_OBJECT (self, " %dx%d", s->width, s->height);
} }
GST_WARNING_OBJECT (self, "Supported preview fps range:"); GST_DEBUG_OBJECT (self, "Supported preview fps range:");
for (i = ranges; i; i = i->next) { for (i = ranges; i; i = i->next) {
int *range = i->data; int *range = i->data;
GST_WARNING_OBJECT (self, " [%d, %d]", range[0], range[1]); GST_DEBUG_OBJECT (self, " [%d, %d]", range[0], range[1]);
} }
gst_ahc_parameters_supported_preview_formats_free (formats); gst_ahc_parameters_supported_preview_formats_free (formats);
@ -407,7 +407,7 @@ gst_ahc_src_setcaps (GstBaseSrc * src, GstCaps * caps)
gst_ahc_parameters_set_preview_fps_range (params, self->fps_min, gst_ahc_parameters_set_preview_fps_range (params, self->fps_min,
self->fps_max); self->fps_max);
GST_WARNING_OBJECT (self, "Setting camera parameters : %d %dx%d @ [%f, %f]", GST_DEBUG_OBJECT (self, "Setting camera parameters : %d %dx%d @ [%f, %f]",
fmt, width, height, self->fps_min / 1000.0, self->fps_max / 1000.0); fmt, width, height, self->fps_min / 1000.0, self->fps_max / 1000.0);
if (!gst_ah_camera_set_parameters (self->camera, params)) { if (!gst_ah_camera_set_parameters (self->camera, params)) {
@ -571,12 +571,12 @@ gst_ahc_src_on_error (int error, gpointer user_data)
static gboolean static gboolean
gst_ahc_src_open (GstAHCSrc * self) gst_ahc_src_open (GstAHCSrc * self)
{ {
GST_WARNING_OBJECT (self, "Openning camera"); GST_DEBUG_OBJECT (self, "Openning camera");
self->camera = gst_ah_camera_open (0); self->camera = gst_ah_camera_open (0);
if (self->camera) { if (self->camera) {
GST_WARNING_OBJECT (self, "Opened camera"); GST_DEBUG_OBJECT (self, "Opened camera");
self->texture = gst_ag_surfacetexture_new (0); self->texture = gst_ag_surfacetexture_new (0);
gst_ah_camera_set_preview_texture (self->camera, self->texture); gst_ah_camera_set_preview_texture (self->camera, self->texture);
@ -612,19 +612,19 @@ gst_ahc_src_change_state (GstElement * element, GstStateChange transition)
gint num_cams = gst_ah_camera_get_number_of_cameras (); gint num_cams = gst_ah_camera_get_number_of_cameras ();
gint i; gint i;
GST_WARNING_OBJECT (self, "Found %d cameras on the system", num_cams); GST_DEBUG_OBJECT (self, "Found %d cameras on the system", num_cams);
for (i = 0; i < num_cams; i++) { for (i = 0; i < num_cams; i++) {
GstAHCCameraInfo info; GstAHCCameraInfo info;
if (gst_ah_camera_get_camera_info (i, &info)) { if (gst_ah_camera_get_camera_info (i, &info)) {
GST_WARNING_OBJECT (self, "Camera info for %d", i); GST_DEBUG_OBJECT (self, "Camera info for %d", i);
GST_WARNING_OBJECT (self, " Facing: %s (%d)", GST_DEBUG_OBJECT (self, " Facing: %s (%d)",
info.facing == CameraInfo_CAMERA_FACING_BACK ? "Back" : "Front", info.facing == CameraInfo_CAMERA_FACING_BACK ? "Back" : "Front",
info.facing); info.facing);
GST_WARNING_OBJECT (self, " Orientation: %d degrees", GST_DEBUG_OBJECT (self, " Orientation: %d degrees",
info.orientation); info.orientation);
} else { } else {
GST_WARNING_OBJECT (self, "Error getting camera info for %d", i); GST_DEBUG_OBJECT (self, "Error getting camera info for %d", i);
} }
} }
@ -661,7 +661,7 @@ gst_ahc_src_start (GstBaseSrc * bsrc)
{ {
GstAHCSrc *self = GST_AHC_SRC (bsrc); GstAHCSrc *self = GST_AHC_SRC (bsrc);
GST_WARNING_OBJECT (self, "Starting preview"); GST_DEBUG_OBJECT (self, "Starting preview");
if (self->camera) { if (self->camera) {
self->previous_ts = GST_CLOCK_TIME_NONE; self->previous_ts = GST_CLOCK_TIME_NONE;
self->fps_min = self->fps_max = self->width = self->height = 0; self->fps_min = self->fps_max = self->width = self->height = 0;
@ -679,7 +679,7 @@ gst_ahc_src_stop (GstBaseSrc * bsrc)
{ {
GstAHCSrc *self = GST_AHC_SRC (bsrc); GstAHCSrc *self = GST_AHC_SRC (bsrc);
GST_WARNING_OBJECT (self, "Stopping preview"); GST_DEBUG_OBJECT (self, "Stopping preview");
if (self->camera) { if (self->camera) {
gst_data_queue_flush (self->queue); gst_data_queue_flush (self->queue);
self->start = FALSE; self->start = FALSE;
@ -695,7 +695,7 @@ gst_ahc_src_unlock (GstBaseSrc * bsrc)
{ {
GstAHCSrc *self = GST_AHC_SRC (bsrc); GstAHCSrc *self = GST_AHC_SRC (bsrc);
GST_WARNING_OBJECT (self, "Unlocking create"); GST_DEBUG_OBJECT (self, "Unlocking create");
gst_data_queue_set_flushing (self->queue, TRUE); gst_data_queue_set_flushing (self->queue, TRUE);
return TRUE; return TRUE;
@ -706,7 +706,7 @@ gst_ahc_src_unlock_stop (GstBaseSrc * bsrc)
{ {
GstAHCSrc *self = GST_AHC_SRC (bsrc); GstAHCSrc *self = GST_AHC_SRC (bsrc);
GST_WARNING_OBJECT (self, "Stopping unlock"); GST_DEBUG_OBJECT (self, "Stopping unlock");
gst_data_queue_set_flushing (self->queue, FALSE); gst_data_queue_set_flushing (self->queue, FALSE);
return TRUE; return TRUE;