[farsight2/master] Put ffmpegcolorspace/audioconvert/audioresample inside the appropriate codec bins

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:20:35 PST 2008


---
 gst/fsrtpconference/fs-rtp-discover-codecs.c |   30 ++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-discover-codecs.c b/gst/fsrtpconference/fs-rtp-discover-codecs.c
index 4084c8a..87cb8ae 100644
--- a/gst/fsrtpconference/fs-rtp-discover-codecs.c
+++ b/gst/fsrtpconference/fs-rtp-discover-codecs.c
@@ -494,6 +494,7 @@ parse_codec_cap_list (GList *list, FsMediaType media_type)
   CodecBlueprint *codec_blueprint;
   gint i;
   gchar *tmp;
+  GstElementFactory *tmpfact;
 
   /* go thru all common caps */
   for (walk = list; walk; walk = g_list_next (walk))
@@ -558,6 +559,35 @@ parse_codec_cap_list (GList *list, FsMediaType media_type)
     codec_blueprint->receive_pipeline_factory =
       copy_element_list (codec_cap->element_list1);
 
+    /* Lets add the converters at the beginning of the encoding pipelines */
+    if (media_type == FS_MEDIA_TYPE_VIDEO)
+    {
+      tmpfact = gst_element_factory_find ("ffmpegcolorspace");
+      if (tmpfact)
+      {
+        codec_blueprint->send_pipeline_factory = g_list_append (
+            codec_blueprint->send_pipeline_factory,
+            g_list_append (NULL, tmpfact));
+      }
+    }
+    else if (media_type == FS_MEDIA_TYPE_AUDIO)
+    {
+      tmpfact = gst_element_factory_find ("audioresample");
+      if (tmpfact)
+      {
+        codec_blueprint->send_pipeline_factory = g_list_append (
+            codec_blueprint->send_pipeline_factory,
+            g_list_append (NULL, tmpfact));
+      }
+      tmpfact = gst_element_factory_find ("audioconvert");
+      if (tmpfact)
+      {
+        codec_blueprint->send_pipeline_factory = g_list_append (
+            codec_blueprint->send_pipeline_factory,
+            g_list_append (NULL, tmpfact));
+      }
+    }
+
     /* insert new information into tables */
     list_codec_blueprints[media_type] = g_list_append (
         list_codec_blueprints[media_type], codec_blueprint);
-- 
1.5.6.5




More information about the farsight-commits mailing list