comparison libmpcodecs/vd_qtrpza.c @ 4915:f6990fad0ab3

Qt RPZA decoder interface by Roberto Togni <rtogni@bresciaonline.it>
author arpi
date Sat, 02 Mar 2002 22:08:19 +0000
parents
children 869e5bff8dab
comparison
equal deleted inserted replaced
4914:de4074ab4e5f 4915:f6990fad0ab3
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 #include "codec-cfg.h"
5
6 #include "config.h"
7 #include "mp_msg.h"
8
9 #include "../libvo/img_format.h"
10
11 #include "stream.h"
12 #include "demuxer.h"
13 #include "stheader.h"
14
15 #include "vd.h"
16 #include "vd_internal.h"
17
18 static vd_info_t info = {
19 "Quicktime Apple Video",
20 "qtrpza",
21 VFM_QTRPZA,
22 "Roberto Togni",
23 "Roberto Togni",
24 "native codec"
25 };
26
27 LIBVD_EXTERN(qtrpza)
28
29 // to set/get/query special features/parameters
30 static int control(sh_video_t *sh,int cmd,void* arg,...){
31 return CONTROL_UNKNOWN;
32 }
33
34 //int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt);
35
36 // init driver
37 static int init(sh_video_t *sh){
38 mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR16);
39 return 1;
40 }
41
42 // uninit driver
43 static void uninit(sh_video_t *sh){
44 }
45
46 //mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
47
48 void qt_decode_rpza(char *encoded, int encodec_size, char *decodec, int width, int height, int bytes_per_pixel);
49
50 // decode a frame
51 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
52 mp_image_t* mpi;
53 if(len<=0) return NULL; // skipped frame
54
55 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE, sh->disp_w, sh->disp_h);
56
57 if(!mpi){ // temporary!
58 printf("couldn't allocate image for qtrpza codec\n");
59 return NULL;
60 }
61
62 qt_decode_rpza(data, len, mpi->planes[0], sh->disp_w, sh->disp_h,
63 ((mpi->imgfmt&255)+7)/8);
64
65 return mpi;
66 }