Bug 856423 Signaling - check return codes from vcmCreateRemoteStream r=jesup

This commit is contained in:
Ethan Hugg 2013-04-08 10:33:30 -07:00
Родитель 19bcd12b01
Коммит 631ba93468
3 изменённых файлов: 46 добавлений и 28 удалений

Просмотреть файл

@ -4305,6 +4305,7 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, boolean initial
tinybool rtcp_mux = FALSE;
sdp_result_e sdp_res;
boolean created_media_stream = FALSE;
int lsm_rc;
config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode));
@ -4620,19 +4621,23 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, boolean initial
TODO(ekr@rtfm.com): revisit when we have media
assigned to streams in the SDP */
if (!created_media_stream){
lsm_add_remote_stream (dcb_p->line,
dcb_p->call_id,
media,
&pc_stream_id);
MOZ_ASSERT(pc_stream_id == 0);
/* Use index 0 because we only have one stream */
result = gsmsdp_add_remote_stream(0,
pc_stream_id,
dcb_p);
MOZ_ASSERT(result); /* TODO(ekr@rtfm.com)
add real error checking,
but this "can't fail" */
created_media_stream = TRUE;
lsm_rc = lsm_add_remote_stream (dcb_p->line,
dcb_p->call_id,
media,
&pc_stream_id);
if (lsm_rc) {
cause = CC_CAUSE_NO_MEDIA;
} else {
MOZ_ASSERT(pc_stream_id == 0);
/* Use index 0 because we only have one stream */
result = gsmsdp_add_remote_stream(0,
pc_stream_id,
dcb_p);
MOZ_ASSERT(result); /* TODO(ekr@rtfm.com)
add real error checking,
but this "can't fail" */
created_media_stream = TRUE;
}
}
/* Now add the track to the single media stream.

Просмотреть файл

@ -106,7 +106,8 @@ void lsm_ui_display_status(const char *pStatusStr, line_t line,
callid_t call_id);
string_t lsm_parse_displaystr(string_t displaystr);
void lsm_speaker_mode(short mode);
void lsm_add_remote_stream (line_t line, callid_t call_id, fsmdef_media_t *media, int *pc_stream_id);
cc_rcs_t lsm_add_remote_stream (line_t line, callid_t call_id, fsmdef_media_t *media,
int *pc_stream_id);
#ifdef _WIN32
void terminate_active_calls(void);

Просмотреть файл

@ -5172,26 +5172,38 @@ lsm_stop_media (lsm_lcb_t *lcb, callid_t call_id, line_t line,
* [in] call_id - GSM call ID
* [in] media - media line to add as remote stream
* [out] pc_stream_id
* Returns: None
*
* Returns: CC_RC_SUCCESS or CC_RC_ERROR if unable to create or add stream
*/
void lsm_add_remote_stream (line_t line, callid_t call_id, fsmdef_media_t *media, int *pc_stream_id)
cc_rcs_t
lsm_add_remote_stream (line_t line, callid_t call_id, fsmdef_media_t *media, int *pc_stream_id)
{
static const char fname[] = "lsm_add_remote_stream";
fsmdef_dcb_t *dcb;
lsm_lcb_t *lcb;
fsmdef_dcb_t *dcb;
int vcm_ret;
lcb = lsm_get_lcb_by_call_id(call_id);
if (lcb != NULL) {
dcb = lcb->dcb;
if (dcb == NULL) {
LSM_ERR_MSG(get_debug_string(DEBUG_INPUT_NULL), fname);
return;
}
vcmCreateRemoteStream(media->cap_index, dcb->peerconnection,
pc_stream_id);
if (!lcb) {
CSFLogError(logTag, "%s: lcb is null", __FUNCTION__);
return CC_RC_ERROR;
}
dcb = lcb->dcb;
if (!dcb) {
CSFLogError(logTag, "%s: dcb is null", __FUNCTION__);
return CC_RC_ERROR;
}
vcm_ret = vcmCreateRemoteStream(media->cap_index, dcb->peerconnection,
pc_stream_id);
if (vcm_ret) {
CSFLogError(logTag, "%s: vcmCreateRemoteStream returned error: %d",
__FUNCTION__, vcm_ret);
return CC_RC_ERROR;
}
return CC_RC_SUCCESS;
}
/*