TDM_NEVER_GET_HERE();
if (tdm_debug_dump & TDM_DUMP_FLAG_CAPTURE) {
+ /* LCOV_EXCL_START */
char str[TDM_PATH_LEN];
static int i;
snprintf(str, TDM_PATH_LEN, "capture_%03d", i++);
tdm_helper_dump_buffer_str(buffer, tdm_debug_dump_dir, str);
+ /* LCOV_EXCL_STOP */
}
if (tdm_debug_module & TDM_DEBUG_BUFFER)
TDM_RETURN_VAL_IF_FAIL(TDM_MUTEX_IS_LOCKED(), NULL);
if (!(private_display->capabilities & TDM_DISPLAY_CAPABILITY_CAPTURE)) {
+ /* LCOV_EXCL_START */
TDM_ERR("no capture capability");
if (error)
*error = TDM_ERROR_NO_CAPABILITY;
return NULL;
+ /* LCOV_EXCL_STOP */
}
if (!(private_display->caps_capture.capabilities & TDM_CAPTURE_CAPABILITY_OUTPUT)) {
+ /* LCOV_EXCL_START */
TDM_ERR("no output capture capability");
if (error)
*error = TDM_ERROR_NO_CAPABILITY;
return NULL;
+ /* LCOV_EXCL_STOP */
}
capture_backend = func_output->output_create_capture(
private_output->output_backend, &ret);
if (ret != TDM_ERROR_NONE) {
+ /* LCOV_EXCL_START */
if (error)
*error = ret;
return NULL;
+ /* LCOV_EXCL_STOP */
}
private_capture = calloc(1, sizeof(tdm_private_capture));
if (!private_capture) {
+ /* LCOV_EXCL_START */
TDM_ERR("failed: alloc memory");
func_capture->capture_destroy(capture_backend);
if (error)
*error = TDM_ERROR_OUT_OF_MEMORY;
return NULL;
+ /* LCOV_EXCL_STOP */
}
ret = func_capture->capture_set_done_handler(capture_backend,
tdm_capture_cb_done, private_capture);
if (ret != TDM_ERROR_NONE) {
+ /* LCOV_EXCL_START */
TDM_ERR("capture(%p) set capture_done_handler failed", private_capture);
func_capture->capture_destroy(capture_backend);
if (error)
*error = ret;
return NULL;
+ /* LCOV_EXCL_STOP */
}
private_capture->stamp = tdm_helper_get_time();
return private_capture;
}
+/* LCOV_EXCL_START */
INTERN tdm_private_capture *
tdm_capture_create_layer_internal(tdm_private_layer *private_layer,
tdm_error *error)
return private_capture;
}
+/* LCOV_EXCL_STOP */
INTERN void
tdm_capture_destroy_internal(tdm_private_capture *private_capture)
_pthread_mutex_lock(&private_display->lock);
if (!func_capture->capture_set_info) {
+ /* LCOV_EXCL_START */
_pthread_mutex_unlock(&private_display->lock);
TDM_DBG("failed: not implemented!!");
return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
}
if (info->type == TDM_CAPTURE_TYPE_STREAM && info->frequency == 0) {
_pthread_mutex_lock(&private_display->lock);
if (!func_capture->capture_attach) {
+ /* LCOV_EXCL_START */
_pthread_mutex_unlock(&private_display->lock);
TDM_DBG("failed: not implemented!!");
return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
}
if (tdm_display_check_module_abi(private_display, 1, 2) &&
private_display->caps_capture.max_attach_count > 0) {
+ /* LCOV_EXCL_START */
int length = LIST_LENGTH(&private_capture->pending_buffer_list) +
LIST_LENGTH(&private_capture->buffer_list);
if (length >= private_display->caps_capture.max_attach_count) {
private_display->caps_capture.max_attach_count);
return TDM_ERROR_BAD_REQUEST;
}
+ /* LCOV_EXCL_STOP */
}
capture_buffer = calloc(1, sizeof * capture_buffer);
if (!capture_buffer) {
+ /* LCOV_EXCL_START */
_pthread_mutex_unlock(&private_display->lock);
TDM_ERR("alloc failed");
return TDM_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ret = func_capture->capture_attach(private_capture->capture_backend, buffer);
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
if (ret != TDM_ERROR_NONE) {
+ /* LCOV_EXCL_START */
free(capture_buffer);
_pthread_mutex_unlock(&private_display->lock);
TDM_ERR("attach failed");
return ret;
+ /* LCOV_EXCL_STOP */
}
LIST_ADDTAIL(&capture_buffer->link, &private_capture->pending_buffer_list);
}
if (!func_capture->capture_commit) {
+ /* LCOV_EXCL_START */
_pthread_mutex_unlock(&private_display->lock);
TDM_DBG("failed: not implemented!!");
return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
}
LIST_INITHEAD(&commit_buffer_list);
continue;
if (ret != TDM_ERROR_NONE) {
+ /* LCOV_EXCL_START */
/* Not to call the user release handler when failed.
* Do we have to call this function here really?
* User better use set_done_handler to know when pp is done. Using
LIST_DEL(&b->link);
free(b);
+ /* LCOV_EXCL_STOP */
}
}