[v4l2videodecoder] Add new property to enable TBM output buffer
[platform/upstream/gst-plugins-good.git] / sys / v4l2 / gstv4l2object.c
index 9db4ae6..8cc1b93 100644 (file)
@@ -831,10 +831,13 @@ gst_v4l2_get_driver_min_buffers (GstV4l2Object * v4l2object)
         "driver requires a minimum of %d buffers", control.value);
 #ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
 #define DEFAULT_DECODER_OUTPUT_BUFFER_COUNT 5
-    if (!V4L2_TYPE_IS_OUTPUT (v4l2object->type) && control.value == 1) {
+    if (v4l2object->tbm_output &&
+        !V4L2_TYPE_IS_OUTPUT (v4l2object->type) && control.value == 1) {
       v4l2object->min_buffers = DEFAULT_DECODER_OUTPUT_BUFFER_COUNT;
       GST_WARNING_OBJECT (v4l2object->dbg_obj, "but SET MIN BUFFER COUNT[%d] and it will be [%d] later",
           v4l2object->min_buffers, v4l2object->min_buffers + 1);
+    } else {
+      v4l2object->min_buffers = control.value;
     }
 #else /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
     v4l2object->min_buffers = control.value;