vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / media-add-ons / radeon / Capture.h
blobe737eab31ae85f1b07ac2720348e398f37e66497
1 /******************************************************************************
3 / File: Capture.h
5 / Description: ATI Radeon Capture Unit interface.
7 / Copyright 2001, Carlos Hasan
9 *******************************************************************************/
11 #ifndef __CAPTURE_H__
12 #define __CAPTURE_H__
14 #include "Radeon.h"
16 enum capture_buffer_mode {
17 C_RADEON_CAPTURE_FIELD_SINGLE = 0,
18 C_RADEON_CAPTURE_FIELD_DOUBLE = 1,
19 C_RADEON_CAPTURE_BOB_SINGLE = 2,
20 C_RADEON_CAPTURE_BOB_DOUBLE = 3,
21 C_RADEON_CAPTURE_WEAVE_SINGLE = 4,
22 C_RADEON_CAPTURE_WEAVE_DOUBLE = 5
25 enum capture_stream_format {
26 C_RADEON_CAPTURE_BROOKTREE = 0,
27 C_RADEON_CAPTURE_CCIR656 = 1,
28 C_RADEON_CAPTURE_ZOOMVIDEO = 2,
29 C_RADEON_CAPTURE_VIP = 3
32 enum capture_interrupt_mask {
33 C_RADEON_CAPTURE_BUF0_INT = 1 << 0,
34 C_RADEON_CAPTURE_BUF0_EVEN_INT = 1 << 1,
35 C_RADEON_CAPTURE_BUF1_INT = 1 << 2,
36 C_RADEON_CAPTURE_BUF1_EVEN_INT = 1 << 3,
37 C_RADEON_CAPTURE_VBI0_INT = 1 << 4,
38 C_RADEON_CAPTURE_VBI1_INT = 1 << 5
41 class CCapture {
42 public:
43 CCapture(CRadeon & radeon);
45 ~CCapture();
47 status_t InitCheck() const;
49 void SetBuffer(capture_stream_format format, capture_buffer_mode mode,
50 int offset0, int offset1, int size, int pitch);
52 void SetClip(int left, int top, int right, int bottom);
54 void SetVBIBuffer(int offset0, int offset1, int size);
56 void SetVBIClip(int left, int top, int right, int bottom);
58 void Start(bool vbi = false);
60 void Stop();
62 public:
63 void SetInterrupts(bool enable);
65 int WaitInterrupts(int * sequence, bigtime_t * when, bigtime_t timeout);
67 private:
68 int Register(radeon_register index, int mask);
70 void SetRegister(radeon_register index, int value);
72 void SetRegister(radeon_register index, int mask, int value);
74 private:
75 CRadeon & fRadeon;
76 capture_buffer_mode fMode;
77 capture_stream_format fFormat;
78 int fOffset0;
79 int fOffset1;
80 int fVBIOffset0;
81 int fVBIOffset1;
82 int fSize;
83 int fVBISize;
84 int fPitch;
85 CRadeonRect fClip;
86 CRadeonRect fVBIClip;
89 #endif