RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
- RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "src_pad is NULL");
RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
+ RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_OPERATION, "src_pad is NULL");
source->media_types = MEDIA_TYPE_VIDEO;
gst_bin_add_many(source->bin, screensrc, capsfilter1, videoconvert, capsfilter2, videoenc, videopay, queue, capsfilter3, NULL);
if (!gst_element_link_many(screensrc, capsfilter1, videoconvert, capsfilter2, videoenc, videopay, queue, capsfilter3, NULL)) {
LOG_ERROR("failed to gst_element_link_many()");
+ ret = WEBRTC_ERROR_INVALID_OPERATION;
goto exit_with_remove_from_bin;
}
return WEBRTC_ERROR_NONE;
exit_with_remove_from_bin:
+ /* elements will be dereferenced */
gst_bin_remove_many(source->bin, screensrc, capsfilter1, videoconvert, capsfilter2, videoenc, videopay, queue, capsfilter3, NULL);
-
- return WEBRTC_ERROR_INVALID_OPERATION;
-
+ return ret;
exit:
SAFE_GST_OBJECT_UNREF(screensrc);
SAFE_GST_OBJECT_UNREF(capsfilter1);
SAFE_GST_OBJECT_UNREF(videopay);
SAFE_GST_OBJECT_UNREF(queue);
SAFE_GST_OBJECT_UNREF(capsfilter3);
-
return ret;
}
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
- RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "src_pad is NULL");
+ RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_OPERATION, "src_pad is NULL");
source->media_types = MEDIA_TYPE_VIDEO;
#ifdef TIZEN_FEATURE_RES_MGR
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
- RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "src_pad is NULL");
+ RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_OPERATION, "src_pad is NULL");
source->media_types = MEDIA_TYPE_AUDIO;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
- RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "src_pad is NULL");
+ RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_OPERATION, "src_pad is NULL");
source->media_types = MEDIA_TYPE_VIDEO;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
- RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "src_pad is NULL");
+ RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_OPERATION, "src_pad is NULL");
source->media_types = MEDIA_TYPE_AUDIO;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
- RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "src_pad is NULL");
+ RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_OPERATION, "src_pad is NULL");
appsrc = __find_element_in_bin(source->bin, "appsrc");
RET_VAL_IF(appsrc == NULL, WEBRTC_ERROR_INVALID_OPERATION, "appsrc is NULL");
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL");
- RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "src_pad is NULL");
+ RET_VAL_IF(source->src_pad == NULL, WEBRTC_ERROR_INVALID_OPERATION, "src_pad is NULL");
appsrc = __find_element_in_bin(source->bin, "appsrc");
RET_VAL_IF(appsrc == NULL, WEBRTC_ERROR_INVALID_OPERATION, "appsrc is NULL");
gchar *bin_name = NULL;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(webrtc->gst.source_slots == NULL, WEBRTC_ERROR_INVALID_OPERATION, "source_slots is NULL");
RET_VAL_IF(source_id == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is NULL");
RET_VAL_IF(type > WEBRTC_MEDIA_SOURCE_TYPE_SCREEN, WEBRTC_ERROR_INVALID_PARAMETER, "invalid source type(%d)", type);
+ RET_VAL_IF(webrtc->gst.source_slots == NULL, WEBRTC_ERROR_INVALID_OPERATION, "source_slots is NULL");
/* bin_name/source will be freed by function which is set to g_hash_table_new_full() */
id = __get_unoccupied_id(webrtc->gst.source_slots);