Home | History | Annotate | Download | only in patches
      1 --- ekiga-2.0.5/src/gui/main.cpp.ori	2007-02-14 04:28:57.000000000 +0800
      2 +++ ekiga-2.0.5/src/gui/main.cpp	2007-03-11 15:49:49.131172000 +0800
      3 @@ -2593,9 +2593,9 @@
      4    GmWindow *mw = NULL;
      5  
      6    GdkPixbuf *lsrc_pic = NULL;
      7 -  GdkPixbuf *zlsrc_pic = NULL;
      8 +  static GdkPixbuf *zlsrc_pic = NULL;
      9    GdkPixbuf *rsrc_pic = NULL;
     10 -  GdkPixbuf *zrsrc_pic = NULL;
     11 +  static GdkPixbuf *zrsrc_pic = NULL;
     12    GdkPixbuf *framepixbuf = NULL;
     13    GdkPixbuf *nzlsrc_pic = NULL;
     14    GdkPixbuf *tmpframe = NULL;
     15 @@ -2645,11 +2645,9 @@
     16    int small_frame_absposx = 0;
     17    int small_frame_absposy = 0;
     18  
     19 -  int incr_resulting_width = 0;
     20 -  int incr_resulting_height = 0;
     21 -  int incr_max_resulting_width = 0;
     22 -  int incr_max_resulting_height = 0;
     23 -
     24 +  static GdkPixbuf *tmp_pixbuf = NULL;
     25 +  static int frame_width, frame_height;
     26 +  
     27  #ifdef HAS_SDL
     28    /* FULLSCREEN config */
     29    const float fs_rratio = 0.7;
     30 @@ -2661,8 +2659,7 @@
     31  #endif
     32  
     33    /* booleans to handle some display types syntactically easier */
     34 -  gboolean display_both_side = FALSE;
     35 -  gboolean display_both_incrusted = FALSE;
     36 +  gboolean display_both = FALSE;
     37    gboolean fs_active = FALSE;
     38  
     39    /* resize the video frame to the requested size, depending on what we want
     40 @@ -2693,8 +2690,15 @@
     41  				 GM_QCIF_HEIGHT);
     42  
     43    /* get the actual size of the video frame */
     44 -  video_frame_width = GTK_WIDGET (mw->main_video_image)->allocation.width;
     45 -  video_frame_height = GTK_WIDGET (mw->main_video_image)->allocation.height;
     46 +  if (display_type != BOTH) {
     47 +    video_frame_width = GTK_WIDGET (mw->main_video_image)->allocation.width;
     48 +    video_frame_height = GTK_WIDGET (mw->main_video_image)->allocation.height;
     49 +  }
     50 +  else {
     51 +    video_frame_width = GTK_WIDGET (mw->local_video_window)->allocation.width * 2;
     52 +    video_frame_height = GTK_WIDGET (mw->local_video_window)->allocation.height;
     53 +  }
     54 +
     55    /* compute reduced values, reductions are fixed,
     56     * we will use THESE values as base to scale the images */
     57    video_frame_rwidth = video_frame_width;
     58 @@ -2739,47 +2743,64 @@
     59        gtk_widget_show_all (GTK_WIDGET (mw->video_frame));
     60    }
     61  
     62 -  if (display_type == BOTH_SIDE) display_both_side = TRUE;
     63 -  if (display_type == BOTH_INCRUSTED) display_both_incrusted = TRUE;
     64 +  if (display_type == BOTH_SIDE || display_type == BOTH)
     65 +    display_both = TRUE;
     66 +
     67  #ifdef HAS_SDL
     68    if (mw->screen != NULL) fs_active = TRUE;
     69  #else
     70    if (display_type == FULLSCREEN) fs_active = TRUE;
     71  #endif
     72  
     73 -  /* The real size picture, if required */
     74 -  if (display_type != REMOTE_VIDEO && lbuffer && !fs_active) {
     75 +  if ((tmp_pixbuf == NULL ||
     76 +      frame_width != video_frame_rwidth ||
     77 +      frame_height != video_frame_rheight) &&
     78 +      !fs_active) {
     79  
     80 -    if (lf_width > 0 && lf_height > 0) 
     81 +    if (tmp_pixbuf != NULL) {
     82 +       g_object_unref (tmp_pixbuf);
     83 +    }
     84 +
     85 +    tmp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 
     86 +   			  video_frame_rwidth, 
     87 +    			video_frame_rheight);
     88 +    frame_width = video_frame_rwidth;
     89 +    frame_height = video_frame_rheight;
     90 +
     91 +    zlsrc_pic =     
     92 +          gdk_pixbuf_new_subpixbuf (tmp_pixbuf,
     93 +            0, 0, 
     94 +            display_both?video_frame_rwidth / 2:video_frame_rwidth,
     95 +            video_frame_rheight);
     96 +    zrsrc_pic =
     97 +            gdk_pixbuf_new_subpixbuf (tmp_pixbuf,
     98 +            display_both?video_frame_rwidth / 2:0, 0,
     99 +            display_both?video_frame_rwidth / 2:video_frame_rwidth, 
    100 +            video_frame_rheight);
    101 +  }
    102 +    
    103 +  if (display_type != REMOTE_VIDEO && 
    104 +      display_type != BOTH_INCRUSTED &&
    105 +      lbuffer && !fs_active) {
    106 +    if (lf_width > 0 && lf_height > 0) {
    107        lsrc_pic =  
    108  	gdk_pixbuf_new_from_data (lbuffer, GDK_COLORSPACE_RGB, 
    109  				  FALSE, 8, lf_width, lf_height, 
    110  				  lf_width * 3, 
    111  				  NULL, NULL);
    112  
    113 -    if (!display_both_incrusted)
    114 -      /* scale the local image to the full available space, or,
    115 -       * if BOTH_SIDE: full_space/2 on X axis */ 
    116 -      zlsrc_pic =
    117 -	gdk_pixbuf_scale_simple (lsrc_pic,
    118 -				 display_both_side?video_frame_rwidth / 2:video_frame_rwidth,
    119 +      gdk_pixbuf_scale (lsrc_pic, zlsrc_pic,
    120 +         0, 0,
    121 +				 display_both?video_frame_rwidth / 2:video_frame_rwidth,
    122  				 video_frame_rheight,
    123 +         0, 0,
    124 +         lzoom, lzoom,
    125  				 bilinear_filtering?GDK_INTERP_BILINEAR:GDK_INTERP_NEAREST);
    126 -
    127 -    else
    128 -      /* scale the local image to the requested small size
    129 -       * for BOTH_INCRUSTED */
    130 -      zlsrc_pic =
    131 -	gdk_pixbuf_scale_simple (lsrc_pic,
    132 -				 (int) (video_frame_rwidth * incr_lratio),
    133 -				 (int) (video_frame_rheight * incr_lratio),
    134 -				 bilinear_filtering?GDK_INTERP_BILINEAR:GDK_INTERP_NEAREST);
    135 -
    136 -    g_object_unref (lsrc_pic);
    137 -
    138 -
    139 +      g_object_unref(lsrc_pic);
    140 +    }
    141    }
    142  
    143 +
    144    if (display_type != LOCAL_VIDEO && rbuffer && !fs_active) {
    145  
    146      if (rf_width > 0 && rf_height > 0) {
    147 @@ -2790,15 +2811,16 @@
    148  				  rf_width * 3, 
    149  				  NULL, NULL);
    150      }
    151 -    /* scale the remote image to the full available space, or,
    152 -     * if BOTH_SIDE: full_space/2 on X axis */
    153 -    zrsrc_pic =
    154 -      gdk_pixbuf_scale_simple (rsrc_pic,
    155 -			       display_both_side?video_frame_rwidth / 2:video_frame_rwidth,
    156 -			       video_frame_rheight,
    157 -			       bilinear_filtering?GDK_INTERP_BILINEAR:GDK_INTERP_NEAREST);
    158  
    159 -    g_object_unref (rsrc_pic);
    160 +      gdk_pixbuf_scale (rsrc_pic, zrsrc_pic,
    161 +         0, 0,
    162 +			   display_both?video_frame_rwidth / 2:video_frame_rwidth,
    163 +			   video_frame_rheight,
    164 +			   0, 0,
    165 +         rzoom, rzoom,
    166 +         bilinear_filtering?GDK_INTERP_BILINEAR:GDK_INTERP_NEAREST);
    167 +
    168 +    g_object_unref (rsrc_pic);      
    169    }
    170  
    171  #ifdef HAS_SDL
    172 @@ -2839,28 +2861,17 @@
    173  
    174    switch (display_type) {
    175  
    176 -  case LOCAL_VIDEO:
    177 -    if (zlsrc_pic) {
    178 -
    179 -      gtk_image_set_from_pixbuf (GTK_IMAGE (mw->main_video_image), 
    180 -				 GDK_PIXBUF (zlsrc_pic));
    181 -      g_object_unref (zlsrc_pic);
    182 -    }
    183 -    break;
    184 -
    185 -  case REMOTE_VIDEO:
    186 -    if (zrsrc_pic) {
    187 -
    188 -      gtk_image_set_from_pixbuf (GTK_IMAGE (mw->main_video_image), 
    189 -				 GDK_PIXBUF (zrsrc_pic));
    190 -      g_object_unref (zrsrc_pic);
    191 -    }
    192 -    break;
    193 -
    194    case BOTH_INCRUSTED:
    195  
    196      if (zlsrc_pic && zrsrc_pic) {
    197  
    198 +      if (lf_width > 0 && lf_height > 0)
    199 +        lsrc_pic = gdk_pixbuf_new_from_data (lbuffer,
    200 +            GDK_COLORSPACE_RGB, 
    201 +				    FALSE, 8, lf_width, lf_height,
    202 +            lf_width * 3, 
    203 +				    NULL, NULL);
    204 +
    205        /* get the frame out of XPM data */
    206        framepixbuf =
    207  	gdk_pixbuf_new_from_xpm_data ((const char **) gm_both_incrusted_frame_xpm);
    208 @@ -2875,50 +2886,33 @@
    209  	(int) (video_frame_rheight * incr_rel_lposy);
    210  
    211        /* scale the local pic down to fit inside the frame */
    212 -      nzlsrc_pic =
    213 -	gdk_pixbuf_scale_simple (zlsrc_pic,
    214 -				 incr_frame_width - (2 * incr_lfrm_thick),
    215 -				 incr_frame_height - (2 * incr_lfrm_thick),
    216 -				 bilinear_filtering?GDK_INTERP_BILINEAR:GDK_INTERP_NEAREST);
    217 -
    218 -      /* copy the local pic inside the frame */
    219 -      gdk_pixbuf_copy_area (nzlsrc_pic,
    220 -			    0, 0,
    221 -			    gdk_pixbuf_get_width (nzlsrc_pic) - incr_lfrm_thick,
    222 -			    gdk_pixbuf_get_height (nzlsrc_pic) - incr_lfrm_thick,
    223 -			    framepixbuf,
    224 -			    incr_lfrm_thick, incr_lfrm_thick);
    225 -
    226 -      /* scale the frame plus the picture to the requested size */
    227 -      tmpframe = gdk_pixbuf_scale_simple (framepixbuf,
    228 -					  (int) (video_frame_rwidth * incr_lratio),
    229 -					  (int) (video_frame_rheight * incr_lratio),
    230 -					  GDK_INTERP_BILINEAR);
    231 -
    232 -      /* make sure we're respecting the forced border */
    233 -      incr_resulting_width = small_frame_absposx + gdk_pixbuf_get_width (tmpframe);
    234 -      incr_resulting_height = small_frame_absposy + gdk_pixbuf_get_height (tmpframe);
    235 -
    236 -      incr_max_resulting_width = video_frame_rwidth - incr_brd_lright;
    237 -      incr_max_resulting_height = video_frame_rheight - incr_brd_ldown;
    238 -
    239 -      if ( incr_resulting_width > incr_max_resulting_width )
    240 -	small_frame_absposx =
    241 -	  video_frame_rwidth - gdk_pixbuf_get_width (tmpframe) - incr_brd_lright;
    242 -
    243 -      if ( incr_resulting_height > incr_max_resulting_height )
    244 -	small_frame_absposy =
    245 -	  video_frame_rheight - gdk_pixbuf_get_height (tmpframe) - incr_brd_ldown;
    246 -
    247 -      /* copy the small picture into the big one, freshly scaled, positioned
    248 -       * and polished :-) */ 
    249 -      gdk_pixbuf_copy_area  (tmpframe, 
    250 -			     0 , 0,
    251 -			     gdk_pixbuf_get_width (tmpframe), 
    252 -			     gdk_pixbuf_get_height (tmpframe),
    253 -			     zrsrc_pic,
    254 -			     small_frame_absposx, 
    255 -			     small_frame_absposy);
    256 +      nzlsrc_pic = gdk_pixbuf_new_subpixbuf(framepixbuf,
    257 +          incr_lfrm_thick,incr_lfrm_thick,
    258 +          incr_frame_width - (2 * incr_lfrm_thick),
    259 +				  incr_frame_height - (2 * incr_lfrm_thick));
    260 +     
    261 +	    gdk_pixbuf_scale (lsrc_pic, nzlsrc_pic,
    262 +          0, 0,
    263 +          incr_frame_width - (2 * incr_lfrm_thick),
    264 +				  incr_frame_height - (2 * incr_lfrm_thick),
    265 +          0, 0,
    266 +          (incr_frame_width - (2 * incr_lfrm_thick)) / lf_width,
    267 +          (incr_frame_height - (2 * incr_lfrm_thick)) / lf_height, 
    268 +				  bilinear_filtering?GDK_INTERP_BILINEAR:GDK_INTERP_NEAREST);
    269 +
    270 +       tmpframe = gdk_pixbuf_new_subpixbuf (zrsrc_pic,
    271 +          small_frame_absposx, small_frame_absposy,
    272 +          (int) (video_frame_rwidth * incr_lratio),
    273 +          (int) (video_frame_rheight * incr_lratio));
    274 +
    275 +      gdk_pixbuf_scale (framepixbuf, tmpframe, 
    276 +          0, 0,
    277 +          (int) (video_frame_rwidth * incr_lratio),
    278 +          (int) (video_frame_rheight * incr_lratio),
    279 +          0, 0,
    280 +          video_frame_rwidth * incr_lratio / incr_frame_width, 
    281 +          video_frame_rheight * incr_lratio / incr_frame_height,
    282 +          bilinear_filtering?GDK_INTERP_BILINEAR:GDK_INTERP_NEAREST);
    283  
    284        gtk_image_set_from_pixbuf (GTK_IMAGE (mw->main_video_image), 
    285  				 GDK_PIXBUF (zrsrc_pic));
    286 @@ -2926,39 +2920,17 @@
    287        g_object_unref (framepixbuf);
    288        g_object_unref (tmpframe);
    289        g_object_unref (nzlsrc_pic);
    290 -      g_object_unref (zrsrc_pic);
    291 -      g_object_unref (zlsrc_pic);
    292      }
    293      break;
    294  
    295 +  case LOCAL_VIDEO:
    296 +  case REMOTE_VIDEO:
    297    case BOTH_SIDE:
    298  
    299 -    if (zlsrc_pic && zrsrc_pic) {
    300 -
    301 -      GdkPixbuf *tmp_pixbuf = 
    302 -	gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 
    303 -			video_frame_rwidth, 
    304 -			video_frame_rheight);
    305 -
    306 -      gdk_pixbuf_copy_area (zrsrc_pic,
    307 -			    0, 0,
    308 -			    video_frame_rwidth / 2,
    309 -			    video_frame_rheight,
    310 -			    tmp_pixbuf,
    311 -			    0, 0);
    312 -
    313 -      gdk_pixbuf_copy_area (zlsrc_pic,
    314 -			    0, 0,
    315 -			    video_frame_rwidth / 2,
    316 -			    video_frame_rheight,
    317 -			    tmp_pixbuf,
    318 -			    video_frame_rwidth / 2, 0);
    319 +    if (tmp_pixbuf) {
    320  
    321        gtk_image_set_from_pixbuf (GTK_IMAGE (mw->main_video_image), 
    322  				 GDK_PIXBUF (tmp_pixbuf));
    323 -      g_object_unref (zrsrc_pic);
    324 -      g_object_unref (zlsrc_pic);
    325 -      g_object_unref (tmp_pixbuf);
    326      }
    327  
    328      break;
    329 @@ -2972,8 +2944,6 @@
    330        gtk_image_set_from_pixbuf (GTK_IMAGE (mw->local_video_image), 
    331  				 GDK_PIXBUF (zlsrc_pic));
    332  
    333 -      g_object_unref (zrsrc_pic);
    334 -      g_object_unref (zlsrc_pic);
    335      }
    336      break;
    337  
    338 --- ekiga-2.0.5/ekiga.schemas.in.in.ori	2007-02-14 04:29:12.000000000 +0800
    339 +++ ekiga-2.0.5/ekiga.schemas.in.in	2007-03-11 15:52:47.872240000 +0800
    340 @@ -173,7 +173,7 @@
    341        <owner>Ekiga</owner>
    342        <type>list</type>
    343        <list_type>string</list_type>
    344 -      <default>[SpeexWide-20.6k=1,iLBC-13k3=1,GSM-06.10=1,MS-GSM=1,SpeexNarrow-8k=1,G.711-uLaw-64k=1,G.711-ALaw-64k=1]</default>
    345 +      <default>[G.711-ulaw-64k=1,SpeexWide-20.6k=0,iLBC-13k3=1,GSM-06.10=1,MS-GSM=1,SpeexNarrow-8k=1,G.711-ALaw-64k=1]</default>
    346        <locale name="C">
    347  	<short>The Audio Codecs List</short>
    348  	<long>The Audio Codecs List</long>
    349 @@ -217,7 +217,7 @@
    350        <applyto>/apps/@PACKAGE_NAME@/codecs/audio/enable_echo_cancelation</applyto>
    351        <owner>Ekiga</owner>
    352        <type>bool</type>
    353 -      <default>true</default>
    354 +      <default>false</default>
    355        <locale name="C">
    356  	<short>Enable echo cancelation</short>
    357  	<long>If enabled, use echo cancelation</long>
    358