annotate libmpcodecs/vd_qtsmc.c @ 9588:b57a0f03627f

add MODULE_LICENSE based on patch by Kronos <kronos@kronoz.cjb.net>
author arpi
date Fri, 14 Mar 2003 23:22:35 +0000
parents 28677d779205
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4989
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
1 #include <stdio.h>
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
2 #include <stdlib.h>
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
3
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
4 #include "config.h"
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
5 #include "mp_msg.h"
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
6
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
7 #include "vd_internal.h"
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
8
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
9 static vd_info_t info = {
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
10 "Apple Graphics (SMC) decoder",
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
11 "qtsmc",
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
12 "A'rpi",
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
13 "Mike Melanson",
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
14 "native codec"
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
15 };
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
16
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
17 LIBVD_EXTERN(qtsmc)
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
18
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
19 // to set/get/query special features/parameters
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
20 static int control(sh_video_t *sh,int cmd,void* arg,...){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
21 return CONTROL_UNKNOWN;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
22 }
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
23
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
24 int qt_init_decode_smc(void);
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
25
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
26 // init driver
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
27 static int init(sh_video_t *sh){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
28 if (qt_init_decode_smc() != 0){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
29 mp_msg(MSGT_DECVIDEO, MSGL_ERR, "SMC decoder could not allocate enough memory");
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
30 return 0;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
31 }
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
32
5124
3dcbf67c0de0 handle error from mpcodecs_config_vo()
arpi
parents: 4989
diff changeset
33 return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
4989
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
34 }
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
35
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
36 // uninit driver
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
37 static void uninit(sh_video_t *sh){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
38 }
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
39
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq 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);
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
41
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
42 void qt_decode_smc(
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
43 unsigned char *encoded,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
44 int encoded_size,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
45 unsigned char *decoded,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
46 int width,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
47 int height,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
48 unsigned char *palette_map,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
49 int bytes_per_pixel);
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
50
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
51 // decode a frame
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
52 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
53 mp_image_t* mpi;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
54 if(len<=0) return NULL; // skipped frame
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
55
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
56 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
57 sh->disp_w, sh->disp_h);
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
58 if(!mpi) return NULL;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
59
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
60 qt_decode_smc(
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
61 data,len, mpi->planes[0],
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
62 sh->disp_w, sh->disp_h,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
63 (unsigned char *)sh->bih+40,
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
64 mpi->bpp/8);
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
65
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
66 return mpi;
11d8bf468334 cyuv, nuv, qtrle, qtsmc, roq added
arpi
parents:
diff changeset
67 }