[Mplayer-cvslog] CVS: main/libmpcodecs vd_fli.c,NONE,1.1 vd_msvidc.c,NONE,1.1 Makefile,1.8,1.9 vd.c,1.11,1.12

Arpi of Ize arpi at mplayer.dev.hu
Thu Mar 7 22:07:01 CET 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mplayer:/var/tmp.root/cvs-serv15467

Modified Files:
	Makefile vd.c 
Added Files:
	vd_fli.c vd_msvidc.c 
Log Message:
fli and msvideo1 added

--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>

#include "config.h"
#include "mp_msg.h"

#include "vd_internal.h"

static vd_info_t info = {
	"Autodesk FLI/FLC Animation decoder",
	"fli",
	VFM_FLI,
	"A'rpi",
	"Mike Melanson",
	"native codec"
};

LIBVD_EXTERN(fli)

// to set/get/query special features/parameters
static int control(sh_video_t *sh,int cmd,void* arg,...){
    return CONTROL_UNKNOWN;
}

void *init_fli_decoder(int width, int height);

void decode_fli_frame(
  unsigned char *encoded,
  int encoded_size,
  unsigned char *decoded,
  int width,
  int height,
  int bytes_per_pixel,
  void *context);

// init driver
static int init(sh_video_t *sh){
    mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
    sh->context = init_fli_decoder(sh->disp_w, sh->disp_h);
    return 1;
}

// uninit driver
static void uninit(sh_video_t *sh){
}

//mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);

// decode a frame
static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
    mp_image_t* mpi;
    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;

    decode_fli_frame(
        data, len, mpi->planes[0],
        sh->disp_w, sh->disp_h,
        mpi->bpp/8,
        sh->context);
    
    return mpi;
}

--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>

#include "config.h"
#include "mp_msg.h"

#include "vd_internal.h"

static vd_info_t info = {
	"Microsoft Video 1 / CRAM decoder",
	"msvidc",
	VFM_MSVIDC,
	"A'rpi",
	"Mike Melanson",
	"native codec"
};

LIBVD_EXTERN(msvidc)

// to set/get/query special features/parameters
static int control(sh_video_t *sh,int cmd,void* arg,...){
    return CONTROL_UNKNOWN;
}

// init driver
static int init(sh_video_t *sh){
    mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
    return 1;
}

// uninit driver
static void uninit(sh_video_t *sh){
}

//mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);

void AVI_Decode_Video1_16(
  char *encoded,
  int encoded_size,
  char *decoded,
  int width,
  int height,
  int bytes_per_pixel);

void AVI_Decode_Video1_8(
  char *encoded,
  int encoded_size,
  char *decoded,
  int width,
  int height,
  unsigned char *palette_map,
  int bytes_per_pixel);

// decode a frame
static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
    mp_image_t* mpi;
    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;
    
    if (sh->bih->biBitCount == 16)
      AVI_Decode_Video1_16(
        data, len, mpi->planes[0],
        sh->disp_w, sh->disp_h,
        mpi->bpp/8);
    else
      AVI_Decode_Video1_8(
        data, len, mpi->planes[0],
        sh->disp_w, sh->disp_h,
	(unsigned char *)sh->bih+40,
        mpi->bpp/8);
    
    return mpi;
}

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Makefile	7 Mar 2002 01:39:07 -0000	1.8
+++ Makefile	7 Mar 2002 21:06:59 -0000	1.9
@@ -3,7 +3,7 @@
 
 LIBNAME = libmpcodecs.a
 
-SRCS=dec_video.c vd.c vd_null.c vd_cinepak.c vd_qtrpza.c vd_ffmpeg.c vd_dshow.c vd_vfw.c vd_odivx.c vd_divx4.c vd_raw.c vd_xanim.c vd_rle.c
+SRCS=dec_video.c vd.c vd_null.c vd_cinepak.c vd_qtrpza.c vd_ffmpeg.c vd_dshow.c vd_vfw.c vd_odivx.c vd_divx4.c vd_raw.c vd_xanim.c vd_rle.c vd_msvidc.c vd_fli.c
 
 OBJS=$(SRCS:.c=.o)
 

Index: vd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- vd.c	7 Mar 2002 13:09:10 -0000	1.11
+++ vd.c	7 Mar 2002 21:06:59 -0000	1.12
@@ -33,6 +33,8 @@
 extern vd_functions_t mpcodecs_vd_raw;
 extern vd_functions_t mpcodecs_vd_xanim;
 extern vd_functions_t mpcodecs_vd_rle;
+extern vd_functions_t mpcodecs_vd_msvidc;
+extern vd_functions_t mpcodecs_vd_fli;
 
 vd_functions_t* mpcodecs_vd_drivers[] = {
         &mpcodecs_vd_null,
@@ -56,6 +58,8 @@
 #endif
         &mpcodecs_vd_raw,
         &mpcodecs_vd_rle,
+        &mpcodecs_vd_msvidc,
+        &mpcodecs_vd_fli,
 #ifdef USE_XANIM
         &mpcodecs_vd_xanim,
 #endif




More information about the MPlayer-cvslog mailing list