Mercurial > mplayer.hg
comparison libmpcodecs/vd_raw.c @ 4969:db86fcf25ede
xanim, raw, rle added
author | arpi |
---|---|
date | Thu, 07 Mar 2002 01:39:07 +0000 |
parents | |
children | eb57973314ae |
comparison
equal
deleted
inserted
replaced
4968:236b06410b03 | 4969:db86fcf25ede |
---|---|
1 #include <stdio.h> | |
2 #include <stdlib.h> | |
3 | |
4 #include "config.h" | |
5 #include "mp_msg.h" | |
6 | |
7 #include "codec-cfg.h" | |
8 #include "../libvo/img_format.h" | |
9 | |
10 #include "stream.h" | |
11 #include "demuxer.h" | |
12 #include "stheader.h" | |
13 | |
14 #include "vd.h" | |
15 #include "vd_internal.h" | |
16 | |
17 static vd_info_t info = { | |
18 "RAW Uncompressed Video", | |
19 "raw", | |
20 VFM_RAW, | |
21 "A'rpi", | |
22 "A'rpi & Alex", | |
23 "uncompressed" | |
24 }; | |
25 | |
26 LIBVD_EXTERN(raw) | |
27 | |
28 // to set/get/query special features/parameters | |
29 static int control(sh_video_t *sh,int cmd,void* arg,...){ | |
30 switch(cmd){ | |
31 case VDCTRL_QUERY_FORMAT: | |
32 if( (*((int*)arg)) == sh->format ) return CONTROL_TRUE; | |
33 return CONTROL_FALSE; | |
34 } | |
35 return CONTROL_UNKNOWN; | |
36 } | |
37 | |
38 // init driver | |
39 static int init(sh_video_t *sh){ | |
40 // set format fourcc for raw RGB: | |
41 if(sh->format==0){ | |
42 switch(sh->bih->biBitCount){ | |
43 case 15: | |
44 case 16: sh->format=IMGFMT_BGR15; break; | |
45 case 24: sh->format=IMGFMT_BGR24; break; | |
46 case 32: sh->format=IMGFMT_BGR32; break; | |
47 default: | |
48 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"RAW: depth %d not supported\n",sh->bih->biBitCount); | |
49 } | |
50 } | |
51 mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format); | |
52 return 1; | |
53 } | |
54 | |
55 // uninit driver | |
56 static void uninit(sh_video_t *sh){ | |
57 } | |
58 | |
59 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h); | |
60 | |
61 // decode a frame | |
62 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ | |
63 mp_image_t* mpi; | |
64 if(len<=0) return NULL; // skipped frame | |
65 | |
66 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, | |
67 sh->disp_w, sh->disp_h); | |
68 if(!mpi) return NULL; | |
69 | |
70 if(mpi->flags&MP_IMGFLAG_PLANAR){ | |
71 // TODO !!! | |
72 mpi->planes[0]=data; | |
73 mpi->stride[0]=mpi->width; | |
74 } else { | |
75 mpi->planes[0]=data; | |
76 mpi->stride[0]=mpi->width*(mpi->bpp/8); | |
77 } | |
78 | |
79 return mpi; | |
80 } | |
81 |