2
* This file was generated automatically by xsubpp version 1.9508 from the
3
* contents of V4l.xs. Do not edit this file, edit V4l.xs instead.
5
* ANY CHANGES MADE HERE WILL BE LOST!
14
#include <sys/types.h>
21
#include <linux/videodev.h>
23
#define NEED_newCONSTSUB
24
#include "../gppport.h"
30
#define XSRETURN_bool(bool) if (bool) XSRETURN_YES; else XSRETURN_NO;
32
#define VBI_BPF (2048*32)
34
typedef struct video_capability *Video__Capture__V4l__Capability;
35
typedef struct video_channel *Video__Capture__V4l__Channel;
36
typedef struct video_audio *Video__Capture__V4l__Audio;
37
typedef struct video_picture *Video__Capture__V4l__Picture;
38
typedef struct video_tuner *Video__Capture__V4l__Tuner;
41
attach_struct (SV *sv, size_t bytes)
46
Newz (0, ptr, bytes, void*);
48
sv_magic (sv, 0, '~', 0, bytes);
49
mg_find(sv, '~')->mg_ptr = ptr;
53
new_struct (SV *sv, size_t bytes, const char *pkg)
55
SV *rv = newRV_noinc (sv);
56
attach_struct (rv, bytes);
57
return sv_bless (rv, gv_stashpv ((char *)pkg, TRUE));
61
old_struct (SV *sv, const char *name)
63
/* TODO: check name */
64
return mg_find (SvRV(sv), '~')->mg_ptr;
68
framesize (unsigned int format, unsigned int pixels)
70
if (format==VIDEO_PALETTE_RGB565) return pixels*2;
71
if (format==VIDEO_PALETTE_RGB24) return pixels*3;
72
if (format==VIDEO_PALETTE_RGB555) return pixels*2;
73
if (format==VIDEO_PALETTE_HI240) return pixels*1;
74
if (format==VIDEO_PALETTE_GREY) return pixels*1;
75
if (format==VIDEO_PALETTE_RGB32) return pixels*4;
76
if (format==VIDEO_PALETTE_UYVY) return pixels*2;
77
if (format==VIDEO_PALETTE_YUYV) return pixels*2;
78
/* everything below is very probably WRONG */
79
if (format==VIDEO_PALETTE_YUV410P) return pixels*2;
80
if (format==VIDEO_PALETTE_YUV411) return pixels*2;
81
if (format==VIDEO_PALETTE_YUV411P) return pixels*2;
82
if (format==VIDEO_PALETTE_YUV420) return pixels*3/2;
83
if (format==VIDEO_PALETTE_YUV420P) return pixels*3/2;
84
if (format==VIDEO_PALETTE_YUV422) return pixels*2;
85
if (format==VIDEO_PALETTE_YUV422P) return pixels*2;
86
if (format==VIDEO_PALETTE_PLANAR) return pixels*2;
87
if (format==VIDEO_PALETTE_RAW) return pixels*8;
93
unsigned char *mmap_base;
98
private_free (pTHX_ SV *obj, MAGIC *mg)
100
struct private *p = (struct private *)mg->mg_ptr;
101
munmap (p->mmap_base, p->vm.size);
105
static MGVTBL vtbl_private = {0, 0, 0, 0, private_free};
107
static struct private *
108
find_private (SV *sv)
110
HV *hv = (HV*)SvRV(sv);
111
MAGIC *mg = mg_find ((SV*)hv, '~');
116
p.fd = SvIV (*hv_fetch (hv, "fd", 2, 0));
117
if (ioctl (p.fd, VIDIOCGMBUF, &p.vm) == 0)
119
p.mmap_base = (unsigned char *)mmap (0, p.vm.size, PROT_READ|PROT_WRITE, MAP_SHARED, p.fd, 0);
122
sv_magic ((SV*)hv, 0, '~', (char*)&p, sizeof p);
123
mg = mg_find ((SV*)hv, '~');
124
mg->mg_virtual = &vtbl_private;
129
return (struct private *) (mg ? mg->mg_ptr : 0);
132
typedef unsigned char u8;
133
typedef unsigned int UI;
135
#define get_field(field) (*hv_fetch ((HV*)SvRV (self), #field, strlen(#field), 0))
137
/* only one thread currently */
138
typedef struct vbi_frame {
139
struct vbi_frame *next;
143
static vbi_frame *vbi_head, *vbi_tail,
147
static pthread_t vbi_snatcher;
148
static pthread_mutex_t vbi_lock = PTHREAD_MUTEX_INITIALIZER;
149
static pthread_cond_t vbi_cond = PTHREAD_COND_INITIALIZER;
152
vbi_snatcher_thread (void *arg)
154
/* try to become a realtime process. */
155
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
157
struct sched_param sp;
159
sp.sched_priority = (sched_get_priority_max (SCHED_FIFO)
160
+ sched_get_priority_min (SCHED_FIFO)) / 2 - 1;
161
pthread_setschedparam (pthread_self (), SCHED_FIFO, &sp);
168
pthread_mutex_lock (&vbi_lock);
172
vbi_free = vbi_free->next;
173
pthread_mutex_unlock (&vbi_lock);
176
next->size = read (vbi_fd, next->data, VBI_BPF);
178
pthread_mutex_lock (&vbi_lock);
181
vbi_tail->next = next;
183
vbi_head = vbi_tail = next;
188
pthread_cond_signal (&vbi_cond);
189
pthread_mutex_unlock (&vbi_lock);
193
static struct timespec to = { 0, 1000000000 / 70 }; /* skip almost a frame */
195
pthread_mutex_unlock (&vbi_lock);
196
pthread_testcancel ();
203
XS(XS_Video__Capture__V4l__VBI_field); /* prototype to pass -Wmissing-prototypes */
204
XS(XS_Video__Capture__V4l__VBI_field)
208
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::VBI::field(self)");
213
int fd = SvIV(get_field(fd));
219
pthread_mutex_lock (&vbi_lock);
221
pthread_cond_wait (&vbi_cond, &vbi_lock);
223
RETVAL = newSVpvn (vbi_head->data, vbi_head->size);
226
next = vbi_head->next;
228
vbi_head->next = vbi_free;
236
pthread_mutex_unlock (&vbi_lock);
242
RETVAL = newSVpvn ("", 0);
243
SvGROW (RETVAL, VBI_BPF);
244
len = read (fd, SvPV_nolen (RETVAL), VBI_BPF);
245
SvCUR_set (RETVAL, len);
255
XS(XS_Video__Capture__V4l__VBI_backlog); /* prototype to pass -Wmissing-prototypes */
256
XS(XS_Video__Capture__V4l__VBI_backlog)
260
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::VBI::backlog(self, backlog)");
263
unsigned int backlog = (unsigned int)SvUV(ST(1));
266
while (vbi_max != backlog)
270
pthread_mutex_lock (&vbi_lock);
272
if (vbi_max < backlog)
274
f = malloc (sizeof (vbi_frame));
284
vbi_free = vbi_free->next;
290
pthread_mutex_unlock (&vbi_lock);
297
vbi_fd = SvIV(get_field(fd));
298
pthread_create (&vbi_snatcher, 0, vbi_snatcher_thread, 0);
305
pthread_cancel (vbi_snatcher);
306
pthread_join (vbi_snatcher, 0);
310
/* no locking necessary, in theory */
313
vbi_frame *next = vbi_head->next;
327
XS(XS_Video__Capture__V4l__VBI_queued); /* prototype to pass -Wmissing-prototypes */
328
XS(XS_Video__Capture__V4l__VBI_queued)
332
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::VBI::queued(self)");
339
/* FIXME: lock/unlock */
340
pthread_mutex_lock (&vbi_lock);
342
pthread_mutex_unlock (&vbi_lock);
347
XSprePUSH; PUSHi((IV)RETVAL);
352
XS(XS_Video__Capture__V4l_capture); /* prototype to pass -Wmissing-prototypes */
353
XS(XS_Video__Capture__V4l_capture)
356
if (items < 4 || items > 5)
357
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::capture(sv, frame, width, height, format = VIDEO_PALETTE_RGB24)");
360
unsigned int frame = (unsigned int)SvUV(ST(1));
361
unsigned int width = (unsigned int)SvUV(ST(2));
362
unsigned int height = (unsigned int)SvUV(ST(3));
367
format = VIDEO_PALETTE_RGB24;
369
format = (unsigned int)SvUV(ST(4));
374
if ((p = find_private (sv)))
376
struct video_mmap vm;
381
if (ioctl (p->fd, VIDIOCMCAPTURE, &vm) == 0)
384
SvUPGRADE (fr, SVt_PV);
386
SvPVX (fr) = p->mmap_base + p->vm.offsets[frame];
387
SvCUR_set (fr, framesize (format, width*height));
405
XS(XS_Video__Capture__V4l_sync); /* prototype to pass -Wmissing-prototypes */
406
XS(XS_Video__Capture__V4l_sync)
410
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::sync(sv, frame)");
414
int frame = (int)SvIV(ST(1));
418
if ((p = find_private (sv))
419
&& ioctl (p->fd, VIDIOCSYNC, &frame) == 0)
430
XS(XS_Video__Capture__V4l__freq); /* prototype to pass -Wmissing-prototypes */
431
XS(XS_Video__Capture__V4l__freq)
435
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_freq(fd, fr)");
437
int fd = (int)SvIV(ST(0));
438
unsigned long fr = (unsigned long)SvUV(ST(1));
439
unsigned long RETVAL;
444
fr = ((fr<<4)+499)/1000;
445
ioctl (fd, VIDIOCSFREQ, &fr);
447
if (GIMME_V != G_VOID)
449
if (ioctl (fd, VIDIOCGFREQ, &fr) == 0)
450
RETVAL = (fr*1000+7)>>4;
457
XSprePUSH; PUSHu((UV)RETVAL);
462
XS(XS_Video__Capture__V4l__capabilities_new); /* prototype to pass -Wmissing-prototypes */
463
XS(XS_Video__Capture__V4l__capabilities_new)
467
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_capabilities_new(fd)");
469
int fd = (int)SvIV(ST(0));
472
RETVAL = new_struct (newSViv (fd), sizeof (struct video_capability), "Video::Capture::V4l::Capability");
480
XS(XS_Video__Capture__V4l__channel_new); /* prototype to pass -Wmissing-prototypes */
481
XS(XS_Video__Capture__V4l__channel_new)
485
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_channel_new(fd)");
487
int fd = (int)SvIV(ST(0));
490
RETVAL = new_struct (newSViv (fd), sizeof (struct video_channel), "Video::Capture::V4l::Channel");
498
XS(XS_Video__Capture__V4l__tuner_new); /* prototype to pass -Wmissing-prototypes */
499
XS(XS_Video__Capture__V4l__tuner_new)
503
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_tuner_new(fd)");
505
int fd = (int)SvIV(ST(0));
508
RETVAL = new_struct (newSViv (fd), sizeof (struct video_tuner), "Video::Capture::V4l::Tuner");
516
XS(XS_Video__Capture__V4l__audio_new); /* prototype to pass -Wmissing-prototypes */
517
XS(XS_Video__Capture__V4l__audio_new)
521
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_audio_new(fd)");
523
int fd = (int)SvIV(ST(0));
526
RETVAL = new_struct (newSViv (fd), sizeof (struct video_audio), "Video::Capture::V4l::Audio");
534
XS(XS_Video__Capture__V4l__picture_new); /* prototype to pass -Wmissing-prototypes */
535
XS(XS_Video__Capture__V4l__picture_new)
539
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_picture_new(fd)");
541
int fd = (int)SvIV(ST(0));
544
RETVAL = new_struct (newSViv (fd), sizeof (struct video_picture), "Video::Capture::V4l::Picture");
552
XS(XS_Video__Capture__V4l__Capability_get); /* prototype to pass -Wmissing-prototypes */
553
XS(XS_Video__Capture__V4l__Capability_get)
557
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::get(sv)");
561
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGCAP, old_struct (sv, "Video::Capture::V4l::Capability")) == 0);
567
XS(XS_Video__Capture__V4l__Channel_get); /* prototype to pass -Wmissing-prototypes */
568
XS(XS_Video__Capture__V4l__Channel_get)
572
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::get(sv)");
576
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGCHAN, old_struct (sv, "Video::Capture::V4l::Channel")) == 0);
582
XS(XS_Video__Capture__V4l__Channel_set); /* prototype to pass -Wmissing-prototypes */
583
XS(XS_Video__Capture__V4l__Channel_set)
587
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::set(sv)");
591
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCSCHAN, old_struct (sv, "Video::Capture::V4l::Channel")) == 0);
597
XS(XS_Video__Capture__V4l__Tuner_get); /* prototype to pass -Wmissing-prototypes */
598
XS(XS_Video__Capture__V4l__Tuner_get)
602
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::get(sv)");
606
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGTUNER, old_struct (sv, "Video::Capture::V4l::Tuner")) == 0);
612
XS(XS_Video__Capture__V4l__Tuner_set); /* prototype to pass -Wmissing-prototypes */
613
XS(XS_Video__Capture__V4l__Tuner_set)
617
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::set(sv)");
621
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCSTUNER, old_struct (sv, "Video::Capture::V4l::Tuner")) == 0);
627
XS(XS_Video__Capture__V4l__Audio_get); /* prototype to pass -Wmissing-prototypes */
628
XS(XS_Video__Capture__V4l__Audio_get)
632
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::get(sv)");
636
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGAUDIO, old_struct (sv, "Video::Capture::V4l::Audio")) == 0);
642
XS(XS_Video__Capture__V4l__Audio_set); /* prototype to pass -Wmissing-prototypes */
643
XS(XS_Video__Capture__V4l__Audio_set)
647
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::set(sv)");
651
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCSAUDIO, old_struct (sv, "Video::Capture::V4l::Audio")) == 0);
657
XS(XS_Video__Capture__V4l__Picture_get); /* prototype to pass -Wmissing-prototypes */
658
XS(XS_Video__Capture__V4l__Picture_get)
662
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::get(sv)");
666
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGPICT, old_struct (sv, "Video::Capture::V4l::Picture")) == 0);
672
XS(XS_Video__Capture__V4l__Picture_set); /* prototype to pass -Wmissing-prototypes */
673
XS(XS_Video__Capture__V4l__Picture_set)
677
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::set(sv)");
681
XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCSPICT, old_struct (sv, "Video::Capture::V4l::Picture")) == 0);
688
/* INCLUDE: Including './genacc |' from 'V4l.xs' */
690
XS(XS_Video__Capture__V4l__Capability_name); /* prototype to pass -Wmissing-prototypes */
691
XS(XS_Video__Capture__V4l__Capability_name)
694
if (items < 1 || items > 2)
695
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::name(s, name=0)");
697
Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
705
name = (char *)SvPV_nolen(ST(1));
707
#line 17 "./genacc |"
709
{ RETVAL = s->name; }
711
{ croak ("attribute 'name' is readonly"); }
713
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
718
XS(XS_Video__Capture__V4l__Capability_type); /* prototype to pass -Wmissing-prototypes */
719
XS(XS_Video__Capture__V4l__Capability_type)
722
if (items < 1 || items > 2)
723
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::type(s, type=0)");
725
Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
733
type = (int)SvIV(ST(1));
735
#line 29 "./genacc |"
737
{ RETVAL = s->type; }
739
{ croak ("attribute 'type' is readonly"); }
741
XSprePUSH; PUSHi((IV)RETVAL);
746
XS(XS_Video__Capture__V4l__Capability_channels); /* prototype to pass -Wmissing-prototypes */
747
XS(XS_Video__Capture__V4l__Capability_channels)
750
if (items < 1 || items > 2)
751
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::channels(s, channels=0)");
753
Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
761
channels = (int)SvIV(ST(1));
763
#line 41 "./genacc |"
765
{ RETVAL = s->channels; }
767
{ croak ("attribute 'channels' is readonly"); }
769
XSprePUSH; PUSHi((IV)RETVAL);
774
XS(XS_Video__Capture__V4l__Capability_audios); /* prototype to pass -Wmissing-prototypes */
775
XS(XS_Video__Capture__V4l__Capability_audios)
778
if (items < 1 || items > 2)
779
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::audios(s, audios=0)");
781
Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
789
audios = (int)SvIV(ST(1));
791
#line 53 "./genacc |"
793
{ RETVAL = s->audios; }
795
{ croak ("attribute 'audios' is readonly"); }
797
XSprePUSH; PUSHi((IV)RETVAL);
802
XS(XS_Video__Capture__V4l__Capability_maxwidth); /* prototype to pass -Wmissing-prototypes */
803
XS(XS_Video__Capture__V4l__Capability_maxwidth)
806
if (items < 1 || items > 2)
807
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::maxwidth(s, maxwidth=0)");
809
Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
817
maxwidth = (int)SvIV(ST(1));
819
#line 65 "./genacc |"
821
{ RETVAL = s->maxwidth; }
823
{ croak ("attribute 'maxwidth' is readonly"); }
825
XSprePUSH; PUSHi((IV)RETVAL);
830
XS(XS_Video__Capture__V4l__Capability_maxheight); /* prototype to pass -Wmissing-prototypes */
831
XS(XS_Video__Capture__V4l__Capability_maxheight)
834
if (items < 1 || items > 2)
835
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::maxheight(s, maxheight=0)");
837
Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
845
maxheight = (int)SvIV(ST(1));
847
#line 77 "./genacc |"
849
{ RETVAL = s->maxheight; }
851
{ croak ("attribute 'maxheight' is readonly"); }
853
XSprePUSH; PUSHi((IV)RETVAL);
858
XS(XS_Video__Capture__V4l__Capability_minwidth); /* prototype to pass -Wmissing-prototypes */
859
XS(XS_Video__Capture__V4l__Capability_minwidth)
862
if (items < 1 || items > 2)
863
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::minwidth(s, minwidth=0)");
865
Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
873
minwidth = (int)SvIV(ST(1));
875
#line 89 "./genacc |"
877
{ RETVAL = s->minwidth; }
879
{ croak ("attribute 'minwidth' is readonly"); }
881
XSprePUSH; PUSHi((IV)RETVAL);
886
XS(XS_Video__Capture__V4l__Capability_minheight); /* prototype to pass -Wmissing-prototypes */
887
XS(XS_Video__Capture__V4l__Capability_minheight)
890
if (items < 1 || items > 2)
891
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::minheight(s, minheight=0)");
893
Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
901
minheight = (int)SvIV(ST(1));
903
#line 101 "./genacc |"
905
{ RETVAL = s->minheight; }
907
{ croak ("attribute 'minheight' is readonly"); }
909
XSprePUSH; PUSHi((IV)RETVAL);
914
XS(XS_Video__Capture__V4l__Channel_channel); /* prototype to pass -Wmissing-prototypes */
915
XS(XS_Video__Capture__V4l__Channel_channel)
918
if (items < 1 || items > 2)
919
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::channel(s, channel=0)");
921
Video__Capture__V4l__Channel s = old_struct (ST(0), "Video::Capture::V4l::Channel");
929
channel = (int)SvIV(ST(1));
931
#line 116 "./genacc |"
933
{ RETVAL = s->channel; }
935
{ s->channel = channel; }
937
XSprePUSH; PUSHi((IV)RETVAL);
942
XS(XS_Video__Capture__V4l__Channel_name); /* prototype to pass -Wmissing-prototypes */
943
XS(XS_Video__Capture__V4l__Channel_name)
946
if (items < 1 || items > 2)
947
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::name(s, name=0)");
949
Video__Capture__V4l__Channel s = old_struct (ST(0), "Video::Capture::V4l::Channel");
957
name = (char *)SvPV_nolen(ST(1));
959
#line 128 "./genacc |"
961
{ RETVAL = s->name; }
963
{ croak ("attribute 'name' is readonly"); }
965
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
970
XS(XS_Video__Capture__V4l__Channel_tuners); /* prototype to pass -Wmissing-prototypes */
971
XS(XS_Video__Capture__V4l__Channel_tuners)
974
if (items < 1 || items > 2)
975
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::tuners(s, tuners=0)");
977
Video__Capture__V4l__Channel s = old_struct (ST(0), "Video::Capture::V4l::Channel");
985
tuners = (int)SvIV(ST(1));
987
#line 140 "./genacc |"
989
{ RETVAL = s->tuners; }
991
{ croak ("attribute 'tuners' is readonly"); }
993
XSprePUSH; PUSHi((IV)RETVAL);
998
XS(XS_Video__Capture__V4l__Channel_flags); /* prototype to pass -Wmissing-prototypes */
999
XS(XS_Video__Capture__V4l__Channel_flags)
1002
if (items < 1 || items > 2)
1003
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::flags(s, flags=0)");
1005
Video__Capture__V4l__Channel s = old_struct (ST(0), "Video::Capture::V4l::Channel");
1013
flags = (unsigned long)SvUV(ST(1));
1015
#line 152 "./genacc |"
1017
{ RETVAL = s->flags; }
1019
{ croak ("attribute 'flags' is readonly"); }
1021
XSprePUSH; PUSHu((UV)RETVAL);
1026
XS(XS_Video__Capture__V4l__Channel_type); /* prototype to pass -Wmissing-prototypes */
1027
XS(XS_Video__Capture__V4l__Channel_type)
1030
if (items < 1 || items > 2)
1031
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::type(s, type=0)");
1033
Video__Capture__V4l__Channel s = old_struct (ST(0), "Video::Capture::V4l::Channel");
1041
type = (unsigned short)SvUV(ST(1));
1043
#line 164 "./genacc |"
1045
{ RETVAL = s->type; }
1047
{ croak ("attribute 'type' is readonly"); }
1049
XSprePUSH; PUSHu((UV)RETVAL);
1054
XS(XS_Video__Capture__V4l__Channel_norm); /* prototype to pass -Wmissing-prototypes */
1055
XS(XS_Video__Capture__V4l__Channel_norm)
1058
if (items < 1 || items > 2)
1059
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::norm(s, norm=0)");
1061
Video__Capture__V4l__Channel s = old_struct (ST(0), "Video::Capture::V4l::Channel");
1069
norm = (unsigned short)SvUV(ST(1));
1071
#line 176 "./genacc |"
1073
{ RETVAL = s->norm; }
1077
XSprePUSH; PUSHu((UV)RETVAL);
1082
XS(XS_Video__Capture__V4l__Audio_audio); /* prototype to pass -Wmissing-prototypes */
1083
XS(XS_Video__Capture__V4l__Audio_audio)
1086
if (items < 1 || items > 2)
1087
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::audio(s, audio=0)");
1089
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1097
audio = (int)SvIV(ST(1));
1099
#line 191 "./genacc |"
1101
{ RETVAL = s->audio; }
1103
{ s->audio = audio; }
1105
XSprePUSH; PUSHi((IV)RETVAL);
1110
XS(XS_Video__Capture__V4l__Audio_volume); /* prototype to pass -Wmissing-prototypes */
1111
XS(XS_Video__Capture__V4l__Audio_volume)
1114
if (items < 1 || items > 2)
1115
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::volume(s, volume=0)");
1117
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1125
volume = (unsigned short)SvUV(ST(1));
1127
#line 203 "./genacc |"
1129
{ RETVAL = s->volume; }
1131
{ s->volume = volume; }
1133
XSprePUSH; PUSHu((UV)RETVAL);
1138
XS(XS_Video__Capture__V4l__Audio_bass); /* prototype to pass -Wmissing-prototypes */
1139
XS(XS_Video__Capture__V4l__Audio_bass)
1142
if (items < 1 || items > 2)
1143
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::bass(s, bass=0)");
1145
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1153
bass = (unsigned short)SvUV(ST(1));
1155
#line 215 "./genacc |"
1157
{ RETVAL = s->bass; }
1161
XSprePUSH; PUSHu((UV)RETVAL);
1166
XS(XS_Video__Capture__V4l__Audio_treble); /* prototype to pass -Wmissing-prototypes */
1167
XS(XS_Video__Capture__V4l__Audio_treble)
1170
if (items < 1 || items > 2)
1171
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::treble(s, treble=0)");
1173
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1181
treble = (unsigned short)SvUV(ST(1));
1183
#line 227 "./genacc |"
1185
{ RETVAL = s->treble; }
1187
{ s->treble = treble; }
1189
XSprePUSH; PUSHu((UV)RETVAL);
1194
XS(XS_Video__Capture__V4l__Audio_flags); /* prototype to pass -Wmissing-prototypes */
1195
XS(XS_Video__Capture__V4l__Audio_flags)
1198
if (items < 1 || items > 2)
1199
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::flags(s, flags=0)");
1201
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1209
flags = (unsigned long)SvUV(ST(1));
1211
#line 239 "./genacc |"
1213
{ RETVAL = s->flags; }
1215
{ s->flags = flags; }
1217
XSprePUSH; PUSHu((UV)RETVAL);
1222
XS(XS_Video__Capture__V4l__Audio_name); /* prototype to pass -Wmissing-prototypes */
1223
XS(XS_Video__Capture__V4l__Audio_name)
1226
if (items < 1 || items > 2)
1227
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::name(s, name=0)");
1229
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1237
name = (char *)SvPV_nolen(ST(1));
1239
#line 251 "./genacc |"
1241
{ RETVAL = s->name; }
1243
{ croak ("attribute 'name' is readonly"); }
1245
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1250
XS(XS_Video__Capture__V4l__Audio_mode); /* prototype to pass -Wmissing-prototypes */
1251
XS(XS_Video__Capture__V4l__Audio_mode)
1254
if (items < 1 || items > 2)
1255
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::mode(s, mode=0)");
1257
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1265
mode = (unsigned short)SvUV(ST(1));
1267
#line 263 "./genacc |"
1269
{ RETVAL = s->mode; }
1273
XSprePUSH; PUSHu((UV)RETVAL);
1278
XS(XS_Video__Capture__V4l__Audio_balance); /* prototype to pass -Wmissing-prototypes */
1279
XS(XS_Video__Capture__V4l__Audio_balance)
1282
if (items < 1 || items > 2)
1283
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::balance(s, balance=0)");
1285
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1293
balance = (unsigned short)SvUV(ST(1));
1295
#line 275 "./genacc |"
1297
{ RETVAL = s->balance; }
1299
{ s->balance = balance; }
1301
XSprePUSH; PUSHu((UV)RETVAL);
1306
XS(XS_Video__Capture__V4l__Audio_step); /* prototype to pass -Wmissing-prototypes */
1307
XS(XS_Video__Capture__V4l__Audio_step)
1310
if (items < 1 || items > 2)
1311
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::step(s, step=0)");
1313
Video__Capture__V4l__Audio s = old_struct (ST(0), "Video::Capture::V4l::Audio");
1321
step = (unsigned short)SvUV(ST(1));
1323
#line 287 "./genacc |"
1325
{ RETVAL = s->step; }
1329
XSprePUSH; PUSHu((UV)RETVAL);
1334
XS(XS_Video__Capture__V4l__Picture_brightness); /* prototype to pass -Wmissing-prototypes */
1335
XS(XS_Video__Capture__V4l__Picture_brightness)
1338
if (items < 1 || items > 2)
1339
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::brightness(s, brightness=0)");
1341
Video__Capture__V4l__Picture s = old_struct (ST(0), "Video::Capture::V4l::Picture");
1349
brightness = (unsigned short)SvUV(ST(1));
1351
#line 302 "./genacc |"
1353
{ RETVAL = s->brightness; }
1355
{ s->brightness = brightness; }
1357
XSprePUSH; PUSHu((UV)RETVAL);
1362
XS(XS_Video__Capture__V4l__Picture_hue); /* prototype to pass -Wmissing-prototypes */
1363
XS(XS_Video__Capture__V4l__Picture_hue)
1366
if (items < 1 || items > 2)
1367
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::hue(s, hue=0)");
1369
Video__Capture__V4l__Picture s = old_struct (ST(0), "Video::Capture::V4l::Picture");
1377
hue = (unsigned short)SvUV(ST(1));
1379
#line 314 "./genacc |"
1381
{ RETVAL = s->hue; }
1385
XSprePUSH; PUSHu((UV)RETVAL);
1390
XS(XS_Video__Capture__V4l__Picture_colour); /* prototype to pass -Wmissing-prototypes */
1391
XS(XS_Video__Capture__V4l__Picture_colour)
1394
if (items < 1 || items > 2)
1395
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::colour(s, colour=0)");
1397
Video__Capture__V4l__Picture s = old_struct (ST(0), "Video::Capture::V4l::Picture");
1405
colour = (unsigned short)SvUV(ST(1));
1407
#line 326 "./genacc |"
1409
{ RETVAL = s->colour; }
1411
{ s->colour = colour; }
1413
XSprePUSH; PUSHu((UV)RETVAL);
1418
XS(XS_Video__Capture__V4l__Picture_contrast); /* prototype to pass -Wmissing-prototypes */
1419
XS(XS_Video__Capture__V4l__Picture_contrast)
1422
if (items < 1 || items > 2)
1423
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::contrast(s, contrast=0)");
1425
Video__Capture__V4l__Picture s = old_struct (ST(0), "Video::Capture::V4l::Picture");
1433
contrast = (unsigned short)SvUV(ST(1));
1435
#line 338 "./genacc |"
1437
{ RETVAL = s->contrast; }
1439
{ s->contrast = contrast; }
1441
XSprePUSH; PUSHu((UV)RETVAL);
1446
XS(XS_Video__Capture__V4l__Picture_whiteness); /* prototype to pass -Wmissing-prototypes */
1447
XS(XS_Video__Capture__V4l__Picture_whiteness)
1450
if (items < 1 || items > 2)
1451
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::whiteness(s, whiteness=0)");
1453
Video__Capture__V4l__Picture s = old_struct (ST(0), "Video::Capture::V4l::Picture");
1461
whiteness = (unsigned short)SvUV(ST(1));
1463
#line 350 "./genacc |"
1465
{ RETVAL = s->whiteness; }
1467
{ s->whiteness = whiteness; }
1469
XSprePUSH; PUSHu((UV)RETVAL);
1474
XS(XS_Video__Capture__V4l__Picture_depth); /* prototype to pass -Wmissing-prototypes */
1475
XS(XS_Video__Capture__V4l__Picture_depth)
1478
if (items < 1 || items > 2)
1479
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::depth(s, depth=0)");
1481
Video__Capture__V4l__Picture s = old_struct (ST(0), "Video::Capture::V4l::Picture");
1489
depth = (unsigned short)SvUV(ST(1));
1491
#line 362 "./genacc |"
1493
{ RETVAL = s->depth; }
1495
{ s->depth = depth; }
1497
XSprePUSH; PUSHu((UV)RETVAL);
1502
XS(XS_Video__Capture__V4l__Picture_palette); /* prototype to pass -Wmissing-prototypes */
1503
XS(XS_Video__Capture__V4l__Picture_palette)
1506
if (items < 1 || items > 2)
1507
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::palette(s, palette=0)");
1509
Video__Capture__V4l__Picture s = old_struct (ST(0), "Video::Capture::V4l::Picture");
1517
palette = (unsigned short)SvUV(ST(1));
1519
#line 374 "./genacc |"
1521
{ RETVAL = s->palette; }
1523
{ s->palette = palette; }
1525
XSprePUSH; PUSHu((UV)RETVAL);
1530
XS(XS_Video__Capture__V4l__Tuner_tuner); /* prototype to pass -Wmissing-prototypes */
1531
XS(XS_Video__Capture__V4l__Tuner_tuner)
1534
if (items < 1 || items > 2)
1535
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::tuner(s, tuner=0)");
1537
Video__Capture__V4l__Tuner s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
1545
tuner = (int)SvIV(ST(1));
1547
#line 389 "./genacc |"
1549
{ RETVAL = s->tuner; }
1551
{ s->tuner = tuner; }
1553
XSprePUSH; PUSHi((IV)RETVAL);
1558
XS(XS_Video__Capture__V4l__Tuner_name); /* prototype to pass -Wmissing-prototypes */
1559
XS(XS_Video__Capture__V4l__Tuner_name)
1562
if (items < 1 || items > 2)
1563
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::name(s, name=0)");
1565
Video__Capture__V4l__Tuner s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
1573
name = (char *)SvPV_nolen(ST(1));
1575
#line 401 "./genacc |"
1577
{ RETVAL = s->name; }
1579
{ croak ("attribute 'name' is readonly"); }
1581
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
1586
XS(XS_Video__Capture__V4l__Tuner_rangelow); /* prototype to pass -Wmissing-prototypes */
1587
XS(XS_Video__Capture__V4l__Tuner_rangelow)
1590
if (items < 1 || items > 2)
1591
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::rangelow(s, rangelow=0)");
1593
Video__Capture__V4l__Tuner s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
1594
unsigned long rangelow;
1595
unsigned long RETVAL;
1601
rangelow = (unsigned long)SvUV(ST(1));
1603
#line 413 "./genacc |"
1605
{ RETVAL = s->rangelow; }
1607
{ croak ("attribute 'rangelow' is readonly"); }
1609
XSprePUSH; PUSHu((UV)RETVAL);
1614
XS(XS_Video__Capture__V4l__Tuner_rangehigh); /* prototype to pass -Wmissing-prototypes */
1615
XS(XS_Video__Capture__V4l__Tuner_rangehigh)
1618
if (items < 1 || items > 2)
1619
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::rangehigh(s, rangehigh=0)");
1621
Video__Capture__V4l__Tuner s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
1622
unsigned long rangehigh;
1623
unsigned long RETVAL;
1629
rangehigh = (unsigned long)SvUV(ST(1));
1631
#line 425 "./genacc |"
1633
{ RETVAL = s->rangehigh; }
1635
{ croak ("attribute 'rangehigh' is readonly"); }
1637
XSprePUSH; PUSHu((UV)RETVAL);
1642
XS(XS_Video__Capture__V4l__Tuner_flags); /* prototype to pass -Wmissing-prototypes */
1643
XS(XS_Video__Capture__V4l__Tuner_flags)
1646
if (items < 1 || items > 2)
1647
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::flags(s, flags=0)");
1649
Video__Capture__V4l__Tuner s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
1657
flags = (unsigned long)SvUV(ST(1));
1659
#line 437 "./genacc |"
1661
{ RETVAL = s->flags; }
1663
{ croak ("attribute 'flags' is readonly"); }
1665
XSprePUSH; PUSHu((UV)RETVAL);
1670
XS(XS_Video__Capture__V4l__Tuner_mode); /* prototype to pass -Wmissing-prototypes */
1671
XS(XS_Video__Capture__V4l__Tuner_mode)
1674
if (items < 1 || items > 2)
1675
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::mode(s, mode=0)");
1677
Video__Capture__V4l__Tuner s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
1685
mode = (unsigned short)SvUV(ST(1));
1687
#line 449 "./genacc |"
1689
{ RETVAL = s->mode; }
1693
XSprePUSH; PUSHu((UV)RETVAL);
1698
XS(XS_Video__Capture__V4l__Tuner_signal); /* prototype to pass -Wmissing-prototypes */
1699
XS(XS_Video__Capture__V4l__Tuner_signal)
1702
if (items < 1 || items > 2)
1703
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::signal(s, signal=0)");
1705
Video__Capture__V4l__Tuner s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
1713
signal = (unsigned short)SvUV(ST(1));
1715
#line 461 "./genacc |"
1717
{ RETVAL = s->signal; }
1719
{ croak ("attribute 'signal' is readonly"); }
1721
XSprePUSH; PUSHu((UV)RETVAL);
1727
/* INCLUDE: Returning to 'V4l.xs' from './genacc |' */
1729
XS(XS_Video__Capture__V4l_bgr2rgb); /* prototype to pass -Wmissing-prototypes */
1730
XS(XS_Video__Capture__V4l_bgr2rgb)
1734
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::bgr2rgb(fr)");
1743
for (data = SvPV_nolen (fr); data < end; data += 3)
1757
XS(XS_Video__Capture__V4l_reduce2); /* prototype to pass -Wmissing-prototypes */
1758
XS(XS_Video__Capture__V4l_reduce2)
1762
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::reduce2(fr, w)");
1765
UI w = (UI)SvIV(ST(1));
1769
u8 *src, *dst, *end;
1771
src = SvPV_nolen (fr);
1772
dst = SvPV_nolen (fr);
1781
dst[1] = ((UI)src[0] + (UI)src[3]) >> 1; src++;
1782
dst[2] = ((UI)src[0] + (UI)src[3]) >> 1; src++;
1783
dst[0] = ((UI)src[0] + (UI)src[3]) >> 1; src++;
1790
while (src < (u8*)SvEND (fr));
1792
SvCUR_set (fr, dst - (u8*)SvPV_nolen (fr));
1801
XS(XS_Video__Capture__V4l_normalize); /* prototype to pass -Wmissing-prototypes */
1802
XS(XS_Video__Capture__V4l_normalize)
1806
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::normalize(fr)");
1811
u8 mfr = 255, max = 0;
1812
u8 *src, *dst, *end;
1815
dst = SvPV_nolen (fr);
1817
for (src = SvPV_nolen (fr); src < end; src++)
1819
if (*src > max) max = *src;
1820
if (*src < mfr) mfr = *src;
1824
for (src = SvPV_nolen (fr); src < end; )
1825
*dst++ = ((UI)*src++ - mfr) * 255 / (max-mfr);
1834
XS(XS_Video__Capture__V4l_findmin); /* prototype to pass -Wmissing-prototypes */
1835
XS(XS_Video__Capture__V4l_findmin)
1838
if (items < 2 || items > 4)
1839
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::findmin(db, fr, start=0, count=0)");
1850
start = (UI)SvIV(ST(2));
1856
count = (UI)SvIV(ST(3));
1862
u8 *src, *dst, *end, *efr;
1863
UI datasize = SvCUR (fr);
1864
UI framesize = datasize + sizeof(int);
1866
src = SvPV_nolen (db) + start * framesize;
1867
if (src < (u8*)SvPV_nolen (db) || src > (u8*)SvEND (db))
1868
src = SvPV_nolen (db);
1870
end = src + count * framesize;
1871
if (end <= src || end > (u8*)SvEND (db))
1876
data = *((int *)src); src += sizeof (int);
1878
dst = SvPV_nolen (fr);
1879
efr = src + datasize;
1884
int dif = (int)*src++ - (int)*dst++;
1898
PUSHs (sv_2mortal (newSViv (mindata)));
1899
PUSHs (sv_2mortal (newSViv ((min << 8) / SvCUR (fr))));
1907
XS(XS_Video__Capture__V4l_linreg); /* prototype to pass -Wmissing-prototypes */
1908
XS(XS_Video__Capture__V4l_linreg)
1912
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::linreg(array)");
1918
AV *xy = (AV*) SvRV (array);
1920
I32 n = (av_len (xy)+1)>>1;
1921
double x_ = 0, y_ = 0;
1922
double sxy = 0, sxx = 0, syy = 0;
1926
x_ += SvNV(*av_fetch(xy, i*2 ,1));
1927
y_ += SvNV(*av_fetch(xy, i*2+1,1));
1935
double x = SvNV(*av_fetch(xy, i*2 ,1));
1936
double y = SvNV(*av_fetch(xy, i*2+1,1));
1938
sxy += (x-x_)*(y-y_);
1939
sxx += (x-x_)*(x-x_);
1940
syy += (y-y_)*(y-y_);
1944
double rxy2 = sxy*sxy / (sxx*syy);
1945
double b = sxy / sxx;
1946
double a = y_ - b*x_;
1947
double r2 = (n-1)/(n-2)*syy*(1-rxy2);
1950
PUSHs (sv_2mortal (newSVnv (a )));
1951
PUSHs (sv_2mortal (newSVnv (b )));
1952
PUSHs (sv_2mortal (newSVnv (r2)));
1961
XS(XS_Video__Capture__V4l_linreg1); /* prototype to pass -Wmissing-prototypes */
1962
XS(XS_Video__Capture__V4l_linreg1)
1966
Perl_croak(aTHX_ "Usage: Video::Capture::V4l::linreg1(array)");
1972
AV *xy = (AV*) SvRV (array);
1974
I32 n = (av_len (xy)+1)>>1;
1980
double d = SvNV(*av_fetch(xy, i*2-1,1)) - SvNV(*av_fetch(xy, i*2,1));
1988
double d = c + SvNV(*av_fetch(xy, i*2,1)) - SvNV(*av_fetch(xy, i*2-1,1));
1995
PUSHs (sv_2mortal (newSVnv (c)));
1996
PUSHs (sv_2mortal (newSVnv (1)));
1997
PUSHs (sv_2mortal (newSVnv (c2)));
2008
XS(boot_Video__Capture__V4l); /* prototype to pass -Wmissing-prototypes */
2009
XS(boot_Video__Capture__V4l)
2012
char* file = __FILE__;
2014
XS_VERSION_BOOTCHECK ;
2016
newXSproto("Video::Capture::V4l::VBI::field", XS_Video__Capture__V4l__VBI_field, file, "$");
2017
newXSproto("Video::Capture::V4l::VBI::backlog", XS_Video__Capture__V4l__VBI_backlog, file, "$$");
2018
newXSproto("Video::Capture::V4l::VBI::queued", XS_Video__Capture__V4l__VBI_queued, file, "$");
2019
newXSproto("Video::Capture::V4l::capture", XS_Video__Capture__V4l_capture, file, "$$$$;$");
2020
newXSproto("Video::Capture::V4l::sync", XS_Video__Capture__V4l_sync, file, "$$");
2021
newXSproto("Video::Capture::V4l::_freq", XS_Video__Capture__V4l__freq, file, "$$");
2022
newXSproto("Video::Capture::V4l::_capabilities_new", XS_Video__Capture__V4l__capabilities_new, file, "$");
2023
newXSproto("Video::Capture::V4l::_channel_new", XS_Video__Capture__V4l__channel_new, file, "$");
2024
newXSproto("Video::Capture::V4l::_tuner_new", XS_Video__Capture__V4l__tuner_new, file, "$");
2025
newXSproto("Video::Capture::V4l::_audio_new", XS_Video__Capture__V4l__audio_new, file, "$");
2026
newXSproto("Video::Capture::V4l::_picture_new", XS_Video__Capture__V4l__picture_new, file, "$");
2027
newXSproto("Video::Capture::V4l::Capability::get", XS_Video__Capture__V4l__Capability_get, file, "$");
2028
newXSproto("Video::Capture::V4l::Channel::get", XS_Video__Capture__V4l__Channel_get, file, "$");
2029
newXSproto("Video::Capture::V4l::Channel::set", XS_Video__Capture__V4l__Channel_set, file, "$");
2030
newXSproto("Video::Capture::V4l::Tuner::get", XS_Video__Capture__V4l__Tuner_get, file, "$");
2031
newXSproto("Video::Capture::V4l::Tuner::set", XS_Video__Capture__V4l__Tuner_set, file, "$");
2032
newXSproto("Video::Capture::V4l::Audio::get", XS_Video__Capture__V4l__Audio_get, file, "$");
2033
newXSproto("Video::Capture::V4l::Audio::set", XS_Video__Capture__V4l__Audio_set, file, "$");
2034
newXSproto("Video::Capture::V4l::Picture::get", XS_Video__Capture__V4l__Picture_get, file, "$");
2035
newXSproto("Video::Capture::V4l::Picture::set", XS_Video__Capture__V4l__Picture_set, file, "$");
2036
newXS("Video::Capture::V4l::Capability::name", XS_Video__Capture__V4l__Capability_name, file);
2037
newXS("Video::Capture::V4l::Capability::type", XS_Video__Capture__V4l__Capability_type, file);
2038
newXS("Video::Capture::V4l::Capability::channels", XS_Video__Capture__V4l__Capability_channels, file);
2039
newXS("Video::Capture::V4l::Capability::audios", XS_Video__Capture__V4l__Capability_audios, file);
2040
newXS("Video::Capture::V4l::Capability::maxwidth", XS_Video__Capture__V4l__Capability_maxwidth, file);
2041
newXS("Video::Capture::V4l::Capability::maxheight", XS_Video__Capture__V4l__Capability_maxheight, file);
2042
newXS("Video::Capture::V4l::Capability::minwidth", XS_Video__Capture__V4l__Capability_minwidth, file);
2043
newXS("Video::Capture::V4l::Capability::minheight", XS_Video__Capture__V4l__Capability_minheight, file);
2044
newXS("Video::Capture::V4l::Channel::channel", XS_Video__Capture__V4l__Channel_channel, file);
2045
newXS("Video::Capture::V4l::Channel::name", XS_Video__Capture__V4l__Channel_name, file);
2046
newXS("Video::Capture::V4l::Channel::tuners", XS_Video__Capture__V4l__Channel_tuners, file);
2047
newXS("Video::Capture::V4l::Channel::flags", XS_Video__Capture__V4l__Channel_flags, file);
2048
newXS("Video::Capture::V4l::Channel::type", XS_Video__Capture__V4l__Channel_type, file);
2049
newXS("Video::Capture::V4l::Channel::norm", XS_Video__Capture__V4l__Channel_norm, file);
2050
newXS("Video::Capture::V4l::Audio::audio", XS_Video__Capture__V4l__Audio_audio, file);
2051
newXS("Video::Capture::V4l::Audio::volume", XS_Video__Capture__V4l__Audio_volume, file);
2052
newXS("Video::Capture::V4l::Audio::bass", XS_Video__Capture__V4l__Audio_bass, file);
2053
newXS("Video::Capture::V4l::Audio::treble", XS_Video__Capture__V4l__Audio_treble, file);
2054
newXS("Video::Capture::V4l::Audio::flags", XS_Video__Capture__V4l__Audio_flags, file);
2055
newXS("Video::Capture::V4l::Audio::name", XS_Video__Capture__V4l__Audio_name, file);
2056
newXS("Video::Capture::V4l::Audio::mode", XS_Video__Capture__V4l__Audio_mode, file);
2057
newXS("Video::Capture::V4l::Audio::balance", XS_Video__Capture__V4l__Audio_balance, file);
2058
newXS("Video::Capture::V4l::Audio::step", XS_Video__Capture__V4l__Audio_step, file);
2059
newXS("Video::Capture::V4l::Picture::brightness", XS_Video__Capture__V4l__Picture_brightness, file);
2060
newXS("Video::Capture::V4l::Picture::hue", XS_Video__Capture__V4l__Picture_hue, file);
2061
newXS("Video::Capture::V4l::Picture::colour", XS_Video__Capture__V4l__Picture_colour, file);
2062
newXS("Video::Capture::V4l::Picture::contrast", XS_Video__Capture__V4l__Picture_contrast, file);
2063
newXS("Video::Capture::V4l::Picture::whiteness", XS_Video__Capture__V4l__Picture_whiteness, file);
2064
newXS("Video::Capture::V4l::Picture::depth", XS_Video__Capture__V4l__Picture_depth, file);
2065
newXS("Video::Capture::V4l::Picture::palette", XS_Video__Capture__V4l__Picture_palette, file);
2066
newXS("Video::Capture::V4l::Tuner::tuner", XS_Video__Capture__V4l__Tuner_tuner, file);
2067
newXS("Video::Capture::V4l::Tuner::name", XS_Video__Capture__V4l__Tuner_name, file);
2068
newXS("Video::Capture::V4l::Tuner::rangelow", XS_Video__Capture__V4l__Tuner_rangelow, file);
2069
newXS("Video::Capture::V4l::Tuner::rangehigh", XS_Video__Capture__V4l__Tuner_rangehigh, file);
2070
newXS("Video::Capture::V4l::Tuner::flags", XS_Video__Capture__V4l__Tuner_flags, file);
2071
newXS("Video::Capture::V4l::Tuner::mode", XS_Video__Capture__V4l__Tuner_mode, file);
2072
newXS("Video::Capture::V4l::Tuner::signal", XS_Video__Capture__V4l__Tuner_signal, file);
2073
newXSproto("Video::Capture::V4l::bgr2rgb", XS_Video__Capture__V4l_bgr2rgb, file, "$");
2074
newXSproto("Video::Capture::V4l::reduce2", XS_Video__Capture__V4l_reduce2, file, "$$");
2075
newXSproto("Video::Capture::V4l::normalize", XS_Video__Capture__V4l_normalize, file, "$");
2076
newXSproto("Video::Capture::V4l::findmin", XS_Video__Capture__V4l_findmin, file, "$$;$$");
2077
newXSproto("Video::Capture::V4l::linreg", XS_Video__Capture__V4l_linreg, file, "$");
2078
newXSproto("Video::Capture::V4l::linreg1", XS_Video__Capture__V4l_linreg1, file, "$");
2080
/* Initialisation Section */
2084
HV *stash = gv_stashpvn("Video::Capture::V4l", 19, TRUE);
2086
newCONSTSUB(stash,"AUDIO_BASS", newSViv(VIDEO_AUDIO_BASS));
2087
newCONSTSUB(stash,"AUDIO_MUTABLE", newSViv(VIDEO_AUDIO_MUTABLE));
2088
newCONSTSUB(stash,"AUDIO_MUTE", newSViv(VIDEO_AUDIO_MUTE));
2089
newCONSTSUB(stash,"AUDIO_TREBLE", newSViv(VIDEO_AUDIO_TREBLE));
2090
newCONSTSUB(stash,"AUDIO_VOLUME", newSViv(VIDEO_AUDIO_VOLUME));
2091
newCONSTSUB(stash,"CAPTURE_EVEN", newSViv(VIDEO_CAPTURE_EVEN));
2092
newCONSTSUB(stash,"CAPTURE_ODD", newSViv(VIDEO_CAPTURE_ODD));
2093
newCONSTSUB(stash,"MAX_FRAME", newSViv(VIDEO_MAX_FRAME));
2094
newCONSTSUB(stash,"MODE_AUTO", newSViv(VIDEO_MODE_AUTO));
2095
newCONSTSUB(stash,"MODE_NTSC", newSViv(VIDEO_MODE_NTSC));
2096
newCONSTSUB(stash,"MODE_PAL", newSViv(VIDEO_MODE_PAL));
2097
newCONSTSUB(stash,"MODE_SECAM", newSViv(VIDEO_MODE_SECAM));
2098
newCONSTSUB(stash,"PALETTE_COMPONENT", newSViv(VIDEO_PALETTE_COMPONENT));
2099
newCONSTSUB(stash,"PALETTE_GREY", newSViv(VIDEO_PALETTE_GREY));
2100
newCONSTSUB(stash,"PALETTE_HI240", newSViv(VIDEO_PALETTE_HI240));
2101
newCONSTSUB(stash,"PALETTE_PLANAR", newSViv(VIDEO_PALETTE_PLANAR));
2102
newCONSTSUB(stash,"PALETTE_RAW", newSViv(VIDEO_PALETTE_RAW));
2103
newCONSTSUB(stash,"PALETTE_RGB24", newSViv(VIDEO_PALETTE_RGB24));
2104
newCONSTSUB(stash,"PALETTE_RGB32", newSViv(VIDEO_PALETTE_RGB32));
2105
newCONSTSUB(stash,"PALETTE_RGB555", newSViv(VIDEO_PALETTE_RGB555));
2106
newCONSTSUB(stash,"PALETTE_RGB565", newSViv(VIDEO_PALETTE_RGB565));
2107
newCONSTSUB(stash,"PALETTE_UYVY", newSViv(VIDEO_PALETTE_UYVY));
2108
newCONSTSUB(stash,"PALETTE_YUV410P", newSViv(VIDEO_PALETTE_YUV410P));
2109
newCONSTSUB(stash,"PALETTE_YUV411", newSViv(VIDEO_PALETTE_YUV411));
2110
newCONSTSUB(stash,"PALETTE_YUV411P", newSViv(VIDEO_PALETTE_YUV411P));
2111
newCONSTSUB(stash,"PALETTE_YUV420", newSViv(VIDEO_PALETTE_YUV420));
2112
newCONSTSUB(stash,"PALETTE_YUV420P", newSViv(VIDEO_PALETTE_YUV420P));
2113
newCONSTSUB(stash,"PALETTE_YUV422", newSViv(VIDEO_PALETTE_YUV422));
2114
newCONSTSUB(stash,"PALETTE_YUV422P", newSViv(VIDEO_PALETTE_YUV422P));
2115
newCONSTSUB(stash,"PALETTE_YUYV", newSViv(VIDEO_PALETTE_YUYV));
2116
newCONSTSUB(stash,"SOUND_LANG1", newSViv(VIDEO_SOUND_LANG1));
2117
newCONSTSUB(stash,"SOUND_LANG2", newSViv(VIDEO_SOUND_LANG2));
2118
newCONSTSUB(stash,"SOUND_MONO", newSViv(VIDEO_SOUND_MONO));
2119
newCONSTSUB(stash,"SOUND_STEREO", newSViv(VIDEO_SOUND_STEREO));
2120
newCONSTSUB(stash,"TUNER_LOW", newSViv(VIDEO_TUNER_LOW));
2121
newCONSTSUB(stash,"TUNER_MBS_ON", newSViv(VIDEO_TUNER_MBS_ON));
2122
newCONSTSUB(stash,"TUNER_NORM", newSViv(VIDEO_TUNER_NORM));
2123
newCONSTSUB(stash,"TUNER_NTSC", newSViv(VIDEO_TUNER_NTSC));
2124
newCONSTSUB(stash,"TUNER_PAL", newSViv(VIDEO_TUNER_PAL));
2125
newCONSTSUB(stash,"TUNER_RDS_ON", newSViv(VIDEO_TUNER_RDS_ON));
2126
newCONSTSUB(stash,"TUNER_SECAM", newSViv(VIDEO_TUNER_SECAM));
2127
newCONSTSUB(stash,"TUNER_STEREO_ON", newSViv(VIDEO_TUNER_STEREO_ON));
2128
newCONSTSUB(stash,"TYPE_CAMERA", newSViv(VIDEO_TYPE_CAMERA));
2129
newCONSTSUB(stash,"TYPE_TV", newSViv(VIDEO_TYPE_TV));
2130
newCONSTSUB(stash,"VC_AUDIO", newSViv(VIDEO_VC_AUDIO));
2131
newCONSTSUB(stash,"VC_TUNER", newSViv(VIDEO_VC_TUNER));
2132
newCONSTSUB(stash,"TYPE_CAPTURE", newSViv(VID_TYPE_CAPTURE));
2133
newCONSTSUB(stash,"TYPE_CHROMAKEY", newSViv(VID_TYPE_CHROMAKEY));
2134
newCONSTSUB(stash,"TYPE_CLIPPING", newSViv(VID_TYPE_CLIPPING));
2135
newCONSTSUB(stash,"TYPE_FRAMERAM", newSViv(VID_TYPE_FRAMERAM));
2136
newCONSTSUB(stash,"TYPE_MONOCHROME", newSViv(VID_TYPE_MONOCHROME));
2137
newCONSTSUB(stash,"TYPE_OVERLAY", newSViv(VID_TYPE_OVERLAY));
2138
newCONSTSUB(stash,"TYPE_SCALES", newSViv(VID_TYPE_SCALES));
2139
newCONSTSUB(stash,"TYPE_SUBCAPTURE", newSViv(VID_TYPE_SUBCAPTURE));
2140
newCONSTSUB(stash,"TYPE_TELETEXT", newSViv(VID_TYPE_TELETEXT));
2141
newCONSTSUB(stash,"TYPE_TUNER", newSViv(VID_TYPE_TUNER));
2146
/* End of Initialisation Section */