GstStructure *st;
GstBufferPool *cpool;
gboolean active;
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+ GstStructure *structure = NULL;
+ const gchar *caps_format = NULL;
+ GstMessage *msg = NULL;
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
if (G_UNLIKELY (!GST_V4L2_IS_ACTIVE (self->v4l2capture))) {
/* init capture fps according to output */
caps = gst_caps_fixate (caps);
GST_DEBUG_OBJECT (self, "Chosen decoded caps: %" GST_PTR_FORMAT, caps);
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+ structure = gst_caps_get_structure (caps, 0);
+ caps_format = gst_structure_get_string (structure, "format");
+
+ if (!strcmp (caps_format, "I420")) {
+ GST_INFO_OBJECT (self, "I420 -> S420");
+ gst_caps_set_simple (caps, "format", G_TYPE_STRING, "S420", NULL);
+ } else if (!strcmp (caps_format, "NV12")) {
+ GST_INFO_OBJECT (self, "NV12 -> SN12");
+ gst_caps_set_simple (caps, "format", G_TYPE_STRING, "SN12", NULL);
+ }
+ GST_INFO_OBJECT (self, "Updated decoded caps: %" GST_PTR_FORMAT, caps);
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
/* Try to set negotiated format, on success replace acquired format */
if (gst_v4l2_object_set_format (self->v4l2capture, caps, &error))
gst_object_unref (cpool);
if (!active)
goto activate_failed;
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+ msg = gst_message_new_element (GST_OBJECT_CAST (decoder),
+ gst_structure_new ("prepare-decode-buffers",
+ "num_buffers", G_TYPE_INT, GST_V4L2_BUFFER_POOL (cpool)->num_allocated,
+ "extra_num_buffers", G_TYPE_INT, GST_V4L2_BUFFER_POOL (cpool)->num_allocated - 2, NULL));
+
+ gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
+
+ GST_WARNING_OBJECT (self, "output buffer[%d]", GST_V4L2_BUFFER_POOL (cpool)->num_allocated);
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
}
return GST_FLOW_OK;