~ubuntu-branches/ubuntu/karmic/libvideo-capture-v4l-perl/karmic

« back to all changes in this revision

Viewing changes to V4l/V4l.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2004-07-15 10:24:22 UTC
  • Revision ID: james.westby@ubuntu.com-20040715102422-301n76srxfpjp63x
Tags: 0.224-5
* Missed a -fPIC in a sub-Makefile, minor compile fixes.
  - Closes: #258991, #259440
* Don't nest examples/ directories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
4
 *
 
5
 *      ANY CHANGES MADE HERE WILL BE LOST!
 
6
 *
 
7
 */
 
8
 
 
9
#line 1 "V4l.xs"
 
10
#include "EXTERN.h"
 
11
#include "perl.h"
 
12
#include "XSUB.h"
 
13
 
 
14
#include <sys/types.h>
 
15
#include <sys/time.h>
 
16
#include <unistd.h>
 
17
#include <sys/mman.h>
 
18
 
 
19
#include <string.h>
 
20
#include <pthread.h>
 
21
#include <linux/videodev.h>
 
22
 
 
23
#define NEED_newCONSTSUB
 
24
#include "../gppport.h"
 
25
 
 
26
#ifndef pTHX_
 
27
#define pTHX_
 
28
#endif
 
29
 
 
30
#define XSRETURN_bool(bool) if (bool) XSRETURN_YES; else XSRETURN_NO;
 
31
 
 
32
#define VBI_BPF (2048*32)
 
33
 
 
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;
 
39
 
 
40
static void
 
41
attach_struct (SV *sv, size_t bytes)
 
42
{
 
43
  void *ptr;
 
44
 
 
45
  sv = SvRV (sv);
 
46
  Newz (0, ptr, bytes, void*);
 
47
 
 
48
  sv_magic (sv, 0, '~', 0, bytes);
 
49
  mg_find(sv, '~')->mg_ptr = ptr;
 
50
}
 
51
 
 
52
static SV *
 
53
new_struct (SV *sv, size_t bytes, const char *pkg)
 
54
{
 
55
  SV *rv = newRV_noinc (sv);
 
56
  attach_struct (rv, bytes);
 
57
  return sv_bless (rv, gv_stashpv ((char *)pkg, TRUE));
 
58
}
 
59
 
 
60
static void *
 
61
old_struct (SV *sv, const char *name)
 
62
{
 
63
  /* TODO: check name */
 
64
  return mg_find (SvRV(sv), '~')->mg_ptr;
 
65
}
 
66
 
 
67
static int
 
68
framesize (unsigned int format, unsigned int pixels)
 
69
{
 
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;
 
88
  return 0;
 
89
}
 
90
 
 
91
struct private {
 
92
  int fd;
 
93
  unsigned char *mmap_base;
 
94
  struct video_mbuf vm;
 
95
};
 
96
 
 
97
static int
 
98
private_free (pTHX_ SV *obj, MAGIC *mg)
 
99
{
 
100
  struct private *p = (struct private *)mg->mg_ptr;
 
101
  munmap (p->mmap_base, p->vm.size);
 
102
  return 0;
 
103
}
 
104
 
 
105
static MGVTBL vtbl_private = {0, 0, 0, 0, private_free};
 
106
 
 
107
static struct private *
 
108
find_private (SV *sv)
 
109
{
 
110
  HV *hv = (HV*)SvRV(sv);
 
111
  MAGIC *mg = mg_find ((SV*)hv, '~');
 
112
 
 
113
  if (!mg)
 
114
    {
 
115
      struct private p;
 
116
      p.fd = SvIV (*hv_fetch (hv, "fd", 2, 0));
 
117
      if (ioctl (p.fd, VIDIOCGMBUF, &p.vm) == 0)
 
118
        {
 
119
          p.mmap_base = (unsigned char *)mmap (0, p.vm.size, PROT_READ|PROT_WRITE, MAP_SHARED, p.fd, 0);
 
120
          if (p.mmap_base)
 
121
            {
 
122
              sv_magic ((SV*)hv, 0, '~', (char*)&p, sizeof p);
 
123
              mg = mg_find ((SV*)hv, '~');
 
124
              mg->mg_virtual = &vtbl_private;
 
125
            }
 
126
        }
 
127
    }
 
128
 
 
129
  return (struct private *) (mg ? mg->mg_ptr : 0);
 
130
}
 
131
 
 
132
typedef unsigned char u8;
 
133
typedef unsigned int UI;
 
134
 
 
135
#define get_field(field) (*hv_fetch ((HV*)SvRV (self), #field, strlen(#field), 0))
 
136
 
 
137
/* only one thread currently */
 
138
typedef struct vbi_frame {
 
139
  struct vbi_frame *next;
 
140
  int size;
 
141
  char data[VBI_BPF];
 
142
} vbi_frame;
 
143
static vbi_frame *vbi_head, *vbi_tail,
 
144
                 *vbi_free;
 
145
static int vbi_fd;
 
146
static UI vbi_max;
 
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;
 
150
 
 
151
static void *
 
152
vbi_snatcher_thread (void *arg)
 
153
{
 
154
  /* try to become a realtime process. */
 
155
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
 
156
  {
 
157
    struct sched_param sp;
 
158
 
 
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);
 
162
  }
 
163
#endif
 
164
  for(;;)
 
165
    {
 
166
      vbi_frame *next;
 
167
 
 
168
      pthread_mutex_lock (&vbi_lock);
 
169
      if (vbi_free)
 
170
        {
 
171
          next = vbi_free;
 
172
          vbi_free = vbi_free->next;
 
173
          pthread_mutex_unlock (&vbi_lock);
 
174
 
 
175
          next->next = 0;
 
176
          next->size = read (vbi_fd, next->data, VBI_BPF);
 
177
 
 
178
          pthread_mutex_lock (&vbi_lock);
 
179
 
 
180
          if (vbi_tail)
 
181
            vbi_tail->next = next;
 
182
          else
 
183
            vbi_head = vbi_tail = next;
 
184
 
 
185
          vbi_tail = next;
 
186
          vbi_max--;
 
187
 
 
188
          pthread_cond_signal (&vbi_cond);
 
189
          pthread_mutex_unlock (&vbi_lock);
 
190
        }
 
191
      else 
 
192
        {
 
193
          static struct timespec to = { 0, 1000000000 / 70 }; /* skip almost a frame */
 
194
 
 
195
          pthread_mutex_unlock (&vbi_lock);
 
196
          pthread_testcancel ();
 
197
          nanosleep (&to, 0);
 
198
        }
 
199
    }
 
200
}
 
201
 
 
202
#line 203 "V4l.c"
 
203
XS(XS_Video__Capture__V4l__VBI_field); /* prototype to pass -Wmissing-prototypes */
 
204
XS(XS_Video__Capture__V4l__VBI_field)
 
205
{
 
206
    dXSARGS;
 
207
    if (items != 1)
 
208
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::VBI::field(self)");
 
209
    {
 
210
        SV *    self = ST(0);
 
211
        SV *    RETVAL;
 
212
#line 201 "V4l.xs"
 
213
        int fd = SvIV(get_field(fd));
 
214
 
 
215
        if (vbi_fd == fd)
 
216
          {
 
217
            vbi_frame *next;
 
218
 
 
219
            pthread_mutex_lock (&vbi_lock);
 
220
            while (!vbi_head)
 
221
              pthread_cond_wait (&vbi_cond, &vbi_lock);
 
222
 
 
223
            RETVAL = newSVpvn (vbi_head->data, vbi_head->size);
 
224
 
 
225
            vbi_max++;
 
226
            next = vbi_head->next;
 
227
 
 
228
            vbi_head->next = vbi_free;
 
229
            vbi_free = vbi_head;
 
230
 
 
231
            vbi_head = next;
 
232
 
 
233
            if (!next)
 
234
              vbi_tail = vbi_head;
 
235
 
 
236
            pthread_mutex_unlock (&vbi_lock);
 
237
          }
 
238
        else
 
239
          {
 
240
            int len;
 
241
 
 
242
            RETVAL = newSVpvn ("", 0);
 
243
            SvGROW (RETVAL, VBI_BPF);
 
244
            len = read (fd, SvPV_nolen (RETVAL), VBI_BPF);
 
245
            SvCUR_set (RETVAL, len);
 
246
          }
 
247
 
 
248
#line 249 "V4l.c"
 
249
        ST(0) = RETVAL;
 
250
        sv_2mortal(ST(0));
 
251
    }
 
252
    XSRETURN(1);
 
253
}
 
254
 
 
255
XS(XS_Video__Capture__V4l__VBI_backlog); /* prototype to pass -Wmissing-prototypes */
 
256
XS(XS_Video__Capture__V4l__VBI_backlog)
 
257
{
 
258
    dXSARGS;
 
259
    if (items != 2)
 
260
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::VBI::backlog(self, backlog)");
 
261
    {
 
262
        SV *    self = ST(0);
 
263
        unsigned int    backlog = (unsigned int)SvUV(ST(1));
 
264
#line 244 "V4l.xs"
 
265
{
 
266
        while (vbi_max != backlog)
 
267
          {
 
268
            vbi_frame *f;
 
269
 
 
270
            pthread_mutex_lock (&vbi_lock);
 
271
 
 
272
            if (vbi_max < backlog)
 
273
              {
 
274
                f = malloc (sizeof (vbi_frame));
 
275
                f->next = vbi_free;
 
276
                vbi_free = f;
 
277
                vbi_max++;
 
278
              }
 
279
            else
 
280
              {
 
281
                if (vbi_free)
 
282
                  {
 
283
                    f = vbi_free;
 
284
                    vbi_free = vbi_free->next;
 
285
                    free (f);
 
286
                    vbi_max--;
 
287
                  }
 
288
              }
 
289
 
 
290
            pthread_mutex_unlock (&vbi_lock);
 
291
          }
 
292
 
 
293
        if (backlog)
 
294
          {
 
295
            if (!vbi_fd)
 
296
              {
 
297
                vbi_fd = SvIV(get_field(fd));
 
298
                pthread_create (&vbi_snatcher, 0, vbi_snatcher_thread, 0);
 
299
              }
 
300
          }
 
301
        else
 
302
          {
 
303
            if (vbi_fd)
 
304
              {
 
305
                pthread_cancel (vbi_snatcher);
 
306
                pthread_join (vbi_snatcher, 0);
 
307
                vbi_fd = 0;
 
308
              }
 
309
 
 
310
            /* no locking necessary, in theory */
 
311
            while (vbi_head)
 
312
              {
 
313
                vbi_frame *next = vbi_head->next;
 
314
 
 
315
                free (vbi_head);
 
316
                vbi_head = next;
 
317
              }
 
318
 
 
319
            vbi_tail = 0;
 
320
          }
 
321
}
 
322
#line 323 "V4l.c"
 
323
    }
 
324
    XSRETURN_EMPTY;
 
325
}
 
326
 
 
327
XS(XS_Video__Capture__V4l__VBI_queued); /* prototype to pass -Wmissing-prototypes */
 
328
XS(XS_Video__Capture__V4l__VBI_queued)
 
329
{
 
330
    dXSARGS;
 
331
    if (items != 1)
 
332
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::VBI::queued(self)");
 
333
    {
 
334
        int     RETVAL;
 
335
        dXSTARG;
 
336
#line 305 "V4l.xs"
 
337
        if (vbi_fd)
 
338
          {
 
339
            /* FIXME: lock/unlock */
 
340
            pthread_mutex_lock (&vbi_lock);
 
341
            RETVAL = !!vbi_head;
 
342
            pthread_mutex_unlock (&vbi_lock);
 
343
          }
 
344
        else
 
345
          RETVAL = 1;
 
346
#line 347 "V4l.c"
 
347
        XSprePUSH; PUSHi((IV)RETVAL);
 
348
    }
 
349
    XSRETURN(1);
 
350
}
 
351
 
 
352
XS(XS_Video__Capture__V4l_capture); /* prototype to pass -Wmissing-prototypes */
 
353
XS(XS_Video__Capture__V4l_capture)
 
354
{
 
355
    dXSARGS;
 
356
    if (items < 4 || items > 5)
 
357
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::capture(sv, frame, width, height, format = VIDEO_PALETTE_RGB24)");
 
358
    {
 
359
        SV *    sv = ST(0);
 
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));
 
363
        unsigned int    format;
 
364
        SV *    RETVAL;
 
365
 
 
366
        if (items < 5)
 
367
            format = VIDEO_PALETTE_RGB24;
 
368
        else {
 
369
            format = (unsigned int)SvUV(ST(4));
 
370
        }
 
371
#line 327 "V4l.xs"
 
372
{
 
373
        struct private *p;
 
374
        if ((p = find_private (sv)))
 
375
          {
 
376
            struct video_mmap vm;
 
377
            vm.frame  = frame;
 
378
            vm.height = height;
 
379
            vm.width  = width;
 
380
            vm.format = format;
 
381
            if (ioctl (p->fd, VIDIOCMCAPTURE, &vm) == 0)
 
382
              {
 
383
                SV *fr = newSV (0);
 
384
                SvUPGRADE (fr, SVt_PV);
 
385
                SvREADONLY_on (fr);
 
386
                SvPVX (fr) = p->mmap_base + p->vm.offsets[frame];
 
387
                SvCUR_set (fr, framesize (format, width*height));
 
388
                SvLEN_set (fr, 0);
 
389
                SvPOK_only (fr);
 
390
                RETVAL = fr;
 
391
              }
 
392
            else
 
393
              XSRETURN_EMPTY;
 
394
          }
 
395
        else
 
396
          XSRETURN_EMPTY;
 
397
}
 
398
#line 399 "V4l.c"
 
399
        ST(0) = RETVAL;
 
400
        sv_2mortal(ST(0));
 
401
    }
 
402
    XSRETURN(1);
 
403
}
 
404
 
 
405
XS(XS_Video__Capture__V4l_sync); /* prototype to pass -Wmissing-prototypes */
 
406
XS(XS_Video__Capture__V4l_sync)
 
407
{
 
408
    dXSARGS;
 
409
    if (items != 2)
 
410
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::sync(sv, frame)");
 
411
    SP -= items;
 
412
    {
 
413
        SV *    sv = ST(0);
 
414
        int     frame = (int)SvIV(ST(1));
 
415
#line 361 "V4l.xs"
 
416
{
 
417
        struct private *p;
 
418
        if ((p = find_private (sv))
 
419
            && ioctl (p->fd, VIDIOCSYNC, &frame) == 0)
 
420
          XSRETURN_YES;
 
421
        else
 
422
          XSRETURN_EMPTY;
 
423
}
 
424
#line 425 "V4l.c"
 
425
        PUTBACK;
 
426
        return;
 
427
    }
 
428
}
 
429
 
 
430
XS(XS_Video__Capture__V4l__freq); /* prototype to pass -Wmissing-prototypes */
 
431
XS(XS_Video__Capture__V4l__freq)
 
432
{
 
433
    dXSARGS;
 
434
    if (items != 2)
 
435
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_freq(fd, fr)");
 
436
    {
 
437
        int     fd = (int)SvIV(ST(0));
 
438
        unsigned long   fr = (unsigned long)SvUV(ST(1));
 
439
        unsigned long   RETVAL;
 
440
        dXSTARG;
 
441
#line 375 "V4l.xs"
 
442
        if (items > 1)
 
443
          {
 
444
            fr = ((fr<<4)+499)/1000;
 
445
            ioctl (fd, VIDIOCSFREQ, &fr);
 
446
          }
 
447
        if (GIMME_V != G_VOID)
 
448
          {
 
449
            if (ioctl (fd, VIDIOCGFREQ, &fr) == 0)
 
450
              RETVAL = (fr*1000+7)>>4;
 
451
            else
 
452
              XSRETURN_EMPTY;
 
453
          }
 
454
        else
 
455
          XSRETURN (0);
 
456
#line 457 "V4l.c"
 
457
        XSprePUSH; PUSHu((UV)RETVAL);
 
458
    }
 
459
    XSRETURN(1);
 
460
}
 
461
 
 
462
XS(XS_Video__Capture__V4l__capabilities_new); /* prototype to pass -Wmissing-prototypes */
 
463
XS(XS_Video__Capture__V4l__capabilities_new)
 
464
{
 
465
    dXSARGS;
 
466
    if (items != 1)
 
467
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_capabilities_new(fd)");
 
468
    {
 
469
        int     fd = (int)SvIV(ST(0));
 
470
        SV *    RETVAL;
 
471
#line 397 "V4l.xs"
 
472
        RETVAL = new_struct (newSViv (fd), sizeof (struct video_capability), "Video::Capture::V4l::Capability");
 
473
#line 474 "V4l.c"
 
474
        ST(0) = RETVAL;
 
475
        sv_2mortal(ST(0));
 
476
    }
 
477
    XSRETURN(1);
 
478
}
 
479
 
 
480
XS(XS_Video__Capture__V4l__channel_new); /* prototype to pass -Wmissing-prototypes */
 
481
XS(XS_Video__Capture__V4l__channel_new)
 
482
{
 
483
    dXSARGS;
 
484
    if (items != 1)
 
485
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_channel_new(fd)");
 
486
    {
 
487
        int     fd = (int)SvIV(ST(0));
 
488
        SV *    RETVAL;
 
489
#line 405 "V4l.xs"
 
490
        RETVAL = new_struct (newSViv (fd), sizeof (struct video_channel), "Video::Capture::V4l::Channel");
 
491
#line 492 "V4l.c"
 
492
        ST(0) = RETVAL;
 
493
        sv_2mortal(ST(0));
 
494
    }
 
495
    XSRETURN(1);
 
496
}
 
497
 
 
498
XS(XS_Video__Capture__V4l__tuner_new); /* prototype to pass -Wmissing-prototypes */
 
499
XS(XS_Video__Capture__V4l__tuner_new)
 
500
{
 
501
    dXSARGS;
 
502
    if (items != 1)
 
503
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_tuner_new(fd)");
 
504
    {
 
505
        int     fd = (int)SvIV(ST(0));
 
506
        SV *    RETVAL;
 
507
#line 413 "V4l.xs"
 
508
        RETVAL = new_struct (newSViv (fd), sizeof (struct video_tuner), "Video::Capture::V4l::Tuner");
 
509
#line 510 "V4l.c"
 
510
        ST(0) = RETVAL;
 
511
        sv_2mortal(ST(0));
 
512
    }
 
513
    XSRETURN(1);
 
514
}
 
515
 
 
516
XS(XS_Video__Capture__V4l__audio_new); /* prototype to pass -Wmissing-prototypes */
 
517
XS(XS_Video__Capture__V4l__audio_new)
 
518
{
 
519
    dXSARGS;
 
520
    if (items != 1)
 
521
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_audio_new(fd)");
 
522
    {
 
523
        int     fd = (int)SvIV(ST(0));
 
524
        SV *    RETVAL;
 
525
#line 421 "V4l.xs"
 
526
        RETVAL = new_struct (newSViv (fd), sizeof (struct video_audio), "Video::Capture::V4l::Audio");
 
527
#line 528 "V4l.c"
 
528
        ST(0) = RETVAL;
 
529
        sv_2mortal(ST(0));
 
530
    }
 
531
    XSRETURN(1);
 
532
}
 
533
 
 
534
XS(XS_Video__Capture__V4l__picture_new); /* prototype to pass -Wmissing-prototypes */
 
535
XS(XS_Video__Capture__V4l__picture_new)
 
536
{
 
537
    dXSARGS;
 
538
    if (items != 1)
 
539
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::_picture_new(fd)");
 
540
    {
 
541
        int     fd = (int)SvIV(ST(0));
 
542
        SV *    RETVAL;
 
543
#line 429 "V4l.xs"
 
544
        RETVAL = new_struct (newSViv (fd), sizeof (struct video_picture), "Video::Capture::V4l::Picture");
 
545
#line 546 "V4l.c"
 
546
        ST(0) = RETVAL;
 
547
        sv_2mortal(ST(0));
 
548
    }
 
549
    XSRETURN(1);
 
550
}
 
551
 
 
552
XS(XS_Video__Capture__V4l__Capability_get); /* prototype to pass -Wmissing-prototypes */
 
553
XS(XS_Video__Capture__V4l__Capability_get)
 
554
{
 
555
    dXSARGS;
 
556
    if (items != 1)
 
557
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::get(sv)");
 
558
    {
 
559
        SV *    sv = ST(0);
 
560
#line 439 "V4l.xs"
 
561
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGCAP, old_struct (sv, "Video::Capture::V4l::Capability")) == 0);
 
562
#line 563 "V4l.c"
 
563
    }
 
564
    XSRETURN_EMPTY;
 
565
}
 
566
 
 
567
XS(XS_Video__Capture__V4l__Channel_get); /* prototype to pass -Wmissing-prototypes */
 
568
XS(XS_Video__Capture__V4l__Channel_get)
 
569
{
 
570
    dXSARGS;
 
571
    if (items != 1)
 
572
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::get(sv)");
 
573
    {
 
574
        SV *    sv = ST(0);
 
575
#line 447 "V4l.xs"
 
576
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGCHAN, old_struct (sv, "Video::Capture::V4l::Channel")) == 0);
 
577
#line 578 "V4l.c"
 
578
    }
 
579
    XSRETURN_EMPTY;
 
580
}
 
581
 
 
582
XS(XS_Video__Capture__V4l__Channel_set); /* prototype to pass -Wmissing-prototypes */
 
583
XS(XS_Video__Capture__V4l__Channel_set)
 
584
{
 
585
    dXSARGS;
 
586
    if (items != 1)
 
587
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::set(sv)");
 
588
    {
 
589
        SV *    sv = ST(0);
 
590
#line 453 "V4l.xs"
 
591
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCSCHAN, old_struct (sv, "Video::Capture::V4l::Channel")) == 0);
 
592
#line 593 "V4l.c"
 
593
    }
 
594
    XSRETURN_EMPTY;
 
595
}
 
596
 
 
597
XS(XS_Video__Capture__V4l__Tuner_get); /* prototype to pass -Wmissing-prototypes */
 
598
XS(XS_Video__Capture__V4l__Tuner_get)
 
599
{
 
600
    dXSARGS;
 
601
    if (items != 1)
 
602
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::get(sv)");
 
603
    {
 
604
        SV *    sv = ST(0);
 
605
#line 461 "V4l.xs"
 
606
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGTUNER, old_struct (sv, "Video::Capture::V4l::Tuner")) == 0);
 
607
#line 608 "V4l.c"
 
608
    }
 
609
    XSRETURN_EMPTY;
 
610
}
 
611
 
 
612
XS(XS_Video__Capture__V4l__Tuner_set); /* prototype to pass -Wmissing-prototypes */
 
613
XS(XS_Video__Capture__V4l__Tuner_set)
 
614
{
 
615
    dXSARGS;
 
616
    if (items != 1)
 
617
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::set(sv)");
 
618
    {
 
619
        SV *    sv = ST(0);
 
620
#line 467 "V4l.xs"
 
621
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCSTUNER, old_struct (sv, "Video::Capture::V4l::Tuner")) == 0);
 
622
#line 623 "V4l.c"
 
623
    }
 
624
    XSRETURN_EMPTY;
 
625
}
 
626
 
 
627
XS(XS_Video__Capture__V4l__Audio_get); /* prototype to pass -Wmissing-prototypes */
 
628
XS(XS_Video__Capture__V4l__Audio_get)
 
629
{
 
630
    dXSARGS;
 
631
    if (items != 1)
 
632
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::get(sv)");
 
633
    {
 
634
        SV *    sv = ST(0);
 
635
#line 475 "V4l.xs"
 
636
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGAUDIO, old_struct (sv, "Video::Capture::V4l::Audio")) == 0);
 
637
#line 638 "V4l.c"
 
638
    }
 
639
    XSRETURN_EMPTY;
 
640
}
 
641
 
 
642
XS(XS_Video__Capture__V4l__Audio_set); /* prototype to pass -Wmissing-prototypes */
 
643
XS(XS_Video__Capture__V4l__Audio_set)
 
644
{
 
645
    dXSARGS;
 
646
    if (items != 1)
 
647
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::set(sv)");
 
648
    {
 
649
        SV *    sv = ST(0);
 
650
#line 481 "V4l.xs"
 
651
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCSAUDIO, old_struct (sv, "Video::Capture::V4l::Audio")) == 0);
 
652
#line 653 "V4l.c"
 
653
    }
 
654
    XSRETURN_EMPTY;
 
655
}
 
656
 
 
657
XS(XS_Video__Capture__V4l__Picture_get); /* prototype to pass -Wmissing-prototypes */
 
658
XS(XS_Video__Capture__V4l__Picture_get)
 
659
{
 
660
    dXSARGS;
 
661
    if (items != 1)
 
662
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::get(sv)");
 
663
    {
 
664
        SV *    sv = ST(0);
 
665
#line 489 "V4l.xs"
 
666
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCGPICT, old_struct (sv, "Video::Capture::V4l::Picture")) == 0);
 
667
#line 668 "V4l.c"
 
668
    }
 
669
    XSRETURN_EMPTY;
 
670
}
 
671
 
 
672
XS(XS_Video__Capture__V4l__Picture_set); /* prototype to pass -Wmissing-prototypes */
 
673
XS(XS_Video__Capture__V4l__Picture_set)
 
674
{
 
675
    dXSARGS;
 
676
    if (items != 1)
 
677
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::set(sv)");
 
678
    {
 
679
        SV *    sv = ST(0);
 
680
#line 495 "V4l.xs"
 
681
        XSRETURN_bool (ioctl (SvIV (SvRV (sv)), VIDIOCSPICT, old_struct (sv, "Video::Capture::V4l::Picture")) == 0);
 
682
#line 683 "V4l.c"
 
683
    }
 
684
    XSRETURN_EMPTY;
 
685
}
 
686
 
 
687
 
 
688
/* INCLUDE:  Including './genacc |' from 'V4l.xs' */
 
689
 
 
690
XS(XS_Video__Capture__V4l__Capability_name); /* prototype to pass -Wmissing-prototypes */
 
691
XS(XS_Video__Capture__V4l__Capability_name)
 
692
{
 
693
    dXSARGS;
 
694
    if (items < 1 || items > 2)
 
695
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::name(s, name=0)");
 
696
    {
 
697
        Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
 
698
        char *  name;
 
699
        char *  RETVAL;
 
700
        dXSTARG;
 
701
 
 
702
        if (items < 2)
 
703
            name = 0;
 
704
        else {
 
705
            name = (char *)SvPV_nolen(ST(1));
 
706
        }
 
707
#line 17 "./genacc |"
 
708
        if (items==1)
 
709
          { RETVAL = s->name; }
 
710
        else
 
711
          { croak ("attribute 'name' is readonly"); }
 
712
#line 713 "V4l.c"
 
713
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
 
714
    }
 
715
    XSRETURN(1);
 
716
}
 
717
 
 
718
XS(XS_Video__Capture__V4l__Capability_type); /* prototype to pass -Wmissing-prototypes */
 
719
XS(XS_Video__Capture__V4l__Capability_type)
 
720
{
 
721
    dXSARGS;
 
722
    if (items < 1 || items > 2)
 
723
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::type(s, type=0)");
 
724
    {
 
725
        Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
 
726
        int     type;
 
727
        int     RETVAL;
 
728
        dXSTARG;
 
729
 
 
730
        if (items < 2)
 
731
            type = 0;
 
732
        else {
 
733
            type = (int)SvIV(ST(1));
 
734
        }
 
735
#line 29 "./genacc |"
 
736
        if (items==1)
 
737
          { RETVAL = s->type; }
 
738
        else
 
739
          { croak ("attribute 'type' is readonly"); }
 
740
#line 741 "V4l.c"
 
741
        XSprePUSH; PUSHi((IV)RETVAL);
 
742
    }
 
743
    XSRETURN(1);
 
744
}
 
745
 
 
746
XS(XS_Video__Capture__V4l__Capability_channels); /* prototype to pass -Wmissing-prototypes */
 
747
XS(XS_Video__Capture__V4l__Capability_channels)
 
748
{
 
749
    dXSARGS;
 
750
    if (items < 1 || items > 2)
 
751
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::channels(s, channels=0)");
 
752
    {
 
753
        Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
 
754
        int     channels;
 
755
        int     RETVAL;
 
756
        dXSTARG;
 
757
 
 
758
        if (items < 2)
 
759
            channels = 0;
 
760
        else {
 
761
            channels = (int)SvIV(ST(1));
 
762
        }
 
763
#line 41 "./genacc |"
 
764
        if (items==1)
 
765
          { RETVAL = s->channels; }
 
766
        else
 
767
          { croak ("attribute 'channels' is readonly"); }
 
768
#line 769 "V4l.c"
 
769
        XSprePUSH; PUSHi((IV)RETVAL);
 
770
    }
 
771
    XSRETURN(1);
 
772
}
 
773
 
 
774
XS(XS_Video__Capture__V4l__Capability_audios); /* prototype to pass -Wmissing-prototypes */
 
775
XS(XS_Video__Capture__V4l__Capability_audios)
 
776
{
 
777
    dXSARGS;
 
778
    if (items < 1 || items > 2)
 
779
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::audios(s, audios=0)");
 
780
    {
 
781
        Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
 
782
        int     audios;
 
783
        int     RETVAL;
 
784
        dXSTARG;
 
785
 
 
786
        if (items < 2)
 
787
            audios = 0;
 
788
        else {
 
789
            audios = (int)SvIV(ST(1));
 
790
        }
 
791
#line 53 "./genacc |"
 
792
        if (items==1)
 
793
          { RETVAL = s->audios; }
 
794
        else
 
795
          { croak ("attribute 'audios' is readonly"); }
 
796
#line 797 "V4l.c"
 
797
        XSprePUSH; PUSHi((IV)RETVAL);
 
798
    }
 
799
    XSRETURN(1);
 
800
}
 
801
 
 
802
XS(XS_Video__Capture__V4l__Capability_maxwidth); /* prototype to pass -Wmissing-prototypes */
 
803
XS(XS_Video__Capture__V4l__Capability_maxwidth)
 
804
{
 
805
    dXSARGS;
 
806
    if (items < 1 || items > 2)
 
807
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::maxwidth(s, maxwidth=0)");
 
808
    {
 
809
        Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
 
810
        int     maxwidth;
 
811
        int     RETVAL;
 
812
        dXSTARG;
 
813
 
 
814
        if (items < 2)
 
815
            maxwidth = 0;
 
816
        else {
 
817
            maxwidth = (int)SvIV(ST(1));
 
818
        }
 
819
#line 65 "./genacc |"
 
820
        if (items==1)
 
821
          { RETVAL = s->maxwidth; }
 
822
        else
 
823
          { croak ("attribute 'maxwidth' is readonly"); }
 
824
#line 825 "V4l.c"
 
825
        XSprePUSH; PUSHi((IV)RETVAL);
 
826
    }
 
827
    XSRETURN(1);
 
828
}
 
829
 
 
830
XS(XS_Video__Capture__V4l__Capability_maxheight); /* prototype to pass -Wmissing-prototypes */
 
831
XS(XS_Video__Capture__V4l__Capability_maxheight)
 
832
{
 
833
    dXSARGS;
 
834
    if (items < 1 || items > 2)
 
835
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::maxheight(s, maxheight=0)");
 
836
    {
 
837
        Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
 
838
        int     maxheight;
 
839
        int     RETVAL;
 
840
        dXSTARG;
 
841
 
 
842
        if (items < 2)
 
843
            maxheight = 0;
 
844
        else {
 
845
            maxheight = (int)SvIV(ST(1));
 
846
        }
 
847
#line 77 "./genacc |"
 
848
        if (items==1)
 
849
          { RETVAL = s->maxheight; }
 
850
        else
 
851
          { croak ("attribute 'maxheight' is readonly"); }
 
852
#line 853 "V4l.c"
 
853
        XSprePUSH; PUSHi((IV)RETVAL);
 
854
    }
 
855
    XSRETURN(1);
 
856
}
 
857
 
 
858
XS(XS_Video__Capture__V4l__Capability_minwidth); /* prototype to pass -Wmissing-prototypes */
 
859
XS(XS_Video__Capture__V4l__Capability_minwidth)
 
860
{
 
861
    dXSARGS;
 
862
    if (items < 1 || items > 2)
 
863
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::minwidth(s, minwidth=0)");
 
864
    {
 
865
        Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
 
866
        int     minwidth;
 
867
        int     RETVAL;
 
868
        dXSTARG;
 
869
 
 
870
        if (items < 2)
 
871
            minwidth = 0;
 
872
        else {
 
873
            minwidth = (int)SvIV(ST(1));
 
874
        }
 
875
#line 89 "./genacc |"
 
876
        if (items==1)
 
877
          { RETVAL = s->minwidth; }
 
878
        else
 
879
          { croak ("attribute 'minwidth' is readonly"); }
 
880
#line 881 "V4l.c"
 
881
        XSprePUSH; PUSHi((IV)RETVAL);
 
882
    }
 
883
    XSRETURN(1);
 
884
}
 
885
 
 
886
XS(XS_Video__Capture__V4l__Capability_minheight); /* prototype to pass -Wmissing-prototypes */
 
887
XS(XS_Video__Capture__V4l__Capability_minheight)
 
888
{
 
889
    dXSARGS;
 
890
    if (items < 1 || items > 2)
 
891
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Capability::minheight(s, minheight=0)");
 
892
    {
 
893
        Video__Capture__V4l__Capability s = old_struct (ST(0), "Video::Capture::V4l::Capability");
 
894
        int     minheight;
 
895
        int     RETVAL;
 
896
        dXSTARG;
 
897
 
 
898
        if (items < 2)
 
899
            minheight = 0;
 
900
        else {
 
901
            minheight = (int)SvIV(ST(1));
 
902
        }
 
903
#line 101 "./genacc |"
 
904
        if (items==1)
 
905
          { RETVAL = s->minheight; }
 
906
        else
 
907
          { croak ("attribute 'minheight' is readonly"); }
 
908
#line 909 "V4l.c"
 
909
        XSprePUSH; PUSHi((IV)RETVAL);
 
910
    }
 
911
    XSRETURN(1);
 
912
}
 
913
 
 
914
XS(XS_Video__Capture__V4l__Channel_channel); /* prototype to pass -Wmissing-prototypes */
 
915
XS(XS_Video__Capture__V4l__Channel_channel)
 
916
{
 
917
    dXSARGS;
 
918
    if (items < 1 || items > 2)
 
919
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::channel(s, channel=0)");
 
920
    {
 
921
        Video__Capture__V4l__Channel    s = old_struct (ST(0), "Video::Capture::V4l::Channel");
 
922
        int     channel;
 
923
        int     RETVAL;
 
924
        dXSTARG;
 
925
 
 
926
        if (items < 2)
 
927
            channel = 0;
 
928
        else {
 
929
            channel = (int)SvIV(ST(1));
 
930
        }
 
931
#line 116 "./genacc |"
 
932
        if (items==1)
 
933
          { RETVAL = s->channel; }
 
934
        else
 
935
          { s->channel = channel; }
 
936
#line 937 "V4l.c"
 
937
        XSprePUSH; PUSHi((IV)RETVAL);
 
938
    }
 
939
    XSRETURN(1);
 
940
}
 
941
 
 
942
XS(XS_Video__Capture__V4l__Channel_name); /* prototype to pass -Wmissing-prototypes */
 
943
XS(XS_Video__Capture__V4l__Channel_name)
 
944
{
 
945
    dXSARGS;
 
946
    if (items < 1 || items > 2)
 
947
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::name(s, name=0)");
 
948
    {
 
949
        Video__Capture__V4l__Channel    s = old_struct (ST(0), "Video::Capture::V4l::Channel");
 
950
        char *  name;
 
951
        char *  RETVAL;
 
952
        dXSTARG;
 
953
 
 
954
        if (items < 2)
 
955
            name = 0;
 
956
        else {
 
957
            name = (char *)SvPV_nolen(ST(1));
 
958
        }
 
959
#line 128 "./genacc |"
 
960
        if (items==1)
 
961
          { RETVAL = s->name; }
 
962
        else
 
963
          { croak ("attribute 'name' is readonly"); }
 
964
#line 965 "V4l.c"
 
965
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
 
966
    }
 
967
    XSRETURN(1);
 
968
}
 
969
 
 
970
XS(XS_Video__Capture__V4l__Channel_tuners); /* prototype to pass -Wmissing-prototypes */
 
971
XS(XS_Video__Capture__V4l__Channel_tuners)
 
972
{
 
973
    dXSARGS;
 
974
    if (items < 1 || items > 2)
 
975
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::tuners(s, tuners=0)");
 
976
    {
 
977
        Video__Capture__V4l__Channel    s = old_struct (ST(0), "Video::Capture::V4l::Channel");
 
978
        int     tuners;
 
979
        int     RETVAL;
 
980
        dXSTARG;
 
981
 
 
982
        if (items < 2)
 
983
            tuners = 0;
 
984
        else {
 
985
            tuners = (int)SvIV(ST(1));
 
986
        }
 
987
#line 140 "./genacc |"
 
988
        if (items==1)
 
989
          { RETVAL = s->tuners; }
 
990
        else
 
991
          { croak ("attribute 'tuners' is readonly"); }
 
992
#line 993 "V4l.c"
 
993
        XSprePUSH; PUSHi((IV)RETVAL);
 
994
    }
 
995
    XSRETURN(1);
 
996
}
 
997
 
 
998
XS(XS_Video__Capture__V4l__Channel_flags); /* prototype to pass -Wmissing-prototypes */
 
999
XS(XS_Video__Capture__V4l__Channel_flags)
 
1000
{
 
1001
    dXSARGS;
 
1002
    if (items < 1 || items > 2)
 
1003
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::flags(s, flags=0)");
 
1004
    {
 
1005
        Video__Capture__V4l__Channel    s = old_struct (ST(0), "Video::Capture::V4l::Channel");
 
1006
        U32     flags;
 
1007
        U32     RETVAL;
 
1008
        dXSTARG;
 
1009
 
 
1010
        if (items < 2)
 
1011
            flags = 0;
 
1012
        else {
 
1013
            flags = (unsigned long)SvUV(ST(1));
 
1014
        }
 
1015
#line 152 "./genacc |"
 
1016
        if (items==1)
 
1017
          { RETVAL = s->flags; }
 
1018
        else
 
1019
          { croak ("attribute 'flags' is readonly"); }
 
1020
#line 1021 "V4l.c"
 
1021
        XSprePUSH; PUSHu((UV)RETVAL);
 
1022
    }
 
1023
    XSRETURN(1);
 
1024
}
 
1025
 
 
1026
XS(XS_Video__Capture__V4l__Channel_type); /* prototype to pass -Wmissing-prototypes */
 
1027
XS(XS_Video__Capture__V4l__Channel_type)
 
1028
{
 
1029
    dXSARGS;
 
1030
    if (items < 1 || items > 2)
 
1031
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::type(s, type=0)");
 
1032
    {
 
1033
        Video__Capture__V4l__Channel    s = old_struct (ST(0), "Video::Capture::V4l::Channel");
 
1034
        U16     type;
 
1035
        U16     RETVAL;
 
1036
        dXSTARG;
 
1037
 
 
1038
        if (items < 2)
 
1039
            type = 0;
 
1040
        else {
 
1041
            type = (unsigned short)SvUV(ST(1));
 
1042
        }
 
1043
#line 164 "./genacc |"
 
1044
        if (items==1)
 
1045
          { RETVAL = s->type; }
 
1046
        else
 
1047
          { croak ("attribute 'type' is readonly"); }
 
1048
#line 1049 "V4l.c"
 
1049
        XSprePUSH; PUSHu((UV)RETVAL);
 
1050
    }
 
1051
    XSRETURN(1);
 
1052
}
 
1053
 
 
1054
XS(XS_Video__Capture__V4l__Channel_norm); /* prototype to pass -Wmissing-prototypes */
 
1055
XS(XS_Video__Capture__V4l__Channel_norm)
 
1056
{
 
1057
    dXSARGS;
 
1058
    if (items < 1 || items > 2)
 
1059
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Channel::norm(s, norm=0)");
 
1060
    {
 
1061
        Video__Capture__V4l__Channel    s = old_struct (ST(0), "Video::Capture::V4l::Channel");
 
1062
        U16     norm;
 
1063
        U16     RETVAL;
 
1064
        dXSTARG;
 
1065
 
 
1066
        if (items < 2)
 
1067
            norm = 0;
 
1068
        else {
 
1069
            norm = (unsigned short)SvUV(ST(1));
 
1070
        }
 
1071
#line 176 "./genacc |"
 
1072
        if (items==1)
 
1073
          { RETVAL = s->norm; }
 
1074
        else
 
1075
          { s->norm = norm; }
 
1076
#line 1077 "V4l.c"
 
1077
        XSprePUSH; PUSHu((UV)RETVAL);
 
1078
    }
 
1079
    XSRETURN(1);
 
1080
}
 
1081
 
 
1082
XS(XS_Video__Capture__V4l__Audio_audio); /* prototype to pass -Wmissing-prototypes */
 
1083
XS(XS_Video__Capture__V4l__Audio_audio)
 
1084
{
 
1085
    dXSARGS;
 
1086
    if (items < 1 || items > 2)
 
1087
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::audio(s, audio=0)");
 
1088
    {
 
1089
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1090
        int     audio;
 
1091
        int     RETVAL;
 
1092
        dXSTARG;
 
1093
 
 
1094
        if (items < 2)
 
1095
            audio = 0;
 
1096
        else {
 
1097
            audio = (int)SvIV(ST(1));
 
1098
        }
 
1099
#line 191 "./genacc |"
 
1100
        if (items==1)
 
1101
          { RETVAL = s->audio; }
 
1102
        else
 
1103
          { s->audio = audio; }
 
1104
#line 1105 "V4l.c"
 
1105
        XSprePUSH; PUSHi((IV)RETVAL);
 
1106
    }
 
1107
    XSRETURN(1);
 
1108
}
 
1109
 
 
1110
XS(XS_Video__Capture__V4l__Audio_volume); /* prototype to pass -Wmissing-prototypes */
 
1111
XS(XS_Video__Capture__V4l__Audio_volume)
 
1112
{
 
1113
    dXSARGS;
 
1114
    if (items < 1 || items > 2)
 
1115
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::volume(s, volume=0)");
 
1116
    {
 
1117
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1118
        U16     volume;
 
1119
        U16     RETVAL;
 
1120
        dXSTARG;
 
1121
 
 
1122
        if (items < 2)
 
1123
            volume = 0;
 
1124
        else {
 
1125
            volume = (unsigned short)SvUV(ST(1));
 
1126
        }
 
1127
#line 203 "./genacc |"
 
1128
        if (items==1)
 
1129
          { RETVAL = s->volume; }
 
1130
        else
 
1131
          { s->volume = volume; }
 
1132
#line 1133 "V4l.c"
 
1133
        XSprePUSH; PUSHu((UV)RETVAL);
 
1134
    }
 
1135
    XSRETURN(1);
 
1136
}
 
1137
 
 
1138
XS(XS_Video__Capture__V4l__Audio_bass); /* prototype to pass -Wmissing-prototypes */
 
1139
XS(XS_Video__Capture__V4l__Audio_bass)
 
1140
{
 
1141
    dXSARGS;
 
1142
    if (items < 1 || items > 2)
 
1143
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::bass(s, bass=0)");
 
1144
    {
 
1145
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1146
        U16     bass;
 
1147
        U16     RETVAL;
 
1148
        dXSTARG;
 
1149
 
 
1150
        if (items < 2)
 
1151
            bass = 0;
 
1152
        else {
 
1153
            bass = (unsigned short)SvUV(ST(1));
 
1154
        }
 
1155
#line 215 "./genacc |"
 
1156
        if (items==1)
 
1157
          { RETVAL = s->bass; }
 
1158
        else
 
1159
          { s->bass = bass; }
 
1160
#line 1161 "V4l.c"
 
1161
        XSprePUSH; PUSHu((UV)RETVAL);
 
1162
    }
 
1163
    XSRETURN(1);
 
1164
}
 
1165
 
 
1166
XS(XS_Video__Capture__V4l__Audio_treble); /* prototype to pass -Wmissing-prototypes */
 
1167
XS(XS_Video__Capture__V4l__Audio_treble)
 
1168
{
 
1169
    dXSARGS;
 
1170
    if (items < 1 || items > 2)
 
1171
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::treble(s, treble=0)");
 
1172
    {
 
1173
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1174
        U16     treble;
 
1175
        U16     RETVAL;
 
1176
        dXSTARG;
 
1177
 
 
1178
        if (items < 2)
 
1179
            treble = 0;
 
1180
        else {
 
1181
            treble = (unsigned short)SvUV(ST(1));
 
1182
        }
 
1183
#line 227 "./genacc |"
 
1184
        if (items==1)
 
1185
          { RETVAL = s->treble; }
 
1186
        else
 
1187
          { s->treble = treble; }
 
1188
#line 1189 "V4l.c"
 
1189
        XSprePUSH; PUSHu((UV)RETVAL);
 
1190
    }
 
1191
    XSRETURN(1);
 
1192
}
 
1193
 
 
1194
XS(XS_Video__Capture__V4l__Audio_flags); /* prototype to pass -Wmissing-prototypes */
 
1195
XS(XS_Video__Capture__V4l__Audio_flags)
 
1196
{
 
1197
    dXSARGS;
 
1198
    if (items < 1 || items > 2)
 
1199
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::flags(s, flags=0)");
 
1200
    {
 
1201
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1202
        U32     flags;
 
1203
        U32     RETVAL;
 
1204
        dXSTARG;
 
1205
 
 
1206
        if (items < 2)
 
1207
            flags = 0;
 
1208
        else {
 
1209
            flags = (unsigned long)SvUV(ST(1));
 
1210
        }
 
1211
#line 239 "./genacc |"
 
1212
        if (items==1)
 
1213
          { RETVAL = s->flags; }
 
1214
        else
 
1215
          { s->flags = flags; }
 
1216
#line 1217 "V4l.c"
 
1217
        XSprePUSH; PUSHu((UV)RETVAL);
 
1218
    }
 
1219
    XSRETURN(1);
 
1220
}
 
1221
 
 
1222
XS(XS_Video__Capture__V4l__Audio_name); /* prototype to pass -Wmissing-prototypes */
 
1223
XS(XS_Video__Capture__V4l__Audio_name)
 
1224
{
 
1225
    dXSARGS;
 
1226
    if (items < 1 || items > 2)
 
1227
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::name(s, name=0)");
 
1228
    {
 
1229
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1230
        char *  name;
 
1231
        char *  RETVAL;
 
1232
        dXSTARG;
 
1233
 
 
1234
        if (items < 2)
 
1235
            name = 0;
 
1236
        else {
 
1237
            name = (char *)SvPV_nolen(ST(1));
 
1238
        }
 
1239
#line 251 "./genacc |"
 
1240
        if (items==1)
 
1241
          { RETVAL = s->name; }
 
1242
        else
 
1243
          { croak ("attribute 'name' is readonly"); }
 
1244
#line 1245 "V4l.c"
 
1245
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
 
1246
    }
 
1247
    XSRETURN(1);
 
1248
}
 
1249
 
 
1250
XS(XS_Video__Capture__V4l__Audio_mode); /* prototype to pass -Wmissing-prototypes */
 
1251
XS(XS_Video__Capture__V4l__Audio_mode)
 
1252
{
 
1253
    dXSARGS;
 
1254
    if (items < 1 || items > 2)
 
1255
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::mode(s, mode=0)");
 
1256
    {
 
1257
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1258
        U16     mode;
 
1259
        U16     RETVAL;
 
1260
        dXSTARG;
 
1261
 
 
1262
        if (items < 2)
 
1263
            mode = 0;
 
1264
        else {
 
1265
            mode = (unsigned short)SvUV(ST(1));
 
1266
        }
 
1267
#line 263 "./genacc |"
 
1268
        if (items==1)
 
1269
          { RETVAL = s->mode; }
 
1270
        else
 
1271
          { s->mode = mode; }
 
1272
#line 1273 "V4l.c"
 
1273
        XSprePUSH; PUSHu((UV)RETVAL);
 
1274
    }
 
1275
    XSRETURN(1);
 
1276
}
 
1277
 
 
1278
XS(XS_Video__Capture__V4l__Audio_balance); /* prototype to pass -Wmissing-prototypes */
 
1279
XS(XS_Video__Capture__V4l__Audio_balance)
 
1280
{
 
1281
    dXSARGS;
 
1282
    if (items < 1 || items > 2)
 
1283
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::balance(s, balance=0)");
 
1284
    {
 
1285
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1286
        U16     balance;
 
1287
        U16     RETVAL;
 
1288
        dXSTARG;
 
1289
 
 
1290
        if (items < 2)
 
1291
            balance = 0;
 
1292
        else {
 
1293
            balance = (unsigned short)SvUV(ST(1));
 
1294
        }
 
1295
#line 275 "./genacc |"
 
1296
        if (items==1)
 
1297
          { RETVAL = s->balance; }
 
1298
        else
 
1299
          { s->balance = balance; }
 
1300
#line 1301 "V4l.c"
 
1301
        XSprePUSH; PUSHu((UV)RETVAL);
 
1302
    }
 
1303
    XSRETURN(1);
 
1304
}
 
1305
 
 
1306
XS(XS_Video__Capture__V4l__Audio_step); /* prototype to pass -Wmissing-prototypes */
 
1307
XS(XS_Video__Capture__V4l__Audio_step)
 
1308
{
 
1309
    dXSARGS;
 
1310
    if (items < 1 || items > 2)
 
1311
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Audio::step(s, step=0)");
 
1312
    {
 
1313
        Video__Capture__V4l__Audio      s = old_struct (ST(0), "Video::Capture::V4l::Audio");
 
1314
        U16     step;
 
1315
        U16     RETVAL;
 
1316
        dXSTARG;
 
1317
 
 
1318
        if (items < 2)
 
1319
            step = 0;
 
1320
        else {
 
1321
            step = (unsigned short)SvUV(ST(1));
 
1322
        }
 
1323
#line 287 "./genacc |"
 
1324
        if (items==1)
 
1325
          { RETVAL = s->step; }
 
1326
        else
 
1327
          { s->step = step; }
 
1328
#line 1329 "V4l.c"
 
1329
        XSprePUSH; PUSHu((UV)RETVAL);
 
1330
    }
 
1331
    XSRETURN(1);
 
1332
}
 
1333
 
 
1334
XS(XS_Video__Capture__V4l__Picture_brightness); /* prototype to pass -Wmissing-prototypes */
 
1335
XS(XS_Video__Capture__V4l__Picture_brightness)
 
1336
{
 
1337
    dXSARGS;
 
1338
    if (items < 1 || items > 2)
 
1339
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::brightness(s, brightness=0)");
 
1340
    {
 
1341
        Video__Capture__V4l__Picture    s = old_struct (ST(0), "Video::Capture::V4l::Picture");
 
1342
        U16     brightness;
 
1343
        U16     RETVAL;
 
1344
        dXSTARG;
 
1345
 
 
1346
        if (items < 2)
 
1347
            brightness = 0;
 
1348
        else {
 
1349
            brightness = (unsigned short)SvUV(ST(1));
 
1350
        }
 
1351
#line 302 "./genacc |"
 
1352
        if (items==1)
 
1353
          { RETVAL = s->brightness; }
 
1354
        else
 
1355
          { s->brightness = brightness; }
 
1356
#line 1357 "V4l.c"
 
1357
        XSprePUSH; PUSHu((UV)RETVAL);
 
1358
    }
 
1359
    XSRETURN(1);
 
1360
}
 
1361
 
 
1362
XS(XS_Video__Capture__V4l__Picture_hue); /* prototype to pass -Wmissing-prototypes */
 
1363
XS(XS_Video__Capture__V4l__Picture_hue)
 
1364
{
 
1365
    dXSARGS;
 
1366
    if (items < 1 || items > 2)
 
1367
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::hue(s, hue=0)");
 
1368
    {
 
1369
        Video__Capture__V4l__Picture    s = old_struct (ST(0), "Video::Capture::V4l::Picture");
 
1370
        U16     hue;
 
1371
        U16     RETVAL;
 
1372
        dXSTARG;
 
1373
 
 
1374
        if (items < 2)
 
1375
            hue = 0;
 
1376
        else {
 
1377
            hue = (unsigned short)SvUV(ST(1));
 
1378
        }
 
1379
#line 314 "./genacc |"
 
1380
        if (items==1)
 
1381
          { RETVAL = s->hue; }
 
1382
        else
 
1383
          { s->hue = hue; }
 
1384
#line 1385 "V4l.c"
 
1385
        XSprePUSH; PUSHu((UV)RETVAL);
 
1386
    }
 
1387
    XSRETURN(1);
 
1388
}
 
1389
 
 
1390
XS(XS_Video__Capture__V4l__Picture_colour); /* prototype to pass -Wmissing-prototypes */
 
1391
XS(XS_Video__Capture__V4l__Picture_colour)
 
1392
{
 
1393
    dXSARGS;
 
1394
    if (items < 1 || items > 2)
 
1395
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::colour(s, colour=0)");
 
1396
    {
 
1397
        Video__Capture__V4l__Picture    s = old_struct (ST(0), "Video::Capture::V4l::Picture");
 
1398
        U16     colour;
 
1399
        U16     RETVAL;
 
1400
        dXSTARG;
 
1401
 
 
1402
        if (items < 2)
 
1403
            colour = 0;
 
1404
        else {
 
1405
            colour = (unsigned short)SvUV(ST(1));
 
1406
        }
 
1407
#line 326 "./genacc |"
 
1408
        if (items==1)
 
1409
          { RETVAL = s->colour; }
 
1410
        else
 
1411
          { s->colour = colour; }
 
1412
#line 1413 "V4l.c"
 
1413
        XSprePUSH; PUSHu((UV)RETVAL);
 
1414
    }
 
1415
    XSRETURN(1);
 
1416
}
 
1417
 
 
1418
XS(XS_Video__Capture__V4l__Picture_contrast); /* prototype to pass -Wmissing-prototypes */
 
1419
XS(XS_Video__Capture__V4l__Picture_contrast)
 
1420
{
 
1421
    dXSARGS;
 
1422
    if (items < 1 || items > 2)
 
1423
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::contrast(s, contrast=0)");
 
1424
    {
 
1425
        Video__Capture__V4l__Picture    s = old_struct (ST(0), "Video::Capture::V4l::Picture");
 
1426
        U16     contrast;
 
1427
        U16     RETVAL;
 
1428
        dXSTARG;
 
1429
 
 
1430
        if (items < 2)
 
1431
            contrast = 0;
 
1432
        else {
 
1433
            contrast = (unsigned short)SvUV(ST(1));
 
1434
        }
 
1435
#line 338 "./genacc |"
 
1436
        if (items==1)
 
1437
          { RETVAL = s->contrast; }
 
1438
        else
 
1439
          { s->contrast = contrast; }
 
1440
#line 1441 "V4l.c"
 
1441
        XSprePUSH; PUSHu((UV)RETVAL);
 
1442
    }
 
1443
    XSRETURN(1);
 
1444
}
 
1445
 
 
1446
XS(XS_Video__Capture__V4l__Picture_whiteness); /* prototype to pass -Wmissing-prototypes */
 
1447
XS(XS_Video__Capture__V4l__Picture_whiteness)
 
1448
{
 
1449
    dXSARGS;
 
1450
    if (items < 1 || items > 2)
 
1451
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::whiteness(s, whiteness=0)");
 
1452
    {
 
1453
        Video__Capture__V4l__Picture    s = old_struct (ST(0), "Video::Capture::V4l::Picture");
 
1454
        U16     whiteness;
 
1455
        U16     RETVAL;
 
1456
        dXSTARG;
 
1457
 
 
1458
        if (items < 2)
 
1459
            whiteness = 0;
 
1460
        else {
 
1461
            whiteness = (unsigned short)SvUV(ST(1));
 
1462
        }
 
1463
#line 350 "./genacc |"
 
1464
        if (items==1)
 
1465
          { RETVAL = s->whiteness; }
 
1466
        else
 
1467
          { s->whiteness = whiteness; }
 
1468
#line 1469 "V4l.c"
 
1469
        XSprePUSH; PUSHu((UV)RETVAL);
 
1470
    }
 
1471
    XSRETURN(1);
 
1472
}
 
1473
 
 
1474
XS(XS_Video__Capture__V4l__Picture_depth); /* prototype to pass -Wmissing-prototypes */
 
1475
XS(XS_Video__Capture__V4l__Picture_depth)
 
1476
{
 
1477
    dXSARGS;
 
1478
    if (items < 1 || items > 2)
 
1479
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::depth(s, depth=0)");
 
1480
    {
 
1481
        Video__Capture__V4l__Picture    s = old_struct (ST(0), "Video::Capture::V4l::Picture");
 
1482
        U16     depth;
 
1483
        U16     RETVAL;
 
1484
        dXSTARG;
 
1485
 
 
1486
        if (items < 2)
 
1487
            depth = 0;
 
1488
        else {
 
1489
            depth = (unsigned short)SvUV(ST(1));
 
1490
        }
 
1491
#line 362 "./genacc |"
 
1492
        if (items==1)
 
1493
          { RETVAL = s->depth; }
 
1494
        else
 
1495
          { s->depth = depth; }
 
1496
#line 1497 "V4l.c"
 
1497
        XSprePUSH; PUSHu((UV)RETVAL);
 
1498
    }
 
1499
    XSRETURN(1);
 
1500
}
 
1501
 
 
1502
XS(XS_Video__Capture__V4l__Picture_palette); /* prototype to pass -Wmissing-prototypes */
 
1503
XS(XS_Video__Capture__V4l__Picture_palette)
 
1504
{
 
1505
    dXSARGS;
 
1506
    if (items < 1 || items > 2)
 
1507
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Picture::palette(s, palette=0)");
 
1508
    {
 
1509
        Video__Capture__V4l__Picture    s = old_struct (ST(0), "Video::Capture::V4l::Picture");
 
1510
        U16     palette;
 
1511
        U16     RETVAL;
 
1512
        dXSTARG;
 
1513
 
 
1514
        if (items < 2)
 
1515
            palette = 0;
 
1516
        else {
 
1517
            palette = (unsigned short)SvUV(ST(1));
 
1518
        }
 
1519
#line 374 "./genacc |"
 
1520
        if (items==1)
 
1521
          { RETVAL = s->palette; }
 
1522
        else
 
1523
          { s->palette = palette; }
 
1524
#line 1525 "V4l.c"
 
1525
        XSprePUSH; PUSHu((UV)RETVAL);
 
1526
    }
 
1527
    XSRETURN(1);
 
1528
}
 
1529
 
 
1530
XS(XS_Video__Capture__V4l__Tuner_tuner); /* prototype to pass -Wmissing-prototypes */
 
1531
XS(XS_Video__Capture__V4l__Tuner_tuner)
 
1532
{
 
1533
    dXSARGS;
 
1534
    if (items < 1 || items > 2)
 
1535
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::tuner(s, tuner=0)");
 
1536
    {
 
1537
        Video__Capture__V4l__Tuner      s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
 
1538
        int     tuner;
 
1539
        int     RETVAL;
 
1540
        dXSTARG;
 
1541
 
 
1542
        if (items < 2)
 
1543
            tuner = 0;
 
1544
        else {
 
1545
            tuner = (int)SvIV(ST(1));
 
1546
        }
 
1547
#line 389 "./genacc |"
 
1548
        if (items==1)
 
1549
          { RETVAL = s->tuner; }
 
1550
        else
 
1551
          { s->tuner = tuner; }
 
1552
#line 1553 "V4l.c"
 
1553
        XSprePUSH; PUSHi((IV)RETVAL);
 
1554
    }
 
1555
    XSRETURN(1);
 
1556
}
 
1557
 
 
1558
XS(XS_Video__Capture__V4l__Tuner_name); /* prototype to pass -Wmissing-prototypes */
 
1559
XS(XS_Video__Capture__V4l__Tuner_name)
 
1560
{
 
1561
    dXSARGS;
 
1562
    if (items < 1 || items > 2)
 
1563
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::name(s, name=0)");
 
1564
    {
 
1565
        Video__Capture__V4l__Tuner      s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
 
1566
        char *  name;
 
1567
        char *  RETVAL;
 
1568
        dXSTARG;
 
1569
 
 
1570
        if (items < 2)
 
1571
            name = 0;
 
1572
        else {
 
1573
            name = (char *)SvPV_nolen(ST(1));
 
1574
        }
 
1575
#line 401 "./genacc |"
 
1576
        if (items==1)
 
1577
          { RETVAL = s->name; }
 
1578
        else
 
1579
          { croak ("attribute 'name' is readonly"); }
 
1580
#line 1581 "V4l.c"
 
1581
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
 
1582
    }
 
1583
    XSRETURN(1);
 
1584
}
 
1585
 
 
1586
XS(XS_Video__Capture__V4l__Tuner_rangelow); /* prototype to pass -Wmissing-prototypes */
 
1587
XS(XS_Video__Capture__V4l__Tuner_rangelow)
 
1588
{
 
1589
    dXSARGS;
 
1590
    if (items < 1 || items > 2)
 
1591
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::rangelow(s, rangelow=0)");
 
1592
    {
 
1593
        Video__Capture__V4l__Tuner      s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
 
1594
        unsigned long   rangelow;
 
1595
        unsigned long   RETVAL;
 
1596
        dXSTARG;
 
1597
 
 
1598
        if (items < 2)
 
1599
            rangelow = 0;
 
1600
        else {
 
1601
            rangelow = (unsigned long)SvUV(ST(1));
 
1602
        }
 
1603
#line 413 "./genacc |"
 
1604
        if (items==1)
 
1605
          { RETVAL = s->rangelow; }
 
1606
        else
 
1607
          { croak ("attribute 'rangelow' is readonly"); }
 
1608
#line 1609 "V4l.c"
 
1609
        XSprePUSH; PUSHu((UV)RETVAL);
 
1610
    }
 
1611
    XSRETURN(1);
 
1612
}
 
1613
 
 
1614
XS(XS_Video__Capture__V4l__Tuner_rangehigh); /* prototype to pass -Wmissing-prototypes */
 
1615
XS(XS_Video__Capture__V4l__Tuner_rangehigh)
 
1616
{
 
1617
    dXSARGS;
 
1618
    if (items < 1 || items > 2)
 
1619
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::rangehigh(s, rangehigh=0)");
 
1620
    {
 
1621
        Video__Capture__V4l__Tuner      s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
 
1622
        unsigned long   rangehigh;
 
1623
        unsigned long   RETVAL;
 
1624
        dXSTARG;
 
1625
 
 
1626
        if (items < 2)
 
1627
            rangehigh = 0;
 
1628
        else {
 
1629
            rangehigh = (unsigned long)SvUV(ST(1));
 
1630
        }
 
1631
#line 425 "./genacc |"
 
1632
        if (items==1)
 
1633
          { RETVAL = s->rangehigh; }
 
1634
        else
 
1635
          { croak ("attribute 'rangehigh' is readonly"); }
 
1636
#line 1637 "V4l.c"
 
1637
        XSprePUSH; PUSHu((UV)RETVAL);
 
1638
    }
 
1639
    XSRETURN(1);
 
1640
}
 
1641
 
 
1642
XS(XS_Video__Capture__V4l__Tuner_flags); /* prototype to pass -Wmissing-prototypes */
 
1643
XS(XS_Video__Capture__V4l__Tuner_flags)
 
1644
{
 
1645
    dXSARGS;
 
1646
    if (items < 1 || items > 2)
 
1647
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::flags(s, flags=0)");
 
1648
    {
 
1649
        Video__Capture__V4l__Tuner      s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
 
1650
        U32     flags;
 
1651
        U32     RETVAL;
 
1652
        dXSTARG;
 
1653
 
 
1654
        if (items < 2)
 
1655
            flags = 0;
 
1656
        else {
 
1657
            flags = (unsigned long)SvUV(ST(1));
 
1658
        }
 
1659
#line 437 "./genacc |"
 
1660
        if (items==1)
 
1661
          { RETVAL = s->flags; }
 
1662
        else
 
1663
          { croak ("attribute 'flags' is readonly"); }
 
1664
#line 1665 "V4l.c"
 
1665
        XSprePUSH; PUSHu((UV)RETVAL);
 
1666
    }
 
1667
    XSRETURN(1);
 
1668
}
 
1669
 
 
1670
XS(XS_Video__Capture__V4l__Tuner_mode); /* prototype to pass -Wmissing-prototypes */
 
1671
XS(XS_Video__Capture__V4l__Tuner_mode)
 
1672
{
 
1673
    dXSARGS;
 
1674
    if (items < 1 || items > 2)
 
1675
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::mode(s, mode=0)");
 
1676
    {
 
1677
        Video__Capture__V4l__Tuner      s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
 
1678
        U16     mode;
 
1679
        U16     RETVAL;
 
1680
        dXSTARG;
 
1681
 
 
1682
        if (items < 2)
 
1683
            mode = 0;
 
1684
        else {
 
1685
            mode = (unsigned short)SvUV(ST(1));
 
1686
        }
 
1687
#line 449 "./genacc |"
 
1688
        if (items==1)
 
1689
          { RETVAL = s->mode; }
 
1690
        else
 
1691
          { s->mode = mode; }
 
1692
#line 1693 "V4l.c"
 
1693
        XSprePUSH; PUSHu((UV)RETVAL);
 
1694
    }
 
1695
    XSRETURN(1);
 
1696
}
 
1697
 
 
1698
XS(XS_Video__Capture__V4l__Tuner_signal); /* prototype to pass -Wmissing-prototypes */
 
1699
XS(XS_Video__Capture__V4l__Tuner_signal)
 
1700
{
 
1701
    dXSARGS;
 
1702
    if (items < 1 || items > 2)
 
1703
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::Tuner::signal(s, signal=0)");
 
1704
    {
 
1705
        Video__Capture__V4l__Tuner      s = old_struct (ST(0), "Video::Capture::V4l::Tuner");
 
1706
        U16     signal;
 
1707
        U16     RETVAL;
 
1708
        dXSTARG;
 
1709
 
 
1710
        if (items < 2)
 
1711
            signal = 0;
 
1712
        else {
 
1713
            signal = (unsigned short)SvUV(ST(1));
 
1714
        }
 
1715
#line 461 "./genacc |"
 
1716
        if (items==1)
 
1717
          { RETVAL = s->signal; }
 
1718
        else
 
1719
          { croak ("attribute 'signal' is readonly"); }
 
1720
#line 1721 "V4l.c"
 
1721
        XSprePUSH; PUSHu((UV)RETVAL);
 
1722
    }
 
1723
    XSRETURN(1);
 
1724
}
 
1725
 
 
1726
 
 
1727
/* INCLUDE: Returning to 'V4l.xs' from './genacc |' */
 
1728
 
 
1729
XS(XS_Video__Capture__V4l_bgr2rgb); /* prototype to pass -Wmissing-prototypes */
 
1730
XS(XS_Video__Capture__V4l_bgr2rgb)
 
1731
{
 
1732
    dXSARGS;
 
1733
    if (items != 1)
 
1734
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::bgr2rgb(fr)");
 
1735
    {
 
1736
        SV *    fr = ST(0);
 
1737
#line 570 "V4l.xs"
 
1738
{
 
1739
        u8 *data, *end;
 
1740
 
 
1741
        end = SvEND (fr);
 
1742
 
 
1743
        for (data = SvPV_nolen (fr); data < end; data += 3)
 
1744
          {
 
1745
            data[0] ^= data[2];
 
1746
            data[2] ^= data[0];
 
1747
            data[0] ^= data[2];
 
1748
          }
 
1749
}
 
1750
#line 1751 "V4l.c"
 
1751
        ST(0) = fr;
 
1752
        SvSETMAGIC(ST(0));
 
1753
    }
 
1754
    XSRETURN_EMPTY;
 
1755
}
 
1756
 
 
1757
XS(XS_Video__Capture__V4l_reduce2); /* prototype to pass -Wmissing-prototypes */
 
1758
XS(XS_Video__Capture__V4l_reduce2)
 
1759
{
 
1760
    dXSARGS;
 
1761
    if (items != 2)
 
1762
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::reduce2(fr, w)");
 
1763
    {
 
1764
        SV *    fr = ST(0);
 
1765
        UI      w = (UI)SvIV(ST(1));
 
1766
        SV *    RETVAL;
 
1767
#line 590 "V4l.xs"
 
1768
{
 
1769
        u8 *src, *dst, *end;
 
1770
 
 
1771
        src = SvPV_nolen (fr);
 
1772
        dst = SvPV_nolen (fr);
 
1773
 
 
1774
        w *= 3;
 
1775
 
 
1776
        do
 
1777
          {
 
1778
            end = src + w;
 
1779
            do
 
1780
              {
 
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++;
 
1784
                src += 3;
 
1785
                dst += 3;
 
1786
              }
 
1787
            while (src < end);
 
1788
            src = end + w;
 
1789
          }
 
1790
        while (src < (u8*)SvEND (fr));
 
1791
 
 
1792
        SvCUR_set (fr, dst - (u8*)SvPV_nolen (fr));
 
1793
}
 
1794
#line 1795 "V4l.c"
 
1795
        ST(0) = fr;
 
1796
        SvSETMAGIC(ST(0));
 
1797
    }
 
1798
    XSRETURN(1);
 
1799
}
 
1800
 
 
1801
XS(XS_Video__Capture__V4l_normalize); /* prototype to pass -Wmissing-prototypes */
 
1802
XS(XS_Video__Capture__V4l_normalize)
 
1803
{
 
1804
    dXSARGS;
 
1805
    if (items != 1)
 
1806
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::normalize(fr)");
 
1807
    {
 
1808
        SV *    fr = ST(0);
 
1809
#line 623 "V4l.xs"
 
1810
{
 
1811
        u8 mfr = 255, max = 0;
 
1812
        u8 *src, *dst, *end;
 
1813
 
 
1814
        end = SvEND (fr);
 
1815
        dst = SvPV_nolen (fr);
 
1816
 
 
1817
        for (src = SvPV_nolen (fr); src < end; src++)
 
1818
          {
 
1819
            if (*src > max) max = *src;
 
1820
            if (*src < mfr) mfr = *src;
 
1821
          }
 
1822
 
 
1823
        if (max != mfr)
 
1824
          for (src = SvPV_nolen (fr); src < end; )
 
1825
              *dst++ = ((UI)*src++ - mfr) * 255 / (max-mfr);
 
1826
}
 
1827
#line 1828 "V4l.c"
 
1828
        ST(0) = fr;
 
1829
        SvSETMAGIC(ST(0));
 
1830
    }
 
1831
    XSRETURN_EMPTY;
 
1832
}
 
1833
 
 
1834
XS(XS_Video__Capture__V4l_findmin); /* prototype to pass -Wmissing-prototypes */
 
1835
XS(XS_Video__Capture__V4l_findmin)
 
1836
{
 
1837
    dXSARGS;
 
1838
    if (items < 2 || items > 4)
 
1839
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::findmin(db, fr, start=0, count=0)");
 
1840
    SP -= items;
 
1841
    {
 
1842
        SV *    db = ST(0);
 
1843
        SV *    fr = ST(1);
 
1844
        UI      start;
 
1845
        UI      count;
 
1846
 
 
1847
        if (items < 3)
 
1848
            start = 0;
 
1849
        else {
 
1850
            start = (UI)SvIV(ST(2));
 
1851
        }
 
1852
 
 
1853
        if (items < 4)
 
1854
            count = 0;
 
1855
        else {
 
1856
            count = (UI)SvIV(ST(3));
 
1857
        }
 
1858
#line 650 "V4l.xs"
 
1859
{
 
1860
        UI diff, min = -1;
 
1861
        int mindata, data;
 
1862
        u8 *src, *dst, *end, *efr;
 
1863
        UI datasize = SvCUR (fr);
 
1864
        UI framesize = datasize + sizeof(int);
 
1865
 
 
1866
        src = SvPV_nolen (db) + start * framesize;
 
1867
        if (src < (u8*)SvPV_nolen (db) || src > (u8*)SvEND (db))
 
1868
          src = SvPV_nolen (db);
 
1869
 
 
1870
        end = src + count * framesize;
 
1871
        if (end <= src || end > (u8*)SvEND (db))
 
1872
          end = SvEND (db);
 
1873
 
 
1874
        do
 
1875
          {
 
1876
            data = *((int *)src); src += sizeof (int);
 
1877
 
 
1878
            dst = SvPV_nolen (fr);
 
1879
            efr = src + datasize;
 
1880
            diff = 0;
 
1881
 
 
1882
            do
 
1883
              {
 
1884
                int dif = (int)*src++ - (int)*dst++;
 
1885
                diff += dif*dif;
 
1886
              }
 
1887
            while (src < efr);
 
1888
 
 
1889
            if (min > diff)
 
1890
              {
 
1891
                min = diff;
 
1892
                mindata = data;
 
1893
              }
 
1894
          }
 
1895
        while (src < end);
 
1896
 
 
1897
        EXTEND (sp, 2);
 
1898
        PUSHs (sv_2mortal (newSViv (mindata)));
 
1899
        PUSHs (sv_2mortal (newSViv ((min << 8) / SvCUR (fr))));
 
1900
}
 
1901
#line 1902 "V4l.c"
 
1902
        PUTBACK;
 
1903
        return;
 
1904
    }
 
1905
}
 
1906
 
 
1907
XS(XS_Video__Capture__V4l_linreg); /* prototype to pass -Wmissing-prototypes */
 
1908
XS(XS_Video__Capture__V4l_linreg)
 
1909
{
 
1910
    dXSARGS;
 
1911
    if (items != 1)
 
1912
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::linreg(array)");
 
1913
    SP -= items;
 
1914
    {
 
1915
        SV *    array = ST(0);
 
1916
#line 697 "V4l.xs"
 
1917
{
 
1918
        AV *xy = (AV*) SvRV (array);
 
1919
        I32 i;
 
1920
        I32 n = (av_len (xy)+1)>>1;
 
1921
        double x_ = 0, y_ = 0;
 
1922
        double sxy = 0, sxx = 0, syy = 0;
 
1923
 
 
1924
        for (i=0; i<n; i++)
 
1925
          {
 
1926
            x_ += SvNV(*av_fetch(xy, i*2  ,1));
 
1927
            y_ += SvNV(*av_fetch(xy, i*2+1,1));
 
1928
          }
 
1929
 
 
1930
        x_ /= n;
 
1931
        y_ /= n;
 
1932
 
 
1933
        for (i=0; i<n; i++)
 
1934
          {
 
1935
            double x = SvNV(*av_fetch(xy, i*2  ,1));
 
1936
            double y = SvNV(*av_fetch(xy, i*2+1,1));
 
1937
 
 
1938
            sxy += (x-x_)*(y-y_);
 
1939
            sxx += (x-x_)*(x-x_);
 
1940
            syy += (y-y_)*(y-y_);
 
1941
          }
 
1942
 
 
1943
        {
 
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);
 
1948
 
 
1949
          EXTEND (sp, 3);
 
1950
          PUSHs (sv_2mortal (newSVnv (a )));
 
1951
          PUSHs (sv_2mortal (newSVnv (b )));
 
1952
          PUSHs (sv_2mortal (newSVnv (r2)));
 
1953
        }
 
1954
}
 
1955
#line 1956 "V4l.c"
 
1956
        PUTBACK;
 
1957
        return;
 
1958
    }
 
1959
}
 
1960
 
 
1961
XS(XS_Video__Capture__V4l_linreg1); /* prototype to pass -Wmissing-prototypes */
 
1962
XS(XS_Video__Capture__V4l_linreg1)
 
1963
{
 
1964
    dXSARGS;
 
1965
    if (items != 1)
 
1966
        Perl_croak(aTHX_ "Usage: Video::Capture::V4l::linreg1(array)");
 
1967
    SP -= items;
 
1968
    {
 
1969
        SV *    array = ST(0);
 
1970
#line 740 "V4l.xs"
 
1971
{
 
1972
        AV *xy = (AV*) SvRV (array);
 
1973
        I32 i;
 
1974
        I32 n = (av_len (xy)+1)>>1;
 
1975
        double c = 0;
 
1976
        double c2 = 0;
 
1977
 
 
1978
        for (i=0; i<n; i++)
 
1979
          {
 
1980
            double d = SvNV(*av_fetch(xy, i*2-1,1)) - SvNV(*av_fetch(xy, i*2,1));
 
1981
            c += d;
 
1982
          }
 
1983
 
 
1984
        c /= n;
 
1985
 
 
1986
        for (i=0; i<n; i++)
 
1987
          {
 
1988
            double d = c + SvNV(*av_fetch(xy, i*2,1)) - SvNV(*av_fetch(xy, i*2-1,1));
 
1989
            c2 += d*d;
 
1990
          }
 
1991
 
 
1992
        c2 /= n;
 
1993
 
 
1994
        EXTEND (sp, 3);
 
1995
        PUSHs (sv_2mortal (newSVnv (c)));
 
1996
        PUSHs (sv_2mortal (newSVnv (1)));
 
1997
        PUSHs (sv_2mortal (newSVnv (c2)));
 
1998
}
 
1999
#line 2000 "V4l.c"
 
2000
        PUTBACK;
 
2001
        return;
 
2002
    }
 
2003
}
 
2004
 
 
2005
#ifdef __cplusplus
 
2006
extern "C"
 
2007
#endif
 
2008
XS(boot_Video__Capture__V4l); /* prototype to pass -Wmissing-prototypes */
 
2009
XS(boot_Video__Capture__V4l)
 
2010
{
 
2011
    dXSARGS;
 
2012
    char* file = __FILE__;
 
2013
 
 
2014
    XS_VERSION_BOOTCHECK ;
 
2015
 
 
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, "$");
 
2079
 
 
2080
    /* Initialisation Section */
 
2081
 
 
2082
#line 505 "V4l.xs"
 
2083
{
 
2084
        HV *stash = gv_stashpvn("Video::Capture::V4l", 19, TRUE);
 
2085
 
 
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));
 
2142
}
 
2143
 
 
2144
#line 2145 "V4l.c"
 
2145
 
 
2146
    /* End of Initialisation Section */
 
2147
 
 
2148
    XSRETURN_YES;
 
2149
}
 
2150