Update recommend format when default format is not supported 87/316887/2 accepted/tizen/unified/20240902.161420 accepted/tizen/unified/dev/20240903.220455 accepted/tizen/unified/x/20240903.023208
authorJeongmo Yang <jm80.yang@samsung.com>
Fri, 30 Aug 2024 04:40:53 +0000 (13:40 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Fri, 30 Aug 2024 05:29:56 +0000 (14:29 +0900)
- In general, recommend formats in configuration are same with default format.
  When device capability is supported and it does not support default format in configuration,
  camera handle creation will be failed because of preview format setting failure.
  It can be resolved by recommend format replacement.
- Minor change
 : Support MM_PIXEL_FORMAT_ENCODED(JPEG) as preview format.

[Version] 1.2.6
[Issue Type] Update

Change-Id: I9edfe92b2669e8d91a4bbc68b89838dea8eeb1b1
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/libmm-camcorder.spec
src/mm_camcorder_capability.c
src/mm_camcorder_gstcommon.c
src/mm_camcorder_util.c

index 88957326e62e3554fa7333bdfba2daab0d7a7d3e..fdae28236dc79157397015e01c4b87d710b0d18c 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    1.2.5
+Version:    1.2.6
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index f9e5e1546b4a99f586e984c96e1aef54644d1625..cb1cfb425135bb35e42b54ad40179f6a2db28914 100644 (file)
@@ -443,6 +443,21 @@ int _mmcamcorder_capability_update_preview_format_list(MMHandleType handle)
                return ret;
        }
 
+       if (!is_current_supported) {
+               MMCAM_LOG_WARNING("update recommend format[%s] for invalid ini",
+                       g_format_string_table[default_mm_format]);
+
+               /* update new default format as recommend format */
+               ret = mm_camcorder_set_attributes(handle, NULL,
+                       MMCAM_RECOMMEND_PREVIEW_FORMAT_FOR_CAPTURE, default_mm_format,
+                       MMCAM_RECOMMEND_PREVIEW_FORMAT_FOR_RECORDING, default_mm_format,
+                       NULL);
+               if (ret != MM_ERROR_NONE) {
+                       MMCAM_LOG_ERROR("update recommend format failed[0x%x]", ret);
+                       return ret;
+               }
+       }
+
        MMCAM_LOG_INFO("done");
 
        return _mmcamcorder_capability_update_preview_resolution_list(handle);
index ba7ce5023f11f9bfbb45f4d43320db29ead73394..b0a5662ffdd16763451218977f7e126b7dd470dd 100644 (file)
@@ -857,6 +857,7 @@ int _mmcamcorder_create_preview_elements(MMHandleType handle)
                case MM_PIXEL_FORMAT_ENCODED_H264:
                        decoder_conf_name = "VideodecoderElementH264";
                        break;
+               case MM_PIXEL_FORMAT_ENCODED: /* fall through */
                case MM_PIXEL_FORMAT_ENCODED_MJPEG:
                        decoder_conf_name = "VideodecoderElementMJPEG";
                        break;
index 423b330edc4ec6ffd16d047d946b68c10c6956e5..788bf0fd0978fbf817a1431f42e84c34534c7a1c 100644 (file)
@@ -2027,6 +2027,7 @@ GstCaps *_mmcamcorder_get_video_caps(MMHandleType handle, MMPixelFormatType form
 #endif /* _MMCAMCORDER_PRODUCT_TV */
                        NULL);
                break;
+       case MM_PIXEL_FORMAT_ENCODED: /* fall through */
        case MM_PIXEL_FORMAT_ENCODED_MJPEG:
 #ifdef _MMCAMCORDER_PRODUCT_TV
                caps = gst_caps_new_empty_simple("video/x-jpeg");