[MPlayer-cygwin] MinGW compile-problem in vd_lcl.c, missing definition of 'Z_NO/BEST_COMPRESSION'

Stefan Gürtler Stefan.guertler at stud.tum.de
Sat Dec 13 15:59:06 CET 2003


Hi
Lately I am unable to compile mplayer under MinGW, no matter how many
options I disable. Both mplayer-1.0pre3 and latest source from cvs.
Both give me an error (see first paragraph blow ) due to missing definitions
for `Z_NO_COMPRESSION' and `Z_BEST_COMPRESSION' in the file vd_lcl.c. (see
second  paragraph blow)
I have browsed the includes of vd_lcl.c and found all include-files on my
system expect of zlib.h.
HAVE_ZLIB is undefind in config.h.
There is another "reference" to 'Z_NO_COMPRESSION' in vo_png.c, but there it
is not defined, but used.(see third paragraph)
Where is the definition of 'Z_NO_COMPRESSION' and `Z_BEST_COMPRESSION' on
your systems? Is it in zlib.h, and who do I get it?

Some information on MinGW:
I am using a fresh installation of MSys 1.09 and MinGW 3.1.0-1. I tryed the
included gcc version 3.2.3 (mingw special 20030504-1) and the update gcc
version 3.3.1 (mingw special 20030804). Only the directx7-header were added
to mingw includes.
Tests were done on a PIII with Win98 and on a P4 with WinXP.

Yours Stefan

----------------------------------------------------------------------------
---------------------------------------------

vd_lcl.c: In function `init':
vd_lcl.c:222: `Z_NO_COMPRESSION' undeclared (first use in this function)
vd_lcl.c:222: (Each undeclared identifier is reported only once
vd_lcl.c:222: for each function it appears in.)
vd_lcl.c:222: `Z_BEST_COMPRESSION' undeclared (first use in this function)
make[1]: *** [vd_lcl.o] Error 1
make[1]: Leaving directory `/home/Stefan/main/libmpcodecs'
make: *** [libmpcodecs/libmpcodecs.a] Error 2

----------------------------------------------------------------------------
----------------------------------------------
/*
 *
 * LCL (LossLess Codec Library) Decoder for Mplayer
 * (c) 2002, 2003 Roberto Togni
 *
 * Fourcc: MSZH, ZLIB
 *
 * Win32 dll:
 * Ver2.23 By Kenji Oshima 2000.09.20
 * avimszh.dll, avizlib.dll
 *
 * A description of the decoding algorithm can be found here:
 *   http://www.pcisys.net/~melanson/codecs
 *
 */

#include <stdio.h>
#include <stdlib.h>

#include "config.h"

#ifdef HAVE_ZLIB
#include <zlib.h>
#endif

#include "mp_msg.h"

#include "vd_internal.h"


static vd_info_t info = {
  "LCL Video decoder",
  "lcl",
  "Roberto Togni",
  "Roberto Togni",
  "native codec"
};

LIBVD_EXTERN(lcl)


#define BMPTYPE_YUV 1
#define BMPTYPE_RGB 2

#define IMGTYPE_YUV111 0
#define IMGTYPE_YUV422 1
#define IMGTYPE_RGB24 2
#define IMGTYPE_YUV411 3
#define IMGTYPE_YUV211 4
#define IMGTYPE_YUV420 5

#define COMP_MSZH 0
#define COMP_MSZH_NOCOMP 1
#define COMP_ZLIB_HISPEED 1
#define COMP_ZLIB_HICOMP 9
#define COMP_ZLIB_NORMAL -1

#define FLAG_MULTITHREAD 1
#define FLAG_NULLFRAME 2
#define FLAG_PNGFILTER 4
#define FLAGMASK_UNUSED 0xf8

#define CODEC_MSZH 1
#define CODEC_ZLIB 3

#define FOURCC_MSZH mmioFOURCC('M','S','Z','H')
#define FOURCC_ZLIB mmioFOURCC('Z','L','I','B')

/*
 * Decoder context
 */
typedef struct {
  // Image type
  int imgtype;
  // Compression type
  int compression;
  // Flags
  int flags;
  // Codec type
  int codec;
  // Decompressed data size
  unsigned int decomp_size;
  // Decompression buffer
  unsigned char* decomp_buf;
#ifdef HAVE_ZLIB
  z_stream zstream;
#endif
} lcl_context_t;


/*
 * Internal function prototypes
 */
...
/* Detect compression method */
  hc->compression = *((char *)bih + sizeof(BITMAPINFOHEADER) + 5);
  switch (hc->codec) {
    case CODEC_MSZH:
      switch (hc->compression) {
        case COMP_MSZH:
          mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] Compression enabled.\n");
          break;
        case COMP_MSZH_NOCOMP:
          hc->decomp_size = 0;
          mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] No compression.\n");
          break;
        default:
          mp_msg(MSGT_DECVIDEO, MSGL_ERR, "[LCL] Unsupported compression
format for MSZH (%d).\n", hc->compression);
          return 0;
      }
      break;
    case CODEC_ZLIB:
      switch (hc->compression) {
        case COMP_ZLIB_HISPEED:
          mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] High speed
compression.\n");
          break;
        case COMP_ZLIB_HICOMP:
          mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] High compression.\n");
          break;
        case COMP_ZLIB_NORMAL:
          mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] Normal compression.\n");
          break;
        default:
          if ((hc->compression < Z_NO_COMPRESSION) || (hc->compression >
Z_BEST_COMPRESSION)) {
     mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] Unusupported compression level
for ZLIB: (%d).\n", hc->compression);
     return 0;
   }
          mp_msg(MSGT_DECVIDEO, MSGL_INFO, "[LCL] Compression level for
ZLIB: (%d).\n", hc->compression);
      }
      break;
    default:
      mp_msg(MSGT_DECVIDEO, MSGL_ERR, "[LCL] BUG! Unknown codec in
compression switch.\n");
      return 0;
  }


----------------------------------------------------------------------------
-------------------------------------------

/*
 * vo_png.c, Portable Network Graphics Renderer for Mplayer
 *
 * Copyright 2001 by Felix Buenemann <atmosfear at users.sourceforge.net>
 *
 * Uses libpng (which uses zlib), so see according licenses.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#include <png.h>

#include "config.h"
#include "video_out.h"
#include "video_out_internal.h"

static vo_info_t info =
{
 "PNG file",
 "png",
 "Felix Buenemann <atmosfear at users.sourceforge.net>",
 ""
};

LIBVO_EXTERN (png)

extern int verbose;
int z_compression = Z_NO_COMPRESSION;
static int framenum = 0;






More information about the MPlayer-cygwin mailing list