1.Modify to use the sub scaler in case of the resource conflict. it looks like MJPEG...
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_gstcommon.c
old mode 100644 (file)
new mode 100755 (executable)
index 39c5285..5406da7
@@ -1743,9 +1743,6 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
        int zoom_attr = 0;
        int zoom_level = 0;
        int do_scaling = FALSE;
-#ifdef _MMCAMCORDER_RM_SUPPORT
-       int display_scaler = 0;
-#endif /* _MMCAMCORDER_RM_SUPPORT */
        int *dp_handle = NULL;
        MMCamWindowInfo *window_info = NULL;
        gulong xid;
@@ -1814,10 +1811,8 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
                        gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(vsink), 0);
                }
 #ifdef _MMCAMCORDER_RM_SUPPORT
-               if (hcamcorder->request_resources.category_id[0] == RM_CATEGORY_VIDEO_DECODER_SUB)
-                       display_scaler = 1;
-
-               MMCAMCORDER_G_OBJECT_SET(vsink, "device-scaler", display_scaler);
+               /* set the videosink using the virtual device id instead of the real id (main=0, sub=1) */
+               MMCAMCORDER_G_OBJECT_SET(vsink, "device-scaler", hcamcorder->returned_devices.device_id[1]);
 #endif /* _MMCAMCORDER_RM_SUPPORT */
        } else if (!strcmp(videosink_name, "evasimagesink") || !strcmp(videosink_name, "evaspixmapsink")) {
                MMCAM_LOG_INFO("videosink : %s, handle : %p", videosink_name, dp_handle);
@@ -1856,9 +1851,9 @@ int _mmcamcorder_videosink_window_set(MMHandleType handle, type_element* Videosi
                        MMCAM_LOG_WARNING("dp_handle is null");
                }
 #ifdef _MMCAMCORDER_RM_SUPPORT
-               if (hcamcorder->request_resources.category_id[0] == RM_CATEGORY_VIDEO_DECODER_SUB)
-                       display_scaler = 1;
-               MMCAMCORDER_G_OBJECT_SET(vsink, "device-scaler", display_scaler);
+               /* set the videosink using the virtual device id instead of the real id (main=0, sub=1) */
+               MMCAM_LOG_INFO("device-scaler : %d", hcamcorder->returned_devices.device_id[1]);
+               MMCAMCORDER_G_OBJECT_SET(vsink, "device-scaler", hcamcorder->returned_devices.device_id[1]);
 #endif /* _MMCAMCORDER_RM_SUPPORT */
        } else {
                MMCAM_LOG_WARNING("Who are you?? (Videosink: %s)", videosink_name);