changeset 4944:f896676db962

DivX5 Build support, not usefull because current divx5linux from avifile.sf.net only decodes black/green image
author atmos4
date Wed, 06 Mar 2002 02:22:46 +0000
parents 511e8d8117e9
children b0e1dc1bba4b
files configure dec_video.c
diffstat 2 files changed, 41 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Tue Mar 05 20:15:25 2002 +0000
+++ b/configure	Wed Mar 06 02:22:46 2002 +0000
@@ -2605,7 +2605,8 @@
 fi
 
 
-echocheck "XviD/DivX4linux/OpenDivX decore"
+echocheck "XviD/DivX4linux/DivX5linux/OpenDivX decore"
+# DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
 cat > $TMPC << EOF
 #include <decore.h>
 int main(void) { (void) decore(0, 0, 0, 0);  return DEC_OPT_FRAME_311; }
@@ -2617,6 +2618,7 @@
   _ld_decore="$_xvidcore"
   _def_decore='#define NEW_DECORE 1'
   _def_divx='#define USE_DIVX'
+  _def_divx5='#undef DECORE_DIVX5'
   _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
   _codecmodules="xvid $_codecmodules"
   echores "XviD (with $_xvidcore)"
@@ -2627,6 +2629,7 @@
   _ld_decore='-lxvidcore'
   _def_decore='#define NEW_DECORE 1'
   _def_divx='#define USE_DIVX'
+  _def_divx5='#undef DECORE_DIVX5'
   _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
   _codecmodules="xvid $_codecmodules"
   echores "XviD (with libxvidcore.so)"
@@ -2637,9 +2640,31 @@
   _ld_decore='-ldivxdecore opendivx/postprocess.o'
   _def_decore='#define NEW_DECORE 1'
   _def_divx='#define USE_DIVX'
+  _def_divx5='#undef DECORE_DIVX5'
   _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
   _codecmodules="divx4linux $_codecmodules"
-  echores "Divx4linux (with libdivxdecore.so)"
+  echores "DivX4linux (with libdivxdecore.so)"
+elif test "$_divx4linux" != no ; then 
+# DivX5 check
+# OdivxPP disabled because of:
+# ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
+cat > $TMPC << EOF
+#include <decore.h>
+int main(void) { (void) decore(0, 0, 0, 0);  return DEC_OPT_MEMORY_REQS; }
+EOF
+if cc_check -lm -ldivxdecore -lm ; then
+  _xvid=no
+  _divx4linux=yes
+  _opendivx=no
+#  _ld_decore='-ldivxdecore opendivx/postprocess.o'
+  _ld_decore='-ldivxdecore'
+  _def_decore='#define NEW_DECORE 1'
+  _def_divx='#define USE_DIVX'
+  _def_divx5='#define DECORE_DIVX5 1'
+#  _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
+  _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
+  _codecmodules="divx5linux $_codecmodules"
+  echores "DivX5linux (with libdivxdecore.so)"
 elif test "$_opendivx" != no ; then
   _xvid=no
   _divx4linux=no
@@ -2647,6 +2672,7 @@
   _ld_decore='-Lopendivx -ldecore'
   _def_decore='#undef NEW_DECORE'
   _def_divx='#define USE_DIVX'
+  _def_divx5='#undef DECORE_DIVX5'
   _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
   _codecmodules="opendivx $_codecmodules"
   echores "OpenDivX"
@@ -2657,8 +2683,10 @@
   _ld_decore=''
   _def_decore='#undef NEW_DECORE'
   _def_divx='#undef USE_DIVX'
+  _def_divx5='#undef DECORE_DIVX5'
   _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
   echores "no"
+fi # DivX5 check
 fi
 
 
@@ -3126,6 +3154,9 @@
 /* You have to change DECORE_LIBS in config.mak too! */
 $_def_decore
 
+/* Define if you are using DivX5Linux Decore library */
+$_def_divx5
+
 /* If build mencoder */
 $_mencoder_flag
 
--- a/dec_video.c	Tue Mar 05 20:15:25 2002 +0000
+++ b/dec_video.c	Wed Mar 06 02:22:46 2002 +0000
@@ -897,7 +897,11 @@
 #ifdef NEW_DECORE
         dec_frame.bmp=&dec_pic;
         dec_pic.y=dec_pic.u=dec_pic.v=NULL;
+#ifdef DECORE_DIVX5
+	decore(0x123, DEC_OPT_FRAME, &dec_frame, NULL);
+#else
 	decore(0x123, (sh_video->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL);
+#endif
 #else
         opendivx_src[0]=NULL;
 	decore(0x123, 0, &dec_frame, NULL);
@@ -943,7 +947,11 @@
         dec_frame.bmp=sh_video->our_out_buffer;
         dec_frame.stride=sh_video->disp_w;
 //	printf("Decoding DivX4 frame\n");
+#ifdef DECORE_DIVX5
+	decore(0x123, DEC_OPT_FRAME, &dec_frame, NULL);
+#else
 	decore(0x123, (sh_video->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL);
+#endif
     if(!drop_frame) blit_frame=3;
     break;
   }