From b5cefffb9f44756e44db7534b35f62cc2d5aa8d5 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Tue, 20 May 2014 07:25:20 +0200 Subject: [PATCH] motioncells: use standard macro for boolean https://bugzilla.gnome.org/show_bug.cgi?id=730141 --- ext/opencv/gstmotioncells.c | 42 +++++++++++++++--------------- ext/opencv/motioncells_wrapper.cpp | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ext/opencv/gstmotioncells.c b/ext/opencv/gstmotioncells.c index d5e037ebdb..483083b01a 100644 --- a/ext/opencv/gstmotioncells.c +++ b/ext/opencv/gstmotioncells.c @@ -376,19 +376,19 @@ gst_motion_cells_init (GstMotioncells * filter) filter->diff_timestamp = -1; gettimeofday (&filter->tv, NULL); filter->starttime = 1000 * filter->tv.tv_sec; - filter->previous_motion = false; - filter->changed_datafile = false; - filter->postallmotion = false; - filter->usealpha = true; - filter->firstdatafile = false; - filter->firstgridx = true; - filter->firstgridy = true; - filter->changed_gridx = false; - filter->changed_gridy = false; - filter->firstframe = true; - filter->changed_startime = false; - filter->sent_init_error_msg = false; - filter->sent_save_error_msg = false; + filter->previous_motion = FALSE; + filter->changed_datafile = FALSE; + filter->postallmotion = FALSE; + filter->usealpha = TRUE; + filter->firstdatafile = FALSE; + filter->firstgridx = TRUE; + filter->firstgridy = TRUE; + filter->changed_gridx = FALSE; + filter->changed_gridy = FALSE; + filter->firstframe = TRUE; + filter->changed_startime = FALSE; + filter->sent_init_error_msg = FALSE; + filter->sent_save_error_msg = FALSE; filter->thickness = THICKNESS_DEF; filter->datafileidx = 0; @@ -417,14 +417,14 @@ gst_motion_cells_set_property (GObject * object, guint prop_id, case PROP_GRID_X: filter->gridx = g_value_get_int (value); if (filter->prevgridx != filter->gridx && !filter->firstframe) { - filter->changed_gridx = true; + filter->changed_gridx = TRUE; } filter->prevgridx = filter->gridx; break; case PROP_GRID_Y: filter->gridy = g_value_get_int (value); if (filter->prevgridy != filter->gridy && !filter->firstframe) { - filter->changed_gridy = true; + filter->changed_gridy = TRUE; } filter->prevgridy = filter->gridy; break; @@ -457,7 +457,7 @@ gst_motion_cells_set_property (GObject * object, guint prop_id, break; case PROP_DATE: if (!filter->firstframe) { - filter->changed_startime = true; + filter->changed_startime = TRUE; } filter->starttime = g_value_get_long (value); break; @@ -966,7 +966,7 @@ gst_motion_cells_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) motioncellscolor, motioncells_count, motioncellsidx, starttime, datafile, changed_datafile, thickness, filter->id); - if ((success == 1) && (filter->sent_init_error_msg == false)) { + if ((success == 1) && (filter->sent_init_error_msg == FALSE)) { char *initfailedreason; int initerrorcode; GstStructure *s; @@ -979,7 +979,7 @@ gst_motion_cells_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) gst_element_post_message (GST_ELEMENT (filter), m); filter->sent_init_error_msg = TRUE; } - if ((success == -1) && (filter->sent_save_error_msg == false)) { + if ((success == -1) && (filter->sent_save_error_msg == FALSE)) { char *savefailedreason; int saveerrorcode; GstStructure *s; @@ -1019,11 +1019,11 @@ gst_motion_cells_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) detectedmotioncells = getMotionCellsIdx (filter->id); if (detectedmotioncells) { filter->consecutive_motion++; - if ((filter->previous_motion == false) + if ((filter->previous_motion == FALSE) && (filter->consecutive_motion >= minimum_motion_frames)) { GstStructure *s; GstMessage *m; - filter->previous_motion = true; + filter->previous_motion = TRUE; filter->motion_begin_timestamp = GST_BUFFER_TIMESTAMP (buf); s = gst_structure_new ("motion", "motion_cells_indices", G_TYPE_STRING, detectedmotioncells, "motion_begin", @@ -1058,7 +1058,7 @@ gst_motion_cells_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) if (filter->previous_motion) { GstStructure *s; GstMessage *m; - filter->previous_motion = false; + filter->previous_motion = FALSE; s = gst_structure_new ("motion", "motion_finished", G_TYPE_UINT64, filter->last_motion_timestamp, NULL); m = gst_message_new_element (GST_OBJECT (filter), s); diff --git a/ext/opencv/motioncells_wrapper.cpp b/ext/opencv/motioncells_wrapper.cpp index 9452216652..dc52443eef 100644 --- a/ext/opencv/motioncells_wrapper.cpp +++ b/ext/opencv/motioncells_wrapper.cpp @@ -54,7 +54,7 @@ #include "motioncells_wrapper.h" static int instanceCounter = 0; -static gboolean element_id_was_max = false; +static bool element_id_was_max = false; MotionCells *mc; char p_str[] = "idx failed";