support hw acceleration
authorJaeho Lee <jaeho81.lee@samsung.com>
Fri, 7 Dec 2012 02:15:44 +0000 (11:15 +0900)
committerJaeho Lee <jaeho81.lee@samsung.com>
Fri, 7 Dec 2012 02:15:44 +0000 (11:15 +0900)
Signed-off-by: Jaeho Lee <jaeho81.lee@samsung.com>
am_daemon/amd_appinfo.c
am_daemon/amd_appinfo.h
am_daemon/amd_launch.c
include/aul.h
include/menu_db_util.h
launchpad_src/launchpad.c
packaging/aul.spec

index c2110dd..2b26fb2 100755 (executable)
@@ -28,6 +28,7 @@ enum _appinfo_idx {
        _AI_ONBOOT,
        _AI_RESTART,
        _AI_MULTI,
+       _AI_HWACC,
        _AI_MAX,
 };
 #define _AI_START _AI_NAME /* start index */
@@ -45,6 +46,7 @@ static struct appinfo_t _appinfos[] = {
        [_AI_ONBOOT] = { "StartOnBoot", AIT_ONBOOT, },
        [_AI_RESTART] = { "AutoRestart", AIT_RESTART, },
        [_AI_MULTI] = { "Multiple", AIT_MULTI, },
+       [_AI_HWACC] = { "Hwacceleration", AIT_HWACC, },
 };
 
 struct appinfo {
@@ -147,6 +149,7 @@ static int __ui_app_info_insert_handler (const pkgmgrinfo_appinfo_h handle, void
        char *type;
        bool multiple;
        char *appid;
+       pkgmgrinfo_app_hwacceleration hwacc;
 
        pkgmgrinfo_appinfo_get_appid(handle, &appid);
 
@@ -188,6 +191,15 @@ static int __ui_app_info_insert_handler (const pkgmgrinfo_appinfo_h handle, void
                c->val[_AI_MULTI] = strdup("true");
        else c->val[_AI_MULTI] = strdup("false");
 
+       pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacc);
+       if (hwacc == PMINFO_HWACCELERATION_USE_GL) {
+               c->val[_AI_HWACC] = strdup("USE");
+       } else if (hwacc == PMINFO_HWACCELERATION_USE_SYSTEM_SETTING) {
+               c->val[_AI_HWACC] = strdup("SYS");
+       } else {
+               c->val[_AI_HWACC] = strdup("NOT_USE");
+       }
+
        _D("%s : %s : %s : %s", c->val[_AI_FILE], c->val[_AI_COMP], c->val[_AI_TYPE], c->val[_AI_MULTI]);
 
        g_hash_table_insert(cf->tbl, c->val[_AI_FILE], c);
index 401b284..a5840f4 100755 (executable)
@@ -12,6 +12,7 @@ enum appinfo_type {
        AIT_ONBOOT, /* start on boot: boolean */
        AIT_RESTART, /* auto restart: boolean */
        AIT_MULTI,
+       AIT_HWACC,
 };
 
 int appinfo_init(struct appinfomgr **cf);
index 5ff7824..bcf5f6e 100755 (executable)
@@ -448,6 +448,7 @@ int __sat_ui_launch(char* appid, bundle* kb, int cmd, int caller_pid, int fd)
                        pid = ret;
                }
        } else if (cmd != APP_RESUME) {
+               bundle_add(kb, AUL_K_HWACC, "NOT_USE");
                bundle_add(kb, AUL_K_EXEC, app_path);
                bundle_add(kb, AUL_K_PACKAGETYPE, "rpm");
                pid = app_send_cmd(LAUNCHPAD_PID, cmd, kb);
@@ -472,6 +473,7 @@ int _start_app(char* appid, bundle* kb, int cmd, int caller_pid, int fd)
        char *app_path = NULL;
        int pid = -1;
        char tmp_pid[MAX_PID_STR_BUFSZ];
+       char *hwacc;
 
        int location = -1;
        app2ext_handle *app2_handle = NULL;
@@ -505,6 +507,8 @@ int _start_app(char* appid, bundle* kb, int cmd, int caller_pid, int fd)
                                pid = ret;
                        }
                } else if (cmd != APP_RESUME) {
+                       hwacc = appinfo_get_value(ai, AIT_HWACC);
+                       bundle_add(kb, AUL_K_HWACC, hwacc);
                        bundle_add(kb, AUL_K_EXEC, app_path);
                        bundle_add(kb, AUL_K_PACKAGETYPE, appinfo_get_value(ai, AIT_TYPE));
                        pid = app_send_cmd(LAUNCHPAD_PID, cmd, kb);
index 0bb36d2..3f1b14b 100755 (executable)
@@ -178,6 +178,9 @@ typedef enum _aul_type{
 #define AUL_K_MULTIPLE         "__AUL_MULTIPLE__"
 /** AUL internal private key */
 #define AUL_K_PACKAGETYPE      "__AUL_PACKAGETYPE__"
+/** AUL internal private key */
+#define AUL_K_HWACC            "__AUL_HWACC__"
+
 
 /** AUL internal private key */
 #define AUL_K_APPID            "__AUL_APPID__"
index b0a952f..f05b9da 100755 (executable)
@@ -47,6 +47,7 @@ typedef struct {
        char *app_path;         /* exec */
        char *original_app_path;        /* exec */
        char *pkg_type;         /* x_slp_packagetype */
+       char *hwacc;            /* hwacceleration */
 } app_info_from_db;
 
 static inline char *_get_pkgname(app_info_from_db *menu_info)
@@ -104,6 +105,8 @@ static inline void _free_app_info_from_db(app_info_from_db *menu_info)
                        free(menu_info->app_path);
                if (menu_info->original_app_path != NULL)
                        free(menu_info->original_app_path);
+               if (menu_info->hwacc != NULL)
+                       free(menu_info->hwacc);
                free(menu_info);
        }
 }
index 66a4937..e5f5777 100755 (executable)
@@ -173,6 +173,8 @@ _static_ void __set_env(app_info_from_db * menu_info, bundle * kb)
                        __set_sdk_env(menu_info, (char *)str);
                }
        }
+       if (menu_info->hwacc != NULL)
+               setenv("HWACC", menu_info->hwacc, 1);
 }
 
 _static_ int __prepare_exec(const char *pkg_name,
@@ -425,6 +427,7 @@ _static_ void __modify_bundle(bundle * kb, int caller_pid,
        bundle_del(kb, AUL_K_PKG_NAME);
        bundle_del(kb, AUL_K_EXEC);
        bundle_del(kb, AUL_K_PACKAGETYPE);
+       bundle_del(kb, AUL_K_HWACC);
 
        /* Parse app_path to retrieve default bundle*/
        if (cmd == APP_START || cmd == APP_START_RES || cmd == APP_OPEN || cmd == APP_RESUME) {
@@ -660,6 +663,7 @@ static app_info_from_db *_get_app_info_from_bundle_by_pkgname(
        if (menu_info->app_path != NULL)
                menu_info->original_app_path = strdup(menu_info->app_path);
        menu_info->pkg_type = strdup(bundle_get_val(kb, AUL_K_PACKAGETYPE));
+       menu_info->hwacc = strdup(bundle_get_val(kb, AUL_K_HWACC));
 
        if (!_get_app_path(menu_info)) {
                _free_app_info_from_db(menu_info);
index 0b71337..f92fef8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       aul
 Summary:    App utility library
-Version:    0.0.211
+Version:    0.0.213
 Release:    1
 Group:      System/Libraries
 License:    Apache License, Version 2.0