+static GstElement *__mc_gst_extra_converter_new(mc_extra_converter_t *extra_converter)
+{
+ GstElement *element = NULL;
+ gint array[MEDIACODEC_CROP_ARRAY_LENGTH] = {0, };
+
+ if (!extra_converter) {
+ LOGE("NULL extra converter");
+ return NULL;
+ }
+
+ LOGI("extra converter[%s]", extra_converter->name);
+
+ element = gst_element_factory_make(extra_converter->name, NULL);
+ if (!element) {
+ LOGE("create element[%s] failed", extra_converter->name);
+ return NULL;
+ }
+
+ array[0] = extra_converter->crop_x;
+ array[1] = extra_converter->crop_y;
+ array[2] = extra_converter->crop_w;
+ array[3] = extra_converter->crop_h;
+
+ if (mc_gst_set_property_array_int(element,
+ "crop", array, MEDIACODEC_CROP_ARRAY_LENGTH) != MC_ERROR_NONE) {
+ gst_object_unref(element);
+ return NULL;
+ }
+
+ LOGI("set crop to extra converter[%d,%d,%dx%d]",
+ array[0], array[1], array[2], array[3] );
+
+ return element;
+}
+
+
+#ifdef TIZEN_FEATURE_ENABLE_DUMP_SOURCE
+static GstPadProbeReturn __dump_probe(GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
+{
+ static int count = 0;
+ int i = 0;
+ const gchar *dump_path = (const gchar *)u_data;
+ GstBuffer *buffer = GST_PAD_PROBE_INFO_BUFFER(info);
+ GstMemory *memory = NULL;
+ FILE *fp = NULL;
+ tbm_surface_h surface = NULL;
+ tbm_surface_info_s sinfo = {0, };
+
+ if (!dump_path) {
+ LOGW("NULL path");
+ return GST_PAD_PROBE_OK;
+ }
+
+ if (count++ > 10) {
+ LOGW("[%s] SKIP DUMP", dump_path);
+ return GST_PAD_PROBE_OK;
+ }
+
+ memory = gst_buffer_peek_memory(buffer, 0);
+
+ if (!gst_is_tizen_memory(memory)) {
+ LOGW("Not tizen memory");
+ return GST_PAD_PROBE_OK;
+ }
+
+ surface = gst_tizen_memory_get_surface(memory);
+ if (!surface) {
+ LOGW("No surface");
+ return GST_PAD_PROBE_OK;
+ }
+
+ fp = fopen(dump_path, "a");
+ if (!fp) {
+ LOGW("file open failed[%s]", dump_path);
+ return GST_PAD_PROBE_OK;
+ }
+
+ tbm_surface_get_info(surface, &sinfo);
+
+ for (i = 0 ; i < sinfo.num_planes ; i++) {
+ LOGI("[dump:%s] write plane[%d] size[%u]", dump_path, i, sinfo.planes[i].size);
+ fwrite(sinfo.planes[i].ptr, 1, sinfo.planes[i].size, fp);
+ }
+
+ fclose(fp);
+
+ return GST_PAD_PROBE_OK;
+}
+#endif /* TIZEN_FEATURE_ENABLE_DUMP_SOURCE */
+
+