File: videolib.h

package info (click to toggle)
squeak-vm 1%3A4.10.2.2614%2B20120917~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,144 kB
  • sloc: ansic: 72,193; objc: 5,494; sh: 3,061; asm: 1,533; cpp: 449; pascal: 372; makefile: 300; awk: 103; cs: 11
file content (81 lines) | stat: -rw-r--r-- 1,645 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef _VIDEOLIB_H
#define _VIDEOLIB_H

#include "palettes.h"

#include <linux/videodev.h>

typedef int BOOLEAN;
#define TRUE  1
#define FALSE 0

struct dev {
   char* deviceName;

   unsigned int desiredWidth;
   unsigned int desiredHeight;

   char desiredPalette;

   int fd;

   struct video_capability vcapability;
   struct video_window     vwindow;
   struct video_picture    vpicture;

   char *buffer;

   struct video_mbuf  memoryBuffer;
   char*              memoryMap;
   struct video_mmap* mmaps;
   int  imageSize;
   int  bufferIndex;

   char *buffer24;

   BOOLEAN forceRead;
   BOOLEAN usingMMap;

   // Bitmap conversor
   Converter converterFunction;

   // V4L2 stuff
   BOOLEAN isV4L2;
   struct v4l2_capability v4l2Capability;
};

typedef struct dev* Device;

#define SIZE_OF_DEVICE     sizeof(struct dev)

void    describeDevice(int deviceID, char* deviceName);

Device  createDevice(int deviceID,
		     int width, int height,
		     int palette);

BOOLEAN convertBufferTo24     (Device device);
BOOLEAN captureFrameFromDevice(Device device);
BOOLEAN nextFrameFromDevice   (Device device);

int getPalette(Device device);

/*
int     getBrightness(Device device);
int     getContrast  (Device device);
int     getSaturation(Device device);
int     getHue       (Device device);

void    setBrightness(Device device, int brightness);
void    setContrast  (Device device, int contrast);
void    setSaturation(Device device, int saturation);
void    setHue       (Device device, int hue);
*/
BOOLEAN updatePicture(Device device);

void    closeDevice(Device device);


void savePPM(char* fileName, Device device);

#endif