It is added to support configuration options for the data channel.
The 3rd parameter is added as below.
- int webrtc_create_data_channel(webrtc_h webrtc,
const char *label,
bundle *options,
webrtc_data_channel_h *channel)
[Version] 0.1.134
[Issue Type] API
Change-Id: I21ec0613227e9a039dcb52b5c06ee1c1b9970468
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
SET(dependents "dlog glib-2.0 gstreamer-1.0 gstreamer-webrtc-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 \
json-glib-1.0 iniparser mm-common mm-display-interface capi-media-tool libtbm libwebsockets \
- cynara-client libsmack capi-system-info libsoup-2.4")
+ cynara-client libsmack capi-system-info libsoup-2.4 bundle")
IF(NOT TIZEN_PROFILE_TV)
SET(dependents "${dependents} mm-resource-manager")
ADD_DEFINITIONS("-DTIZEN_FEATURE_RES_MGR")
#include <tizen.h>
#include <media_format.h>
#include <media_packet.h>
+#include <bundle.h>
#ifdef __cplusplus
extern "C" {
* @since_tizen 6.5
* @param[in] webrtc WebRTC handle
* @param[in] label Name for the channel
+ * @param[in] options Configuration options for the data channel (optional, this can be NULL)
* @param[out] channel Data channel handle
* @return @c 0 on success,
* otherwise a negative error value
* @pre @a webrtc state must be set to #WEBRTC_STATE_IDLE.
* @see webrtc_destroy_data_channel()
*/
-int webrtc_create_data_channel(webrtc_h webrtc, const char *label, webrtc_data_channel_h *channel);
+int webrtc_create_data_channel(webrtc_h webrtc, const char *label, bundle *options, webrtc_data_channel_h *channel);
/**
* @brief Destroys the data channel.
void _init_data_channels(webrtc_s *webrtc);
void _destroy_data_channels(webrtc_s *webrtc);
-int _create_data_channel(webrtc_s *webrtc, const char *label, webrtc_data_channel_s **channel);
+int _create_data_channel(webrtc_s *webrtc, const char *label, bundle *options, webrtc_data_channel_s **channel);
int _destroy_data_channel(webrtc_data_channel_s *channel);
int _data_channel_send_string(webrtc_data_channel_s *channel, const char *string);
int _data_channel_send_bytes(webrtc_data_channel_s *channel, const char *data, unsigned int size);
Name: capi-media-webrtc
Summary: A WebRTC library in Tizen Native API
-Version: 0.1.133
+Version: 0.1.134
Release: 0
Group: Multimedia/API
License: Apache-2.0
BuildRequires: pkgconfig(cynara-client)
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(bundle)
%if "%{tizen_profile_name}" != "tv"
BuildRequires: pkgconfig(mm-resource-manager)
%endif
return ret;
}
-int webrtc_create_data_channel(webrtc_h webrtc, const char *label, webrtc_data_channel_h *channel)
+int webrtc_create_data_channel(webrtc_h webrtc, const char *label, bundle *options, webrtc_data_channel_h *channel)
{
int ret = WEBRTC_ERROR_NONE;
webrtc_s *_webrtc = (webrtc_s*)webrtc;
ret = _gst_pipeline_set_state(_webrtc, GST_STATE_READY);
RET_VAL_WITH_UNLOCK_IF(ret != WEBRTC_ERROR_NONE, ret, &_webrtc->mutex, "failed to change GST state to READY");
- ret = _create_data_channel(webrtc, label, (webrtc_data_channel_s **)channel);
+ ret = _create_data_channel(webrtc, label, options, (webrtc_data_channel_s **)channel);
g_mutex_unlock(&_webrtc->mutex);
__invoke_data_channel_cb(webrtc, channel);
}
-int _create_data_channel(webrtc_s *webrtc, const char *label, webrtc_data_channel_s **channel)
+int _create_data_channel(webrtc_s *webrtc, const char *label, bundle *options, webrtc_data_channel_s **channel)
{
webrtc_data_channel_s *_channel;
GObject *data_channel;
+ GstStructure *_options = NULL;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(label == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "label is NULL");
RET_VAL_IF(channel == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "channel is NULL");
- g_signal_emit_by_name(webrtc->gst.webrtcbin, "create-data-channel", label, NULL, &data_channel);
+ /* TODO: get GstStructure from the options parameter */
+
+ g_signal_emit_by_name(webrtc->gst.webrtcbin, "create-data-channel", label, _options, &data_channel);
if (!data_channel) {
LOG_ERROR("failed to create data channel");
return WEBRTC_ERROR_INVALID_OPERATION;
label = g_strdup_printf("data_channel_%d_%d", index, g_conns[index].channel_index);
- ret = webrtc_create_data_channel(g_conns[index].webrtc, label, &g_conns[index].channels[g_conns[index].channel_index]);
+ ret = webrtc_create_data_channel(g_conns[index].webrtc, label, NULL, &g_conns[index].channels[g_conns[index].channel_index]);
if (ret != WEBRTC_ERROR_NONE) {
g_print("failed to webrtc_create_data_channel()\n");
} else {