]> git.sesse.net Git - vlc/commitdiff
giclage de ces putains de .old et .new qu'� chaque commit je me plante
authorSam Hocevar <sam@videolan.org>
Thu, 20 Jan 2000 04:09:39 +0000 (04:09 +0000)
committerSam Hocevar <sam@videolan.org>
Thu, 20 Jan 2000 04:09:39 +0000 (04:09 +0000)
et � chaque update aussi, alors pouf, des #ifdef �a va aussi..

Makefile
include/video_decoder.h
include/vlc.h
src/input/input.c
src/input/input_ctrl.c

index e85a7722ad6976997890532da5567d679f05e573..ef8b7905a4097e58ef51aa9da529fa6ff99e418e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,8 @@ ARCH=MMX
 # Decoder choice - ?? old decoder will be removed soon
 #DECODER=old
 DECODER=new
+# !!! don't forget to run this command after changing decoder type !!!
+# touch input/input.c input/input_ctrl.c include/vlc.h include/video_decoder.h
 
 #----------------- do not change anything below this line ----------------------
 
@@ -194,6 +196,7 @@ subtitle_decoder_obj =              subtitle_decoder/subtitle_decoder.o
 # remeber to add it to OBJ 
 
 ifeq ($(DECODER),old)
+CFLAGS += -DOLD_DECODER
 video_decoder_obj =            video_decoder_ref/video_decoder.o \
                                                video_decoder_ref/display.o \
                                                video_decoder_ref/getblk.o \
index 0b328f7bab3a91da55fa4735f64796b7be04b5a8..3dc1ad9aa7ac756b33e744c6a049b793220991fa 100644 (file)
@@ -1,8 +1,8 @@
-/*******************************************************************************
+/*****************************************************************************
  * video_decoder.h : video decoder thread
  * (c)1999 VideoLAN
- *******************************************************************************
- *******************************************************************************
+ *****************************************************************************
+ *****************************************************************************
  * Requires:
  *  "config.h"
  *  "common.h"
  *  "video.h"
  *  "video_output.h"
  *  "decoder_fifo.h"
- *******************************************************************************/
+ *****************************************************************************/
 
-/*******************************************************************************
+/*****************************************************************************
  * vdec_thread_t: video decoder thread descriptor
- *******************************************************************************
+ *****************************************************************************
  * ??
- *******************************************************************************/
+ *****************************************************************************/
 typedef struct vdec_thread_s
 {
     /* Thread properties and locks */
-    boolean_t           b_die;                                   /* `die' flag */
-    boolean_t           b_run;                                   /* `run' flag */
-    boolean_t           b_error;                               /* `error' flag */
-    boolean_t           b_active;                             /* `active' flag */
-    vlc_thread_t        thread_id;                  /* id for thread functions */
+    boolean_t           b_die;                                 /* `die' flag */
+    boolean_t           b_run;                                 /* `run' flag */
+    boolean_t           b_error;                             /* `error' flag */
+    boolean_t           b_active;                           /* `active' flag */
+    vlc_thread_t        thread_id;                /* id for thread functions */
 
     /* Thread configuration */
     /* ?? */
  /*??*/
 //    int *pi_status;
-    
 
+#ifdef OLD_DECODER
     /* Input properties */
-    decoder_fifo_t      fifo;                                /* PES input fifo */
+    decoder_fifo_t      fifo;                              /* PES input fifo */
 
     /* The bit stream structure handles the PES stream at the bit level */
     bit_stream_t        bit_stream;
 
     /* Output properties */
-    vout_thread_t *     p_vout;                         /* video output thread */
-    int                 i_stream;                           /* video stream id */
-    
+    vout_thread_t *     p_vout;                       /* video output thread */
+    int                 i_stream;                         /* video stream id */
+#else
+    /* idct iformations */
+    dctelem_t              p_pre_idct[64*64];
+
+    /* Input properties */
+    struct vpar_thread_s *    p_vpar;                 /* video_parser thread */
+
+    /* Lookup tables */
+//#ifdef MPEG2_COMPLIANT
+    u8              pi_crop_buf[VDEC_CROPRANGE];
+    u8 *            pi_crop;
+//#endif
+#endif
         
 #ifdef STATS
     /* Statistics */
-    count_t         c_loops;                               /* number of loops */
-    count_t         c_idle_loops;                     /* number of idle loops */
-    count_t         c_pictures;                    /* number of pictures read */
-    count_t         c_i_pictures;                /* number of I pictures read */
-    count_t         c_p_pictures;                /* number of P pictures read */
-    count_t         c_b_pictures;                /* number of B pictures read */    
-    count_t         c_decoded_pictures;         /* number of pictures decoded */
-    count_t         c_decoded_i_pictures;     /* number of I pictures decoded */
-    count_t         c_decoded_p_pictures;     /* number of P pictures decoded */
-    count_t         c_decoded_b_pictures;     /* number of B pictures decoded */
+    count_t         c_loops;                              /* number of loops */
+    count_t         c_idle_loops;                    /* number of idle loops */
+#ifdef OLD_DECODER
+    count_t         c_pictures;                   /* number of pictures read */
+    count_t         c_i_pictures;               /* number of I pictures read */
+    count_t         c_p_pictures;               /* number of P pictures read */
+    count_t         c_b_pictures;               /* number of B pictures read */    
+#endif
+    count_t         c_decoded_pictures;        /* number of pictures decoded */
+    count_t         c_decoded_i_pictures;    /* number of I pictures decoded */
+    count_t         c_decoded_p_pictures;    /* number of P pictures decoded */
+    count_t         c_decoded_b_pictures;    /* number of B pictures decoded */
 #endif
 } vdec_thread_t;
 
-/*******************************************************************************
+/*****************************************************************************
+ * Function pointers
+ *****************************************************************************/
+#ifndef OLD_DECODER
+typedef void (*f_addb_t)( vdec_thread_t *, dctelem_t*, yuv_data_t*, int );
+#endif
+
+/*****************************************************************************
  * Prototypes
- *******************************************************************************/
+ *****************************************************************************/
+#ifndef OLD_DECODER
+struct vpar_thread_s;
+#endif
 
 /* Thread management functions */
+#ifdef OLD_DECODER
 p_vdec_thread_t  vdec_CreateThread       ( /* video_cfg_t *p_cfg, */ input_thread_t *p_input /*,
                                           vout_thread_t *p_vout, int *pi_status */ );
 void             vdec_DestroyThread      ( vdec_thread_t *p_vdec /*, int *pi_status */ );
-
-/* Time management functions */
-/* ?? */
-
-/* Dynamic thread settings */
-/* ?? */
+#else
+vdec_thread_t * vdec_CreateThread       ( struct vpar_thread_s *p_vpar /*, int *pi_status */ );
+void vdec_DestroyThread      ( vdec_thread_t *p_vdec /*, int *pi_status */ );
+void vdec_AddBlock( vdec_thread_t *, dctelem_t*, yuv_data_t*, int );
+void vdec_CopyBlock( vdec_thread_t *, dctelem_t*, yuv_data_t*, int );
+void vdec_DummyBlock( vdec_thread_t *, dctelem_t*, yuv_data_t*, int );
+#endif
index 40f97c28f9999e7660f42e552d4eff0da5a2a7de..0f0911e6d96dfb096b9882fc8a4ae07342724868 100644 (file)
 /* Video */
 #include "video.h"
 #include "video_output.h"
+
+#ifdef OLD_DECODER
+#include "video_decoder.h"
+#else
+#include "vdec_idct.h"
 #include "video_decoder.h"
+#include "vdec_motion.h"
+#include "vpar_blocks.h"
+#include "vpar_headers.h"
+#include "video_fifo.h"
+#include "vpar_synchro.h"
+#include "video_parser.h"
+#endif
 
 /* Interface */
 #include "intf_cmd.h"
 #include "intf_ctrl.h"
+#ifndef OLD_DECODER
+#include "intf_sys.h"
+#include "intf_console.h"
+#endif
 #include "interface.h"
 
 #include "main.h"
index c0f42219cdc839fbfa0c17c969623dc98f21eb54..0d947db3f6c18b328ddc1ee6d9812aae1c0f6953 100644 (file)
@@ -112,9 +112,15 @@ input_thread_t *input_CreateThread( input_cfg_t *p_cfg )
     {
         /* File methods */
         case INPUT_METHOD_TS_FILE:
+#ifdef OLD_DECODER
             p_input->p_open = &input_FileCreateMethod;
             p_input->p_read = &input_FileRead;
             p_input->p_clean = &input_FileDestroyMethod;
+#else
+            p_input->p_open = input_FileCreateMethod;
+            p_input->p_read = input_FileRead;
+            p_input->p_clean = input_FileDestroyMethod;
+#endif
             break;
 
         /* Network methods */
@@ -122,9 +128,15 @@ input_thread_t *input_CreateThread( input_cfg_t *p_cfg )
         case INPUT_METHOD_TS_MCAST:
         case INPUT_METHOD_TS_BCAST:
         case INPUT_METHOD_TS_VLAN_BCAST:
+#ifdef OLD_DECODER
             p_input->p_open = &input_NetworkCreateMethod;
             p_input->p_read = &input_NetworkRead;
             p_input->p_clean = &input_NetworkDestroyMethod;
+#else
+            p_input->p_open = input_NetworkCreateMethod;
+            p_input->p_read = input_NetworkRead;
+            p_input->p_clean = input_NetworkDestroyMethod;
+#endif
             break;
 
         case INPUT_METHOD_NONE:
@@ -341,7 +353,11 @@ static void EndThread( input_thread_t * p_input )
             {
                 case MPEG1_VIDEO_ES:
                 case MPEG2_VIDEO_ES:
+#ifdef OLD_DECODER
                     vdec_DestroyThread( (vdec_thread_t*)(p_input->pp_selected_es[i_es_loop]->p_dec) /*, NULL */ );
+#else
+                    vpar_DestroyThread( (vpar_thread_t*)(p_input->pp_selected_es[i_es_loop]->p_dec) /*, NULL */ );
+#endif
                     break;
 
                 case MPEG1_AUDIO_ES:
@@ -986,7 +1002,11 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
             {
                 case MPEG1_VIDEO_ES:
                 case MPEG2_VIDEO_ES:
+#ifdef OLD_DECODER
                     p_fifo = &(((vdec_thread_t*)(p_es_descriptor->p_dec))->fifo);
+#else
+                    p_fifo = &(((vpar_thread_t*)(p_es_descriptor->p_dec))->fifo);
+#endif
                     break;
 
                 case MPEG1_AUDIO_ES:
index ea62c58cc280254fa103716457bce9f5c13ed0c8..96505db00305e3743ed12bb9705b4e13fa36e775 100644 (file)
@@ -9,12 +9,13 @@
 /*******************************************************************************
  * Preamble
  *******************************************************************************/
+
 #include "vlc.h"
 
-/*
+#if 0
 #include <errno.h>
-#include <sys/uio.h>                                                
-#include <stdlib.h>                             
+#include <sys/uio.h>                                                 /* iovec */
+#include <stdlib.h>                               /* atoi(), malloc(), free() */
 #include <string.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -22,7 +23,7 @@
 #include <X11/Xlib.h>
 #include <X11/extensions/XShm.h>
 #include <sys/soundcard.h>
-#include <netinet/in.h>                                             
+#include <netinet/in.h>                                              /* ntohs */
 
 #include "common.h"
 #include "config.h"
@@ -42,7 +43,9 @@
 
 #include "video.h"
 #include "video_output.h"
-#include "video_decoder.h" */
+#include "video_decoder.h"
+
+#endif
 
 /******************************************************************************
  * input_AddPgrmElem: Start the extraction and the decoding of a program element
@@ -128,10 +131,19 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
                     case MPEG2_VIDEO_ES:
                         /* Spawn video thread. */
 /* Les 2 pointeurs NULL ne doivent pas etre NULL sinon on segfault !!!! */
+#ifdef OLD_DECODER
                         if( ((vdec_thread_t*)(p_input->p_es[i_es_loop].p_dec) =
                             vdec_CreateThread( p_input )) == NULL )
+#else
+                        if( ((vpar_thread_t*)(p_input->p_es[i_es_loop].p_dec) =
+                            vpar_CreateThread( p_input )) == NULL )
+#endif
                         {
+#ifdef OLD_DECODER
                             intf_ErrMsg("Could not start video decoder\n");
+#else
+                            intf_ErrMsg("Could not start video parser\n");
+#endif
                             vlc_mutex_unlock( &p_input->es_lock );
                             return( -1 );
                         }
@@ -216,7 +228,11 @@ int input_DelPgrmElem( input_thread_t *p_input, int i_current_id )
 
                     case MPEG1_VIDEO_ES:
                     case MPEG2_VIDEO_ES:
+#ifdef OLD_DECODER
                         vdec_DestroyThread( (vdec_thread_t*)(p_input->pp_selected_es[i_selected_es_loop]->p_dec) /*, NULL */ );
+#else
+                        vpar_DestroyThread( (vpar_thread_t*)(p_input->pp_selected_es[i_selected_es_loop]->p_dec) /*, NULL */ );
+#endif
                         break;
                 }