Removed Deprecated API's 29/211729/6 submit/tizen/20190809.115255
authorprachi kumar <prachi.kumar@samsung.com>
Thu, 8 Aug 2019 17:55:35 +0000 (23:25 +0530)
committerprachi kumar <prachi.kumar@samsung.com>
Fri, 9 Aug 2019 17:24:14 +0000 (22:54 +0530)
Change-Id: I7869ddd55326d6fa1bd4276161e011874545c54a

common/src/vp-chapter-db.c
common/src/vp-preview-db.c
common/src/vp-thumb-db.c
playview/src/core/vp-media-contents.c
src/common/mp-util-media-service.c

index 759ca58..3b1137c 100644 (file)
@@ -91,10 +91,10 @@ static bool _vp_chapter_db_get_count(char *szMediaID, int *nCount)
                vp_dbgW("Get Chapter Count : %d", *nCount);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -139,10 +139,10 @@ static bool _vp_chapter_db_delete_items(char *szMediaID)
                nRet = sqlite3_step(stmt);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -316,10 +316,10 @@ bool vp_chapter_db_get_items(vp_chapter_db_h hChapterDB,
                nRet = sqlite3_step(stmt);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -366,10 +366,10 @@ bool vp_chapter_db_get_all_items_media_id(vp_chapter_db_h hChapterDB,
                nRet = sqlite3_step(stmt);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -426,12 +426,12 @@ bool vp_chapter_db_insert(vp_chapter_db_h hChapterDB,
 
        sqlite3_step(stmt);
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -478,12 +478,12 @@ bool vp_chapter_db_delete(vp_chapter_db_h hChapterDB)
 
        sqlite3_step(stmt);
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
index 706ffbc..4d6f0c9 100644 (file)
@@ -91,10 +91,10 @@ static bool _vp_preview_db_get_count(char *szMediaID, int *nCount)
                vp_dbgW("Get Chapter Count : %d", *nCount);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -138,10 +138,10 @@ static bool _vp_preview_db_delete_item(char *szMeidaID)
 
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -304,10 +304,10 @@ bool vp_preview_db_get_file_path(vp_preview_db_h hPreviewDB,
                VP_STRDUP(*szFilePath, (char *) sqlite3_column_text(stmt, 1));
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -364,10 +364,10 @@ bool vp_preview_db_get_file_size(vp_preview_db_h hPreviewDB,
                *nFileSize = (int) sqlite3_column_int(stmt, 2);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -432,10 +432,10 @@ bool vp_preview_db_get_all_items_media_id(vp_preview_db_h hPreviewDB,
                nRet = sqlite3_step(stmt);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -489,12 +489,12 @@ bool vp_preview_db_insert(vp_preview_db_h hPreviewDB,
 
        sqlite3_step(stmt);
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -541,12 +541,12 @@ bool vp_preview_db_delete(vp_preview_db_h hPreviewDB)
 
        sqlite3_step(stmt);
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
index 475face..1fe0fa6 100644 (file)
@@ -94,10 +94,10 @@ static bool _vp_thumb_db_get_count(char *szMediaID, int *nCount)
                vp_dbgW("Get Thumb Count : %d", *nCount);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -142,10 +142,10 @@ static bool _vp_thumb_db_delete_items(char *szMediaID)
                nRet = sqlite3_step(stmt);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -317,10 +317,10 @@ bool vp_thumb_db_get_items(vp_thumb_db_h hThumbDB, GList ** pThumbList)
                nRet = sqlite3_step(stmt);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -365,10 +365,10 @@ bool vp_thumb_db_get_all_items_media_id(vp_thumb_db_h hThumbDB,
                nRet = sqlite3_step(stmt);
        }
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -424,12 +424,12 @@ bool vp_thumb_db_insert(vp_thumb_db_h hThumbDB, const char *szThumbPath,
 
        sqlite3_step(stmt);
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
@@ -476,12 +476,12 @@ bool vp_thumb_db_delete(vp_thumb_db_h hThumbDB)
 
        sqlite3_step(stmt);
 
-       if (stmt) {
+       //if (stmt) { // SVACE issue, pointer dereferenced compared to NULL
                sqlite3_reset(stmt);
                sqlite3_clear_bindings(stmt);
                sqlite3_finalize(stmt);
                stmt = NULL;
-       }
+       //}
 
        if (szSql) {
                sqlite3_free(szSql);
index 53f6488..6a16847 100644 (file)
@@ -586,12 +586,12 @@ bool vp_media_contents_refresh_db(const char *szMediaID)
                return FALSE;
        }
 
-       int nRet = MEDIA_CONTENT_ERROR_NONE;
-       nRet = media_info_refresh_metadata_to_db(szMediaID);
+       /* int nRet = MEDIA_CONTENT_ERROR_NONE;
+       nRet = media_info_refresh_metadata_to_db(szMediaID); // Deprecated API, Parent function not called.
        if (nRet != MEDIA_CONTENT_ERROR_NONE) {
                VideoLogError("media_info_refresh_metadata_to_db fail : %d", nRet);
                return FALSE;
-       }
+       } */
        return TRUE;
 }
 
@@ -2088,11 +2088,11 @@ bool vp_media_contents_set_location_tag(const char *szFilePath,
                goto Exception;
        }
 
-       nRet = media_info_set_location_tag(pMediaHandle, pLocation);
+       /* nRet = media_info_set_location_tag(pMediaHandle, pLocation); // Deprecated API, Parent function not called.
        if (nRet != MEDIA_CONTENT_ERROR_NONE) {
                VideoLogError("media_info_set_location_tag is fail : 0x%x", nRet);
                goto Exception;
-       }
+       } */
 
        nRet = media_info_update_to_db(pMediaHandle);
        if (nRet != MEDIA_CONTENT_ERROR_NONE) {
@@ -2190,11 +2190,11 @@ bool vp_media_contents_get_location_tag(const char *szFilePath,
                goto Exception;
        }
 
-       nRet = media_info_get_location_tag(pMediaHandle, &szLocation);
+       /* nRet = media_info_get_location_tag(pMediaHandle, &szLocation); // Deprecated API, Parent function not called.
        if (nRet != MEDIA_CONTENT_ERROR_NONE) {
                VideoLogError("media_info_get_location_tag is fail : 0x%x", nRet);
                goto Exception;
-       }
+       } */
 
        VP_STRDUP(*szLocationTag, szLocation);
        VP_FREE(szLocation);
@@ -2289,11 +2289,11 @@ bool vp_media_contents_set_weahter_tag(const char *szFilePath,
                goto Exception;
        }
 
-       nRet = media_info_set_weather(pMediaHandle, pWeather);
+       /* nRet = media_info_set_weather(pMediaHandle, pWeather); // Deprecated API, Parent function not called.
        if (nRet != MEDIA_CONTENT_ERROR_NONE) {
                VideoLogError("media_info_set_weather is fail : 0x%x", nRet);
                goto Exception;
-       }
+       } */
 
        nRet = media_info_update_to_db(pMediaHandle);
        if (nRet != MEDIA_CONTENT_ERROR_NONE) {
@@ -2390,11 +2390,11 @@ bool vp_media_contents_get_weahter_tag(const char *szFilePath,
                goto Exception;
        }
 
-       nRet = media_info_get_weather(pMediaHandle, &szWeather);
+       /* nRet = media_info_get_weather(pMediaHandle, &szWeather); // Deprecated API, Parent function not called.
        if (nRet != MEDIA_CONTENT_ERROR_NONE) {
                VideoLogError("media_info_get_weather is fail : 0x%x", nRet);
                goto Exception;
-       }
+       } */
 
        VP_STRDUP(*szWeatherTag, szWeather);
        VP_FREE(szWeather);
index f0fd270..7aa4121 100644 (file)
@@ -30,6 +30,7 @@
 #include "vp-util.h"
 
 #define CAMERA_FOLDER_PATH     "/opt/usr/media/Camera"
+#define MEDIA_LAST_PLAYED_TIME "last_played_time"
 
 typedef struct _storage_rec_t storage_rec_s;
 
@@ -1193,7 +1194,7 @@ void mp_util_svc_set_video_last_played_time_by_url(char *szMediaUri,
                        VideoLogError("Fail to get pVideoMetaHandle.");
                } else {
                        if (pVideoMetaHandle) {
-                               video_meta_update_to_db(pVideoMetaHandle);
+                               // video_meta_update_to_db(pVideoMetaHandle); // Deprecated API, Parent function not called.
                                video_meta_destroy(pVideoMetaHandle);
                        } else {
                                VideoLogError("No exist pVideoMetaHandle");