mirror of
https://github.com/mpv-player/mpv
synced 2025-02-20 23:07:02 +00:00
fli and msvideo1 added
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4988 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
092aa814f7
commit
4efc145738
@ -3,7 +3,7 @@ include ../config.mak
|
||||
|
||||
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)
|
||||
|
||||
|
@ -33,6 +33,8 @@ extern vd_functions_t mpcodecs_vd_divx4;
|
||||
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 @@ vd_functions_t* mpcodecs_vd_drivers[] = {
|
||||
#endif
|
||||
&mpcodecs_vd_raw,
|
||||
&mpcodecs_vd_rle,
|
||||
&mpcodecs_vd_msvidc,
|
||||
&mpcodecs_vd_fli,
|
||||
#ifdef USE_XANIM
|
||||
&mpcodecs_vd_xanim,
|
||||
#endif
|
||||
|
65
libmpcodecs/vd_fli.c
Normal file
65
libmpcodecs/vd_fli.c
Normal file
@ -0,0 +1,65 @@
|
||||
#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;
|
||||
}
|
76
libmpcodecs/vd_msvidc.c
Normal file
76
libmpcodecs/vd_msvidc.c
Normal file
@ -0,0 +1,76 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user