[UTC][ITC][ACR-1506][STREAMRECORDER] add feature checking 44/229644/4
authorHyunsoo Park <hance.park@samsung.com>
Thu, 2 Apr 2020 11:26:20 +0000 (20:26 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Mon, 6 Apr 2020 09:32:06 +0000 (18:32 +0900)
Change-Id: Ideca51754bc947d4b4242402031943bd20cced84
Signed-off-by: Hyunsoo Park <hance.park@samsung.com>
src/itc/mediastreamrecorder/ITs-mediastreamrecorder-callback.c
src/itc/mediastreamrecorder/ITs-mediastreamrecorder-common.c
src/itc/mediastreamrecorder/ITs-mediastreamrecorder-common.h
src/itc/mediastreamrecorder/ITs-mediastreamrecorder.c
src/utc/streamrecorder/utc_streamrecorder.c
src/utc/streamrecorder/utc_streamrecorder_buffer.c
src/utc/streamrecorder/utc_streamrecorder_callback.c
src/utc/streamrecorder/utc_streamrecorder_lifecycle.c

index 2ae514f3f8c4fd80a73619a3d24f9f3f4f051413..af1136a8a755fff5571b59529058be08c8c36beb 100755 (executable)
@@ -184,6 +184,18 @@ void ITs_mediastreamrecorder_callback_startup(void)
 #if DEBUG
        FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_mediastreamrecorder_callback_startup\\n", __LINE__, API_NAMESPACE);
 #endif
+       if ( !TCTCheckSystemInfoFeatureSupported(STREAMRECORDER_FEATURE, API_NAMESPACE) )
+       {
+               if ( streamrecorder_create(&g_hRecorder) != TIZEN_ERROR_NOT_SUPPORTED )
+               {
+                       g_bMismatch = true;
+               }
+               else
+               {
+                       g_bStreamRecorderNotSupported = true;
+               }
+               return;
+       }
 
        g_bMediaStrRecorderConnect= true;
        int nRet = streamrecorder_create(&g_hCallRecorder);
index ccbea303dfe62c0492a692859f297f5fa63edd01..12ec62b3c36ff0f39cdcfe57140b579f1aaa6d92 100644 (file)
@@ -289,7 +289,7 @@ int CreatePacketAndFormatData(streamrecorder_h g_hRecorder)
 
                read_sum = 0;
                media_packet_get_video_plane_data_ptr(g_hMediaPkt[nCounter], 0, (void**)&pszPtr);
-               FPRINTF("[Line : %d][%s] video plane info : 0 %x\n", __LINE__, API_NAMESPACE, pszPtr);
+               FPRINTF("[Line : %d][%s] video plane info : 0 %p\n", __LINE__, API_NAMESPACE, pszPtr);
                while (total_ysize - read_sum)
                {
                        read_sum += fread(pszPtr + read_sum, 1, total_ysize - read_sum, pvFile);
@@ -309,7 +309,7 @@ int CreatePacketAndFormatData(streamrecorder_h g_hRecorder)
                total_read += read_sum;
                read_sum = 0;
                media_packet_get_video_plane_data_ptr(g_hMediaPkt[nCounter], 1, (void**)&pszPtr);
-               FPRINTF("[Line : %d][%s] video plane info : 1 %x\n", __LINE__, API_NAMESPACE, pszPtr);
+               FPRINTF("[Line : %d][%s] video plane info : 1 %p\n", __LINE__, API_NAMESPACE, pszPtr);
                while (total_uvsize - read_sum)
                {
                        read_sum += fread(pszPtr + read_sum, 1, total_uvsize - read_sum, pvFile);
@@ -330,7 +330,7 @@ int CreatePacketAndFormatData(streamrecorder_h g_hRecorder)
                total_read += read_sum;
                read_sum = 0;
                media_packet_get_video_plane_data_ptr(g_hMediaPkt[nCounter], 2, (void**)&pszPtr);
-               FPRINTF("[Line : %d][%s] video plane info : 2 %x\n", __LINE__, API_NAMESPACE, pszPtr);
+               FPRINTF("[Line : %d][%s] video plane info : 2 %p\n", __LINE__, API_NAMESPACE, pszPtr);
                while (total_uvsize - read_sum)
                {
                        read_sum += fread(pszPtr + read_sum, 1, total_uvsize - read_sum, pvFile);
@@ -428,7 +428,7 @@ int CreatePacketAndFormatDataCall(streamrecorder_h g_hCallRecorder)
 
                read_sum = 0;
                media_packet_get_video_plane_data_ptr(g_hMediaPkt[nCounter], 0, (void**)&pszPtr);
-               FPRINTF("[Line : %d][%s] video plane info : 0 %x\n", __LINE__, API_NAMESPACE, pszPtr);
+               FPRINTF("[Line : %d][%s] video plane info : 0 %p\n", __LINE__, API_NAMESPACE, pszPtr);
                while (total_ysize - read_sum)
                {
                        read_sum += fread(pszPtr + read_sum, 1, total_ysize - read_sum, pvFile);
@@ -449,7 +449,7 @@ int CreatePacketAndFormatDataCall(streamrecorder_h g_hCallRecorder)
 
                read_sum = 0;
                media_packet_get_video_plane_data_ptr(g_hMediaPkt[nCounter], 1, (void**)&pszPtr);
-               FPRINTF("[Line : %d][%s] video plane info : 1 %x\n", __LINE__, API_NAMESPACE, pszPtr);
+               FPRINTF("[Line : %d][%s] video plane info : 1 %p\n", __LINE__, API_NAMESPACE, pszPtr);
                while (total_uvsize - read_sum)
                {
                        read_sum += fread(pszPtr + read_sum, 1, total_uvsize - read_sum, pvFile);
@@ -468,7 +468,7 @@ int CreatePacketAndFormatDataCall(streamrecorder_h g_hCallRecorder)
                }
                total_read += read_sum;
 
-               FPRINTF("[Line : %d][%s] Read data file size : %lld\\n", __LINE__, API_NAMESPACE, total_read);
+               FPRINTF("[Line : %d][%s] Read data file size : %zu\\n", __LINE__, API_NAMESPACE, total_read);
                if (media_packet_set_buffer_size(g_hMediaPkt[nCounter], total_read))
                {
                        FPRINTF("[Line : %d][%s]buf size failed\\n", __LINE__, API_NAMESPACE);
index 8428ad109ad3fa5f71dd59852283027fde7fc351..8c8941153dac69fb1b2ef28b5f1a4eb8fa330502 100755 (executable)
 #define MEDIA_PATH_AUDIO                       "short.mp3"
 #define MEDIA_FILE_PATH                                "I420_352x288.yuv"
 #define API_NAMESPACE                          "MEDIASTREAMRECORDER_ITC"
+#define STREAMRECORDER_FEATURE         "http://tizen.org/feature/multimedia.stream_recorder"
 #define SLEEP_TIME                                     3
 #define MEDIA_DUMMY_PATH                       "hello.mp4"
 #define MAX_MEDIA_PACKET_CNT           20
 
 bool g_bMediaStrRecorderConnect;
 bool g_bCheckCb;
+bool g_bStreamRecorderNotSupported;
+bool g_bMismatch;
 GMainLoop *g_pMainLoop;
 gboolean TimeoutFunction(gpointer data);
 long int g_ncount;
@@ -49,11 +52,21 @@ streamrecorder_h g_hRecorder;
 
 #define START_TEST {\
        FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\
+       if ( g_bStreamRecorderNotSupported)\
+       {\
+               FPRINTF("[Line : %d][%s] Required feature of stream recorder is not supported. So leaving test\\n", __LINE__, API_NAMESPACE);\
+               return 0;\
+       }\
+       if ( g_bMismatch )\
+       {\
+               FPRINTF("[Line : %d][%s] MediaStreaRecorder feature checker and streamrecorder_create returned different value. So leaving test\\n", __LINE__, API_NAMESPACE);\
+               return 1;\
+       }\
        if ( !g_bMediaStrRecorderConnect )\
-{\
-       FPRINTF("[Line : %d][%s] Precondition of connecting to calendar service failed so leaving test\\n", __LINE__, API_NAMESPACE);\
-       return 1;\
-}\
+       {\
+               FPRINTF("[Line : %d][%s] Precondition of connecting to stream recorder failed so leaving test\\n", __LINE__, API_NAMESPACE);\
+               return 1;\
+       }\
 }
 
 #define RUN_POLLING_LOOP {\
index ff51d4066c56df2f02824b516a102fd60163b0f6..c301e468c3241fd2786e83d1b699cbb70bef7ad8 100755 (executable)
@@ -38,10 +38,22 @@ void ITs_mediastreamrecorder_startup(void)
 #if DEBUG
        FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_mediastreamrecoder_startup\\n", __LINE__, API_NAMESPACE);
 #endif
-       
-       g_bMediaStrRecorderConnect= true;       
+       if ( !TCTCheckSystemInfoFeatureSupported(STREAMRECORDER_FEATURE, API_NAMESPACE) )
+       {
+               if ( streamrecorder_create(&g_hRecorder) != TIZEN_ERROR_NOT_SUPPORTED )
+               {
+                       g_bMismatch = true;
+               }
+               else
+               {
+                       g_bStreamRecorderNotSupported = true;
+               }
+               return;
+       }
+
+       g_bMediaStrRecorderConnect= true;
        int nRet = streamrecorder_create(&g_hRecorder);
-       if ( nRet != STREAMRECORDER_ERROR_NONE) 
+       if ( nRet != STREAMRECORDER_ERROR_NONE)
        {
                FPRINTF("[Line : %d][%s] streamrecorder_create fail in startup \\n", __LINE__, API_NAMESPACE);
                g_bMediaStrRecorderConnect = false;
index 87044155c181c901b5998b63176bfee7944004d9..3f98b3448adc46897ce429168a200359e176f6d4 100644 (file)
 #include <storage.h>
 #include <system_info.h>
 
-
 static char* media=".test_record.mp4";
 static char* media_path=NULL;
 
 static streamrecorder_h recorder = NULL;
 static int startup_ret;
+static bool is_streamrecorder_supported = false;
 
 static bool storage_device_cb(int storage_id, storage_type_e type, storage_state_e state, const char* path, void* user_data)
 {
@@ -53,6 +53,8 @@ static bool storage_device_cb(int storage_id, storage_type_e type, storage_state
  */
 void utc_streamrecorder_startup(void)
 {
+    system_info_get_platform_bool("http://tizen.org/feature/multimedia.stream_recorder", &is_streamrecorder_supported);
+
     startup_ret = STREAMRECORDER_ERROR_NONE;
     storage_foreach_device_supported(storage_device_cb,NULL);
 
@@ -95,6 +97,12 @@ void utc_streamrecorder_cleanup(void)
 int utc_streamrecorder_get_audio_channel_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     int channel = 0;
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
@@ -117,6 +125,11 @@ int utc_streamrecorder_get_audio_channel_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_audio_channel(recorder, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -137,6 +150,11 @@ int utc_streamrecorder_get_audio_channel_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_audio_channel (NULL, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -159,6 +177,12 @@ int utc_streamrecorder_get_audio_encoder_bitrate_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     int bitrate = 0;
 
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
@@ -186,6 +210,11 @@ int utc_streamrecorder_get_audio_encoder_bitrate_n1(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_get_audio_encoder_bitrate(recorder, NULL);
@@ -208,6 +237,11 @@ int utc_streamrecorder_get_audio_encoder_bitrate_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_get_audio_encoder_bitrate(NULL, NULL);
@@ -233,6 +267,11 @@ int utc_streamrecorder_get_audio_samplerate_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     int samplerate;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_get_audio_samplerate(recorder, &samplerate);
@@ -254,10 +293,14 @@ int utc_streamrecorder_get_audio_samplerate_p(void)
  */
 int utc_streamrecorder_get_audio_samplerate_n1(void)
 {
-    assert(recorder);
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_get_audio_samplerate(recorder, NULL);
@@ -279,10 +322,14 @@ int utc_streamrecorder_get_audio_samplerate_n1(void)
  */
 int utc_streamrecorder_get_audio_samplerate_n2(void)
 {
-    assert(recorder);
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
 
     ret = streamrecorder_get_audio_samplerate(NULL, NULL);
@@ -307,6 +354,11 @@ int utc_streamrecorder_get_recording_limitation_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     int value = 0;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_recording_limit(recorder, STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE, &value);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -330,6 +382,11 @@ int utc_streamrecorder_get_recording_limit_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_recording_limit(recorder, STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -353,6 +410,11 @@ int utc_streamrecorder_get_recording_limit_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_recording_limit(NULL, STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -378,6 +440,11 @@ int utc_streamrecorder_get_video_framerate_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     int value = 0;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_framerate(recorder, &value);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -399,6 +466,11 @@ int utc_streamrecorder_get_video_framerate_n1(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_framerate(recorder, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -419,6 +491,11 @@ int utc_streamrecorder_get_video_frmaerate_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_framerate(NULL, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -441,6 +518,11 @@ int utc_streamrecorder_get_video_source_format_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_video_source_format_e value;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_source_format(recorder, &value);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -462,6 +544,11 @@ int utc_streamrecorder_get_video_source_format_n1(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_source_format(recorder, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -482,6 +569,11 @@ int utc_streamrecorder_get_video_source_format_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_source_format(NULL, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -504,6 +596,11 @@ int utc_streamrecorder_get_video_encoder_bitrate_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     int value = 0;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_encoder_bitrate(recorder, &value);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -525,6 +622,11 @@ int utc_streamrecorder_get_video_encoder_bitrate_n1(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_encoder_bitrate(recorder, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -545,6 +647,11 @@ int utc_streamrecorder_get_video_encoder_bitrate_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_encoder_bitrate(NULL, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -568,6 +675,11 @@ int utc_streamrecorder_set_audio_channel_p(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -594,6 +706,11 @@ int utc_streamrecorder_set_audio_channel_n1(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_set_audio_channel(recorder, -1);
@@ -619,6 +736,11 @@ int utc_streamrecorder_set_audio_channel_n2(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_set_audio_channel(NULL, 10);
@@ -643,6 +765,11 @@ int utc_streamrecorder_set_audio_encoder_bitrate_p(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_set_audio_encoder_bitrate(recorder, 11111);
@@ -664,10 +791,14 @@ int utc_streamrecorder_set_audio_encoder_bitrate_p(void)
  */
 int utc_streamrecorder_set_audio_encoder_bitrate_n(void)
 {
-    assert(recorder);
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_set_audio_encoder_bitrate(recorder, -1);
@@ -691,6 +822,11 @@ int utc_streamrecorder_set_audio_samplerate_p(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_audio_samplerate(recorder, 11111);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -713,6 +849,11 @@ int utc_streamrecorder_set_audio_samplerate_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_set_audio_samplerate(recorder, -1);
@@ -736,6 +877,11 @@ int utc_streamrecorder_set_recording_limit_p(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_recording_limit(recorder, STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE, 1000);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -760,6 +906,11 @@ int utc_streamrecorder_set_recording_limit_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_recording_limit(recorder, STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE, -1);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -783,6 +934,11 @@ int utc_streamrecorder_set_recording_limit_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_recording_limit(NULL, STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE, 1000);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -806,6 +962,11 @@ int utc_streamrecorder_set_video_encoder_bitrate_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_encoder_bitrate(recorder, 0);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -826,6 +987,11 @@ int utc_streamrecorder_set_video_encoder_bitrate_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_encoder_bitrate(recorder, -1);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -846,6 +1012,11 @@ int utc_streamrecorder_set_video_encoder_bitrate_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_encoder_bitrate(NULL, -1);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -867,6 +1038,11 @@ int utc_streamrecorder_get_audio_encoder_p1(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     streamrecorder_audio_codec_e value;
 
     ret = streamrecorder_enable_source_buffer(recorder,STREAMRECORDER_SOURCE_AUDIO);
@@ -901,6 +1077,11 @@ int utc_streamrecorder_get_audio_encoder_p2(void)
     streamrecorder_audio_codec_e codec = STREAMRECORDER_AUDIO_CODEC_AMR;
     streamrecorder_audio_codec_e ret_codec = STREAMRECORDER_AUDIO_CODEC_AMR;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_enable_source_buffer(recorder,STREAMRECORDER_SOURCE_AUDIO);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -944,6 +1125,11 @@ int utc_streamrecorder_get_audio_encoder_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_audio_encoder(recorder, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -964,6 +1150,11 @@ int utc_streamrecorder_get_audio_encoder_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_audio_encoder(NULL, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -987,6 +1178,12 @@ int utc_streamrecorder_get_file_format_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
 
     streamrecorder_file_format_e value;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_file_format(recorder, &value);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -1007,6 +1204,11 @@ int utc_streamrecorder_get_file_format_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_file_format(recorder, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1029,6 +1231,11 @@ int utc_streamrecorder_get_video_encoder_p1(void)
     streamrecorder_video_codec_e value;
     streamrecorder_video_codec_e codec = STREAMRECORDER_VIDEO_CODEC_H263;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret |= streamrecorder_set_video_encoder(recorder, codec);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     ret = streamrecorder_get_video_encoder(recorder, &value);
@@ -1058,6 +1265,11 @@ int utc_streamrecorder_get_video_encoder_p2(void)
     streamrecorder_video_codec_e codec = STREAMRECORDER_VIDEO_CODEC_H263;
     streamrecorder_video_codec_e ret_codec = STREAMRECORDER_VIDEO_CODEC_H263;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     codec = STREAMRECORDER_VIDEO_CODEC_H263;
     ret = streamrecorder_set_video_encoder(recorder, codec);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
@@ -1091,6 +1303,11 @@ int utc_streamrecorder_get_video_encoder_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_encoder(recorder, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1111,6 +1328,11 @@ int utc_streamrecorder_get_video_encoder_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_encoder(NULL, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1134,6 +1356,11 @@ int utc_streamrecorder_get_video_resolution_p(void)
     int mHeight = 0;
     int mWidth = 0;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_resolution(recorder, &mWidth, &mHeight);
 
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
@@ -1155,6 +1382,11 @@ int utc_streamrecorder_get_video_resolution_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_resolution(recorder, NULL, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1175,6 +1407,11 @@ int utc_streamrecorder_get_video_resolution_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_video_resolution(NULL, NULL, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1197,6 +1434,11 @@ int utc_streamrecorder_set_audio_encoder_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_audio_codec_e codec = STREAMRECORDER_AUDIO_CODEC_AMR;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_audio_encoder(recorder, codec);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -1219,6 +1461,11 @@ int utc_streamrecorder_set_audio_encoder_n1(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_audio_codec_e codec = -2;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_audio_encoder(recorder, codec);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1242,6 +1489,11 @@ int utc_streamrecorder_set_audio_encoder_n2(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_audio_codec_e codec = -2;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_audio_encoder(NULL, codec);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1263,6 +1515,11 @@ int utc_streamrecorder_set_file_format_p1(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_file_format_e format = STREAMRECORDER_FILE_FORMAT_3GP;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_file_format(recorder, format);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -1293,6 +1550,11 @@ int utc_streamrecorder_get_file_format_p2(void)
     streamrecorder_file_format_e format;
     streamrecorder_file_format_e ret_format;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     format = STREAMRECORDER_FILE_FORMAT_3GP;
     ret = streamrecorder_set_file_format(recorder, format);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
@@ -1340,6 +1602,11 @@ int utc_streamrecorder_set_file_format_n(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_file_format_e format = -1;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_file_format(recorder, format);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1360,6 +1627,11 @@ int utc_streamrecorder_set_filename_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_filename(recorder, "/mnt/nfs/test.test");
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -1380,6 +1652,11 @@ int utc_streamrecorder_set_filename_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_filename(recorder, NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1401,6 +1678,11 @@ int utc_streamrecorder_set_video_encoder_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_video_codec_e codec = STREAMRECORDER_VIDEO_CODEC_MPEG4;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_encoder(recorder, codec);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -1423,6 +1705,11 @@ int utc_streamrecorder_set_video_encoder_n1(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_video_codec_e codec = -1;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_encoder(recorder, codec);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1445,6 +1732,11 @@ int utc_streamrecorder_set_video_encoder_n2(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_video_codec_e codec = -1;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_encoder(NULL, codec);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1468,6 +1760,11 @@ int utc_streamrecorder_set_video_resolution_p(void)
     int width = 1280;
     int height = 720;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_resolution(recorder, width, height);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     return 0;
@@ -1487,6 +1784,11 @@ int utc_streamrecorder_set_video_resolution_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_resolution(recorder, 0, 0);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1508,6 +1810,11 @@ int utc_streamrecorder_set_video_resolution_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_resolution(NULL, 1280, 720);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1532,6 +1839,11 @@ int utc_streamrecorder_get_filename_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     char* f_name = NULL;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_filename(recorder, "/mnt/nfs/test.test");
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -1561,6 +1873,12 @@ int utc_streamrecorder_get_filename_p(void)
 int utc_streamrecorder_get_filename_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_get_filename(recorder,NULL);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
@@ -1581,6 +1899,12 @@ int utc_streamrecorder_set_video_source_format_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_video_source_format_e format = STREAMRECORDER_VIDEO_SOURCE_FORMAT_NV12;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_source_format(recorder,format);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
     return 0;
@@ -1601,6 +1925,12 @@ int utc_streamrecorder_set_video_source_format_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
     streamrecorder_video_source_format_e format = STREAMRECORDER_VIDEO_SOURCE_FORMAT_NV12;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_source_format(NULL,format);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
     return 0;
@@ -1622,6 +1952,11 @@ int utc_streamrecorder_set_video_framerate_p(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     int value = 20;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_framerate(recorder, value);
     assert_eq(ret, STREAMRECORDER_ERROR_NONE);
 
@@ -1644,6 +1979,11 @@ int utc_streamrecorder_set_video_framerate_n(void)
     int ret = STREAMRECORDER_ERROR_NONE;
     int framerate = 30;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     ret = streamrecorder_set_video_framerate(NULL, framerate);
     assert_eq(ret, STREAMRECORDER_ERROR_INVALID_PARAMETER);
 
index 00afb3611eaa08a0504221a68ee25af7aa276921..dbbb8935a6167b33f01fbe6b6d84b29ad15cda79 100644 (file)
@@ -25,6 +25,7 @@ static char* media_path=NULL;
 
 static streamrecorder_h recorder = NULL;
 static int startup_ret;
+static bool is_streamrecorder_supported = false;
 static media_format_h media_format = NULL;
 static media_packet_h out_pkt = NULL;
 static media_format_h media_audio_format = NULL;
@@ -59,6 +60,7 @@ void utc_streamrecorder_buffer_startup(void)
 {
     startup_ret = STREAMRECORDER_ERROR_NONE;
     storage_foreach_device_supported(storage_device_cb,NULL);
+    system_info_get_platform_bool("http://tizen.org/feature/multimedia.stream_recorder", &is_streamrecorder_supported);
     startup_ret = streamrecorder_create(&recorder);
 
 }
@@ -102,6 +104,11 @@ int utc_streamrecorder_push_stream_buffer_p(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     if (media_format_create(&media_format)) {
@@ -174,6 +181,11 @@ int utc_streamrecorder_push_stream_buffer_n(void)
 
     int ret = STREAMRECORDER_ERROR_NONE;
 
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
     if (media_format_create(&media_format)) {
         assert_neq(0, 0);
index 377f82e83605c0df73b0f9e907400869ea01f355..71574da78470921d5bc918b2a66043d7e8c8788d 100644 (file)
@@ -20,7 +20,7 @@
 
 static streamrecorder_h recorder = NULL;
 static int startup_ret;
-
+static bool is_streamrecorder_supported = false;
 
 /**
  * @function           utc_streamrecorder_callback_startup
@@ -36,6 +36,9 @@ void utc_streamrecorder_callback_startup(void)
 {
     /* start of TC */
     startup_ret = STREAMRECORDER_ERROR_NONE;
+
+    system_info_get_platform_bool("http://tizen.org/feature/multimedia.stream_recorder", &is_streamrecorder_supported);
+
     startup_ret = streamrecorder_create(&recorder);
     startup_ret |= streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
 
@@ -104,6 +107,12 @@ int utc_streamrecorder_foreach_supported_audio_encoder_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_audio_encoder(recorder, _audio_encoder_cb, NULL);
@@ -126,6 +135,12 @@ int utc_streamrecorder_foreach_supported_audio_encoder_n(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_audio_encoder(recorder, NULL, NULL);
@@ -148,6 +163,12 @@ int utc_streamrecorder_foreach_supported_file_format_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_file_format(recorder, _file_format_cb, NULL);
@@ -170,6 +191,12 @@ int utc_streamrecorder_foreach_supported_file_format_n1(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_file_format(recorder, NULL, NULL);
@@ -192,6 +219,12 @@ int utc_streamrecorder_foreach_supported_file_format_n2(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_file_format(NULL, NULL, NULL);
@@ -216,6 +249,12 @@ int utc_streamrecorder_foreach_supported_video_encoder_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_video_encoder(recorder, _video_encoder_cb, NULL);
@@ -238,6 +277,12 @@ int utc_streamrecorder_foreach_supported_video_encoder_n1(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_video_encoder(NULL, NULL, NULL);
@@ -259,6 +304,12 @@ int utc_streamrecorder_foreach_supported_video_encoder_n2(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_video_encoder(recorder, NULL, NULL);
@@ -281,6 +332,12 @@ int utc_streamrecorder_foreach_supported_video_resolution_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_video_resolution(recorder, _video_resolution_cb, NULL);
@@ -303,6 +360,12 @@ int utc_streamrecorder_foreach_supported_video_resolution_n(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_foreach_supported_video_resolution(recorder, NULL, NULL);
@@ -326,6 +389,12 @@ int utc_streamrecorder_set_buffer_consume_completed_cb_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_buffer_consume_completed_cb(recorder, _consume_completed_cb, NULL);
@@ -348,6 +417,12 @@ int utc_streamrecorder_set_buffer_consume_completed_cb_n1(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_buffer_consume_completed_cb(recorder, NULL, NULL);
@@ -371,6 +446,12 @@ int utc_streamrecorder_set_buffer_consume_completed_cb_n2(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_buffer_consume_completed_cb(NULL, NULL, NULL);
@@ -393,6 +474,12 @@ int utc_streamrecorder_set_recording_limit_reached_cb_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_recording_limit_reached_cb(recorder, _limit_reached_cb, NULL);
@@ -415,6 +502,12 @@ int utc_streamrecorder_set_recording_limit_reached_cb_n1(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_recording_limit_reached_cb(recorder, NULL, NULL);
@@ -438,6 +531,12 @@ int utc_streamrecorder_set_recording_limit_reached_cb_n2(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_recording_limit_reached_cb(NULL, NULL, NULL);
@@ -462,6 +561,12 @@ int utc_streamrecorder_set_recording_status_cb_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_recording_status_cb(recorder, _recording_status_cb, NULL);
@@ -484,6 +589,12 @@ int utc_streamrecorder_set_recording_status_cb_n1(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_recording_status_cb(recorder, NULL, NULL);
@@ -506,6 +617,12 @@ int utc_streamrecorder_set_recording_status_cb_n2(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_recording_status_cb(NULL, NULL, NULL);
@@ -529,6 +646,12 @@ int utc_streamrecorder_set_notify_cb_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_notify_cb(recorder, _notify_cb, NULL);
@@ -551,6 +674,12 @@ int utc_streamrecorder_set_notify_cb_n1(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_notify_cb(recorder, NULL, NULL);
@@ -573,6 +702,12 @@ int utc_streamrecorder_set_notify_cb_n2(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_notify_cb(NULL, NULL, NULL);
@@ -596,6 +731,12 @@ int utc_streamrecorder_set_error_cb_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_error_cb(recorder, _error_cb, NULL);
@@ -618,6 +759,12 @@ int utc_streamrecorder_set_error_cb_n1(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_error_cb(recorder, NULL, NULL);
@@ -639,6 +786,12 @@ int utc_streamrecorder_set_error_cb_n1(void)
 int utc_streamrecorder_set_error_cb_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_set_error_cb(NULL, NULL, NULL);
@@ -662,6 +815,12 @@ int utc_streamrecorder_unset_recording_limit_reached_cb_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_recording_limit_reached_cb(recorder);
@@ -683,6 +842,12 @@ int utc_streamrecorder_unset_recording_limit_reached_cb_p(void)
 int utc_streamrecorder_unset_recording_limit_reached_cb_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_recording_limit_reached_cb(NULL);
@@ -704,6 +869,12 @@ int utc_streamrecorder_unset_recording_limit_reached_cb_n(void)
 int utc_streamrecorder_unset_buffer_consume_completed_cb_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_buffer_consume_completed_cb(recorder);
@@ -725,6 +896,12 @@ int utc_streamrecorder_unset_buffer_consume_completed_cb_p(void)
 int utc_streamrecorder_unset_buffer_consume_completed_cb_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_buffer_consume_completed_cb(NULL);
@@ -745,6 +922,12 @@ int utc_streamrecorder_unset_buffer_consume_completed_cb_n1(void)
 int utc_streamrecorder_unset_recording_status_cb_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_recording_status_cb(recorder);
@@ -766,6 +949,12 @@ int utc_streamrecorder_unset_recording_status_cb_p(void)
 int utc_streamrecorder_unset_recording_status_cb_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_recording_status_cb(NULL);
@@ -787,6 +976,12 @@ int utc_streamrecorder_unset_recording_status_cb_n(void)
 int utc_streamrecorder_unset_notify_cb_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_notify_cb(recorder);
@@ -807,6 +1002,12 @@ int utc_streamrecorder_unset_notify_cb_p(void)
 int utc_streamrecorder_unset_notify_cb_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_notify_cb(NULL);
@@ -828,6 +1029,12 @@ int utc_streamrecorder_unset_notify_cb_n(void)
 int utc_streamrecorder_unset_error_cb_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_error_cb(recorder);
@@ -849,6 +1056,12 @@ int utc_streamrecorder_unset_error_cb_p(void)
 int utc_streamrecorder_unset_error_cb_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unset_error_cb(NULL);
index f72d746b6de34cccbd23b4dc78b29642b918edf3..bec0a0764b503226796626938979a3e3337e6e27 100644 (file)
@@ -32,6 +32,7 @@ static media_packet_h vid_pkt = NULL;
 static media_format_h media_format = NULL;
 
 static int startup_ret;
+static bool is_streamrecorder_supported = false;
 
 static bool storage_device_cb(int storage_id, storage_type_e type, storage_state_e state, const char* path, void* user_data) {
 
@@ -74,6 +75,9 @@ void utc_streamrecorder_lifecycle_startup(void)
        startup_ret = STREAMRECORDER_ERROR_NONE;
 
        storage_foreach_device_supported(storage_device_cb,NULL);
+
+    system_info_get_platform_bool("http://tizen.org/feature/multimedia.stream_recorder", &is_streamrecorder_supported);
+
        startup_ret |= streamrecorder_create(&recorder);
 }
 
@@ -126,6 +130,12 @@ void utc_streamrecorder_lifecycle_cleanup(void)
 int utc_streamrecorder_enable_source_buffer_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_enable_source_buffer(NULL, STREAMRECORDER_SOURCE_VIDEO_AUDIO);
@@ -146,6 +156,12 @@ int utc_streamrecorder_enable_source_buffer_n(void)
 int utc_streamrecorder_enable_source_buffer_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO_AUDIO);
@@ -175,6 +191,12 @@ int utc_streamrecorder_enable_source_buffer_p(void)
 int utc_streamrecorder_cancel_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret  = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
@@ -217,6 +239,12 @@ int utc_streamrecorder_cancel_p(void)
 int utc_streamrecorder_cancel_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_cancel(NULL);
@@ -254,6 +282,12 @@ int utc_streamrecorder_commit_p(void)
     FILE *pvFile = NULL;
     unsigned char *dptr = NULL;
     int i = 0;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     //Create media packet
@@ -404,6 +438,12 @@ int utc_streamrecorder_commit_p(void)
 int utc_streamrecorder_commit_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret |= streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
@@ -435,6 +475,12 @@ int utc_streamrecorder_destroy_p(void)
 {
 
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
@@ -459,6 +505,12 @@ int utc_streamrecorder_destroy_p(void)
 int utc_streamrecorder_destroy_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_destroy(NULL);
@@ -497,6 +549,12 @@ int utc_streamrecorder_pause_p(void)
     FILE *pvFile = NULL;
     unsigned char *dptr = NULL;
     int i = 0;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     //Create media packet
@@ -649,6 +707,12 @@ int utc_streamrecorder_pause_p(void)
 int utc_streamrecorder_pause_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
@@ -687,6 +751,12 @@ int utc_streamrecorder_pause_n(void)
 int utc_streamrecorder_prepare_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret |= streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
@@ -721,6 +791,12 @@ int utc_streamrecorder_prepare_p(void)
 int utc_streamrecorder_prepare_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret |= streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
@@ -754,6 +830,12 @@ int utc_streamrecorder_prepare_n1(void)
 int utc_streamrecorder_prepare_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_prepare(NULL);
@@ -784,6 +866,12 @@ int utc_streamrecorder_prepare_n2(void)
 int utc_streamrecorder_start_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret  = streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
@@ -823,6 +911,12 @@ int utc_streamrecorder_start_p(void)
 int utc_streamrecorder_start_n(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_start(recorder);
@@ -851,6 +945,12 @@ int utc_streamrecorder_start_n(void)
 int utc_streamrecorder_unprepare_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret |= streamrecorder_enable_source_buffer(recorder, STREAMRECORDER_SOURCE_VIDEO);
@@ -880,6 +980,12 @@ int utc_streamrecorder_unprepare_p(void)
 int utc_streamrecorder_unprepare_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unprepare(recorder);
@@ -901,6 +1007,12 @@ int utc_streamrecorder_unprepare_n1(void)
 int utc_streamrecorder_unprepare_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_unprepare(NULL);
@@ -924,6 +1036,12 @@ int utc_streamrecorder_unprepare_n2(void)
 int utc_streamrecorder_get_state_p(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
@@ -948,6 +1066,12 @@ int utc_streamrecorder_get_state_p(void)
 int utc_streamrecorder_get_state_n1(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);
 
     ret = streamrecorder_get_state(recorder, NULL);
@@ -968,6 +1092,12 @@ int utc_streamrecorder_get_state_n1(void)
 int utc_streamrecorder_get_state_n2(void)
 {
     int ret = STREAMRECORDER_ERROR_NONE;
+
+    if (!is_streamrecorder_supported) {
+               assert_eq(startup_ret, STREAMRECORDER_ERROR_NOT_SUPPORTED);
+               return 0;
+       }
+
     streamrecorder_state_e state = STREAMRECORDER_STATE_NONE;
     assert_eq(startup_ret, STREAMRECORDER_ERROR_NONE);