*webrtc = _webrtc;
- g_mutex_unlock(&_webrtc->mutex);
-
LOG_INFO("webrtc[%p] is created", *webrtc);
+ g_mutex_unlock(&_webrtc->mutex);
+
return ret;
}
g_mutex_clear(&_webrtc->desc_mutex);
g_cond_clear(&_webrtc->desc_cond);
+ LOG_INFO("webrtc[%p] is destroyed", webrtc);
+
g_mutex_unlock(&_webrtc->mutex);
g_mutex_clear(&_webrtc->mutex);
g_free(_webrtc);
- LOG_INFO("webrtc[%p] is destroyed", webrtc);
-
return WEBRTC_ERROR_NONE;
}
_gst_pipeline_set_state(webrtc, GST_STATE_PLAYING);
_webrtc->pend_state = WEBRTC_STATE_NEGOTIATING;
- g_mutex_unlock(&_webrtc->mutex);
-
LOG_INFO("webrtc[%p] is started", webrtc);
+ g_mutex_unlock(&_webrtc->mutex);
+
return WEBRTC_ERROR_NONE;
}
_gst_pipeline_set_state(webrtc, GST_STATE_READY);
_webrtc->pend_state = WEBRTC_STATE_IDLE;
- g_mutex_unlock(&_webrtc->mutex);
-
LOG_INFO("webrtc[%p] is stopped", webrtc);
+ g_mutex_unlock(&_webrtc->mutex);
+
return WEBRTC_ERROR_NONE;
}
*state = _webrtc->state;
- g_mutex_unlock(&_webrtc->mutex);
-
LOG_INFO("state[%d]", *state);
+ g_mutex_unlock(&_webrtc->mutex);
+
return WEBRTC_ERROR_NONE;
}
RET_VAL_WITH_UNLOCK_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, &_webrtc->mutex, "the state should be IDLE");
ret = _add_media_source(webrtc, type, source_id);
-
- g_mutex_unlock(&_webrtc->mutex);
-
if (ret == WEBRTC_ERROR_NONE)
LOG_INFO("source_id[%u]", *source_id);
+ g_mutex_unlock(&_webrtc->mutex);
+
return ret;
}
RET_VAL_WITH_UNLOCK_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, &_webrtc->mutex, "the state should be IDLE");
- LOG_INFO("source_id[%u]", source_id);
-
ret = _remove_media_source(webrtc, source_id);
+ if (ret == WEBRTC_ERROR_NONE)
+ LOG_INFO("source_id[%u]", source_id);
g_mutex_unlock(&_webrtc->mutex);
g_mutex_lock(&_webrtc->mutex);
ret = _get_transceiver_direction(webrtc, source_id, media_type, direction);
+ if (ret == WEBRTC_ERROR_NONE)
+ LOG_INFO("source_id[%u] media_type[%d] direction[%d]", source_id, media_type, *direction);
g_mutex_unlock(&_webrtc->mutex);
- if (ret == WEBRTC_ERROR_NONE)
- LOG_INFO("source_id[%u], media_type[%d], direction[%d]", source_id, media_type, *direction);
-
return ret;
}
RET_VAL_WITH_UNLOCK_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, &_webrtc->mutex, "the state should be IDLE");
ret = _set_transceiver_direction(webrtc, source_id, media_type, direction);
+ if (ret == WEBRTC_ERROR_NONE)
+ LOG_INFO("source_id[%u] media_type[%d] direction[%d]", source_id, media_type, direction);
g_mutex_unlock(&_webrtc->mutex);
- LOG_INFO("source_id[%u], media_type[%d], direction[%d]", source_id, media_type, direction);
-
return ret;
}
_webrtc->stun_server_url = g_strdup(stun_server);
g_object_set(G_OBJECT(_webrtc->gst.webrtcbin), "stun-server", _webrtc->stun_server_url, NULL);
- g_mutex_unlock(&_webrtc->mutex);
-
LOG_INFO("stun_server[%s]", stun_server);
+ g_mutex_unlock(&_webrtc->mutex);
+
return WEBRTC_ERROR_NONE;
}
RET_VAL_WITH_UNLOCK_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, &_webrtc->mutex, "the state should be NEGOTIATING");
- LOG_INFO("description[ %s ]", description);
+ LOG_INFO("description: %s", description);
ret = _webrtcbin_set_session_description(webrtc, description, FALSE);
RET_VAL_WITH_UNLOCK_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, &_webrtc->mutex, "the state should be NEGOTIATING");
- LOG_INFO("description[ %s ]", description);
+ LOG_INFO("description: %s", description);
ret = _webrtcbin_set_session_description(webrtc, description, TRUE);
RET_VAL_WITH_UNLOCK_IF(_webrtc->state != WEBRTC_STATE_NEGOTIATING, WEBRTC_ERROR_INVALID_STATE, &_webrtc->mutex, "the state should be NEGOTIATING");
- LOG_INFO("candidate[ %s ]", candidate);
+ LOG_INFO("candidate: %s", candidate);
ret = _webrtcbin_add_ice_candidate(webrtc, candidate);