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;
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);
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);
#include <rm_api.h>
#include <ri-api.h>
#include <ri-module-api.h>
+#include <resource_center.h>
#include "mm_camcorder_rm.h"
#include "mm_camcorder_internal.h"
return cb_res;
}
-
-
int _mmcamcorder_rm_create(MMHandleType handle)
{
int ret = RM_OK;
- rm_consumer_info rci;
- int app_pid = 0;
mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
if (!hcamcorder) {
MMCAM_LOG_ERROR("Not initialized");
return MM_ERROR_CAMCORDER_NOT_INITIALIZED;
}
-
- memset(&rci, 0x00, sizeof(rm_consumer_info));
-
+ memset(&hcamcorder->rci, 0x00, sizeof(rm_consumer_info));
mm_camcorder_get_attributes(handle, NULL,
- MMCAM_CLIENT_PID, &app_pid,
+ MMCAM_CLIENT_PID, &hcamcorder->rci.app_pid,
NULL);
- rci.app_pid = app_pid;
- aul_app_get_appid_bypid(rci.app_pid, rci.app_id, sizeof(rci.app_id));
+ aul_app_get_appid_bypid(hcamcorder->rci.app_pid, hcamcorder->rci.app_id, sizeof(hcamcorder->rci.app_id));
/* RM register */
+ /* NULL should be passed for the rci parameter if the application does not have "visibility" */
if (hcamcorder->rm_handle == 0) {
ret = rm_register((rm_resource_cb)__mmcamcorder_rm_callback,
(void*)hcamcorder,
&(hcamcorder->rm_handle),
- (rci.app_id[0] != '\0') ? &rci : NULL);
+ (hcamcorder->rci.app_id[0] != '\0') ? &hcamcorder->rci : NULL);
if (ret != RM_OK) {
MMCAM_LOG_ERROR("rm_register fail ret = %d",ret);
return MM_ERROR_RESOURCE_INTERNAL;
return MM_ERROR_CAMCORDER_NOT_INITIALIZED;
}
+ MMCAM_LOG_INFO("app id : %s", hcamcorder->rci.app_id);
+ /* if the app_id is null,
+ In the multiview mode, the rc_get_capable_category_id returns the error(RI_CATEGORY_NOT_PERMITTED).
+ In the normal mode, it returns the category itself which is passed in the parameter. */
+
mm_camcorder_get_attributes(handle, NULL,
MMCAM_DISPLAY_SURFACE, &display_surface_type,
NULL);
if (preview_format == MM_PIXEL_FORMAT_ENCODED_H264) {
hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_VIDEO_DECODER;
-
+ hcamcorder->request_resources.category_option[resource_count] = rc_get_capable_category_id(hcamcorder->rm_handle, hcamcorder->rci.app_id, RM_CATEGORY_VIDEO_DECODER);
MMCAM_LOG_INFO("request dec rsc - category 0x%x", RM_CATEGORY_VIDEO_DECODER);
resource_count++;
mm_camcorder_get_attributes(handle, NULL,
MMCAM_CAMERA_WIDTH, &camera_width,
NULL);
-
hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_MJPEG_DECODER;
- hcamcorder->request_resources.category_option[resource_count] = ri_get_jpeg_category_id("MJPEG", camera_width);
+ hcamcorder->request_resources.category_option[resource_count] = rc_get_capable_category_id(hcamcorder->rm_handle, hcamcorder->rci.app_id, ri_get_jpeg_category_id("MJPEG", camera_width));
MMCAM_LOG_INFO("request dec rsc - category 0x%x, option width [%d]", RM_CATEGORY_MJPEG_DECODER, camera_width);
resource_count++;
}
if (display_surface_type == MM_DISPLAY_SURFACE_OVERLAY) {
hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_SCALER;
+ hcamcorder->request_resources.category_option[resource_count] = rc_get_capable_category_id(hcamcorder->rm_handle, hcamcorder->rci.app_id, RM_CATEGORY_SCALER);
MMCAM_LOG_INFO("request scaler rsc - category 0x%x", RM_CATEGORY_SCALER);
resource_count++;
}
qret = rm_query(hcamcorder->rm_handle, RM_QUERY_ALLOCATION, &(hcamcorder->request_resources), &qret_avail);
if (qret != RM_OK || qret_avail != 1) {
MMCAM_LOG_INFO("rm query failed. retry with sub devices");
-
resource_count = 0;
memset(&hcamcorder->request_resources, 0x0, sizeof(rm_category_request_s));
memset(&hcamcorder->returned_devices, 0x0, sizeof(rm_device_return_s));
if (preview_format == MM_PIXEL_FORMAT_ENCODED_H264) {
hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_VIDEO_DECODER_SUB;
+ hcamcorder->request_resources.category_option[resource_count] = rc_get_capable_category_id(hcamcorder->rm_handle, hcamcorder->rci.app_id, RM_DEVICE_OPT_SUB);
MMCAM_LOG_INFO("request dec rsc - category 0x%x", RM_CATEGORY_VIDEO_DECODER_SUB);
resource_count++;
} else if (preview_format == MM_PIXEL_FORMAT_ENCODED_MJPEG) {
hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_MJPEG_DECODER;
- hcamcorder->request_resources.category_option[resource_count] = ri_get_jpeg_category_id("MJPEG", camera_width);
+ hcamcorder->request_resources.category_option[resource_count] = rc_get_capable_category_id(hcamcorder->rm_handle, hcamcorder->rci.app_id, ri_get_jpeg_category_id("MJPEG", camera_width));
MMCAM_LOG_INFO("request dec rsc - category 0x%x", RM_CATEGORY_MJPEG_DECODER);
resource_count++;
}
- if (display_surface_type == MM_DISPLAY_SURFACE_OVERLAY) {
- if (preview_format == MM_PIXEL_FORMAT_ENCODED_H264) {
- hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
- hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_SCALER_SUB;
- MMCAM_LOG_INFO("request scaler rsc - category 0x%x", RM_CATEGORY_SCALER_SUB);
- resource_count++;
- } else if (preview_format == MM_PIXEL_FORMAT_ENCODED_MJPEG) {
- hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
- hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_SCALER;
- MMCAM_LOG_INFO("request scaler rsc - category 0x%x", RM_CATEGORY_SCALER);
- resource_count++;
- }
+ if ((display_surface_type == MM_DISPLAY_SURFACE_OVERLAY) &&
+ (preview_format == MM_PIXEL_FORMAT_ENCODED_H264 || preview_format == MM_PIXEL_FORMAT_ENCODED_MJPEG)) {
+ hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
+ hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_SCALER_SUB;
+ hcamcorder->request_resources.category_option[resource_count] = rc_get_capable_category_id(hcamcorder->rm_handle, hcamcorder->rci.app_id, RM_DEVICE_OPT_SUB);
+ MMCAM_LOG_INFO("request scaler rsc - category 0x%x", RM_CATEGORY_SCALER_SUB);
+ resource_count++;
}
}
}
hcamcorder->request_resources.state[resource_count] = RM_STATE_EXCLUSIVE;
hcamcorder->request_resources.category_id[resource_count] = RM_CATEGORY_CAMERA;
+ hcamcorder->request_resources.category_option[resource_count] = rc_get_capable_category_id(hcamcorder->rm_handle, hcamcorder->rci.app_id, RM_CATEGORY_CAMERA);
hcamcorder->request_resources.request_num = resource_count + 1;
MMCAM_LOG_INFO("request camera rsc - category 0x%x", RM_CATEGORY_CAMERA);