annotate libmpcodecs/vd_xanim.c @ 5100:c1eeb9416fd1

added i18n support (also disabled, later auto detection will be enabled)
author alex
date Fri, 15 Mar 2002 20:48:42 +0000
parents eb57973314ae
children 3dcbf67c0de0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4969
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
1 #include <stdio.h>
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
2 #include <stdlib.h>
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
3
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
4 #include "config.h"
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
5 #ifdef USE_XANIM
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
6
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
7 #include "mp_msg.h"
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
8
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
9 #include "vd_internal.h"
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
10
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
11 static vd_info_t info = {
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
12 "XAnim codecs",
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
13 "xanim",
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
14 VFM_XANIM,
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
15 "A'rpi & Alex",
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
16 "XAnim... TODO: name+url here",
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
17 "binary codec plugins"
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
18 };
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
19
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
20 LIBVD_EXTERN(xanim)
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
21
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
22 #include "xacodec.h"
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
23
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
24 // to set/get/query special features/parameters
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
25 static int control(sh_video_t *sh,int cmd,void* arg,...){
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
26 return CONTROL_UNKNOWN;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
27 }
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
28
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
29 // init driver
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
30 static int init(sh_video_t *sh){
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
31 mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format);
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
32 return xacodec_init_video(sh,sh->codec->outfmt[sh->outfmtidx]);
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
33 }
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
34
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
35 // uninit driver
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
36 static void uninit(sh_video_t *sh){
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
37 xacodec_exit();
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
38 }
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
39
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
40 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
41
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
42 // decode a frame
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
43 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
44 mp_image_t* mpi;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
45 xacodec_image_t* image;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
46
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
47 if(len<=0) return NULL; // skipped frame
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
48
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
49 image=xacodec_decode_frame(data,len,(flags&3)?1:0);
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
50 if(!image) return NULL;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
51
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
52 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE,
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
53 sh->disp_w, sh->disp_h);
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
54 if(!mpi) return NULL;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
55
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
56 mpi->planes[0]=image->planes[0];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
57 mpi->planes[1]=image->planes[1];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
58 mpi->planes[2]=image->planes[2];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
59 mpi->stride[0]=image->stride[0];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
60 mpi->stride[1]=image->stride[1];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
61 mpi->stride[2]=image->stride[2];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
62
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
63 return mpi;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
64 }
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
65
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
66 #endif