vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / media-add-ons / radeon / Theater200.h
blob3dace07769eddaf02201590c9277bde3faa51a2c
1 /******************************************************************************
3 / File: Theater200.h
5 / Description: ATI Rage Theater Video Decoder interface.
7 / Based on code from X.org
9 *******************************************************************************/
11 #ifndef __THEATER200_H__
12 #define __THEATER200_H__
14 #include "Theater.h"
15 #include "Radeon.h"
16 #include "VIPPort.h"
18 enum theater200_state
20 MODE_UNINITIALIZED,
21 MODE_INITIALIZATION_IN_PROGRESS,
22 MODE_INITIALIZED_FOR_TV_IN
25 class CTheater200 : public CTheater {
26 public:
27 CTheater200(CRadeon & radeon, int device);
29 ~CTheater200();
31 status_t InitCheck() const;
33 void Reset();
35 void SetEnable(bool enable, bool vbi);
37 void SetStandard(theater_standard standard, theater_source source);
39 void SetSize(int hactive, int vactive);
41 void SetDeinterlace(bool deinterlace);
43 void SetSharpness(int sharpness);
45 void SetBrightness(int brightness);
47 void SetContrast(int contrast);
49 void SetSaturation(int saturation);
51 void SetHue(int hue);
53 int CurrentLine();
55 // help no idea
56 void getActiveRange( theater_standard standard, CRadeonRect &rect );
58 // help no idea.
59 void getVBIRange( theater_standard standard, CRadeonRect &rect );
61 void PrintToStream();
63 private:
65 status_t DspInit();
67 status_t DspLoad( struct rt200_microc_data* microc_datap );
69 status_t DspGetMicrocode( char* micro_path,
70 char* micro_type,
71 struct rt200_microc_data* microc_datap );
73 status_t DSPLoadMicrocode( char* micro_path,
74 char* micro_type,
75 struct rt200_microc_data* microc_datap );
77 void DSPCleanMicrocode(struct rt200_microc_data* microc_datap);
79 status_t DspSendCommand( uint32 fb_scratch1, uint32 fb_scratch0 );
81 void InitTheatre();
83 int DSPDownloadMicrocode();
85 void ShutdownTheatre();
87 // in accelerant?
88 void ResetTheatreRegsForNoTVout();
89 void ResetTheatreRegsForTVout();
91 int32 DspSetVideostreamformat(int32 format);
92 int32 DspGetSignalLockStatus();
93 int32 DspAudioMute(int8 left, int8 right);
94 int32 DspSetAudioVolume(int8 left, int8 right, int8 auto_mute);
95 int32 DspConfigureI2SPort(int8 tx_mode, int8 rx_mode, int8 clk_mode);
96 int32 DspConfigureSpdifPort(int8 state);
98 // does nothing now
99 void SetClock(theater_standard standard, radeon_video_clock clock){;};
101 // source not correct values for PAL NTSC etc...
102 void SetADC(theater_standard standard, theater_source source);
104 // does nothing now
105 void SetHSYNC(theater_standard standard){;};
107 void WaitHSYNC();
109 // does nothing now
110 void SetVSYNC(theater_standard standard){;};
112 void WaitVSYNC();
114 // does nothing now
115 void SetSyncGenerator(theater_standard standard){;};
117 // does nothing now
118 void SetCombFilter(theater_standard standard, theater_source source){;};
120 // does nothing now
121 void SetLuminanceProcessor(theater_standard standard){;};
123 void SetLuminanceLevels(theater_standard standard, int brightness, int contrast);
125 // does nothing now
126 void SetChromaProcessor(theater_standard standard);
128 void SetChromaLevels(theater_standard standard, int saturation, int hue);
130 // does nothing now
131 void SetClipWindow(theater_standard standard, bool vbi);
133 // um, help
134 void SetScaler(theater_standard standard, int hactive, int vactive, bool deinterlace);
136 public:
137 int ReadFifo(uint32 address, uint8 *buffer);
139 int WriteFifo(uint32 address, uint32 count, uint8 *buffer);
141 private:
142 theater200_state fMode;
143 char* microcode_path;
144 char* microcode_type;
147 #endif