[ITC][metadata-editor][ACR-1569][Added Support for WAV, FLAC and OGG format] 84/239084/2
authorPriya Kohli <priya.kohli@samsung.com>
Tue, 21 Jul 2020 14:40:45 +0000 (20:10 +0530)
committershobhit verma <shobhit.v@samsung.com>
Tue, 21 Jul 2020 14:46:04 +0000 (14:46 +0000)
Change-Id: Ia2c2df5faaa1146f919d438365cbed4d5cb98ae6
Signed-off-by: Priya Kohli <priya.kohli@samsung.com>
scripts_tpk/spec.sh
src/itc/metadata-editor/ITs-metadata-editor-common.h
src/itc/metadata-editor/ITs-metadata-editor.c
src/itc/metadata-editor/metadata_editor_audio.flac [new file with mode: 0755]
src/itc/metadata-editor/metadata_editor_audio.ogg [new file with mode: 0644]
src/itc/metadata-editor/metadata_editor_audio.wav [new file with mode: 0755]

index 63a5dd5582b773e564a2d40e9c12fbb4628f37a5..f8ff86053b7fca63fbbce1453c8fc4aaf9582561 100755 (executable)
@@ -262,6 +262,9 @@ case "$1" in
                        cp metadata_editor_video2.MP4 $APP_DATA_DIR/metadata_editor_video2.MP4
                        cp metadata_editor_audio.MP3 $APP_DATA_DIR/metadata_editor_audio.MP3
                        cp metadata_editor_picture.JPG $APP_DATA_DIR/metadata_editor_picture.JPG
+                       cp metadata_editor_audio.wav $APP_DATA_DIR/metadata_editor_audio.wav
+                       cp metadata_editor_audio.flac $APP_DATA_DIR/metadata_editor_audio.flac
+                       cp metadata_editor_audio.ogg $APP_DATA_DIR/metadata_editor_audio.ogg
                        chown -R 5000:5000 $APP_DATA_DIR
                        chmod -R 777 $APP_DATA_DIR
                        chsmack -a "User::App::Shared" $APP_DATA_DIR/*
index c54026f9b5cc6717679b510518c61f703181f760..154a3ca93efb6ffb49de7c71d3a13cca4792fc57 100755 (executable)
@@ -36,6 +36,9 @@ bool                          g_bMetadataEditorCreation;
 #define MEDIA_VIDEO_PATH                                               "metadata_editor_video.MP4"
 #define MEDIA_AUDIO_PATH                                               "metadata_editor_audio.MP3"
 #define MEDIA_PICTURE_PATH                                             "metadata_editor_picture.JPG"
+#define MEDIA_WAV_PATH                                                 "metadata_editor_audio.wav"
+#define MEDIA_FLAC_PATH                                                        "metadata_editor_audio.flac"
+#define MEDIA_OGG_PATH                                                 "metadata_editor_audio.ogg"
 
 #define START_TEST {\
        FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\
@@ -49,4 +52,4 @@ bool MetadataEditorAppendToAppDataPath(char* pInputPath, char* pFinalPath);
 
 /** @} */ //end of itc-metadata-editor
 
-#endif  //_ITS_METADATA_EDITOR_COMMON_H_
\ No newline at end of file
+#endif  //_ITS_METADATA_EDITOR_COMMON_H_
index 01f403b6e3221cadbec00af72d0f08e92c36f4c2..99194950e898f608296073e4b1073b99e8ac9395 100755 (executable)
 //& set: MetadataEditor
 
  metadata_editor_attr_e g_attribute[] = {
-    METADATA_EDITOR_ATTR_ARTIST,                               
-       METADATA_EDITOR_ATTR_TITLE,                                     
-       METADATA_EDITOR_ATTR_ALBUM,                                     
-       METADATA_EDITOR_ATTR_GENRE,                                     
-       METADATA_EDITOR_ATTR_AUTHOR,                            
-       METADATA_EDITOR_ATTR_COPYRIGHT,                         
-       METADATA_EDITOR_ATTR_DATE,                                      
-       METADATA_EDITOR_ATTR_DESCRIPTION,                       
-       METADATA_EDITOR_ATTR_COMMENT,                           
-       METADATA_EDITOR_ATTR_TRACK_NUM,                         
-       METADATA_EDITOR_ATTR_CONDUCTOR,                         
+    METADATA_EDITOR_ATTR_ARTIST,
+       METADATA_EDITOR_ATTR_TITLE,
+       METADATA_EDITOR_ATTR_ALBUM,
+       METADATA_EDITOR_ATTR_GENRE,
+       METADATA_EDITOR_ATTR_AUTHOR,
+       METADATA_EDITOR_ATTR_COPYRIGHT,
+       METADATA_EDITOR_ATTR_DATE,
+       METADATA_EDITOR_ATTR_DESCRIPTION,
+       METADATA_EDITOR_ATTR_COMMENT,
+       METADATA_EDITOR_ATTR_TRACK_NUM,
+       METADATA_EDITOR_ATTR_CONDUCTOR,
        METADATA_EDITOR_ATTR_UNSYNCLYRICS
 };
 
  * @description                Called before each test
  * @parameter          NA
  * @return                     NA
- */ 
+ */
 void ITs_metadata_editor_startup(void)
 {
-       struct stat stBuff;   
+       struct stat stBuff;
        if ( stat(ERR_LOG, &stBuff) == 0 )
        {
                remove(ERR_LOG);
@@ -53,30 +53,30 @@ void ITs_metadata_editor_startup(void)
        char szAudioFilePath[PATH_LEN] = {0,};
 
        int nRet = metadata_editor_create(&g_hMetadataEditorHandle );
-       
+
        if ( nRet != METADATA_EDITOR_ERROR_NONE )
        {
                FPRINTF("[Line : %d][%s] metadata_editor_create failed\\n", __LINE__, API_NAMESPACE);
                Metadata_EditorGetError(nRet);
                return;
-       }       
+       }
 
        if ( false == MetadataEditorAppendToAppDataPath(MEDIA_AUDIO_PATH, szAudioFilePath) )
        {
                FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
                metadata_editor_destroy(g_hMetadataEditorHandle);
                return;
-       }               
+       }
 
        nRet = metadata_editor_set_path(g_hMetadataEditorHandle, szAudioFilePath);
-       
+
        if ( nRet != METADATA_EDITOR_ERROR_NONE )
        {
                FPRINTF("[Line : %d][%s] metadata_editor_set_path failed\\n", __LINE__, API_NAMESPACE);
                metadata_editor_destroy(g_hMetadataEditorHandle);
                Metadata_EditorGetError(nRet);
                return;
-       }       
+       }
 
        return;
 }
@@ -87,17 +87,17 @@ void ITs_metadata_editor_startup(void)
  * @description                Called after each test
  * @parameter          NA
  * @return                     NA
- */ 
+ */
 void ITs_metadata_editor_cleanup(void)
 {
        int nRet = metadata_editor_destroy(g_hMetadataEditorHandle);
-               
+
        if ( nRet != METADATA_EDITOR_ERROR_NONE )
        {
                FPRINTF("[Line : %d][%s] metadata_editor_destroy failed\\n", __LINE__, API_NAMESPACE);
                Metadata_EditorGetError(nRet);
                return;
-       }       
+       }
        return;
 }
 
@@ -127,8 +127,9 @@ int ITc_metadata_editor_create_destroy_p(void)
 {
        START_TEST;
        metadata_editor_h hMetadata;
+
        int nRet = metadata_editor_create(&hMetadata);
-       PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_create", Metadata_EditorGetError(nRet));        
+       PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_create", Metadata_EditorGetError(nRet));
 
        char szAudioFilePath[PATH_LEN] = {0,};
        if ( false == MetadataEditorAppendToAppDataPath(MEDIA_AUDIO_PATH, szAudioFilePath) )
@@ -136,13 +137,47 @@ int ITc_metadata_editor_create_destroy_p(void)
                FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
                metadata_editor_destroy(hMetadata);
                return 1;
-       }               
+       }
 
        nRet = metadata_editor_set_path(hMetadata, szAudioFilePath);
-       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));  
+       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
+
+       char szWavFilePath[PATH_LEN] = {0,};
+       if ( false == MetadataEditorAppendToAppDataPath(MEDIA_WAV_PATH, szWavFilePath) )
+       {
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               metadata_editor_destroy(g_hMetadataEditorHandle);
+               return 1;
+       }
+
+       nRet = metadata_editor_set_path(hMetadata, szWavFilePath);
+       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
+
+       char szFlacFilePath[PATH_LEN] = {0,};
+       if ( false == MetadataEditorAppendToAppDataPath(MEDIA_FLAC_PATH, szFlacFilePath) )
+       {
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               metadata_editor_destroy(g_hMetadataEditorHandle);
+               return 1;
+       }
+
+       nRet = metadata_editor_set_path(hMetadata, szFlacFilePath);
+       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
+
+       char szOggFilePath[PATH_LEN] = {0,};
+       if ( false == MetadataEditorAppendToAppDataPath(MEDIA_OGG_PATH, szOggFilePath) )
+       {
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               metadata_editor_destroy(g_hMetadataEditorHandle);
+               return 1;
+       }
+
+       nRet = metadata_editor_set_path(hMetadata, szOggFilePath);
+       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(hMetadata));
 
        nRet = metadata_editor_destroy(hMetadata);
-       PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_destroy", Metadata_EditorGetError(nRet));       
+       PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_destroy", Metadata_EditorGetError(nRet));
+
        return 0;
 }
 
@@ -154,7 +189,7 @@ int ITc_metadata_editor_create_destroy_p(void)
  * @author                     SRID(a.ankush)
  * @reviewer                   SRID(gupta.sanjay)
  * @type                                       auto
- * @description                                Sets a file path for meta-data extraction. 
+ * @description                                Sets a file path for meta-data extraction.
  * @scenario                           Before getting artwork of file need to set file path.
  * @apicovered                         metadata_editor_set_path
  * @passcase                           When metadata_editor_set_path is successful
@@ -165,24 +200,55 @@ int ITc_metadata_editor_create_destroy_p(void)
 int ITc_metadata_editor_set_path_p(void)
 {
        START_TEST;
-       char szAudioFilePath[PATH_LEN] = {0,};
-
 
+       char szAudioFilePath[PATH_LEN] = {0,};
        if ( false == MetadataEditorAppendToAppDataPath(MEDIA_AUDIO_PATH, szAudioFilePath) )
        {
                FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
                return 1;
-       }       
+       }
 
        int nRet = metadata_editor_set_path(g_hMetadataEditorHandle,szAudioFilePath );
        PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet));
 
-       
+       char szWavFilePath[PATH_LEN] = {0,};
+       if ( false == MetadataEditorAppendToAppDataPath(MEDIA_WAV_PATH, szWavFilePath) )
+       {
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               metadata_editor_destroy(g_hMetadataEditorHandle);
+               return 1;
+       }
+
+       nRet = metadata_editor_set_path(g_hMetadataEditorHandle,szWavFilePath );
+        PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet));
+
+       char szFlacFilePath[PATH_LEN] = {0,};
+       if ( false == MetadataEditorAppendToAppDataPath(MEDIA_FLAC_PATH, szFlacFilePath) )
+       {
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               metadata_editor_destroy(g_hMetadataEditorHandle);
+               return 1;
+       }
+
+       nRet = metadata_editor_set_path(g_hMetadataEditorHandle, szFlacFilePath);
+       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(g_hMetadataEditorHandle));
+
+       char szOggFilePath[PATH_LEN] = {0,};
+       if ( false == MetadataEditorAppendToAppDataPath(MEDIA_OGG_PATH, szOggFilePath) )
+       {
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               metadata_editor_destroy(g_hMetadataEditorHandle);
+               return 1;
+       }
+
+       nRet = metadata_editor_set_path(g_hMetadataEditorHandle, szOggFilePath);
+       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(g_hMetadataEditorHandle));
+
        return 0;
 
 }
 
-//& purpose: Gets meta-data and sets meta-data of multimedia file.  
+//& purpose: Gets meta-data and sets meta-data of multimedia file.
 //& type: auto
 /**
  * @testcase                   ITc_metadata_editor_set_get_metadata_p
@@ -190,8 +256,8 @@ int ITc_metadata_editor_set_path_p(void)
  * @author             SRID(a.ankush)
  * @reviewer           SRID(gupta.sanjay)
  * @type                               auto
- * @description                        Gets meta-data and sets meta-data of multimedia file.   
- * @scenario                   Before getting artwork of file need to set file path.                                                   
+ * @description                        Gets meta-data and sets meta-data of multimedia file.
+ * @scenario                   Before getting artwork of file need to set file path.
  * @apicovered                 metadata_editor_get_metadata ,metadata_editor_set_metadata.
  * @passcase                   When metadata_editor_set_metadata & metadata_editor_get_metadata is successful
  * @failcase                   If metadata_editor_set_metadata or metadata_editor_get_metadata fails
@@ -208,11 +274,11 @@ int ITc_metadata_editor_set_get_metadata_p(void)
        int i = 0;
        for( i = 0; i < (sizeof(g_attribute)/sizeof(int)); ++i)
        {
-               nRet = metadata_editor_set_metadata(g_hMetadataEditorHandle, g_attribute[i], input_data );      
+               nRet = metadata_editor_set_metadata(g_hMetadataEditorHandle, g_attribute[i], input_data );
                PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_metadata", Metadata_EditorGetError(nRet));
 
                nRet = metadata_editor_get_metadata(g_hMetadataEditorHandle, g_attribute[i], &pMetadataInfo );
-               
+
                //check for value mis-match
                if ( 0 != strcmp(input_data, pMetadataInfo) )
                {
@@ -220,14 +286,14 @@ int ITc_metadata_editor_set_get_metadata_p(void)
                        FREE_MEMORY(pMetadataInfo);
                        return 1;
                }
-               
+
                FREE_MEMORY(pMetadataInfo);
                PRINT_RESULT(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_get_metadata", Metadata_EditorGetError(nRet));
        }
        return 0;
 }
 
-//& purpose: Updates meta-data of multimedia file.  
+//& purpose: Updates meta-data of multimedia file.
 //& type: auto
 /**
  * @testcase                   ITc_metadata_editor_update_metadata_p
@@ -235,9 +301,9 @@ int ITc_metadata_editor_set_get_metadata_p(void)
  * @author             SRID(a.ankush)
  * @reviewer           SRID(gupta.sanjay)
  * @type                               auto
- * @description                        Updates meta-data of multimedia file.   
+ * @description                        Updates meta-data of multimedia file.
  * @scenario                   Before getting artwork of file need to set file path\n
- *                                             Set or change meta-data attribute of multimedia file.                                                   
+ *                                             Set or change meta-data attribute of multimedia file.
  * @apicovered                 metadata_editor_set_metadata,metadata_editor_update_metadata.
  * @passcase                   When metadata_editor_set_metadata and metadata_editor_update_metadata is successful.
  * @failcase                   If metadata_editor_set_metadata and metadata_editor_update_metadata fails.
@@ -257,7 +323,7 @@ int ITc_metadata_editor_update_metadata_p(void)
        return 0;
 }
 
-//& purpose: Append the picture to the media file.  
+//& purpose: Append the picture to the media file.
 //& type: auto
 /**
  * @testcase                   ITc_metadata_editor_get_picture_p
@@ -265,8 +331,8 @@ int ITc_metadata_editor_update_metadata_p(void)
  * @author             SRID(a.ankush)
  * @reviewer           SRID(gupta.sanjay)
  * @type                               auto
- * @description                        Append the picture to the media file.   
- * @scenario                   Before getting artwork of file need to set file path.                                   
+ * @description                        Append the picture to the media file.
+ * @scenario                   Before getting artwork of file need to set file path.
  * @apicovered                 metadata_editor_append_picture.
  * @passcase                   When metadata_editor_append_picture is successful.
  * @failcase                   If metadata_editor_append_picture fails.
@@ -297,7 +363,7 @@ int ITc_metadata_editor_append_picture_p(void)
        return 0;
 }
 
-//& purpose: Get the picture in the multimedia file.  
+//& purpose: Get the picture in the multimedia file.
 //& type: auto
 /**
  * @testcase                   ITc_metadata_editor_get_picture_p
@@ -305,7 +371,7 @@ int ITc_metadata_editor_append_picture_p(void)
  * @author             SRID(a.ankush)
  * @reviewer           SRID(gupta.sanjay)
  * @type                               auto
- * @description                        Get the picture in the multimedia file.   
+ * @description                        Get the picture in the multimedia file.
  * @scenario                   Before getting artwork of file need to set file path\n
  *                                             Get the picture index attribute from the multimedia file.
  * @apicovered                 metadata_editor_get_metadata,metadata_editor_get_picture.
@@ -335,7 +401,7 @@ int ITc_metadata_editor_get_picture_p(void)
        }
        void *picture_val = NULL;
        nRet = metadata_editor_set_path(g_hMetadata_local, szAudioFilePath);
-       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(g_hMetadata_local));  
+       PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_set_path", Metadata_EditorGetError(nRet), metadata_editor_destroy(g_hMetadata_local));
 
        nRet = metadata_editor_get_metadata(g_hMetadata_local, attribute, &picture_index);
        PRINT_RESULT_CLEANUP(METADATA_EDITOR_ERROR_NONE, nRet, "metadata_editor_get_metadata", Metadata_EditorGetError(nRet),metadata_editor_destroy(g_hMetadata_local));
@@ -355,16 +421,16 @@ int ITc_metadata_editor_get_picture_p(void)
        return 0;
 }
 
-//& purpose: Remove artwork image from media file.  
+//& purpose: Remove artwork image from media file.
 //& type: auto
 /**
- * @testcase                   ITc_metadata_editor_get_picture_p
+ * @testcase                   ITc_metadata_editor_remove_picture_p
  * @since_tizen                2.3
  * @author             SRID(a.ankush)
  * @reviewer           SRID(gupta.sanjay)
  * @type                               auto
- * @description                        Remove artwork image from media file.   
- * @scenario                   Before getting artwork of file need to set file path.                                   
+ * @description                        Remove artwork image from media file.
+ * @scenario                   Before getting artwork of file need to set file path.
  * @apicovered                 metadata_editor_remove_picture.
  * @passcase                   When metadata_editor_remove_picture is successful.
  * @failcase                   If metadata_editor_remove_picture fails.
@@ -383,4 +449,4 @@ int ITc_metadata_editor_remove_picture_p(void)
 }
 
 /** @} */ //end of itc-metadata-editor
-/** @} */ //end of itc-metadata-editor-testcases
\ No newline at end of file
+/** @} */ //end of itc-metadata-editor-testcases
diff --git a/src/itc/metadata-editor/metadata_editor_audio.flac b/src/itc/metadata-editor/metadata_editor_audio.flac
new file mode 100755 (executable)
index 0000000..b574de2
Binary files /dev/null and b/src/itc/metadata-editor/metadata_editor_audio.flac differ
diff --git a/src/itc/metadata-editor/metadata_editor_audio.ogg b/src/itc/metadata-editor/metadata_editor_audio.ogg
new file mode 100644 (file)
index 0000000..563985d
Binary files /dev/null and b/src/itc/metadata-editor/metadata_editor_audio.ogg differ
diff --git a/src/itc/metadata-editor/metadata_editor_audio.wav b/src/itc/metadata-editor/metadata_editor_audio.wav
new file mode 100755 (executable)
index 0000000..99fc1c2
Binary files /dev/null and b/src/itc/metadata-editor/metadata_editor_audio.wav differ