void *_get_unused_tbm_bo(webrtc_tbm_s *tbm, unsigned int timeout_sec);
void _release_tbm_bo(webrtc_tbm_s *tbm, void *bo);
-int _webrtcbin_create_offer(webrtc_s *webrtc, char **offer);
-int _webrtcbin_create_answer(webrtc_s *webrtc, char **answer);
+int _webrtcbin_create_session_description(webrtc_s *webrtc, bool is_offer, char **desc);
int _webrtcbin_set_session_description(webrtc_s *webrtc, const char *description, bool is_remote);
int _webrtcbin_add_ice_candidate(webrtc_s *webrtc, const char *candidate);
void _webrtcbin_on_data_channel_cb(GstElement *webrtcbin, GObject *data_channel, gpointer user_data);
LOG_INFO("offer[%p]", offer);
- ret = _webrtcbin_create_offer(_webrtc, offer);
+ ret = _webrtcbin_create_session_description(webrtc, true, offer);
g_mutex_unlock(&_webrtc->mutex);
LOG_INFO("answer[%p]", answer);
- ret = _webrtcbin_create_answer(_webrtc, answer);
+ ret = _webrtcbin_create_session_description(webrtc, false, answer);
g_mutex_unlock(&_webrtc->mutex);
LOG_DEBUG_LEAVE();
}
-static int _create_session_description(webrtc_s *webrtc, bool is_offer, char **desc)
+int _webrtcbin_create_session_description(webrtc_s *webrtc, bool is_offer, char **desc)
{
GstPromise *promise;
gint64 end_time;
return WEBRTC_ERROR_NONE;
}
-int _webrtcbin_create_offer(webrtc_s *webrtc, char **offer)
-{
- RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(offer == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "offer is NULL");
- RET_VAL_IF(webrtc->gst.webrtcbin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "webrtcbin is NULL");
-
- return _create_session_description(webrtc, true, offer);
-}
-
-int _webrtcbin_create_answer(webrtc_s *webrtc, char **answer)
-{
- RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(answer == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "answer is NULL");
- RET_VAL_IF(webrtc->gst.webrtcbin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "webrtcbin is NULL");
-
- return _create_session_description(webrtc, false, answer);
-}
-
/* Use g_free() to release the sdp and type parameter. */
static int __get_sdp_from_description(const char *description, gchar **sdp, gchar **type)
{