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