ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Video-Capture-V4l/RTjpeg/RTjpeg.xs
Revision: 1.1
Committed: Fri May 5 20:21:52 2000 UTC (24 years, 2 months ago) by pcg
Branch: MAIN
CVS Tags: rel-0_9, rel-0_902, HEAD
Log Message:
Initial check-in

File Contents

# User Rev Content
1 pcg 1.1 #include "EXTERN.h"
2     #include "perl.h"
3     #include "XSUB.h"
4    
5     #include <sys/types.h>
6     #include <unistd.h>
7     #include <sys/mman.h>
8    
9     #include "../gppport.h"
10    
11     #include "codec/RTjpeg.h"
12    
13     static int fwidth, fheight;
14    
15     MODULE = Video::RTjpeg PACKAGE = Video::RTjpeg PREFIX = RTjpeg_
16    
17     PROTOTYPES: ENABLE
18    
19     SV *
20     RTjpeg_init_compress(width,height,Q)
21     int width
22     int height
23     U8 Q
24     CODE:
25     fwidth = width;
26     fheight = height;
27     RETVAL = newSVpv ("", 0);
28     SvGROW (RETVAL, sizeof (RTjpeg_tables));
29     SvCUR_set (RETVAL, sizeof (RTjpeg_tables));
30     RTjpeg_init_compress ((u32 *)SvPV_nolen (RETVAL), width, height, Q);
31     OUTPUT:
32     RETVAL
33    
34     void
35     RTjpeg_init_decompress(tables,width,height)
36     SV * tables
37     int width
38     int height
39     CODE:
40     fwidth = width;
41     fheight = height;
42     RTjpeg_init_decompress ((u32 *)SvPV_nolen (tables), width, height);
43    
44     SV *
45     RTjpeg_compress(YCrCb422_data)
46     SV * YCrCb422_data
47     CODE:
48     RETVAL = newSVpv ("", 0);
49     SvGROW (RETVAL, (fwidth * fheight * 3 + 2) / 2);
50     SvCUR_set (RETVAL, RTjpeg_compress (SvPV_nolen (RETVAL), SvPV_nolen (YCrCb422_data)));
51     OUTPUT:
52     RETVAL
53    
54     SV *
55     RTjpeg_decompress(RTjpeg_data)
56     SV * RTjpeg_data
57     CODE:
58     RETVAL = newSVpv ("", 0);
59     SvGROW (RETVAL, fwidth * fheight * 2);
60     SvCUR_set (RETVAL, fwidth * fheight * 2);
61     RTjpeg_decompress (SvPV_nolen (RTjpeg_data), SvPV_nolen (RETVAL));
62     OUTPUT:
63     RETVAL
64    
65     void
66     RTjpeg_init_mcompress()
67    
68     SV *
69     RTjpeg_mcompress(YCrCb422_data,lmask,cmask=(lmask)>>1,x=0,y=0,w=fwidth,h=fheight)
70     SV * YCrCb422_data
71     U16 lmask
72     U16 cmask
73     int x
74     int y
75     int w
76     int h
77     CODE:
78     RETVAL = newSVpv ("", 0);
79     SvGROW (RETVAL, (fwidth * fheight * 3 + 2) / 2);
80     SvCUR_set (RETVAL, RTjpeg_mcompress (SvPV_nolen (RETVAL), SvPV_nolen (YCrCb422_data), lmask, cmask,
81     x, y, w, h));
82     OUTPUT:
83     RETVAL
84    
85     SV *
86     RTjpeg_yuvrgb(yuv_data)
87     SV * yuv_data
88     CODE:
89     RETVAL = newSVpv ("", 0);
90     SvGROW (RETVAL, fwidth * fheight * 3);
91     SvCUR_set (RETVAL, fwidth * fheight * 3);
92     RTjpeg_yuvrgb (SvPV_nolen (yuv_data), SvPV_nolen (RETVAL));
93     OUTPUT:
94     RETVAL
95    
96     void
97     _exit(retcode=0)
98     int retcode
99     CODE:
100     _exit (retcode);
101    
102     void
103     fdatasync(fd)
104     int fd
105     CODE:
106     #ifdef _POSIX_SYNCHRONIZED_IO
107     fdatasync (fd);
108     #endif
109    
110     BOOT:
111     {
112     HV *stash = gv_stashpvn("Video::RTjpeg", 13, TRUE);
113    
114     //newCONSTSUB(stash,"VBI_VT", newSViv(VBI_VT));
115     }
116