From 6cbbdc49eab3099c49b0c08a4d6c59f0b0926855 Mon Sep 17 00:00:00 2001 From: komh Date: Wed, 10 Mar 2010 10:00:59 +0000 Subject: Include osdep/osdep.h instead of checking a platfrom specific macro to include a platform specific header. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30880 b3059339-0415-0410-9bf9-f77b7e298cf2 --- get_path.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/get_path.c b/get_path.c index 4a04f9ebb7..d1822b909d 100644 --- a/get_path.c +++ b/get_path.c @@ -40,11 +40,10 @@ #elif defined(__CYGWIN__) #include #include -#elif defined(__OS2__) -#define INCL_DOS -#include #endif +#include "osdep/osdep.h" + char *get_path(const char *filename){ char *homedir; char *buff; -- cgit v1.2.3 From f74d169fc6e9ddeae19eab5bfe874154138b9474 Mon Sep 17 00:00:00 2001 From: komh Date: Wed, 10 Mar 2010 11:33:02 +0000 Subject: Include libavutil/avutil.h for FFMIN git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30881 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_kai.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libao2/ao_kai.c b/libao2/ao_kai.c index cc0a3373a7..98a3e49b44 100644 --- a/libao2/ao_kai.c +++ b/libao2/ao_kai.c @@ -38,6 +38,7 @@ #include "mp_msg.h" #include "libvo/fastmemcpy.h" #include "subopt-helper.h" +#include "libavutil/avutil.h" #include "libavutil/fifo.h" static const ao_info_t info = { -- cgit v1.2.3 From e0c5806d44bc6cb56d41f54de585c8d02e74ad1a Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 12 Mar 2010 17:21:05 +0000 Subject: Add newlines to generated fragment program to make both fragment program dump with -v more readable and compiler error message more understandable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30882 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.c | 234 +++++++++++++++++++++++++++--------------------------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/libvo/gl_common.c b/libvo/gl_common.c index 3e9263c9e9..8895a07781 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -855,168 +855,168 @@ static void gen_spline_lookup_tex(GLenum unit) { } static const char *bilin_filt_template = - "TEX yuv.%c, fragment.texcoord[%c], texture[%c], %s;"; + "TEX yuv.%c, fragment.texcoord[%c], texture[%c], %s;\n"; #define BICUB_FILT_MAIN(textype) \ /* first y-interpolation */ \ - "ADD coord, fragment.texcoord[%c].xyxy, cdelta.xyxw;" \ - "ADD coord2, fragment.texcoord[%c].xyxy, cdelta.zyzw;" \ - "TEX a.r, coord.xyxy, texture[%c], "textype";" \ - "TEX a.g, coord.zwzw, texture[%c], "textype";" \ + "ADD coord, fragment.texcoord[%c].xyxy, cdelta.xyxw;\n" \ + "ADD coord2, fragment.texcoord[%c].xyxy, cdelta.zyzw;\n" \ + "TEX a.r, coord.xyxy, texture[%c], "textype";\n" \ + "TEX a.g, coord.zwzw, texture[%c], "textype";\n" \ /* second y-interpolation */ \ - "TEX b.r, coord2.xyxy, texture[%c], "textype";" \ - "TEX b.g, coord2.zwzw, texture[%c], "textype";" \ - "LRP a.b, parmy.b, a.rrrr, a.gggg;" \ - "LRP a.a, parmy.b, b.rrrr, b.gggg;" \ + "TEX b.r, coord2.xyxy, texture[%c], "textype";\n" \ + "TEX b.g, coord2.zwzw, texture[%c], "textype";\n" \ + "LRP a.b, parmy.b, a.rrrr, a.gggg;\n" \ + "LRP a.a, parmy.b, b.rrrr, b.gggg;\n" \ /* x-interpolation */ \ - "LRP yuv.%c, parmx.b, a.bbbb, a.aaaa;" + "LRP yuv.%c, parmx.b, a.bbbb, a.aaaa;\n" static const char *bicub_filt_template_2D = - "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};" - "TEX parmx, coord.x, texture[%c], 1D;" - "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};" - "TEX parmy, coord.y, texture[%c], 1D;" - "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};" + "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};\n" + "TEX parmx, coord.x, texture[%c], 1D;\n" + "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};\n" + "TEX parmy, coord.y, texture[%c], 1D;\n" + "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};\n" BICUB_FILT_MAIN("2D"); static const char *bicub_filt_template_RECT = - "ADD coord, fragment.texcoord[%c], {0.5, 0.5};" - "TEX parmx, coord.x, texture[%c], 1D;" - "MUL cdelta.xz, parmx.rrgg, {-1, 0, 1, 0};" - "TEX parmy, coord.y, texture[%c], 1D;" - "MUL cdelta.yw, parmy.rrgg, {0, -1, 0, 1};" + "ADD coord, fragment.texcoord[%c], {0.5, 0.5};\n" + "TEX parmx, coord.x, texture[%c], 1D;\n" + "MUL cdelta.xz, parmx.rrgg, {-1, 0, 1, 0};\n" + "TEX parmy, coord.y, texture[%c], 1D;\n" + "MUL cdelta.yw, parmy.rrgg, {0, -1, 0, 1};\n" BICUB_FILT_MAIN("RECT"); #define CALCWEIGHTS(t, s) \ - "MAD "t", {-0.5, 0.1666, 0.3333, -0.3333}, "s", {1, 0, -0.5, 0.5};" \ - "MAD "t", "t", "s", {0, 0, -0.5, 0.5};" \ - "MAD "t", "t", "s", {-0.6666, 0, 0.8333, 0.1666};" \ - "RCP a.x, "t".z;" \ - "RCP a.y, "t".w;" \ - "MAD "t".xy, "t".xyxy, a.xyxy, {1, 1, 0, 0};" \ - "ADD "t".x, "t".xxxx, "s";" \ - "SUB "t".y, "t".yyyy, "s";" + "MAD "t", {-0.5, 0.1666, 0.3333, -0.3333}, "s", {1, 0, -0.5, 0.5};\n" \ + "MAD "t", "t", "s", {0, 0, -0.5, 0.5};\n" \ + "MAD "t", "t", "s", {-0.6666, 0, 0.8333, 0.1666};\n" \ + "RCP a.x, "t".z;\n" \ + "RCP a.y, "t".w;\n" \ + "MAD "t".xy, "t".xyxy, a.xyxy, {1, 1, 0, 0};\n" \ + "ADD "t".x, "t".xxxx, "s";\n" \ + "SUB "t".y, "t".yyyy, "s";\n" static const char *bicub_notex_filt_template_2D = - "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};" - "FRC coord.xy, coord.xyxy;" + "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};\n" + "FRC coord.xy, coord.xyxy;\n" CALCWEIGHTS("parmx", "coord.xxxx") - "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};" + "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};\n" CALCWEIGHTS("parmy", "coord.yyyy") - "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};" + "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};\n" BICUB_FILT_MAIN("2D"); static const char *bicub_notex_filt_template_RECT = - "ADD coord, fragment.texcoord[%c], {0.5, 0.5};" - "FRC coord.xy, coord.xyxy;" + "ADD coord, fragment.texcoord[%c], {0.5, 0.5};\n" + "FRC coord.xy, coord.xyxy;\n" CALCWEIGHTS("parmx", "coord.xxxx") - "MUL cdelta.xz, parmx.rrgg, {-1, 0, 1, 0};" + "MUL cdelta.xz, parmx.rrgg, {-1, 0, 1, 0};\n" CALCWEIGHTS("parmy", "coord.yyyy") - "MUL cdelta.yw, parmy.rrgg, {0, -1, 0, 1};" + "MUL cdelta.yw, parmy.rrgg, {0, -1, 0, 1};\n" BICUB_FILT_MAIN("RECT"); #define BICUB_X_FILT_MAIN(textype) \ - "ADD coord.xy, fragment.texcoord[%c].xyxy, cdelta.xyxy;" \ - "ADD coord2.xy, fragment.texcoord[%c].xyxy, cdelta.zyzy;" \ - "TEX a.r, coord, texture[%c], "textype";" \ - "TEX b.r, coord2, texture[%c], "textype";" \ + "ADD coord.xy, fragment.texcoord[%c].xyxy, cdelta.xyxy;\n" \ + "ADD coord2.xy, fragment.texcoord[%c].xyxy, cdelta.zyzy;\n" \ + "TEX a.r, coord, texture[%c], "textype";\n" \ + "TEX b.r, coord2, texture[%c], "textype";\n" \ /* x-interpolation */ \ - "LRP yuv.%c, parmx.b, a.rrrr, b.rrrr;" + "LRP yuv.%c, parmx.b, a.rrrr, b.rrrr;\n" static const char *bicub_x_filt_template_2D = - "MAD coord.x, fragment.texcoord[%c], {%e}, {0.5};" - "TEX parmx, coord, texture[%c], 1D;" - "MUL cdelta.xyz, parmx.rrgg, {-%e, 0, %e};" + "MAD coord.x, fragment.texcoord[%c], {%e}, {0.5};\n" + "TEX parmx, coord, texture[%c], 1D;\n" + "MUL cdelta.xyz, parmx.rrgg, {-%e, 0, %e};\n" BICUB_X_FILT_MAIN("2D"); static const char *bicub_x_filt_template_RECT = - "ADD coord.x, fragment.texcoord[%c], {0.5};" - "TEX parmx, coord, texture[%c], 1D;" - "MUL cdelta.xyz, parmx.rrgg, {-1, 0, 1};" + "ADD coord.x, fragment.texcoord[%c], {0.5};\n" + "TEX parmx, coord, texture[%c], 1D;\n" + "MUL cdelta.xyz, parmx.rrgg, {-1, 0, 1};\n" BICUB_X_FILT_MAIN("RECT"); static const char *unsharp_filt_template = - "PARAM dcoord%c = {%e, %e, %e, %e};" - "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" - "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" - "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" - "TEX b.r, coord.xyxy, texture[%c], %s;" - "TEX b.g, coord.zwzw, texture[%c], %s;" - "ADD b.r, b.r, b.g;" - "TEX b.b, coord2.xyxy, texture[%c], %s;" - "TEX b.g, coord2.zwzw, texture[%c], %s;" - "DP3 b, b, {0.25, 0.25, 0.25};" - "SUB b.r, a.r, b.r;" - "MAD yuv.%c, b.r, {%e}, a.r;"; + "PARAM dcoord%c = {%e, %e, %e, %e};\n" + "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;\n" + "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;\n" + "TEX a.r, fragment.texcoord[%c], texture[%c], %s;\n" + "TEX b.r, coord.xyxy, texture[%c], %s;\n" + "TEX b.g, coord.zwzw, texture[%c], %s;\n" + "ADD b.r, b.r, b.g;\n" + "TEX b.b, coord2.xyxy, texture[%c], %s;\n" + "TEX b.g, coord2.zwzw, texture[%c], %s;\n" + "DP3 b, b, {0.25, 0.25, 0.25};\n" + "SUB b.r, a.r, b.r;\n" + "MAD yuv.%c, b.r, {%e}, a.r;\n"; static const char *unsharp_filt_template2 = - "PARAM dcoord%c = {%e, %e, %e, %e};" - "PARAM dcoord2%c = {%e, 0, 0, %e};" - "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" - "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" - "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" - "TEX b.r, coord.xyxy, texture[%c], %s;" - "TEX b.g, coord.zwzw, texture[%c], %s;" - "ADD b.r, b.r, b.g;" - "TEX b.b, coord2.xyxy, texture[%c], %s;" - "TEX b.g, coord2.zwzw, texture[%c], %s;" - "ADD b.r, b.r, b.b;" - "ADD b.a, b.r, b.g;" - "ADD coord, fragment.texcoord[%c].xyxy, dcoord2%c;" - "SUB coord2, fragment.texcoord[%c].xyxy, dcoord2%c;" - "TEX b.r, coord.xyxy, texture[%c], %s;" - "TEX b.g, coord.zwzw, texture[%c], %s;" - "ADD b.r, b.r, b.g;" - "TEX b.b, coord2.xyxy, texture[%c], %s;" - "TEX b.g, coord2.zwzw, texture[%c], %s;" - "DP4 b.r, b, {-0.1171875, -0.1171875, -0.1171875, -0.09765625};" - "MAD b.r, a.r, {0.859375}, b.r;" - "MAD yuv.%c, b.r, {%e}, a.r;"; + "PARAM dcoord%c = {%e, %e, %e, %e};\n" + "PARAM dcoord2%c = {%e, 0, 0, %e};\n" + "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;\n" + "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;\n" + "TEX a.r, fragment.texcoord[%c], texture[%c], %s;\n" + "TEX b.r, coord.xyxy, texture[%c], %s;\n" + "TEX b.g, coord.zwzw, texture[%c], %s;\n" + "ADD b.r, b.r, b.g;\n" + "TEX b.b, coord2.xyxy, texture[%c], %s;\n" + "TEX b.g, coord2.zwzw, texture[%c], %s;\n" + "ADD b.r, b.r, b.b;\n" + "ADD b.a, b.r, b.g;\n" + "ADD coord, fragment.texcoord[%c].xyxy, dcoord2%c;\n" + "SUB coord2, fragment.texcoord[%c].xyxy, dcoord2%c;\n" + "TEX b.r, coord.xyxy, texture[%c], %s;\n" + "TEX b.g, coord.zwzw, texture[%c], %s;\n" + "ADD b.r, b.r, b.g;\n" + "TEX b.b, coord2.xyxy, texture[%c], %s;\n" + "TEX b.g, coord2.zwzw, texture[%c], %s;\n" + "DP4 b.r, b, {-0.1171875, -0.1171875, -0.1171875, -0.09765625};\n" + "MAD b.r, a.r, {0.859375}, b.r;\n" + "MAD yuv.%c, b.r, {%e}, a.r;\n"; static const char *yuv_prog_template = - "PARAM ycoef = {%e, %e, %e};" - "PARAM ucoef = {%e, %e, %e};" - "PARAM vcoef = {%e, %e, %e};" - "PARAM offsets = {%e, %e, %e};" - "TEMP res;" - "MAD res.rgb, yuv.rrrr, ycoef, offsets;" - "MAD res.rgb, yuv.gggg, ucoef, res;" - "MAD result.color.rgb, yuv.bbbb, vcoef, res;" + "PARAM ycoef = {%e, %e, %e};\n" + "PARAM ucoef = {%e, %e, %e};\n" + "PARAM vcoef = {%e, %e, %e};\n" + "PARAM offsets = {%e, %e, %e};\n" + "TEMP res;\n" + "MAD res.rgb, yuv.rrrr, ycoef, offsets;\n" + "MAD res.rgb, yuv.gggg, ucoef, res;\n" + "MAD result.color.rgb, yuv.bbbb, vcoef, res;\n" "END"; static const char *yuv_pow_prog_template = - "PARAM ycoef = {%e, %e, %e};" - "PARAM ucoef = {%e, %e, %e};" - "PARAM vcoef = {%e, %e, %e};" - "PARAM offsets = {%e, %e, %e};" - "PARAM gamma = {%e, %e, %e};" - "TEMP res;" - "MAD res.rgb, yuv.rrrr, ycoef, offsets;" - "MAD res.rgb, yuv.gggg, ucoef, res;" - "MAD_SAT res.rgb, yuv.bbbb, vcoef, res;" - "POW result.color.r, res.r, gamma.r;" - "POW result.color.g, res.g, gamma.g;" - "POW result.color.b, res.b, gamma.b;" + "PARAM ycoef = {%e, %e, %e};\n" + "PARAM ucoef = {%e, %e, %e};\n" + "PARAM vcoef = {%e, %e, %e};\n" + "PARAM offsets = {%e, %e, %e};\n" + "PARAM gamma = {%e, %e, %e};\n" + "TEMP res;\n" + "MAD res.rgb, yuv.rrrr, ycoef, offsets;\n" + "MAD res.rgb, yuv.gggg, ucoef, res;\n" + "MAD_SAT res.rgb, yuv.bbbb, vcoef, res;\n" + "POW result.color.r, res.r, gamma.r;\n" + "POW result.color.g, res.g, gamma.g;\n" + "POW result.color.b, res.b, gamma.b;\n" "END"; static const char *yuv_lookup_prog_template = - "PARAM ycoef = {%e, %e, %e, 0};" - "PARAM ucoef = {%e, %e, %e, 0};" - "PARAM vcoef = {%e, %e, %e, 0};" - "PARAM offsets = {%e, %e, %e, 0.125};" - "TEMP res;" - "MAD res, yuv.rrrr, ycoef, offsets;" - "MAD res.rgb, yuv.gggg, ucoef, res;" - "MAD res.rgb, yuv.bbbb, vcoef, res;" - "TEX result.color.r, res.raaa, texture[%c], 2D;" - "ADD res.a, res.a, 0.25;" - "TEX result.color.g, res.gaaa, texture[%c], 2D;" - "ADD res.a, res.a, 0.25;" - "TEX result.color.b, res.baaa, texture[%c], 2D;" + "PARAM ycoef = {%e, %e, %e, 0};\n" + "PARAM ucoef = {%e, %e, %e, 0};\n" + "PARAM vcoef = {%e, %e, %e, 0};\n" + "PARAM offsets = {%e, %e, %e, 0.125};\n" + "TEMP res;\n" + "MAD res, yuv.rrrr, ycoef, offsets;\n" + "MAD res.rgb, yuv.gggg, ucoef, res;\n" + "MAD res.rgb, yuv.bbbb, vcoef, res;\n" + "TEX result.color.r, res.raaa, texture[%c], 2D;\n" + "ADD res.a, res.a, 0.25;\n" + "TEX result.color.g, res.gaaa, texture[%c], 2D;\n" + "ADD res.a, res.a, 0.25;\n" + "TEX result.color.b, res.baaa, texture[%c], 2D;\n" "END"; static const char *yuv_lookup3d_prog_template = - "TEX result.color, yuv, texture[%c], 3D;" + "TEX result.color, yuv, texture[%c], 3D;\n" "END"; /** @@ -1254,10 +1254,10 @@ static void glSetupYUVFragprog(gl_conversion_params_t *params) { int rect = params->target == GL_TEXTURE_RECTANGLE; static const char prog_hdr[] = "!!ARBfp1.0\n" - "OPTION ARB_precision_hint_fastest;" + "OPTION ARB_precision_hint_fastest;\n" // all scaler variables must go here so they aren't defined // multiple times when the same scaler is used more than once - "TEMP coord, coord2, cdelta, parmx, parmy, a, b, yuv;"; + "TEMP coord, coord2, cdelta, parmx, parmy, a, b, yuv;\n"; int prog_remain; char *yuv_prog, *prog_pos; int cur_texu = 3; -- cgit v1.2.3 From fdd4ddccd46830f9439d545c54da98d50bf49951 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 12 Mar 2010 17:29:48 +0000 Subject: Fix crash if speex_packet_to_header fails. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30883 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_speex.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmpcodecs/ad_speex.c b/libmpcodecs/ad_speex.c index 4eca5293df..9abc1ad032 100644 --- a/libmpcodecs/ad_speex.c +++ b/libmpcodecs/ad_speex.c @@ -61,6 +61,10 @@ static int init(sh_audio_t *sh) { return 0; } ctx->hdr = speex_packet_to_header((char *)&sh->wf[1], sh->wf->cbSize); + if (!ctx->hdr) { + mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Invalid extradata!\n"); + return 0; + } if (ctx->hdr->nb_channels != 1 && ctx->hdr->nb_channels != 2) { mp_msg(MSGT_DECAUDIO, MSGL_WARN, "Invalid number of channels (%i), " "assuming mono\n", ctx->hdr->nb_channels); -- cgit v1.2.3 From d06c04bb678dcbda68949bbd88637de192be3399 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 12 Mar 2010 18:19:51 +0000 Subject: Support extradata format of the speex.acm windows codec formerly available from openacm.org. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30884 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_speex.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/libmpcodecs/ad_speex.c b/libmpcodecs/ad_speex.c index 9abc1ad032..a93a245492 100644 --- a/libmpcodecs/ad_speex.c +++ b/libmpcodecs/ad_speex.c @@ -52,8 +52,15 @@ static int preinit(sh_audio_t *sh) { return 1; } +static int read_le32(const uint8_t **src) { + const uint8_t *p = *src; + *src += 4; + return p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] << 24); +} + static int init(sh_audio_t *sh) { context_t *ctx = calloc(1, sizeof(context_t)); + const uint8_t *hdr = (const uint8_t *)(sh->wf + 1); const SpeexMode *spx_mode; const SpeexStereoState st_st = SPEEX_STEREO_STATE_INIT; // hack if (!sh->wf || sh->wf->cbSize < 80) { @@ -61,6 +68,23 @@ static int init(sh_audio_t *sh) { return 0; } ctx->hdr = speex_packet_to_header((char *)&sh->wf[1], sh->wf->cbSize); + if (!ctx->hdr && sh->wf->cbSize == 0x72 && hdr[0] == 1 && hdr[1] == 0) { + // speex.acm format: raw SpeexHeader dump + ctx->hdr = calloc(1, sizeof(*ctx->hdr)); + hdr += 2; + hdr += 8; // identifier string + hdr += 20; // version string + ctx->hdr->speex_version_id = read_le32(&hdr); + ctx->hdr->header_size = read_le32(&hdr); + ctx->hdr->rate = read_le32(&hdr); + ctx->hdr->mode = read_le32(&hdr); + ctx->hdr->mode_bitstream_version = read_le32(&hdr); + ctx->hdr->nb_channels = read_le32(&hdr); + ctx->hdr->bitrate = read_le32(&hdr); + ctx->hdr->frame_size = read_le32(&hdr); + ctx->hdr->vbr = read_le32(&hdr); + ctx->hdr->frames_per_packet = read_le32(&hdr); + } if (!ctx->hdr) { mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Invalid extradata!\n"); return 0; -- cgit v1.2.3 From f6cef36bdb13fc332184eba6afdaffb096c8e13a Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 12 Mar 2010 18:23:30 +0000 Subject: Add the 0xA109 format for speex, it is claimed to be officially registered (have not verified). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30885 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 06fc94911b..2fe487bc91 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -4448,6 +4448,7 @@ audiocodec speex status working comment "Speex driver using libspeex" fourcc 'spx ' + format 0xA109 driver speex dll "speex" -- cgit v1.2.3 From 2f46a41e3b8fdd7133adc2c3426ef8ba88515369 Mon Sep 17 00:00:00 2001 From: jrash Date: Sat, 13 Mar 2010 00:31:03 +0000 Subject: sync with en/mplayer.1 rev. 30868 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30886 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/zh_CN/mplayer.1 | 83 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1 index 1589cabd78..fdc0d0f7ae 100644 --- a/DOCS/man/zh_CN/mplayer.1 +++ b/DOCS/man/zh_CN/mplayer.1 @@ -1,4 +1,4 @@ -.\" sync with en/mplayer.1 rev. 30822 +.\" sync with en/mplayer.1 rev. 30868 .\" Encoding: UTF-8 .\" Reminder of hard terms which need better/final solution later: .\" /capture; playtree in parent list; colorkey; retrace; desync; downmix; @@ -7003,6 +7003,45 @@ h参数值。 的像素(默认值:16)。 .RE. . +.TP +.B fixpts[=options] +修正视频帧的呈现时间戳(PTS)。 +默认行为是丢弃传递至下一级滤镜的 PTS,但以下选项可以改变这一行为: +.RSs +.IPs print +打印得到的 PTS。 +.IPs fps= +指定一个每秒帧数值 +.IPs start= +为 PTS 指定一个初始值 +Specify an initial value for the PTS. +.IPs autostart= +使用 +.IR 第 n 个 +得到的 PTS 作为初始 PTS。 +保留所有之前的 PTS,因此如果设置了一个很大的值或设为 \-1 则将完整保留 PTS。 +.IPs autofps= +在自动开始后使用 +.IR 第 n 个 +得到的 PTS 判断帧率。 +.RE +.sp 1 +.RS +.I 示例: +.RE +.PD 0 +.RSs +.IPs "\-vf fixpts=fps=24000/1001,ass,fixpts" +产生一个新的 PTS 序列,将其用于 ASS 字幕,然后将其丢弃。 +在节目结束后时间戳就重置的情况下,生成一个新的序列是有效的;该情形在 DVD 中很常见。 +丢弃该序列对于避免编码器判断错误是有必要的 +.RE +.PD 1 +.sp 1 +.RS +.I 注意: +将该滤镜与任何种类的定位选项(包括 -ss 和 EDL)一同使用可能会产生意想不到的结果。 +.RE . . .SH "通用编码选项(仅用于MENCODER)" @@ -9971,6 +10010,48 @@ Windows CMD.EXE的用户如果尝试使用全部CQM列表时,可能在解析 .TP .B (no)aud 将存取单元的分隔标志写入数据流(默认值:禁用)。 +除非你的目标存储格式需要有存取单元分隔标志,否则不要启用该选项。 +. +.TP +.B overscan= +在媒体流中包含 VUI 全画面模式信息(默认值:禁用)。 +参见 x264 源代码中的 doc/vui.txt 以获取更多信息。 +. +.TP +.B videoformat= +在媒体流中包含 VUI 视频格式信息(默认值:禁用)。 +该选项只是用以描述最初媒体来源的一个提供信息的选项。 +参见 x264 源代码中的 doc/vui.txt 以获取更多信息。 +. +.TP +.B (no)fullrange +在媒体流中包含 VUI 全信号范围信息(默认值:禁用)。 +如果你的源视频不限制信号范围则使用该选项。 +参见 x264 源代码中的 doc/vui.txt 以获取更多信息。 +. +.TP +.B colorprim= +包含元色彩信息(默认值:禁用)。 +该选项可用于色彩修正。 +参见 x264 源代码中的 doc/vui.txt 以获取更多信息。 +. +.TP +.B transfer= +在媒体流中包含 VUI 传输特征信息(默认值:禁用)。 +该选项可用于色彩修正。 +参见 x264 源代码中的 doc/vui.txt 以获取更多信息。 +. +.TP +.B colormatrix= +在媒体流中包含 VUI 矩阵系数(默认值:禁用)。 +该选项可用于色彩修正。 +参见 x264 源代码中的 doc/vui.txt 以获取更多信息。 +. +.TP +.B chromaloc=<0-5> +在媒体流中包含 VUI 色度样本位置信息(默认值:禁用)。 +使用该选项能保证色彩空间转换后色度和亮度平面正确排列。 +参见 x264 源代码中的 doc/vui.txt 以获取更多信息。 . .TP .B log=<\-1\-3> -- cgit v1.2.3 From 13d16eb051b31e046c9943cf38c6e9f484b0af8e Mon Sep 17 00:00:00 2001 From: conrad Date: Sat, 13 Mar 2010 22:46:58 +0000 Subject: fftheora supports 4:2:2 and 4:4:4 now git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30887 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index 2fe487bc91..1233410e11 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -2071,7 +2071,7 @@ videocodec fftheora format 0xFFFC driver ffmpeg dll "theora" - out YV12 + out YV12,422P,444P videocodec vp3 info "On2 Open Source VP3 Codec" -- cgit v1.2.3 From aee9749bca8e418752627bbfe8859029ea43d28e Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Mar 2010 16:13:32 +0000 Subject: Replace separate Win32, XAnim and Real codec directories by one global dir. Nowadays MPlayer does not use the codecs from other installed programs. A runtime setting will soon take over the rare case that binary codecs should be searched for in non-standard directories. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30888 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 26 +------------------------- get_path.c | 22 ++++------------------ libmpcodecs/ad_realaud.c | 12 ++++++------ libmpcodecs/vd_realvid.c | 4 ++-- libmpcodecs/vd_xanim.c | 2 +- loader/drv.c | 4 ++-- loader/win32.c | 2 +- 7 files changed, 17 insertions(+), 55 deletions(-) diff --git a/configure b/configure index 4e57ce3172..bd6e9ab833 100755 --- a/configure +++ b/configure @@ -218,9 +218,6 @@ Installation directories: [PREFIX/etc/mplayer] --libdir=DIR directory for object code libraries [PREFIX/lib] --codecsdir=DIR directory for binary codecs [LIBDIR/codecs] - --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs] - --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs] - --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs] Optional features: --disable-mencoder disable MEncoder (A/V encoder) compilation [enable] @@ -791,15 +788,6 @@ for ac_option do --codecsdir=*) _codecsdir=$(echo $ac_option | cut -d '=' -f 2) ;; - --win32codecsdir=*) - _win32codecsdir=$(echo $ac_option | cut -d '=' -f 2) - ;; - --xanimcodecsdir=*) - _xanimcodecsdir=$(echo $ac_option | cut -d '=' -f 2) - ;; - --realcodecsdir=*) - _realcodecsdir=$(echo $ac_option | cut -d '=' -f 2) - ;; --with-install=*) _install=$(echo $ac_option | cut -d '=' -f 2 ) @@ -7063,8 +7051,6 @@ if test "$_win32dll" = auto ; then fi if test "$_win32dll" = yes ; then def_win32dll='#define CONFIG_WIN32DLL 1' - test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir - _res_comment="using $_win32codecsdir" if ! win32 ; then def_win32_loader='#define WIN32_LOADER 1' _win32_emulation=yes @@ -7090,14 +7076,10 @@ if test "$_xanim" = auto ; then fi fi if test "$_xanim" = yes ; then - test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir def_xanim='#define CONFIG_XANIM 1' - def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\"" _codecmodules="xanim $_codecmodules" - _res_comment="using $_xanimcodecsdir" else def_xanim='#undef CONFIG_XANIM' - def_xanim_path='#undef XACODEC_PATH' _nocodecmodules="xanim $_nocodecmodules" fi echores "$_xanim" @@ -7113,14 +7095,10 @@ if test "$_real" = auto ; then fi fi if test "$_real" = yes ; then - test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir" def_real='#define CONFIG_REALCODECS 1' - def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\"" _codecmodules="real $_codecmodules" - _res_comment="using $_realcodecsdir" else def_real='#undef CONFIG_REALCODECS' - def_real_path="#undef REALCODEC_PATH" _nocodecmodules="real $_nocodecmodules" fi echores "$_real" @@ -8989,13 +8967,11 @@ $def_libnut $def_qtx $def_qtx_win32 $def_real -$def_real_path $def_win32_loader $def_win32dll -#define WIN32_PATH "$_win32codecsdir" $def_xanim -$def_xanim_path $def_xmms +#define BINARY_CODECS_PATH "$_codecsdir" #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir" diff --git a/get_path.c b/get_path.c index d1822b909d..0412dbaa8d 100644 --- a/get_path.c +++ b/get_path.c @@ -161,31 +161,17 @@ void set_path_env(void) /*make our codec dirs available for LoadLibraryA()*/ char tmppath[MAX_PATH*2 + 1]; char win32path[MAX_PATH]; - char realpath[MAX_PATH]; #ifdef __CYGWIN__ - cygwin_conv_to_full_win32_path(WIN32_PATH,win32path); + cygwin_conv_to_full_win32_path(BINARY_CODECS_PATH, win32path); strcpy(tmppath,win32path); -#ifdef CONFIG_REALCODECS - cygwin_conv_to_full_win32_path(REALCODEC_PATH,realpath); - sprintf(tmppath,"%s;%s",win32path,realpath); -#endif /*CONFIG_REALCODECS*/ #else /*__CYGWIN__*/ /* Expand to absolute path unless it's already absolute */ - if (!strstr(WIN32_PATH,":") && WIN32_PATH[0] != '\\'){ + if (!strstr(BINARY_CODECS_PATH,":") && BINARY_CODECS_PATH[0] != '\\') { GetModuleFileNameA(NULL, win32path, MAX_PATH); - strcpy(strrchr(win32path, '\\') + 1, WIN32_PATH); + strcpy(strrchr(win32path, '\\') + 1, BINARY_CODECS_PATH); } - else strcpy(win32path,WIN32_PATH); + else strcpy(win32path, BINARY_CODECS_PATH); strcpy(tmppath,win32path); -#ifdef CONFIG_REALCODECS - /* Expand to absolute path unless it's already absolute */ - if (!strstr(REALCODEC_PATH,":") && REALCODEC_PATH[0] != '\\'){ - GetModuleFileNameA(NULL, realpath, MAX_PATH); - strcpy(strrchr(realpath, '\\') + 1, REALCODEC_PATH); - } - else strcpy(realpath,REALCODEC_PATH); - sprintf(tmppath,"%s;%s",win32path,realpath); -#endif /*CONFIG_REALCODECS*/ #endif /*__CYGWIN__*/ mp_msg(MSGT_WIN32, MSGL_V,"Setting PATH to %s\n",tmppath); if (!SetEnvironmentVariableA("PATH", tmppath)) diff --git a/libmpcodecs/ad_realaud.c b/libmpcodecs/ad_realaud.c index 00f995cd3a..4f179e69c2 100644 --- a/libmpcodecs/ad_realaud.c +++ b/libmpcodecs/ad_realaud.c @@ -251,9 +251,9 @@ static int preinit(sh_audio_t *sh){ unsigned int result; char *path; - path = malloc(strlen(REALCODEC_PATH)+strlen(sh->codec->dll)+2); + path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2); if (!path) return 0; - sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll); + sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll); /* first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones */ @@ -277,8 +277,8 @@ static int preinit(sh_audio_t *sh){ if(raSetDLLAccessPath){ #endif // used by 'SIPR' - path = realloc(path, strlen(REALCODEC_PATH) + 13); - sprintf(path, "DT_Codecs=" REALCODEC_PATH); + path = realloc(path, strlen(BINARY_CODECS_PATH) + 13); + sprintf(path, "DT_Codecs=" BINARY_CODECS_PATH); if(path[strlen(path)-1]!='/'){ path[strlen(path)+1]=0; path[strlen(path)]='/'; @@ -300,13 +300,13 @@ static int preinit(sh_audio_t *sh){ #ifdef CONFIG_WIN32DLL if (dll_type == 1){ if(wraOpenCodec2) - result=wraOpenCodec2(&sh->context,REALCODEC_PATH "\\"); + result = wraOpenCodec2(&sh->context, BINARY_CODECS_PATH "\\"); else result=wraOpenCodec(&sh->context); } else #endif if(raOpenCodec2) - result=raOpenCodec2(&sh->context,REALCODEC_PATH "/"); + result = raOpenCodec2(&sh->context, BINARY_CODECS_PATH "/"); else result=raOpenCodec(&sh->context); if(result){ diff --git a/libmpcodecs/vd_realvid.c b/libmpcodecs/vd_realvid.c index 6d71a49e20..110498ab90 100644 --- a/libmpcodecs/vd_realvid.c +++ b/libmpcodecs/vd_realvid.c @@ -273,9 +273,9 @@ static int init(sh_video_t *sh){ mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",be2me_32(((unsigned int*)extrahdr)[1]),be2me_32(((unsigned int*)extrahdr)[0])); - path = malloc(strlen(REALCODEC_PATH)+strlen(sh->codec->dll)+2); + path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2); if (!path) return 0; - sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll); + sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll); /* first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones */ diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c index 6bb5e1f71b..a9926daeb2 100644 --- a/libmpcodecs/vd_xanim.c +++ b/libmpcodecs/vd_xanim.c @@ -664,7 +664,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ static int init(sh_video_t *sh) { vd_xanim_ctx *priv; - char *def_path = XACODEC_PATH; + char *def_path = BINARY_CODECS_PATH; char dll[1024]; XA_CODEC_HDR codec_hdr; int i; diff --git a/loader/drv.c b/loader/drv.c index 9479e6944d..13945538d2 100644 --- a/loader/drv.c +++ b/loader/drv.c @@ -27,7 +27,7 @@ #endif #ifndef WIN32_LOADER -char* def_path=WIN32_PATH; +char* def_path = BINARY_CODECS_PATH; #else extern char* def_path; #endif @@ -71,7 +71,7 @@ void SetCodecPath(const char* path) if(needs_free)free(def_path); if(path==0) { - def_path=WIN32_PATH; + def_path = BINARY_CODECS_PATH; needs_free=0; return; } diff --git a/loader/win32.c b/loader/win32.c index d540e6dfe2..96106da154 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -77,7 +77,7 @@ for DLL to know too much about its environment. #include "osdep/mmap_anon.h" #include "libavutil/avstring.h" -char* def_path = WIN32_PATH; +char* def_path = BINARY_CODECS_PATH; static void do_cpuid(unsigned int ax, unsigned int *regs) { -- cgit v1.2.3 From 299f7ad933f93961027aae5d253a50b346f8bc26 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Sun, 14 Mar 2010 22:50:15 +0000 Subject: Fix compilation after FFmpeg r22522. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30889 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index bd6e9ab833..ac6ef191f8 100755 --- a/configure +++ b/configure @@ -8702,6 +8702,7 @@ FULLNAME=\$(NAME)\$(BUILDSUF) # Some FFmpeg codecs depend on these. Enable them unconditionally for now. CONFIG_AANDCT=yes CONFIG_DCT=yes +CONFIG_DWT=yes CONFIG_FFT=yes CONFIG_FFT_MMX=$fft_mmx CONFIG_GOLOMB=yes -- cgit v1.2.3 From 70fafd780384c6ba348bf3a111347b52d1087d74 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Mar 2010 22:55:13 +0000 Subject: Use menu instead of GUI as example for an internal feature turned on by a flag. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30890 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index ac6ef191f8..7e7f8de472 100755 --- a/configure +++ b/configure @@ -9341,7 +9341,7 @@ skipping autodetection. This behavior is unlike what you may be used to from autoconf-based configure scripts that can decide to override you. This greater level of control comes at a price. You may have to provide the correct compiler and linker flags yourself. -If you used one of these options (except --enable-gui and similar ones that +If you used one of these options (except --enable-menu and similar ones that turn on internal features) and experience a compilation or linking failure, make sure you have passed the necessary compiler/linker flags to configure. -- cgit v1.2.3 From 0dd44a006efea7d3b7ac62e83a8ffe13f7930229 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Mar 2010 22:58:20 +0000 Subject: Add -Wstrict-prototypes to CFLAGS. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30891 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 7e7f8de472..06e35169be 100755 --- a/configure +++ b/configure @@ -2519,6 +2519,7 @@ if test "$cc_vendor" = "gnu" ; then cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS" cc_check -Wundef && CFLAGS="-Wundef $CFLAGS" cc_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS" + cc_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS" else CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS" fi -- cgit v1.2.3 From 3aee1115a8d089be203eba0cb7bf60993fa16f4a Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Mar 2010 23:00:06 +0000 Subject: cosmetics: Simplify _codecsdir setting for MinGW and OS/2. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30892 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure b/configure index 06e35169be..7d19b8e6e7 100755 --- a/configure +++ b/configure @@ -7038,8 +7038,7 @@ fi # Fall back on default directory. if test -z "$_codecsdir" ; then _codecsdir="$_libdir/codecs" - mingw32 && _codecsdir="codecs" - os2 && _codecsdir="codecs" + mingw32 || os2 && _codecsdir="codecs" fi -- cgit v1.2.3 From 7d51464c27296a27fdfa1c1ecfe5971d2a002f98 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Mar 2010 23:37:58 +0000 Subject: Remove unused MMX_FFT Makefile variable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30893 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure b/configure index 7d19b8e6e7..956da0592b 100755 --- a/configure +++ b/configure @@ -2680,13 +2680,11 @@ fi echo "pabsw xmm0, xmm0" > $TMPS yasm_check || _yasm="" if test $_yasm ; then - test "$_mmx" = "yes" && fft_mmx="yes" def_yasm='#define HAVE_YASM 1' _have_yasm="yes" echores "$_yasm" else def_yasm='#define HAVE_YASM 0' - fft_mmx="no" _have_yasm="no" echores "no" fi @@ -8704,7 +8702,6 @@ CONFIG_AANDCT=yes CONFIG_DCT=yes CONFIG_DWT=yes CONFIG_FFT=yes -CONFIG_FFT_MMX=$fft_mmx CONFIG_GOLOMB=yes CONFIG_LPC=yes CONFIG_LSP=yes -- cgit v1.2.3 From ee2ac03ccc9a1e75aaf94143fb757a4a60ded956 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Mar 2010 23:39:02 +0000 Subject: variable renaming cosmetics: _have_yasm --> have_yasm git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30894 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 956da0592b..5663287e20 100755 --- a/configure +++ b/configure @@ -2681,11 +2681,11 @@ echo "pabsw xmm0, xmm0" > $TMPS yasm_check || _yasm="" if test $_yasm ; then def_yasm='#define HAVE_YASM 1' - _have_yasm="yes" + have_yasm="yes" echores "$_yasm" else def_yasm='#define HAVE_YASM 0' - _have_yasm="no" + have_yasm="no" echores "no" fi @@ -8737,7 +8737,7 @@ CONFIG_ZLIB=$_zlib HAVE_PTHREADS = $_pthreads HAVE_SHM = $_shm HAVE_W32THREADS = $_w32threads -HAVE_YASM = $_have_yasm +HAVE_YASM = $have_yasm $(echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/') $(echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/') -- cgit v1.2.3 From 6ca07e4c8bc5b2e794bf89b4c1283d6d8c03c76e Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Mar 2010 23:42:03 +0000 Subject: Get rid of pointless tmppath variable in set_path_env(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30895 b3059339-0415-0410-9bf9-f77b7e298cf2 --- get_path.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/get_path.c b/get_path.c index 0412dbaa8d..ad3c422639 100644 --- a/get_path.c +++ b/get_path.c @@ -159,11 +159,9 @@ char *get_path(const char *filename){ void set_path_env(void) { /*make our codec dirs available for LoadLibraryA()*/ - char tmppath[MAX_PATH*2 + 1]; char win32path[MAX_PATH]; #ifdef __CYGWIN__ cygwin_conv_to_full_win32_path(BINARY_CODECS_PATH, win32path); - strcpy(tmppath,win32path); #else /*__CYGWIN__*/ /* Expand to absolute path unless it's already absolute */ if (!strstr(BINARY_CODECS_PATH,":") && BINARY_CODECS_PATH[0] != '\\') { @@ -171,10 +169,9 @@ void set_path_env(void) strcpy(strrchr(win32path, '\\') + 1, BINARY_CODECS_PATH); } else strcpy(win32path, BINARY_CODECS_PATH); - strcpy(tmppath,win32path); #endif /*__CYGWIN__*/ - mp_msg(MSGT_WIN32, MSGL_V,"Setting PATH to %s\n",tmppath); - if (!SetEnvironmentVariableA("PATH", tmppath)) + mp_msg(MSGT_WIN32, MSGL_V, "Setting PATH to %s\n", win32path); + if (!SetEnvironmentVariableA("PATH", win32path)) mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); } #endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ -- cgit v1.2.3 From 2c2097601e579ee0a5af2f7b4f5ac0aed3c3e3ff Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 15 Mar 2010 06:39:21 +0000 Subject: Add CONFIG_DCT and CONFIG_DWT to config.h as well as to config.mak for FFmpeg. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30896 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 5663287e20..b34dbec8c1 100755 --- a/configure +++ b/configure @@ -9217,6 +9217,8 @@ $def_yasm /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */ #define CONFIG_AANDCT 1 +#define CONFIG_DCT 1 +#define CONFIG_DWT 1 #define CONFIG_FFT 1 #define CONFIG_GOLOMB 1 #define CONFIG_LPC 1 -- cgit v1.2.3 From 8686b281f85ba58c24729d1aad75ddd04ab9c537 Mon Sep 17 00:00:00 2001 From: komh Date: Mon, 15 Mar 2010 08:30:06 +0000 Subject: Add -codecpath option. It allows to search binary codecs in non-standard directories. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30897 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 4 ++++ cfg-common-opts.h | 3 +++ get_path.h | 6 ++++++ mencoder.c | 5 +++++ mplayer.c | 5 +++++ 5 files changed, 23 insertions(+) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index e2df09d996..d118f43ae4 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -754,6 +754,10 @@ Using realtime priority can cause system lockup. .RE . .TP +.B \-codecpath +Specify a directory for binary codecs. +. +.TP .B \-profile Use the given profile(s), \-profile help displays a list of the defined profiles. . diff --git a/cfg-common-opts.h b/cfg-common-opts.h index 1bdbca4735..7c85e8885a 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -39,6 +39,9 @@ {"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL}, #ifdef CONFIG_PRIORITY {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, +#endif +#ifdef CONFIG_WIN32DLL + {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif {"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL}, diff --git a/get_path.h b/get_path.h index 2f1909b601..759356e527 100644 --- a/get_path.h +++ b/get_path.h @@ -24,4 +24,10 @@ char *get_path(const char *filename); void set_path_env(void); +#ifdef CONFIG_WIN32DLL +extern void SetCodecPath(const char *); // in loader/drv.c + +static char *codec_path=NULL; +#endif + #endif /* MPLAYER_GET_PATH_H */ diff --git a/mencoder.c b/mencoder.c index 7b9f5705eb..12467cccfc 100644 --- a/mencoder.c +++ b/mencoder.c @@ -534,6 +534,11 @@ if (frameno_filename) { set_priority(); #endif +#ifdef CONFIG_WIN32DLL + if (codec_path) + SetCodecPath(codec_path); +#endif + // check font #ifdef CONFIG_FREETYPE init_freetype(); diff --git a/mplayer.c b/mplayer.c index a5fe132d0a..77400a0ed0 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2701,6 +2701,11 @@ int gui_no_filename=0; set_priority(); #endif +#ifdef CONFIG_WIN32DLL + if (codec_path) + SetCodecPath(codec_path); +#endif + #ifndef CONFIG_GUI if(use_gui){ mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_NoGui); -- cgit v1.2.3 From 7092da127c869e4168a5f88e691d790caad8eb59 Mon Sep 17 00:00:00 2001 From: komh Date: Mon, 15 Mar 2010 09:32:53 +0000 Subject: Relocate -codecpath description in alphabetical order. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30898 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index d118f43ae4..5d1fcb81e9 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -638,6 +638,10 @@ lavcopts=mbd=2:trell=yes:v4mv=yes .SH "GENERAL OPTIONS" . .TP +.B \-codecpath +Specify a directory for binary codecs. +. +.TP .B \-codecs\-file (also see \-afm, \-ac, \-vfm, \-vc) Override the standard search path and use the specified file instead of the builtin codecs.conf. @@ -754,10 +758,6 @@ Using realtime priority can cause system lockup. .RE . .TP -.B \-codecpath -Specify a directory for binary codecs. -. -.TP .B \-profile Use the given profile(s), \-profile help displays a list of the defined profiles. . -- cgit v1.2.3 From 45fd2e045749d2459eb2174030513b29dcb47ff6 Mon Sep 17 00:00:00 2001 From: sesse Date: Mon, 15 Mar 2010 12:05:56 +0000 Subject: Use the high-level QuickTime decoding APIs (DecompressSequenceFrameS and friends) instead of the unsupported, internal ones (ImageCodecBeginBand etc.). This is a prerequisite for, among others, Apple ProRes 4:2:2 support, and simplifies the file by quite a bit. Tested on Linux with all existing QuickTime codecs I could get to work in the first place; qt261, qtavui, qtsvq3 have no change. qtcvid appears to not give bit-exact the same output as before, but it looks just the same in playback to me. qt3ivx stops crashing on exit (so works better than before). With some extra patches and a codecs.conf entry, ProRes 4:2:2 also works, including on Linux. Since codec initialization is now actually done on decoder init instead of on first frame, fallback should also work a bit better (although usually, qtvideo is last in the chain). Also made the decoder complain explicitly if the demuxer data is not there (ie., the user tried to run without -demuxer mov). This patch is a cleaned up version of what Andrew Wason (rectalogic A rectalogic D com) posted to mplayer-dev-eng in June. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30899 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_qtvideo.c | 311 ++++++++++++----------------------------- loader/qtx/qtxsdk/components.h | 8 ++ 2 files changed, 95 insertions(+), 224 deletions(-) diff --git a/libmpcodecs/vd_qtvideo.c b/libmpcodecs/vd_qtvideo.c index aeead624e0..ea7aa4eaa1 100644 --- a/libmpcodecs/vd_qtvideo.c +++ b/libmpcodecs/vd_qtvideo.c @@ -44,18 +44,12 @@ static const vd_info_t info = { LIBVD_EXTERN(qtvideo) -//static ComponentDescription desc; // for FindNextComponent() -static ComponentInstance ci=NULL; // codec handle -//static CodecInfo cinfo; // for ImageCodecGetCodecInfo() -//Component prev=NULL; -//ComponentResult cres; // -static CodecCapabilities codeccap; // for decpar -static CodecDecompressParams decpar; // for ImageCodecPreDecompress() -//static ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize() +static mp_image_t* mpi; static Rect OutBufferRect; //the dimensions of our GWorld static GWorldPtr OutBufferGWorld = NULL;//a GWorld is some kind of description for a drawing environment static ImageDescriptionHandle framedescHandle; +static ImageSequence imageSeq; #ifndef CONFIG_QUICKTIME HMODULE WINAPI LoadLibraryA(LPCSTR); @@ -63,24 +57,26 @@ FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); int WINAPI FreeLibrary(HMODULE); static HINSTANCE qtime_qts; // handle to the preloaded quicktime.qts static HMODULE handler; -static Component (*FindNextComponent)(Component prev,ComponentDescription* desc); -static OSErr (*GetComponentInfo)(Component prev,ComponentDescription* desc,Handle h1,Handle h2,Handle h3); -static long (*CountComponents)(ComponentDescription* desc); static OSErr (*InitializeQTML)(long flags); static OSErr (*EnterMovies)(void); -static ComponentInstance (*OpenComponent)(Component c); -static ComponentResult (*ImageCodecInitialize)(ComponentInstance ci, - ImageSubCodecDecompressCapabilities * cap); -static ComponentResult (*ImageCodecBeginBand)(ComponentInstance ci, - CodecDecompressParams * params, - ImageSubCodecDecompressRecord * drp, - long flags); -static ComponentResult (*ImageCodecGetCodecInfo)(ComponentInstance ci, - CodecInfo * info); -static ComponentResult (*ImageCodecPreDecompress)(ComponentInstance ci, - CodecDecompressParams * params); -static ComponentResult (*ImageCodecBandDecompress)(ComponentInstance ci, - CodecDecompressParams * params); +static OSErr (*ExitMovies)(void); +static OSErr (*DecompressSequenceBegin)(ImageSequence *seqID, + ImageDescriptionHandle desc, + CGrafPtr port, + /*GDHandle*/void* gdh, + const Rect *srcRect, + MatrixRecordPtr matrix, + short mode, + RgnHandle mask, + CodecFlags flags, + CodecQ accuracy, + DecompressorComponent codec); +static OSErr (*DecompressSequenceFrameS)(ImageSequence seqID, + Ptr data, + long dataSize, + CodecFlags inFlags, + CodecFlags *outFlags, + ICMCompletionProcRecordPtr asyncCompletionProc); static PixMapHandle (*GetGWorldPixMap)(GWorldPtr offscreenGWorld); static OSErr (*QTNewGWorldFromPtr)(GWorldPtr *gw, OSType pixelFormat, @@ -91,6 +87,9 @@ static OSErr (*QTNewGWorldFromPtr)(GWorldPtr *gw, void *baseAddr, long rowBytes); static Handle (*NewHandleClear)(Size byteCount); +static void (*DisposeHandle)(Handle h); +static void (*DisposeGWorld)(GWorldPtr offscreenGWorld); +static OSErr (*CDSequenceEnd)(ImageSequence seqID); #endif /* #ifndef CONFIG_QUICKTIME */ // to set/get/query special features/parameters @@ -98,24 +97,18 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ return CONTROL_UNKNOWN; } -static int codec_initialized=0; - // init driver static int init(sh_video_t *sh){ #ifndef CONFIG_QUICKTIME OSErr result = 1; #endif - ComponentResult cres; - ComponentDescription desc; - Component prev=NULL; - CodecInfo cinfo; // for ImageCodecGetCodecInfo() - ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize() - codec_initialized = 0; -#ifdef CONFIG_QUICKTIME - EnterMovies(); -#else + if (sh->ImageDesc == NULL) { + mp_msg(MSGT_DECVIDEO,MSGL_ERR,"sh->ImageDesc not set, cannot use binary QuickTime codecs (try -demuxer mov?)\n"); + return 0; + } +#ifndef CONFIG_QUICKTIME #ifdef WIN32_LOADER Setup_LDT_Keeper(); #endif @@ -135,89 +128,29 @@ static int init(sh_video_t *sh){ InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML"); EnterMovies = (OSErr (*)(void))GetProcAddress(handler, "EnterMovies"); - FindNextComponent = (Component (*)(Component,ComponentDescription*))GetProcAddress(handler, "FindNextComponent"); - CountComponents = (long (*)(ComponentDescription*))GetProcAddress(handler, "CountComponents"); - GetComponentInfo = (OSErr (*)(Component,ComponentDescription*,Handle,Handle,Handle))GetProcAddress(handler, "GetComponentInfo"); - OpenComponent = (ComponentInstance (*)(Component))GetProcAddress(handler, "OpenComponent"); - ImageCodecInitialize = (ComponentResult (*)(ComponentInstance,ImageSubCodecDecompressCapabilities *))GetProcAddress(handler, "ImageCodecInitialize"); - ImageCodecGetCodecInfo = (ComponentResult (*)(ComponentInstance,CodecInfo *))GetProcAddress(handler, "ImageCodecGetCodecInfo"); - ImageCodecBeginBand = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *,ImageSubCodecDecompressRecord *,long))GetProcAddress(handler, "ImageCodecBeginBand"); - ImageCodecPreDecompress = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *))GetProcAddress(handler, "ImageCodecPreDecompress"); - ImageCodecBandDecompress = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *))GetProcAddress(handler, "ImageCodecBandDecompress"); + ExitMovies = (OSErr (*)(void))GetProcAddress(handler, "ExitMovies"); + DecompressSequenceBegin = (OSErr (*)(ImageSequence*,ImageDescriptionHandle,CGrafPtr,void *,const Rect *,MatrixRecordPtr,short,RgnHandle,CodecFlags,CodecQ,DecompressorComponent))GetProcAddress(handler, "DecompressSequenceBegin"); + DecompressSequenceFrameS = (OSErr (*)(ImageSequence,Ptr,long,CodecFlags,CodecFlags*,ICMCompletionProcRecordPtr))GetProcAddress(handler, "DecompressSequenceFrameS"); GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap"); QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr"); NewHandleClear = (OSErr(*)(Size))GetProcAddress(handler, "NewHandleClear"); - // = GetProcAddress(handler, ""); + DisposeHandle = (void (*)(Handle))GetProcAddress(handler, "DisposeHandle"); + DisposeGWorld = (void (*)(GWorldPtr))GetProcAddress(handler, "DisposeGWorld"); + CDSequenceEnd = (OSErr (*)(ImageSequence))GetProcAddress(handler, "CDSequenceEnd"); - if(!InitializeQTML || !EnterMovies || !FindNextComponent || !ImageCodecBandDecompress){ + if(!InitializeQTML || !EnterMovies || !DecompressSequenceBegin || !DecompressSequenceFrameS){ mp_msg(MSGT_DECVIDEO,MSGL_ERR,"invalid qtmlClient.dll!\n"); return 0; } - result=InitializeQTML(6+16); -// result=InitializeQTML(0); + result=InitializeQTML(kInitializeQTMLDisableDirectSound | + kInitializeQTMLUseGDIFlag | + kInitializeQTMLDisableDDClippers); mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"InitializeQTML returned %d\n",result); -// result=EnterMovies(); -// printf("EnterMovies->%d\n",result); #endif /* CONFIG_QUICKTIME */ -#if 0 - memset(&desc,0,sizeof(desc)); - while((prev=FindNextComponent(prev,&desc))){ - ComponentDescription desc2; - unsigned char* c1=&desc2.componentType; - unsigned char* c2=&desc2.componentSubType; - memset(&desc2,0,sizeof(desc2)); -// printf("juhee %p (%p)\n",prev,&desc); - GetComponentInfo(prev,&desc2,NULL,NULL,NULL); - mp_msg(MSGT_DECVIDEO,MSGL_DGB2,"DESC: %c%c%c%c/%c%c%c%c [0x%X/0x%X] 0x%X\n", - c1[3],c1[2],c1[1],c1[0], - c2[3],c2[2],c2[1],c2[0], - desc2.componentType,desc2.componentSubType, - desc2.componentFlags); - } -#endif - - - memset(&desc,0,sizeof(desc)); - desc.componentType= (((unsigned char)'i')<<24)| - (((unsigned char)'m')<<16)| - (((unsigned char)'d')<<8)| - (((unsigned char)'c')); -#if 0 - desc.componentSubType= - (((unsigned char)'S'<<24))| - (((unsigned char)'V')<<16)| - (((unsigned char)'Q')<<8)| - (((unsigned char)'3')); -#else - desc.componentSubType = bswap_32(sh->format); -#endif - desc.componentManufacturer=0; - desc.componentFlags=0; - desc.componentFlagsMask=0; - - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"Count = %ld\n",CountComponents(&desc)); - prev=FindNextComponent(NULL,&desc); - if(!prev){ - mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Cannot find requested component\n"); - return 0; - } - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"Found it! ID = %p\n",prev); - - ci=OpenComponent(prev); - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ci=%p\n",ci); - - memset(&icap,0,sizeof(icap)); - cres=ImageCodecInitialize(ci,&icap); - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageCodecInitialize->%#x size=%d (%d)\n",cres,icap.recordSize,icap.decompressRecordSize); - - memset(&cinfo,0,sizeof(cinfo)); - cres=ImageCodecGetCodecInfo(ci,&cinfo); - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"Flags: compr: 0x%X decomp: 0x%X format: 0x%X\n", - cinfo.compressFlags, cinfo.decompressFlags, cinfo.formatFlags); - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"Codec name: %.*s\n",((unsigned char*)&cinfo.typeName)[0], - ((unsigned char*)&cinfo.typeName)+1); + result=EnterMovies(); + mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"EnterMovies returned %d\n",result); //make a yuy2 gworld OutBufferRect.top=0; @@ -227,27 +160,14 @@ static int init(sh_video_t *sh){ //Fill the imagedescription for our SVQ3 frame //we can probably get this from Demuxer -#if 0 - framedescHandle=(ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription)+200); - printf("framedescHandle=%p *p=%p\n",framedescHandle,*framedescHandle); -{ FILE* f=fopen("/root/.wine/fake_windows/IDesc","r"); - if(!f) printf("filenot found: IDesc\n"); - fread(*framedescHandle,sizeof(ImageDescription)+200,1,f); - fclose(f); -} -#else if(!sh->ImageDesc) sh->ImageDesc=(sh->bih+1); // hack for SVQ3-in-AVI mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageDescription size: %d\n",((ImageDescription*)(sh->ImageDesc))->idSize); framedescHandle=(ImageDescriptionHandle)NewHandleClear(((ImageDescription*)(sh->ImageDesc))->idSize); memcpy(*framedescHandle,sh->ImageDesc,((ImageDescription*)(sh->ImageDesc))->idSize); dump_ImageDescription(*framedescHandle); -#endif -//Find codecscomponent for video decompression -// result = FindCodec ('SVQ1',anyCodec,&compressor,&decompressor ); -// printf("FindCodec SVQ1 returned:%i compressor: 0x%X decompressor: 0x%X\n",result,compressor,decompressor); + (**framedescHandle).cType = bswap_32(sh->format); sh->context = (void *)kYUVSPixelFormat; -#if 1 { int imgfmt = sh->codec->outfmt[sh->outfmtidx]; int qt_imgfmt; @@ -263,7 +183,7 @@ static int init(sh_video_t *sh){ qt_imgfmt = 0x79343230; break; case IMGFMT_UYVY: - qt_imgfmt = kUYVY422PixelFormat; + qt_imgfmt = k2vuyPixelFormat; break; case IMGFMT_YVYU: qt_imgfmt = kYVYU422PixelFormat; @@ -289,45 +209,13 @@ static int init(sh_video_t *sh){ sh->context = (void *)qt_imgfmt; if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,imgfmt)) return 0; } -#else - if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0; -#endif - - return 1; -} - -// uninit driver -static void uninit(sh_video_t *sh){ -#ifdef CONFIG_QUICKTIME - ExitMovies(); -#endif -} - -// decode a frame -static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ - OSErr result = 1; - int i; - mp_image_t* mpi; - ComponentResult cres; - - if(len<=0) return NULL; // skipped frame mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE, sh->disp_w, sh->disp_h); - if(!mpi) return NULL; - -#ifdef WIN32_LOADER - Setup_FS_Segment(); -#endif - - decpar.data = (char*)data; - decpar.bufferSize = len; - (**framedescHandle).dataSize=len; + if(!mpi) return 0; -if(!codec_initialized){ result = QTNewGWorldFromPtr( &OutBufferGWorld, -// kYUVSPixelFormat, //pixel format of new GWorld == YUY2 (OSType)sh->context, &OutBufferRect, //we should benchmark if yvu9 is faster for svq3, too 0, @@ -335,88 +223,63 @@ if(!codec_initialized){ 0, mpi->planes[0], mpi->stride[0]); - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"NewGWorldFromPtr returned:%d\n",result); -// if (65536-(result&0xFFFF) != 10000) -// return NULL; - -// printf("IDesc=%d\n",sizeof(ImageDescription)); - - decpar.imageDescription = framedescHandle; - decpar.startLine=0; - decpar.stopLine=(**framedescHandle).height; - decpar.frameNumber = 1; //1 -// decpar.conditionFlags=0xFFD; // first -// decpar.callerFlags=0x2001; // first - decpar.matrixFlags = 0; - decpar.matrixType = 0; - decpar.matrix = 0; - decpar.capabilities=&codeccap; -// decpar.accuracy = 0x1680000; //codecNormalQuality; - decpar.accuracy = codecNormalQuality; -// decpar.port = OutBufferGWorld; -// decpar.preferredOffscreenPixelSize=17207; - -// decpar.sequenceID=malloc(1000); -// memset(decpar.sequenceID,0,1000); - -// SrcRect.top=17207; -// SrcRect.left=0; -// SrcRect.right=0;//image_width; -// SrcRect.bottom=0;//image_height; - -// decpar.srcRect = SrcRect; - decpar.srcRect = OutBufferRect; - - decpar.transferMode = srcCopy; - decpar.dstPixMap = **GetGWorldPixMap( OutBufferGWorld);//destPixmap; - - cres=ImageCodecPreDecompress(ci,&decpar); - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageCodecPreDecompress cres=0x%X\n",cres); - - if(decpar.wantedDestinationPixelTypes) - { OSType *p=*(decpar.wantedDestinationPixelTypes); - if(p) while(*p){ - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"supported csp: 0x%08X %.4s\n",*p,(char *)p); - ++p; - } + if (result) { + mp_msg(MSGT_DECVIDEO,MSGL_ERR,"QTNewGWorldFromPtr result=%d\n",result); + return 0; } + result = DecompressSequenceBegin(&imageSeq, framedescHandle, (CGrafPtr)OutBufferGWorld, + NULL, NULL, NULL, srcCopy, NULL, 0, + codecNormalQuality, 0); + if(result) { + mp_msg(MSGT_DECVIDEO,MSGL_ERR,"DecompressSequenceBegin result=%d\n",result); + return 0; + } -// decpar.conditionFlags=0x10FFF; // first -// decpar.preferredOffscreenPixelSize=17207; - -// decpar.conditionFlags=0x10FFD; // first - -// cres=ImageCodecPreDecompress(ci,&decpar); -// printf("ImageCodecPreDecompress cres=0x%X\n",cres); - - - codec_initialized=1; + return 1; } -#if 0 - if(decpar.frameNumber==124){ - decpar.frameNumber=1; - cres=ImageCodecPreDecompress(ci,&decpar); - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageCodecPreDecompress cres=0x%lX\n",cres); +// uninit driver +static void uninit(sh_video_t *sh){ + OSErr result; + if(OutBufferGWorld) { + DisposeGWorld(OutBufferGWorld); + OutBufferGWorld = NULL; } -#endif + if(framedescHandle) { + DisposeHandle((Handle)framedescHandle); + framedescHandle = NULL; + } + if(imageSeq) { + CDSequenceEnd(imageSeq); + imageSeq = 0; + } + result=ExitMovies(); + mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ExitMovies returned %d\n",result); +} + +// decode a frame +static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ + OSErr result = 1; + CodecFlags ignore; - cres=ImageCodecBandDecompress(ci,&decpar); + if(len<=0) return NULL; // skipped frame - ++decpar.frameNumber; +#ifdef WIN32_LOADER + Setup_FS_Segment(); +#endif - if(cres) { - mp_msg(MSGT_DECVIDEO,MSGL_DBG2,"ImageCodecBandDecompress cres=0x%X (-0x%X) %d\n",cres,-cres,cres); - return NULL; + result = DecompressSequenceFrameS(imageSeq, data, len, 0, &ignore, NULL); + if(result) { + mp_msg(MSGT_DECVIDEO,MSGL_ERR,"DecompressSequenceFrameS result=0x%d\n",result); + return NULL; } -// for(i=0;i<8;i++) -// printf("img_base[%d]=%p\n",i,((int*)decpar.dstPixMap.baseAddr)[i]); - if((int)sh->context==0x73797639){ // Sorenson 16-bit YUV -> std YVU9 + int i; - short *src0=(short *)((char*)decpar.dstPixMap.baseAddr+0x20); + PixMap dstPixMap = **GetGWorldPixMap(OutBufferGWorld); + short *src0=(short *)((char*)dstPixMap.baseAddr+0x20); for(i=0;ih;i++){ int x; diff --git a/loader/qtx/qtxsdk/components.h b/loader/qtx/qtxsdk/components.h index 94cb8456dc..7320c81630 100644 --- a/loader/qtx/qtxsdk/components.h +++ b/loader/qtx/qtxsdk/components.h @@ -29,6 +29,14 @@ typedef int32_t SInt32; typedef void *GlobalsPtr; typedef void **Globals; +enum { + kInitializeQTMLNoSoundFlag = (1L << 0), + kInitializeQTMLUseGDIFlag = (1L << 1), + kInitializeQTMLDisableDirectSound = (1L << 2), + kInitializeQTMLUseExclusiveFullScreenModeFlag = (1L << 3), + kInitializeQTMLDisableDDClippers = (1L << 4) +}; + //==================== COMPONENTS =========================== struct __attribute__((__packed__)) ComponentParameters { -- cgit v1.2.3 From 22ede70e586599ab5810494c8321ea76c8821184 Mon Sep 17 00:00:00 2001 From: sesse Date: Mon, 15 Mar 2010 12:54:54 +0000 Subject: Implement GetVersionExW with the same data as GetVersionExA but taking in a different structure, and CreateMutexW, CreateEventW and CreateSemaphoreW as simple wrappers around the A versions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30900 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/loader/win32.c b/loader/win32.c index 96106da154..ad5ecf21e8 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -792,6 +792,18 @@ static void* WINAPI expCreateEventA(void* pSecAttr, char bManualReset, return ret; } +static void* WINAPI expCreateEventW(void* pSecAttr, char bManualReset, + char bInitialState, const WCHAR* name) +{ + char ascii_name[256]; + char *aname = NULL; + if (name) { + WideCharToMultiByte(65001, 0x0, name, -1, ascii_name, 256, NULL, NULL); + aname = ascii_name; + } + return expCreateEventA(pSecAttr, bManualReset, bInitialState, aname); +} + static void* WINAPI expSetEvent(void* event) { mutex_list *ml = (mutex_list *)event; @@ -1798,6 +1810,7 @@ static long WINAPI expWideCharToMultiByte(long v1, long v2, short* s1, long siz1 if(s2)dbgprintf(" dest: %s\n", s2); return result; } + static long WINAPI expGetVersionExA(OSVERSIONINFOA* c) { dbgprintf("GetVersionExA(0x%x) => 1\n"); @@ -1817,6 +1830,33 @@ static long WINAPI expGetVersionExA(OSVERSIONINFOA* c) " Platform Id: VER_PLATFORM_WIN32_NT\n Version string: 'Service Pack 3'\n"); re