210
211
GstCaps * outcaps)
212
213
GstOpencvBaseTransform *transform = GST_OPENCV_BASE_TRANSFORM (trans);
213
GstStructure *structure;
216
structure = gst_caps_get_structure (incaps, 0);
217
if (!gst_structure_get_int (structure, "width", &width) ||
218
!gst_structure_get_int (structure, "height", &height)) {
219
GST_WARNING_OBJECT (transform, "No width/height on caps");
214
gint in_width, in_height;
215
gint in_depth, in_type, in_channels;
216
gint out_width, out_height;
217
gint out_depth, out_type, out_channels;
218
GError *in_err = NULL;
219
GError *out_err = NULL;
221
if (!gst_opencv_parse_iplimage_params_from_caps (incaps, &in_width,
222
&in_height, &in_depth, &in_type, &in_channels, &in_err)) {
223
GST_WARNING_OBJECT (transform, "Failed to parse input caps: %s",
225
g_error_free (in_err);
229
if (!gst_opencv_parse_iplimage_params_from_caps (outcaps, &out_width,
230
&out_height, &out_depth, &out_type, &out_channels, &out_err)) {
231
GST_WARNING_OBJECT (transform, "Failed to parse output caps: %s",
233
g_error_free (out_err);
227
241
cvReleaseImage (&transform->out_cvImage);
230
/* FIXME - how do we know it is IPL_DEPTH_8U? */
231
244
transform->cvImage =
232
cvCreateImageHeader (cvSize (width, height), IPL_DEPTH_8U, 3);
245
cvCreateImageHeader (cvSize (in_width, in_height), in_depth, in_channels);
233
246
transform->out_cvImage =
234
cvCreateImageHeader (cvSize (width, height), IPL_DEPTH_8U, 3);
247
cvCreateImageHeader (cvSize (out_width, out_height), out_depth,
236
250
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (transform),
237
251
transform->in_place);