return true;
}
-//LCOV_EXCL_START
-static void __release_filesrc_resources(webrtc_gst_slot_s *source)
-{
- GstElement *appsrc = NULL;
- GstElement *queue = NULL;
- GstElement *capsfilter = NULL;
- int av_idx = 0;
-
- RET_IF(source == NULL, "source is NULL");
- RET_IF(source->bin == NULL, "bin is NULL");
- RET_IF(source->filesrc_pipeline == NULL, "filesrc_pipeline is NULL");
-
- _release_request_pad(source);
-
- for (av_idx = 0; av_idx < AV_IDX_MAX; av_idx++) {
- GList *element_list = NULL;
-
- if (source->av[av_idx].src_pad_probe_id == 0)
- continue;
-
- _remove_probe_from_pad_for_pause(source, av_idx);
- _remove_probe_from_pad_for_render(source, av_idx);
- _remove_filesrc_pad_block_probe(source, av_idx);
-
- if (source->av[av_idx].pt > 0)
- _return_payload_type(source->webrtc, source->av[av_idx].pt);
-
- _destroy_looopback_render_pipeline(source, av_idx);
-
- if ((appsrc = gst_bin_get_by_name(source->bin, _get_element_name(av_idx, ELEMENT_APPSRC))))
- APPEND_ELEMENT(element_list, appsrc);
- else
- LOG_ERROR("appsrc is NULL");
-
- if ((queue = gst_bin_get_by_name(source->bin, _get_element_name(av_idx, ELEMENT_QUEUE))))
- APPEND_ELEMENT(element_list, queue);
- else
- LOG_ERROR("queue is NULL");
-
- if ((capsfilter = gst_bin_get_by_name(source->bin, _get_element_name(av_idx, ELEMENT_CAPSFILTER))))
- APPEND_ELEMENT(element_list, capsfilter);
- else
- LOG_ERROR("capsfilter is NULL");
-
- _remove_elements_from_bin(source->bin, element_list);
-
- SAFE_G_LIST_FREE(element_list);
- }
-
- _remove_rest_of_elements_for_filesrc_pipeline(source);
-
- if (source->display)
- _release_display(source->display);
-
- if (source->sound_stream_info.type) {
- free(source->sound_stream_info.type);
- source->sound_stream_info.type = NULL;
- }
-
- source->media_types = 0;
-}
-
-int _set_media_path(webrtc_s *webrtc, unsigned int source_id, const char *path)
-{
- webrtc_gst_slot_s *source = NULL;
- GstElement *filesrc = NULL;
- gchar *location = NULL;
-
- RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0");
- RET_VAL_IF(path == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "path is NULL");
- RET_VAL_IF((source = _get_slot_by_id(webrtc->gst.source_slots, source_id)) == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "could not find source");
- RET_VAL_IF(source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE, WEBRTC_ERROR_INVALID_PARAMETER, "invalid source type [%d]", source->type);
-
- if (access(path, R_OK) < 0) {
- if (errno == EACCES || errno == EPERM) {
- LOG_ERROR("Fail to open path: Permission Denied [%s]", path);
- return WEBRTC_ERROR_PERMISSION_DENIED;
- } else {
- LOG_ERROR("Fail to open path: Invalid Path [%s] errno[%d]", path, errno);
- return WEBRTC_ERROR_INVALID_PARAMETER;
- }
- }
-
- filesrc = gst_bin_get_by_name(GST_BIN(source->filesrc_pipeline), ELEMENT_NAME_FILE_SRC);
- RET_VAL_IF(filesrc == NULL, WEBRTC_ERROR_INVALID_OPERATION, "filesrc is NULL");
-
- g_object_get(G_OBJECT(filesrc), "location", &location, NULL);
- if (location) {
- __release_filesrc_resources(source);
- g_free(location);
- source->media_types = 0;
- }
-
- g_object_set(G_OBJECT(filesrc), "location", path, NULL);
-
- _set_filesrc_media_types(source, path);
-
- LOG_DEBUG("source_id[%u] path[%s]", source_id, path);
-
- return WEBRTC_ERROR_NONE;
-}
-//LCOV_EXCL_STOP
-
-static gboolean __check_path_is_not_set_cb(gpointer key, gpointer value, gpointer user_data)
-{
- const webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value;
- gchar *location = NULL;
-
- if (source->type == GPOINTER_TO_INT(user_data)) {
- LOG_INFO("found file source[%p, id:%u]", source, source->id);
- g_object_get(G_OBJECT(gst_bin_get_by_name(GST_BIN(source->filesrc_pipeline), ELEMENT_NAME_FILE_SRC)), "location", &location, NULL);
-
- if (!location)
- return TRUE;
-
- g_free(location);
- }
-
- return FALSE;
-}
-
-bool _check_if_path_is_set_to_file_sources(webrtc_s *webrtc)
-{
- const webrtc_gst_slot_s *source;
-
- RET_VAL_IF(webrtc == NULL, false, "webrtc is NULL");
-
- source = g_hash_table_find(webrtc->gst.source_slots, __check_path_is_not_set_cb, GINT_TO_POINTER(WEBRTC_MEDIA_SOURCE_TYPE_FILE));
- if (source) {
- LOG_ERROR("media path is not set to the file source[%u]", source->id);
- return false;
- }
-
- return true;
-}
-
//LCOV_EXCL_START
static GstPadProbeReturn __camerasrc_probe_cb(GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
{
#include "webrtc_private.h"
#include "webrtc_source_private.h"
-static void __set_filesrc_pipline_state_foreach_cb(gpointer key, gpointer value, gpointer user_data)
+static void __remove_filesrc_pad_block_probe(webrtc_gst_slot_s *source, unsigned int av_idx)
{
- webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value;
- GstStateChangeReturn ret;
- GstState state = GPOINTER_TO_UINT(user_data);
+ RET_IF(source == NULL, "source is NULL");
+ RET_IF(av_idx >= AV_IDX_MAX, "invalid idx(%u)", av_idx);
- if (source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE)
+ if (source->filesrc_av[av_idx].sink_pad_probe_id == 0)
return;
- LOG_INFO("found file source[%p, id:%u]", source, source->id);
+ LOG_DEBUG("source[id:%u] for[%s] pad[%p] probe_id[%lu]", source->id, GET_MEDIA_TYPE_NAME(av_idx == AV_IDX_AUDIO),
+ source->filesrc_av[av_idx].sink_pad, source->filesrc_av[av_idx].sink_pad_probe_id);
- ret = gst_element_set_state(source->filesrc_pipeline, state);
- if (ret == GST_STATE_CHANGE_FAILURE) {
- LOG_ERROR("failed to gst_element_set_state(), state[%s]", gst_element_state_get_name(state));
+ gst_pad_remove_probe(source->filesrc_av[av_idx].sink_pad, source->filesrc_av[av_idx].sink_pad_probe_id);
+
+ source->filesrc_av[av_idx].sink_pad = NULL;
+ source->filesrc_av[av_idx].sink_pad_probe_id = 0;
+}
+
+static void __remove_filesrc_pad_block_foreach_cb(gpointer key, gpointer value, gpointer user_data)
+{
+ webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value;
+ int av_idx;
+
+ if (source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE)
return;
- }
- LOG_INFO("change filesrc pipeline state to [%s]", gst_element_state_get_name(state));
+ for (av_idx = 0; av_idx < AV_IDX_MAX; av_idx++)
+ __remove_filesrc_pad_block_probe(source, av_idx);
}
-int _gst_filesrc_pipeline_set_state(webrtc_s *webrtc, GstState state)
+int _remove_all_filesrc_pad_block_probes(webrtc_s *webrtc)
{
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- g_hash_table_foreach(webrtc->gst.source_slots, __set_filesrc_pipline_state_foreach_cb, GINT_TO_POINTER(state));
+ g_hash_table_foreach(webrtc->gst.source_slots, __remove_filesrc_pad_block_foreach_cb, NULL);
return WEBRTC_ERROR_NONE;
}
-int _set_filesrc_looping(webrtc_s *webrtc, unsigned int source_id, bool looping)
+static void __remove_rest_of_elements_for_filesrc_pipeline(webrtc_gst_slot_s *source)
{
- webrtc_gst_slot_s *source;
+ GstBin *bin = NULL;
+ GstIterator *iter = NULL;
+ GstIteratorResult result;
+ GValue value = { 0 };
+ GstElement *elem = NULL;
- RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0");
- RET_VAL_IF((source = _get_slot_by_id(webrtc->gst.source_slots, source_id)) == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
- RET_VAL_IF(source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE, WEBRTC_ERROR_INVALID_PARAMETER, "invalid source type [%d]", source->type);
+ RET_IF(source == NULL, "pad is NULL");
+ RET_IF(source->filesrc_pipeline == NULL, "filesrc_pipeline is NULL");
- source->filesrc_loop = looping;
+ bin = GST_BIN(source->filesrc_pipeline);
- LOG_DEBUG("source_id[%u] looping[%d]", source_id, looping);
+ iter = gst_bin_iterate_elements(bin);
- return WEBRTC_ERROR_NONE;
-}
+ do {
+ switch ((result = gst_iterator_next (iter, &value))) {
+ case GST_ITERATOR_OK:
+ elem = (GstElement *) g_value_get_object(&value);
+ if (!g_strrstr(GST_ELEMENT_NAME(elem), ELEMENT_NAME_FILE_SRC) && !g_strrstr(GST_ELEMENT_NAME(elem), "decodebin"))
+ gst_bin_remove(bin, elem);
+ g_value_unset (&value);
+ break;
-int _get_filesrc_looping(webrtc_s *webrtc, unsigned int source_id, bool *looping)
-{
- const webrtc_gst_slot_s *source;
+ case GST_ITERATOR_RESYNC:
+ gst_iterator_resync(iter);
+ break;
- RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0");
- RET_VAL_IF(looping == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "looping is NULL");
- RET_VAL_IF((source = _get_slot_by_id(webrtc->gst.source_slots, source_id)) == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
- RET_VAL_IF(source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE, WEBRTC_ERROR_INVALID_PARAMETER, "invalid source type [%d]", source->type);
+ case GST_ITERATOR_ERROR:
+ LOG_ERROR("error in iterating elements");
+ break;
- *looping = source->filesrc_loop;
+ case GST_ITERATOR_DONE:
+ break;
- LOG_DEBUG("source_id[%u] looping[%d]", source_id, *looping);
+ default:
+ break;
+ }
+ } while (result == GST_ITERATOR_OK || result == GST_ITERATOR_RESYNC);
- return WEBRTC_ERROR_NONE;
+ gst_iterator_free(iter);
}
-void _remove_filesrc_pad_block_probe(webrtc_gst_slot_s *source, unsigned int av_idx)
+static void __release_filesrc_resources(webrtc_gst_slot_s *source)
{
+ GstElement *appsrc = NULL;
+ GstElement *queue = NULL;
+ GstElement *capsfilter = NULL;
+ int av_idx = 0;
+
RET_IF(source == NULL, "source is NULL");
- RET_IF(av_idx >= AV_IDX_MAX, "invalid idx(%u)", av_idx);
+ RET_IF(source->bin == NULL, "bin is NULL");
+ RET_IF(source->filesrc_pipeline == NULL, "filesrc_pipeline is NULL");
- if (source->filesrc_av[av_idx].sink_pad_probe_id == 0)
- return;
+ _release_request_pad(source);
- LOG_DEBUG("source[id:%u] for[%s] pad[%p] probe_id[%lu]", source->id, GET_MEDIA_TYPE_NAME(av_idx == AV_IDX_AUDIO),
- source->filesrc_av[av_idx].sink_pad, source->filesrc_av[av_idx].sink_pad_probe_id);
+ for (av_idx = 0; av_idx < AV_IDX_MAX; av_idx++) {
+ GList *element_list = NULL;
- gst_pad_remove_probe(source->filesrc_av[av_idx].sink_pad, source->filesrc_av[av_idx].sink_pad_probe_id);
+ if (source->av[av_idx].src_pad_probe_id == 0)
+ continue;
- source->filesrc_av[av_idx].sink_pad = NULL;
- source->filesrc_av[av_idx].sink_pad_probe_id = 0;
-}
+ _remove_probe_from_pad_for_pause(source, av_idx);
+ _remove_probe_from_pad_for_render(source, av_idx);
+ __remove_filesrc_pad_block_probe(source, av_idx);
-static void __remove_filesrc_pad_block_foreach_cb(gpointer key, gpointer value, gpointer user_data)
-{
- webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value;
- int av_idx;
+ if (source->av[av_idx].pt > 0)
+ _return_payload_type(source->webrtc, source->av[av_idx].pt);
- if (source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE)
- return;
+ _destroy_looopback_render_pipeline(source, av_idx);
- for (av_idx = 0; av_idx < AV_IDX_MAX; av_idx++)
- _remove_filesrc_pad_block_probe(source, av_idx);
-}
+ if ((appsrc = gst_bin_get_by_name(source->bin, _get_element_name(av_idx, ELEMENT_APPSRC))))
+ APPEND_ELEMENT(element_list, appsrc);
+ else
+ LOG_ERROR("appsrc is NULL");
-int _remove_all_filesrc_pad_block_probes(webrtc_s *webrtc)
-{
- RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
+ if ((queue = gst_bin_get_by_name(source->bin, _get_element_name(av_idx, ELEMENT_QUEUE))))
+ APPEND_ELEMENT(element_list, queue);
+ else
+ LOG_ERROR("queue is NULL");
- g_hash_table_foreach(webrtc->gst.source_slots, __remove_filesrc_pad_block_foreach_cb, NULL);
+ if ((capsfilter = gst_bin_get_by_name(source->bin, _get_element_name(av_idx, ELEMENT_CAPSFILTER))))
+ APPEND_ELEMENT(element_list, capsfilter);
+ else
+ LOG_ERROR("capsfilter is NULL");
- return WEBRTC_ERROR_NONE;
+ _remove_elements_from_bin(source->bin, element_list);
+
+ SAFE_G_LIST_FREE(element_list);
+ }
+
+ __remove_rest_of_elements_for_filesrc_pipeline(source);
+
+ if (source->display)
+ _release_display(source->display);
+
+ if (source->sound_stream_info.type) {
+ free(source->sound_stream_info.type);
+ source->sound_stream_info.type = NULL;
+ }
+
+ source->media_types = 0;
}
-void _set_filesrc_media_types(webrtc_gst_slot_s *source, const char *path)
+static void __set_filesrc_media_types(webrtc_gst_slot_s *source, const char *path)
{
int ret = FILEINFO_ERROR_NONE;
int audio_tracks_num = 0;
source->media_types |= MEDIA_TYPE_VIDEO;
}
+int _set_media_path(webrtc_s *webrtc, unsigned int source_id, const char *path)
+{
+ webrtc_gst_slot_s *source = NULL;
+ GstElement *filesrc = NULL;
+ gchar *location = NULL;
+
+ RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
+ RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0");
+ RET_VAL_IF(path == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "path is NULL");
+ RET_VAL_IF((source = _get_slot_by_id(webrtc->gst.source_slots, source_id)) == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "could not find source");
+ RET_VAL_IF(source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE, WEBRTC_ERROR_INVALID_PARAMETER, "invalid source type [%d]", source->type);
+
+ if (access(path, R_OK) < 0) {
+ if (errno == EACCES || errno == EPERM) {
+ LOG_ERROR("Fail to open path: Permission Denied [%s]", path);
+ return WEBRTC_ERROR_PERMISSION_DENIED;
+ } else {
+ LOG_ERROR("Fail to open path: Invalid Path [%s] errno[%d]", path, errno);
+ return WEBRTC_ERROR_INVALID_PARAMETER;
+ }
+ }
+
+ filesrc = gst_bin_get_by_name(GST_BIN(source->filesrc_pipeline), ELEMENT_NAME_FILE_SRC);
+ RET_VAL_IF(filesrc == NULL, WEBRTC_ERROR_INVALID_OPERATION, "filesrc is NULL");
+
+ g_object_get(G_OBJECT(filesrc), "location", &location, NULL);
+ if (location) {
+ __release_filesrc_resources(source);
+ g_free(location);
+ source->media_types = 0;
+ }
+
+ g_object_set(G_OBJECT(filesrc), "location", path, NULL);
+
+ __set_filesrc_media_types(source, path);
+
+ LOG_DEBUG("source_id[%u] path[%s]", source_id, path);
+
+ return WEBRTC_ERROR_NONE;
+}
+
+static void __set_filesrc_pipline_state_foreach_cb(gpointer key, gpointer value, gpointer user_data)
+{
+ webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value;
+ GstStateChangeReturn ret;
+ GstState state = GPOINTER_TO_UINT(user_data);
+
+ if (source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE)
+ return;
+
+ LOG_INFO("found file source[%p, id:%u]", source, source->id);
+
+ ret = gst_element_set_state(source->filesrc_pipeline, state);
+ if (ret == GST_STATE_CHANGE_FAILURE) {
+ LOG_ERROR("failed to gst_element_set_state(), state[%s]", gst_element_state_get_name(state));
+ return;
+ }
+
+ LOG_INFO("change filesrc pipeline state to [%s]", gst_element_state_get_name(state));
+}
+
+int _gst_filesrc_pipeline_set_state(webrtc_s *webrtc, GstState state)
+{
+ RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
+
+ g_hash_table_foreach(webrtc->gst.source_slots, __set_filesrc_pipline_state_foreach_cb, GINT_TO_POINTER(state));
+
+ return WEBRTC_ERROR_NONE;
+}
+
+int _set_filesrc_looping(webrtc_s *webrtc, unsigned int source_id, bool looping)
+{
+ webrtc_gst_slot_s *source;
+
+ RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
+ RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0");
+ RET_VAL_IF((source = _get_slot_by_id(webrtc->gst.source_slots, source_id)) == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
+ RET_VAL_IF(source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE, WEBRTC_ERROR_INVALID_PARAMETER, "invalid source type [%d]", source->type);
+
+ source->filesrc_loop = looping;
+
+ LOG_DEBUG("source_id[%u] looping[%d]", source_id, looping);
+
+ return WEBRTC_ERROR_NONE;
+}
+
+int _get_filesrc_looping(webrtc_s *webrtc, unsigned int source_id, bool *looping)
+{
+ const webrtc_gst_slot_s *source;
+
+ RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
+ RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0");
+ RET_VAL_IF(looping == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "looping is NULL");
+ RET_VAL_IF((source = _get_slot_by_id(webrtc->gst.source_slots, source_id)) == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL");
+ RET_VAL_IF(source->type != WEBRTC_MEDIA_SOURCE_TYPE_FILE, WEBRTC_ERROR_INVALID_PARAMETER, "invalid source type [%d]", source->type);
+
+ *looping = source->filesrc_loop;
+
+ LOG_DEBUG("source_id[%u] looping[%d]", source_id, *looping);
+
+ return WEBRTC_ERROR_NONE;
+}
+
static GstElement * __create_payloader_for_filesrc_pipeline(GstPad *pad, bool is_audio)
{
element_info_s elem_info;
return WEBRTC_ERROR_INVALID_OPERATION;
}
-void _remove_rest_of_elements_for_filesrc_pipeline(webrtc_gst_slot_s *source)
-{
- GstBin *bin = NULL;
- GstIterator *iter = NULL;
- GstIteratorResult result;
- GValue value = { 0 };
- GstElement *elem = NULL;
-
- RET_IF(source == NULL, "pad is NULL");
- RET_IF(source->filesrc_pipeline == NULL, "filesrc_pipeline is NULL");
-
- bin = GST_BIN(source->filesrc_pipeline);
-
- iter = gst_bin_iterate_elements(bin);
-
- do {
- switch ((result = gst_iterator_next (iter, &value))) {
- case GST_ITERATOR_OK:
- elem = (GstElement *) g_value_get_object(&value);
- if (!g_strrstr(GST_ELEMENT_NAME(elem), ELEMENT_NAME_FILE_SRC) && !g_strrstr(GST_ELEMENT_NAME(elem), "decodebin"))
- gst_bin_remove(bin, elem);
- g_value_unset (&value);
- break;
-
- case GST_ITERATOR_RESYNC:
- gst_iterator_resync(iter);
- break;
-
- case GST_ITERATOR_ERROR:
- LOG_ERROR("error in iterating elements");
- break;
-
- case GST_ITERATOR_DONE:
- break;
-
- default:
- break;
- }
- } while (result == GST_ITERATOR_OK || result == GST_ITERATOR_RESYNC);
-
- gst_iterator_free(iter);
-}
-
static gboolean __filesrc_pipeline_bus_watch_cb(GstBus *bus, GstMessage *message, gpointer user_data)
{
webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)user_data;
source->filesrc_pipeline = NULL;
}
}
+
+static gboolean __check_path_is_not_set_cb(gpointer key, gpointer value, gpointer user_data)
+{
+ const webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value;
+ gchar *location = NULL;
+
+ if (source->type == GPOINTER_TO_INT(user_data)) {
+ LOG_INFO("found file source[%p, id:%u]", source, source->id);
+ g_object_get(G_OBJECT(gst_bin_get_by_name(GST_BIN(source->filesrc_pipeline), ELEMENT_NAME_FILE_SRC)), "location", &location, NULL);
+
+ if (!location)
+ return TRUE;
+
+ g_free(location);
+ }
+
+ return FALSE;
+}
+
+bool _check_if_path_is_set_to_file_sources(webrtc_s *webrtc)
+{
+ const webrtc_gst_slot_s *source;
+
+ RET_VAL_IF(webrtc == NULL, false, "webrtc is NULL");
+
+ source = g_hash_table_find(webrtc->gst.source_slots, __check_path_is_not_set_cb, GINT_TO_POINTER(WEBRTC_MEDIA_SOURCE_TYPE_FILE));
+ if (source) {
+ LOG_ERROR("media path is not set to the file source[%u]", source->id);
+ return false;
+ }
+
+ return true;
+}