~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to libvo/vo_gl.c

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
static int lscale;
119
119
static int cscale;
120
120
static float filter_strength;
 
121
static float noise_strength;
121
122
static int yuvconvtype;
122
123
static int use_rectangle;
123
124
static int err_shown;
150
151
static int custom_trect;
151
152
static int mipmap_gen;
152
153
static int stereo_mode;
 
154
static enum MPGLType backend;
153
155
 
154
156
static int int_pause;
155
157
static int eq_bri = 0;
171
173
static void redraw(void);
172
174
 
173
175
static void resize(int x,int y){
 
176
  // simple orthogonal projection for 0-image_width;0-image_height
 
177
  float matrix[16] = {
 
178
    2.0/image_width,   0, 0, 0,
 
179
    0, -2.0/image_height, 0, 0,
 
180
    0, 0, 0, 0,
 
181
    -1, 1, 0, 1
 
182
  };
174
183
  mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y);
175
184
  if (WinID >= 0) {
176
185
    int left = 0, top = 0, w = x, h = y;
181
190
    mpglViewport( 0, 0, x, y );
182
191
 
183
192
  mpglMatrixMode(GL_PROJECTION);
184
 
  mpglLoadIdentity();
185
193
  ass_border_x = ass_border_y = 0;
186
194
  if (aspect_scaling() && use_aspect) {
187
195
    int new_w, new_h;
192
200
    new_h += vo_panscan_y;
193
201
    scale_x = (GLdouble)new_w / (GLdouble)x;
194
202
    scale_y = (GLdouble)new_h / (GLdouble)y;
195
 
    mpglScaled(scale_x, scale_y, 1);
 
203
    matrix[0]  *= scale_x;
 
204
    matrix[12] *= scale_x;
 
205
    matrix[5]  *= scale_y;
 
206
    matrix[13] *= scale_y;
196
207
    ass_border_x = (vo_dwidth - new_w) / 2;
197
208
    ass_border_y = (vo_dheight - new_h) / 2;
198
209
  }
199
 
  mpglOrtho(0, image_width, image_height, 0, -1,1);
 
210
  mpglLoadMatrixf(matrix);
200
211
 
201
212
  mpglMatrixMode(GL_MODELVIEW);
202
213
  mpglLoadIdentity();
240
251
  float bgamma = exp(log(8.0) * eq_bgamma / 100.0);
241
252
  gl_conversion_params_t params = {gl_target, yuvconvtype,
242
253
      {colorspace, levelconv, bri, cont, hue, sat, rgamma, ggamma, bgamma, 0},
243
 
      texture_width, texture_height, 0, 0, filter_strength};
 
254
      texture_width, texture_height, 0, 0, filter_strength, noise_strength};
244
255
  mp_get_chroma_shift(image_format, &xs, &ys, &depth);
245
256
  params.chrom_texw = params.texw >> xs;
246
257
  params.chrom_texh = params.texh >> ys;
537
548
  mpglDepthMask(GL_FALSE);
538
549
  mpglDisable(GL_CULL_FACE);
539
550
  mpglEnable(gl_target);
540
 
  mpglDrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT);
 
551
  if (mpglDrawBuffer)
 
552
    mpglDrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT);
541
553
  mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
542
554
 
543
555
  mp_msg(MSGT_VO, MSGL_V, "[gl] Creating %dx%d texture...\n",
608
620
  if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
609
621
    return -1;
610
622
#endif
 
623
#ifdef CONFIG_GL_EGL_X11
 
624
  if (glctx.type == GLTYPE_EGL_X11) {
 
625
    XVisualInfo vinfo = { .visual = CopyFromParent, .depth = CopyFromParent };
 
626
    vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height, flags,
 
627
            CopyFromParent, "gl", title);
 
628
  }
 
629
#endif
611
630
#ifdef CONFIG_GL_X11
612
631
  if (glctx.type == GLTYPE_X11) {
613
632
    static int default_glx_attribs[] = {
774
793
    return;
775
794
  // set special rendering parameters
776
795
  if (!scaled_osd) {
 
796
    // simple orthogonal projection for 0-vo_dwidth;0-vo_dheight
 
797
    float matrix[16] = {
 
798
      2.0/vo_dwidth,   0, 0, 0,
 
799
      0, -2.0/vo_dheight, 0, 0,
 
800
      0,  0, 0, 0,
 
801
      -1, 1, 0, 1
 
802
    };
777
803
    mpglMatrixMode(GL_PROJECTION);
778
804
    mpglPushMatrix();
779
 
    mpglLoadIdentity();
780
 
    mpglOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1);
 
805
    mpglLoadMatrixf(matrix);
781
806
  }
782
807
  mpglEnable(GL_BLEND);
783
808
  if (draw_eosd) {
819
844
//  Enable(GL_TEXTURE_2D);
820
845
//  BindTexture(GL_TEXTURE_2D, texture_id);
821
846
 
822
 
  mpglColor3f(1,1,1);
 
847
  mpglColor4f(1,1,1,1);
823
848
  if (is_yuv || custom_prog)
824
849
    glEnableYUVConversion(gl_target, yuvconvtype);
825
850
  if (stereo_mode) {
1113
1138
  uninit_mpglcontext(&glctx);
1114
1139
}
1115
1140
 
 
1141
static int valid_backend(void *p)
 
1142
{
 
1143
  int *backend = p;
 
1144
  return *backend >= GLTYPE_AUTO && *backend < GLTYPE_COUNT;
 
1145
}
 
1146
 
1116
1147
static int valid_csp(void *p)
1117
1148
{
1118
1149
  int *csp = p;
1139
1170
  {"lscale",       OPT_ARG_INT,  &lscale,       int_non_neg},
1140
1171
  {"cscale",       OPT_ARG_INT,  &cscale,       int_non_neg},
1141
1172
  {"filter-strength", OPT_ARG_FLOAT, &filter_strength, NULL},
 
1173
  {"noise-strength", OPT_ARG_FLOAT, &noise_strength, NULL},
1142
1174
  {"ati-hack",     OPT_ARG_BOOL, &ati_hack,     NULL},
1143
1175
  {"force-pbo",    OPT_ARG_BOOL, &force_pbo,    NULL},
1144
1176
  {"mesa-buffer",  OPT_ARG_BOOL, &mesa_buffer,  NULL},
1151
1183
  {"mipmapgen",    OPT_ARG_BOOL, &mipmap_gen,   NULL},
1152
1184
  {"osdcolor",     OPT_ARG_INT,  &osd_color,    NULL},
1153
1185
  {"stereo",       OPT_ARG_INT,  &stereo_mode,  NULL},
 
1186
  {"backend",      OPT_ARG_INT,  &backend,      valid_backend},
1154
1187
  {NULL}
1155
1188
};
1156
1189
 
1157
1190
static int preinit_internal(const char *arg, int allow_sw)
1158
1191
{
1159
1192
    // set defaults
1160
 
    enum MPGLType gltype = GLTYPE_AUTO;
 
1193
    backend = GLTYPE_AUTO;
1161
1194
    many_fmts = 1;
1162
1195
    use_osd = -1;
1163
1196
    scaled_osd = 0;
1169
1202
    lscale = 0;
1170
1203
    cscale = 0;
1171
1204
    filter_strength = 0.5;
 
1205
    noise_strength = 0.0;
1172
1206
    use_rectangle = -1;
1173
1207
    use_glFinish = 0;
1174
1208
    ati_hack = -1;
1244
1278
              "    as lscale but for chroma (2x slower with little visible effect).\n"
1245
1279
              "  filter-strength=<value>\n"
1246
1280
              "    set the effect strength for some lscale/cscale filters\n"
 
1281
              "  noise-strength=<value>\n"
 
1282
              "    set how much noise to add. 1.0 is suitable for dithering to 6 bit.\n"
1247
1283
              "  customprog=<filename>\n"
1248
1284
              "    use a custom YUV conversion program\n"
1249
1285
              "  customtex=<filename>\n"
1256
1292
              "    generate mipmaps for the video image (use with TXB in customprog)\n"
1257
1293
              "  osdcolor=<0xAARRGGBB>\n"
1258
1294
              "    use the given color for the OSD\n"
1259
 
              "  stereo=<n>\n"
 
1295
              "  stereo=<n> (add 32 to swap left and right)\n"
1260
1296
              "    0: normal display\n"
1261
1297
              "    1: side-by-side to red-cyan stereo\n"
1262
1298
              "    2: side-by-side to green-magenta stereo\n"
1263
1299
              "    3: side-by-side to quadbuffer stereo\n"
 
1300
              "  backend=<n>\n"
 
1301
              "   -1: auto-select\n"
 
1302
              "    0: Win32/WGL\n"
 
1303
              "    1: X11/GLX\n"
 
1304
              "    2: SDL\n"
 
1305
              "    3: X11/EGL (experimental)\n"
1264
1306
              "\n" );
1265
1307
      return -1;
1266
1308
    }
1267
 
    if (!init_mpglcontext(&glctx, gltype))
 
1309
    if (!init_mpglcontext(&glctx, backend))
1268
1310
      goto err_out;
1269
1311
    if (use_yuv == -1 || !allow_sw) {
1270
1312
      if (create_window(320, 200, VOFLAG_HIDDEN, NULL) < 0)