static void gst_tcamwhitebalance_init (GstTcamWhitebalance* self) { gst_base_transform_set_in_place(GST_BASE_TRANSFORM(self), TRUE); init_wb_values(self); self->auto_wb = TRUE; self->image_size.width = 0; self->image_size.height = 0; }
/* Entry point */ static GstFlowReturn gst_tcamwhitebalance_transform_ip (GstBaseTransform* trans, GstBuffer* buf) { GstTcamWhitebalance* self = GST_TCAMWHITEBALANCE (trans); if (self->image_size.width == 0 || self->image_size.height == 0) { if (!extract_resolution(self)) { GST_ERROR("Received format is not usable. Aborting"); return GST_FLOW_ERROR; } if (self->force_hardware_wb) { self->res.color.has_whitebalance = TRUE; } if (self->res.color.has_whitebalance) { WB_MAX = self->res.color.max; WB_IDENTITY = self->res.color.default_value; init_wb_values(self); } } /* auto is completely disabled */ if (!self->auto_enabled) { return GST_FLOW_OK; } // validity checks GstMapInfo info; gst_buffer_map(buf, &info, GST_MAP_READ); guint* data = (guint*)info.data; guint length = info.size; gst_buffer_unmap(buf, &info); if (data == NULL || length != self->expected_buffer_size) { GST_ERROR("Buffer is not valid! Ignoring buffer and trying to continue..."); return GST_FLOW_OK; } whitebalance_buffer(self, buf); return GST_FLOW_OK; }
/* Entry point */ static GstFlowReturn gst_tiswhitebalance_transform_ip (GstBaseTransform* trans, GstBuffer* buf) { GstTisWhiteBalance* self = GST_TISWHITEBALANCE (trans); if (self->res.source_element == NULL) { gst_debug_log (gst_tiswhitebalance_debug_category, GST_LEVEL_INFO, "gst_tiswhitebalance", "gst_tiswhitebalance_fixate_caps", __LINE__, NULL, "Searching for source"); self->res = find_source(GST_ELEMENT(self)); if (self->force_hardware_wb) { self->res.color.has_whitebalance = TRUE; } if (self->res.color.has_whitebalance) { WB_MAX = self->res.color.max; WB_IDENTITY = self->res.color.default_value; init_wb_values(self); } } /* auto is completely disabled */ if (!self->auto_enabled) { return GST_FLOW_OK; } whitebalance_buffer(self, buf); return GST_FLOW_OK; }
static void gst_tiswhitebalance_init (GstTisWhiteBalance *self) { init_wb_values(self); self->auto_wb = TRUE; self->res.source_element = NULL; }