Hi,

  As discussed on irc. Attached is a small patch that ensures the Call activity
  uses an xvimagesink for the main video output and an ximagesink for the
  video preview. Apart from using less cpu when scaling (Although i don't know
  if Call does that) on B1 and B2 machine it also has the added benifit of
  making the colors of the video output look ugly due to the xv issue.

  Sjoerd
-- 
All men know the utility of useful things;
but they do not know the utility of futility.
                -- Chuang-tzu
Thu May 17 00:27:11 CEST 2007  Sjoerd Simons <[EMAIL PROTECTED]>
  * Hack to force usage of ximagesink for the preview window, so the xvimagesink is free for the main window
diff -rN -u old-stream-engine/src/stream.c new-stream-engine/src/stream.c
--- old-stream-engine/src/stream.c	2007-05-17 01:13:16.000000000 +0200
+++ new-stream-engine/src/stream.c	2007-05-17 01:13:16.000000000 +0200
@@ -1374,7 +1374,7 @@
       return TRUE;
     }
 
-  sink = tp_stream_engine_make_video_sink (engine);
+  sink = tp_stream_engine_make_video_sink (engine, FALSE);
 
   if (sink == NULL)
     {
diff -rN -u old-stream-engine/src/tp-stream-engine.c new-stream-engine/src/tp-stream-engine.c
--- old-stream-engine/src/tp-stream-engine.c	2007-05-17 01:13:16.000000000 +0200
+++ new-stream-engine/src/tp-stream-engine.c	2007-05-17 01:13:16.000000000 +0200
@@ -274,7 +274,7 @@
 }
 
 GstElement *
-tp_stream_engine_make_video_sink (TpStreamEngine *obj)
+tp_stream_engine_make_video_sink (TpStreamEngine *obj, gboolean is_preview)
 {
   TpStreamEnginePrivate *priv = TP_STREAM_ENGINE_GET_PRIVATE (obj);
   const gchar *videosink_name;
@@ -296,7 +296,16 @@
   else
     {
 #ifndef MAEMO_OSSO_SUPPORT
-      sink = gst_element_factory_make ("gconfvideosink", NULL);
+      if (is_preview) {
+        /* hack to leave an xvimage free for the bigger output.
+         * Most machines only have one xvport, so this helps in the majority of
+         * cases. More intelligent widgets 
+         * */
+        sink = gst_element_factory_make ("ximagesink", NULL);
+      }
+
+      if (sink == NULL)
+        sink = gst_element_factory_make ("gconfvideosink", NULL);
 
       if (sink == NULL)
         sink = gst_element_factory_make ("autovideosink", NULL);
@@ -385,7 +394,7 @@
   g_debug ("adding preview in window %u", window_id);
 
   tee = gst_bin_get_by_name (GST_BIN (priv->pipeline), "tee");
-  sink = tp_stream_engine_make_video_sink (obj);
+  sink = tp_stream_engine_make_video_sink (obj, TRUE);
 
   if (sink == NULL)
     goto sink_failure;
diff -rN -u old-stream-engine/src/tp-stream-engine.h new-stream-engine/src/tp-stream-engine.h
--- old-stream-engine/src/tp-stream-engine.h	2007-05-17 01:13:16.000000000 +0200
+++ new-stream-engine/src/tp-stream-engine.h	2007-05-17 01:13:16.000000000 +0200
@@ -73,7 +73,7 @@
 void tp_stream_engine_emit_receiving (TpStreamEngine *obj, gchar *channel_path,
     guint stream_id, gboolean state);
 
-GstElement *tp_stream_engine_make_video_sink (TpStreamEngine *obj);
+GstElement *tp_stream_engine_make_video_sink (TpStreamEngine *obj, gboolean is_preview);
 GstElement *tp_stream_engine_get_pipeline (TpStreamEngine *obj);
 
 gboolean

_______________________________________________
Sugar mailing list
[email protected]
http://mailman.laptop.org/mailman/listinfo/sugar

Reply via email to