gpointer key, value;
webrtc_gst_slot_s *source;
int i;
+ guint mlineindex;
+ gchar *mid;
+ GstWebRTCRTPTransceiverDirection direction;
+ GstWebRTCKind kind;
+ GstCaps *caps;
RET_IF(webrtcbin == NULL, "webrtcbin is NULL");
RET_IF(transceiver == NULL, "transceiver is NULL");
RET_IF(webrtc == NULL, "webrtc is NULL");
- LOG_INFO("webrtc[%p] new transceiver[%p, mline:%u, mid:%s, direction:%d, kind:%d] user_data[%p]",
- webrtc, transceiver, transceiver->mline, transceiver->mid, transceiver->direction, transceiver->kind, user_data);
- PRINT_CAPS(transceiver->codec_preferences, "codec preferences");
+ g_object_get(G_OBJECT(transceiver),
+ "mlineindex", &mlineindex,
+ "mid", &mid,
+ "direction", &direction,
+ "kind", &kind,
+ "codec-preferences", &caps,
+ NULL);
+
+ LOG_INFO("webrtc[%p] new transceiver[%p, mlineindex:%u, mid:%s, direction:%d, kind:%d] user_data[%p]",
+ webrtc, transceiver, mlineindex, mid, direction, kind, user_data);
+ PRINT_CAPS(caps, "codec preferences");
if (g_hash_table_size(webrtc->gst.source_slots) == 0) {
- if (transceiver->mline >= MAX_MLINE_NUM) {
- LOG_ERROR("mline[%u] exceeds the max value", transceiver->mline);
+ if (mlineindex >= MAX_MLINE_NUM) {
+ LOG_ERROR("mlineindex[%u] exceeds the max value", mlineindex);
return;
}
/* In this case, it might be an answerer without setting any media source. */
- if (webrtc->data_recovery_types[transceiver->mline].red &&
- webrtc->data_recovery_types[transceiver->mline].ulpfec)
+ if (webrtc->data_recovery_types[mlineindex].red &&
+ webrtc->data_recovery_types[mlineindex].ulpfec)
__webrtcbin_transceiver_set_ulpfec_red(webrtc, transceiver);
return;
}
gpointer key, value;
webrtc_gst_slot_s *source;
int i;
+ guint mlineindex;
+ GstWebRTCRTPTransceiverDirection direction;
RET_IF(webrtc == NULL, "webrtc is NULL");
if (!(transceiver = source->av[i].transceiver))
continue;
+ g_object_get(G_OBJECT(transceiver),
+ "mlineindex", &mlineindex,
+ "direction", &direction,
+ NULL);
+
ini_source = _ini_get_source_by_type(&webrtc->ini, source->type);
if (ini_source == NULL)
ini_source = &(webrtc->ini.media_source);
} else {
/* NOTE that this maximum value exists only for data_recovery_types due to the scenario an answerer
* without any added media sources. It would be moved to the source slot without this scenario. */
- if (transceiver->mline >= MAX_MLINE_NUM) {
- LOG_ERROR("mline[%u] exceeds the max value", transceiver->mline);
+ if (mlineindex >= MAX_MLINE_NUM) {
+ LOG_ERROR("mline[%u] exceeds the max value", mlineindex);
continue;
}
- if (!webrtc->data_recovery_types[transceiver->mline].red ||
- !webrtc->data_recovery_types[transceiver->mline].ulpfec)
+ if (!webrtc->data_recovery_types[mlineindex].red ||
+ !webrtc->data_recovery_types[mlineindex].ulpfec)
continue;
__webrtcbin_transceiver_set_ulpfec_red(webrtc, transceiver);
}
- if (transceiver->direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY ||
- transceiver->direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV)
+ if (direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY ||
+ direction == GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV)
__webrtcbin_transceiver_set_fec_percentage(webrtc, transceiver, ini_source->fec_percentage);
}
}
LOG_INFO("webrtc[%p] [%s] is [%f]", webrtc, prop_name, *probability);
return WEBRTC_ERROR_NONE;
-}
\ No newline at end of file
+}
RET_VAL_IF(trans == NULL, WEBRTC_ERROR_INVALID_OPERATION, "transceiver of source[media_type:%d, id:%u] is NULL", media_type, source_id);
- trans->direction = __direction_info[direction].gst;
- LOG_DEBUG("Set direction to transceiver[%p, mline:%u, direction:%s]", trans, trans->mline, __direction_info[direction].str);
+ g_object_set(G_OBJECT(trans), "direction", __direction_info[direction].gst, NULL);
+
+ LOG_DEBUG("Set direction to transceiver[%p, direction:%s]", trans, __direction_info[direction].str);
return WEBRTC_ERROR_NONE;
}
int ret;
const webrtc_gst_slot_s *source;
const GstWebRTCRTPTransceiver *trans;
+ guint mlineindex;
+ gchar *mid;
+ GstWebRTCRTPTransceiverDirection gst_direction;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(direction == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "direction is NULL");
RET_VAL_IF(trans == NULL, WEBRTC_ERROR_INVALID_OPERATION, "transceiver of source[media_type:%d, id:%u] is NULL", media_type, source_id);
- ret = __convert_direction(trans->direction, direction);
+ g_object_get(G_OBJECT(trans),
+ "mlineindex", &mlineindex,
+ "mid", &mid,
+ "direction", &gst_direction,
+ NULL);
+
+ ret = __convert_direction(gst_direction, direction);
if (ret == WEBRTC_ERROR_NONE)
- LOG_DEBUG("transceiver[%p, mline:%u, mid:%s, direction:%s]", trans, trans->mline, trans->mid, __direction_info[*direction].str);
+ LOG_DEBUG("transceiver[%p, mlineindex:%u, mid:%s, direction:%s]", trans, mlineindex, mid, __direction_info[*direction].str);
return ret;
}