void __ms_generate_dots(GstElement *bin, gchar *name_tag);
/**
- * @brief Link two elements.
- *
- * @since_tizen 3.0
- */
-gboolean __ms_link_two_elements(GstElement *previous_element, GstPad *prev_elem_src_pad, GstElement *found_element);
-
-/**
- * @brief Finds GstElement by klass name.
- *
- * @since_tizen 3.0
- */
-GstElement *__ms_bin_find_element_by_klass(GstElement *sink_bin, GstElement *previous_elem,
- GstPad *source_pad, const gchar *klass_name, const gchar *bin_name);
-
-/**
* @brief Creates GstElement by plugin name.
*
* @since_tizen 3.0
GstElement *__ms_node_element_create(node_plug_s *plug_info, media_streamer_node_type_e type);
/**
- * @brief Creates encoder GstElement by mime type.
- *
- * @since_tizen 3.0
- */
-GstElement *__ms_video_encoder_element_create(node_plug_s *plug_info);
-
-/**
- * @brief Creates decoder GstElement by mime type.
- *
- * @since_tizen 3.0
- */
-GstElement *__ms_video_decoder_element_create(node_plug_s *plug_info);
-
-/**
- * @brief Creates audio encoder GstElement.
- *
- * @since_tizen 3.0
- */
-GstElement *__ms_audio_encoder_element_create(node_plug_s *plug_info);
-
-/**
- * @brief Creates audio decoder GstElement.
- *
- * @since_tizen 3.0
- */
-GstElement *__ms_audio_decoder_element_create(node_plug_s *plug_info);
-
-/**
* @brief Creates rtp container GstElement.
*
* @since_tizen 3.0
GstCaps *__ms_create_caps_from_fmt(media_format_h fmt);
/**
- * @brief Creates mediaformat from GstCaps.
- *
- * @since_tizen 3.0
- */
-media_format_h __ms_create_fmt_from_caps(GstCaps *caps);
-
-/**
* @brief Seeks GstElement to according time value.
*
* @since_tizen 3.0
return peer_element;
}
-gboolean __ms_link_two_elements(GstElement *previous_element, GstPad *prev_elem_src_pad, GstElement *found_element)
+static gboolean __ms_link_two_elements(GstElement *previous_element, GstPad *prev_elem_src_pad, GstElement *found_element)
{
GValue src_pad_value = G_VALUE_INIT;
gboolean elements_linked = FALSE;
return gst_element;
}
-GstElement *__ms_node_element_create(node_plug_s *plug_info, media_streamer_node_type_e type)
-{
- GstElement *gst_element = NULL;
- const gchar *src_type = NULL;
- const gchar *sink_type = NULL;
-
- ms_debug_fenter();
-
- ms_retvm_if(plug_info == NULL, NULL, "plug_info is NULL");
-
- MS_GET_CAPS_TYPE(plug_info->src_caps, src_type);
- MS_GET_CAPS_TYPE(plug_info->sink_caps, sink_type);
-
- /* 1. Main priority:
- * If Node klass defined as MEDIA_STREAMER_STRICT or ENCODER/DECODER or CONVERTER types,
- * element will be created immediately by format ot name */
- if (type == MEDIA_STREAMER_NODE_TYPE_AUDIO_ENCODER)
- gst_element = __ms_audio_encoder_element_create(plug_info);
- else if (type == MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER)
- gst_element = __ms_audio_decoder_element_create(plug_info);
- else if (type == MEDIA_STREAMER_NODE_TYPE_VIDEO_ENCODER)
- gst_element = __ms_video_encoder_element_create(plug_info);
- else if (type == MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER)
- gst_element = __ms_video_decoder_element_create(plug_info);
- else if (type == MEDIA_STREAMER_NODE_TYPE_AUDIO_CONVERTER || type == MEDIA_STREAMER_NODE_TYPE_VIDEO_CONVERTER)
- gst_element = __ms_element_create(plug_info->info->default_name, NULL);
- else if (g_strrstr(MEDIA_STREAMER_STRICT, plug_info->info->klass_name) || (!src_type && !sink_type)) {
- if (type == MEDIA_STREAMER_NODE_TYPE_RTP)
- gst_element = __ms_rtp_element_create();
- else
- gst_element = __ms_element_create(plug_info->info->default_name, NULL);
- } else {
-
- /* 2. Second priority:
- * Try to get plugin name that defined in ini file
- * according with node type and specified format. */
- gst_element = __ms_element_create_from_ini(plug_info, type);
- }
-
- /* 3. Third priority:
- * If previous cases did not create a valid gst_element,
- * try to find compatible plugin in gstreamer registry.
- * Elements that are compatible but defined as excluded will be skipped*/
- if (!gst_element) {
- /* Read exclude elements list */
- gst_element = __ms_element_create_by_registry(plug_info, type);
- }
-
- if (type == MEDIA_STREAMER_NODE_TYPE_FILTER) {
- if (plug_info->src_caps)
- g_object_set(G_OBJECT(gst_element), "caps", plug_info->src_caps, NULL);
- }
-
- ms_debug_fleave();
-
- return gst_element;
-}
-
-GstElement *__ms_video_encoder_element_create(node_plug_s *plug_info)
+static GstElement *__ms_video_encoder_element_create(node_plug_s *plug_info)
{
GstElement *video_scale = NULL;
GstElement *video_convert = NULL;
return NULL;
}
-GstElement *__ms_video_decoder_element_create(node_plug_s *plug_info)
+static GstElement *__ms_video_decoder_element_create(node_plug_s *plug_info)
{
gboolean is_hw_codec = FALSE;
GstElement *last_elem = NULL;
return NULL;
}
-GstElement *__ms_audio_encoder_element_create(node_plug_s *plug_info)
+static GstElement *__ms_audio_encoder_element_create(node_plug_s *plug_info)
{
gboolean gst_ret = FALSE;
GstElement *audio_convert = NULL;
}
-GstElement *__ms_audio_decoder_element_create(node_plug_s *plug_info)
+static GstElement *__ms_audio_decoder_element_create(node_plug_s *plug_info)
{
gboolean gst_ret = FALSE;
GstElement *decoder_bin = NULL;
return NULL;
}
+GstElement *__ms_node_element_create(node_plug_s *plug_info, media_streamer_node_type_e type)
+{
+ GstElement *gst_element = NULL;
+ const gchar *src_type = NULL;
+ const gchar *sink_type = NULL;
+
+ ms_debug_fenter();
+
+ ms_retvm_if(plug_info == NULL, NULL, "plug_info is NULL");
+
+ MS_GET_CAPS_TYPE(plug_info->src_caps, src_type);
+ MS_GET_CAPS_TYPE(plug_info->sink_caps, sink_type);
+
+ /* 1. Main priority:
+ * If Node klass defined as MEDIA_STREAMER_STRICT or ENCODER/DECODER or CONVERTER types,
+ * element will be created immediately by format ot name */
+ if (type == MEDIA_STREAMER_NODE_TYPE_AUDIO_ENCODER)
+ gst_element = __ms_audio_encoder_element_create(plug_info);
+ else if (type == MEDIA_STREAMER_NODE_TYPE_AUDIO_DECODER)
+ gst_element = __ms_audio_decoder_element_create(plug_info);
+ else if (type == MEDIA_STREAMER_NODE_TYPE_VIDEO_ENCODER)
+ gst_element = __ms_video_encoder_element_create(plug_info);
+ else if (type == MEDIA_STREAMER_NODE_TYPE_VIDEO_DECODER)
+ gst_element = __ms_video_decoder_element_create(plug_info);
+ else if (type == MEDIA_STREAMER_NODE_TYPE_AUDIO_CONVERTER || type == MEDIA_STREAMER_NODE_TYPE_VIDEO_CONVERTER)
+ gst_element = __ms_element_create(plug_info->info->default_name, NULL);
+ else if (g_strrstr(MEDIA_STREAMER_STRICT, plug_info->info->klass_name) || (!src_type && !sink_type)) {
+ if (type == MEDIA_STREAMER_NODE_TYPE_RTP)
+ gst_element = __ms_rtp_element_create();
+ else
+ gst_element = __ms_element_create(plug_info->info->default_name, NULL);
+ } else {
+
+ /* 2. Second priority:
+ * Try to get plugin name that defined in ini file
+ * according with node type and specified format. */
+ gst_element = __ms_element_create_from_ini(plug_info, type);
+ }
+
+ /* 3. Third priority:
+ * If previous cases did not create a valid gst_element,
+ * try to find compatible plugin in gstreamer registry.
+ * Elements that are compatible but defined as excluded will be skipped*/
+ if (!gst_element) {
+ /* Read exclude elements list */
+ gst_element = __ms_element_create_by_registry(plug_info, type);
+ }
+
+ if (type == MEDIA_STREAMER_NODE_TYPE_FILTER) {
+ if (plug_info->src_caps)
+ g_object_set(G_OBJECT(gst_element), "caps", plug_info->src_caps, NULL);
+ }
+
+ ms_debug_fleave();
+
+ return gst_element;
+}
+
GstElement *__ms_rtp_element_create(void)
{
GstElement *rtp_container = NULL;
return caps;
}
-media_format_h __ms_create_fmt_from_caps(GstCaps *caps)
+static media_format_h __ms_create_fmt_from_caps(GstCaps *caps)
{
media_format_h fmt;
GstStructure *pad_struct;