Merge branch 'tizen_line_coverage' into tizen
[platform/core/api/mediacodec.git] / src / media_codec.c
index be2435e..cff7fc1 100644 (file)
@@ -155,13 +155,13 @@ int mediacodec_create(mediacodec_h *mediacodec)
        if (handle != NULL) {
                memset(handle, 0 , sizeof(mediacodec_s));
        } else {
-               LOGE("MEDIACODEC_ERROR_OUT_OF_MEMORY(0x%08x)", MEDIACODEC_ERROR_OUT_OF_MEMORY);
+               LOGE("MEDIACODEC_ERROR_OUT_OF_MEMORY(0x%08x)", MEDIACODEC_ERROR_OUT_OF_MEMORY); //LCOV_EXCL_LINE
                return MEDIACODEC_ERROR_OUT_OF_MEMORY;
        }
 
        ret = mc_create(&handle->mc_handle);
        if (ret != MEDIACODEC_ERROR_NONE) {
-               LOGE("MEDIACODEC_ERROR_INVALID_OPERATION(0x%08x)", MEDIACODEC_ERROR_INVALID_OPERATION);
+               LOGE("MEDIACODEC_ERROR_INVALID_OPERATION(0x%08x)", MEDIACODEC_ERROR_INVALID_OPERATION); //LCOV_EXCL_LINE
                handle->state = MEDIACODEC_STATE_NONE;
                g_free(handle->mc_handle);
                g_free(handle);
@@ -199,7 +199,7 @@ int mediacodec_destroy(mediacodec_h mediacodec)
 
        int ret = mc_destroy(handle->mc_handle);
        if (ret != MEDIACODEC_ERROR_NONE) {
-               LOGD("MEDIACODEC_ERROR_INVALID_OPERATION(0x%08x)", MEDIACODEC_ERROR_INVALID_OPERATION);
+               LOGD("MEDIACODEC_ERROR_INVALID_OPERATION(0x%08x)", MEDIACODEC_ERROR_INVALID_OPERATION); //LCOV_EXCL_LINE
                return MEDIACODEC_ERROR_INVALID_OPERATION;
        } else {
 #ifdef USE_MM_RESOURCE_MANAGER
@@ -326,7 +326,7 @@ int mediacodec_prepare(mediacodec_h mediacodec)
        if (mc_handle->is_hw && mc_handle->is_video) {
 
                if (handle->codec_resource) {
-                       LOGE("Codec resource is tried to be acquired twice\n");
+                       LOGE("Codec resource is tried to be acquired twice\n"); //LCOV_EXCL_LINE
                        return MC_INTERNAL_ERROR;
                }
 
@@ -344,6 +344,7 @@ int mediacodec_prepare(mediacodec_h mediacodec)
                 * mm_resource_manager_get_res_type_volume() can be used.
                 * Additional info can be found in doxygen comments of mm_resource_manager.h
                 */
+//LCOV_EXCL_START
                rm_ret = mm_resource_manager_mark_for_acquire(g_mc_resource_manager,
                                mc_handle->is_encoder ?
                                MM_RESOURCE_MANAGER_RES_TYPE_VIDEO_ENCODER :
@@ -367,8 +368,8 @@ int mediacodec_prepare(mediacodec_h mediacodec)
                        LOGE("Failed to commit resource manager : %x", rm_ret);
                        return MEDIACODEC_ERROR_INTERNAL;
                }
-
                handle->codec_resource = resource;
+//LCOV_EXCL_STOP
        }
 #endif
 
@@ -397,6 +398,7 @@ int mediacodec_unprepare(mediacodec_h mediacodec)
        } else {
 #ifdef USE_MM_RESOURCE_MANAGER
                if (handle->codec_resource != NULL) {
+//LCOV_EXCL_START
                        mm_resource_manager_mark_for_release(g_mc_resource_manager,
                                        handle->codec_resource);
                        handle->codec_resource = NULL;
@@ -410,6 +412,7 @@ int mediacodec_unprepare(mediacodec_h mediacodec)
                                        return MEDIACODEC_ERROR_INTERNAL;
                                }
                        }
+//LCOV_EXCL_STOP
                } else {
                        LOGD("No codec resource to release. Probably resource release cb called\n");
                }
@@ -718,8 +721,8 @@ static gboolean __mediacodec_buffer_status_cb(mediacodec_status_e status, void *
        return 1;
 }
 
-
 #ifdef USE_MM_RESOURCE_MANAGER
+//LCOV_EXCL_START
 static int __mediacodec_resource_release_cb(mm_resource_manager_h rm,
                mm_resource_manager_res_h resource_h, void *user_data)
 {
@@ -747,6 +750,7 @@ static int __mediacodec_resource_release_cb(mm_resource_manager_h rm,
 
        return FALSE;
 }
+//LCOV_EXCL_STOP
 
 
 static void __mediacodec_init_lib()
@@ -772,3 +776,4 @@ static void __mediacodec_deinit_lib()
        LOGD("DONE");
 }
 #endif
+