annotate libmpcodecs/vd_xanim.c @ 7183:6f7ae14f29a8

generalized iconv detection
author atmos4
date Sat, 31 Aug 2002 02:13:20 +0000
parents 28677d779205
children 46336b8e7a28
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 "A'rpi & Alex",
5272
edb622813c46 added xanim url
alex
parents: 5124
diff changeset
15 "Xanim (http://xanim.va.pubnix.com/)",
4969
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
16 "binary codec plugins"
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
17 };
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
18
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
19 LIBVD_EXTERN(xanim)
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
20
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
21 #include "xacodec.h"
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
22
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
23 // to set/get/query special features/parameters
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
24 static int control(sh_video_t *sh,int cmd,void* arg,...){
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
25 return CONTROL_UNKNOWN;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
26 }
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
27
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
28 // init driver
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
29 static int init(sh_video_t *sh){
6525
0a7be46617d8 yvu9 and if09 support
alex
parents: 5272
diff changeset
30 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12)) return 0;
4969
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
31 return xacodec_init_video(sh,sh->codec->outfmt[sh->outfmtidx]);
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
32 }
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
33
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
34 // uninit driver
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
35 static void uninit(sh_video_t *sh){
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
36 xacodec_exit();
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
37 }
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
38
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
39 //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
40
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
41 // decode a frame
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
42 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
43 mp_image_t* mpi;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
44 xacodec_image_t* image;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
45
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
46 if(len<=0) return NULL; // skipped frame
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
47
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
48 image=xacodec_decode_frame(data,len,(flags&3)?1:0);
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
49 if(!image) return NULL;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
50
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
51 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE,
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
52 sh->disp_w, sh->disp_h);
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
53 if(!mpi) return NULL;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
54
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
55 mpi->planes[0]=image->planes[0];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
56 mpi->planes[1]=image->planes[1];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
57 mpi->planes[2]=image->planes[2];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
58 mpi->stride[0]=image->stride[0];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
59 mpi->stride[1]=image->stride[1];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
60 mpi->stride[2]=image->stride[2];
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
61
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
62 return mpi;
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
63 }
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
64
db86fcf25ede xanim, raw, rle added
arpi
parents:
diff changeset
65 #endif