static Audio* getInstance();
// static void setInstance(Audio* );
- virtual int init(UCHAR streamType)=0;
+ virtual int init(u1 streamType)=0;
virtual int shutdown()=0;
- virtual int setStreamType(UCHAR streamType)=0;
+ virtual int setStreamType(u1 streamType)=0;
virtual int setChannel()=0;
virtual int setSource()=0;
virtual int sync()=0;
int doMuting();
// Audio stream type // FIXME these are MVP specific (probably!)
- const static UCHAR MPEG2_PES = 2;
- const static UCHAR MPEG1_PES = 3; // unused
- const static UCHAR MP3 = 0; //media player
+ const static u1 MPEG2_PES = 2;
+ const static u1 MPEG1_PES = 3; // unused
+ const static u1 MP3 = 0; //media player
#ifdef DEV
virtual int test()=0;
protected:
static Audio* instance;
int initted;
- UCHAR userMute;
- UCHAR systemMute;
- UCHAR muted;
+ u1 userMute;
+ u1 systemMute;
+ u1 muted;
int volume;
audio_volume Aoffset;
{
}
-int AudioOMX::init(UCHAR tstreamType) {
+int AudioOMX::init(u1 tstreamType) {
if (initted)
return 0;
initted = 1;
unMute();
decompress_buffer_size=20000;
- decompress_buffer=static_cast<UCHAR*>(malloc(decompress_buffer_size));
+ decompress_buffer=static_cast<u1*>(malloc(decompress_buffer_size));
decompress_buffer_filled=0;
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100)
return OMX_ErrorNone;
}
-int AudioOMX::setStreamType(UCHAR /* type */)
+int AudioOMX::setStreamType(u1 /* type */)
{
if (!initted) return 0;
}
#endif
-unsigned int AudioOMX::AdvanceMpAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize)
+unsigned int AudioOMX::AdvanceMpAudioSync(const u1 *data,unsigned int size,unsigned int *framesize)
{
if (size<=2) return size; // silly;
unsigned int atest=0;
return size;
}
-unsigned int AudioOMX::AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize)
+unsigned int AudioOMX::AdvanceAc3AudioSync(const u1 *data,unsigned int size,unsigned int *framesize)
{
if (size<=4) return size; // silly;
const int frm_size_tab[] = { 64, 64, 80, 80, 96, 96, 112, 112, 128, 128,
return size;
}
-unsigned int AudioOMX::AdvanceAacLatmAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize)
+unsigned int AudioOMX::AdvanceAacLatmAudioSync(const u1 *data,unsigned int size,unsigned int *framesize)
{
if (size<=4) return size; // silly;
unsigned int atest=0;
packet = mplist.front();
}
-u4 AudioOMX::DeliverMediaSample(UCHAR* buffer, u4* samplepos) {
+u4 AudioOMX::DeliverMediaSample(u1* buffer, u4* samplepos) {
DeliverMediaPacket(packet, buffer, samplepos);
if (*samplepos == packet.length) {
*samplepos = 0;
}
-u4 AudioOMX::DeliverMediaPacket(MediaPacket mpacket, const UCHAR* buffer,
+u4 AudioOMX::DeliverMediaPacket(MediaPacket mpacket, const u1* buffer,
u4 *samplepos) {
/*First Check, if we have an audio sample*/
VideoOMX* vw = static_cast<VideoOMX*>(Video::getInstance());
AudioOMX();
virtual ~AudioOMX();
- int init(UCHAR streamType);
+ int init(u1 streamType);
int shutdown();
- int setStreamType(UCHAR streamType);
+ int setStreamType(u1 streamType);
int setChannel();
int setSource();
int sync();
//Writing Data to Audiodevice
virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos);
- virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos);
- u4 DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer,u4 *samplepos);
+ virtual u4 DeliverMediaSample(u1* buffer, u4 *samplepos);
+ u4 DeliverMediaPacket(MediaPacket packet, const u1* buffer,u4 *samplepos);
virtual long long SetStartOffset(long long curreftime, bool *rsync);
virtual void ResetTimeOffsets();
virtual bool DrainTargetBufferFull();
- UCHAR getLastAType() {return lastAType;}
+ u1 getLastAType() {return lastAType;}
bool loadOptionsFromServer(VDR* vdr);
bool saveOptionstoServer();
private:
int initAllParams();
- UCHAR streamType;
- UCHAR lastAType;
+ u1 streamType;
+ u1 lastAType;
bool firstsynched;
MediaPacket packet;
- unsigned int AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize);
- unsigned int AdvanceAacLatmAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize);
- unsigned int AdvanceMpAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize);
+ unsigned int AdvanceAc3AudioSync(const u1 *data,unsigned int size,unsigned int *framesize);
+ unsigned int AdvanceAacLatmAudioSync(const u1 *data,unsigned int size,unsigned int *framesize);
+ unsigned int AdvanceMpAudioSync(const u1 *data,unsigned int size,unsigned int *framesize);
void ReturnEmptyOMXBuffer(OMX_BUFFERHEADERTYPE* bulibaver);
SwrContext* resam_con_libav;
- UCHAR * decompress_buffer;
+ u1 * decompress_buffer;
unsigned int decompress_buffer_size;
unsigned int decompress_buffer_filled;
bool lsync;
return playerRunnig;
}
-int AudioPlayer::setRequestedState(UCHAR rstate) {
+int AudioPlayer::setRequestedState(u1 rstate) {
int rt=0;
threadLock();
requestState=rstate;
}
-UCHAR AudioPlayer::getState() {
- UCHAR rt=0;
+u1 AudioPlayer::getState() {
+ u1 rt=0;
threadLock();
rt=state;
threadUnlock();
return rt;
}
-void AudioPlayer::setState(UCHAR s) {
+void AudioPlayer::setState(u1 s) {
threadLock();
state=s;
threadUnlock();
rt=MediaPlayer::getInstance()->getMediaInfo(2,&mi);
canPosition=mi.canPosition;
u4 rsize=0;
- UCHAR *idbuf=NULL;
+ u1 *idbuf=NULL;
if (canPosition) {
rt=MediaPlayer::getInstance()->getMediaBlock(2,0,demuxer->headerBytes(),&rsize,&idbuf);
}
}
//method called by the playing thread to handle
//"commands" by the frontend
-UCHAR AudioPlayer::checkState()
+u1 AudioPlayer::checkState()
{
threadLock();
- UCHAR rstate=requestState;
- UCHAR cstate=state;
+ u1 rstate=requestState;
+ u1 cstate=state;
int rseq=requestedSequence;
int cseq=sequence;
int fseq=playSequence;
int retrycount=0;
while(1)
{
- UCHAR cstate=checkState();
+ u1 cstate=checkState();
if (! running) {
break;
}
virtual void call(void * caller);
- UCHAR getState() ;
+ u1 getState() ;
- const static UCHAR S_PLAY = 1;
- const static UCHAR S_PAUSE = 2;
- const static UCHAR S_POSITION = 3;
+ const static u1 S_PLAY = 1;
+ const static u1 S_PAUSE = 2;
+ const static u1 S_POSITION = 3;
//player finished a song - no reset, next will follow
- const static UCHAR S_DONE=5;
- const static UCHAR S_STOP = 6;
- const static UCHAR S_ERROR = 8;
- const static UCHAR S_FF = 9;
- const static UCHAR S_BACK = 10;
+ const static u1 S_DONE=5;
+ const static u1 S_STOP = 6;
+ const static u1 S_ERROR = 8;
+ const static u1 S_FF = 9;
+ const static u1 S_BACK = 10;
//message parameters for frontend messages
const static u4 CONNECTION_LOST=1;
int feederState;
//synchronized get/set methods for states
- int setRequestedState(UCHAR st);
- void setState(UCHAR st);
+ int setRequestedState(u1 st);
+ void setState(u1 st);
//to be called from within the thread
- UCHAR checkState();
+ u1 checkState();
//variables used by the thread
u4 thisWrite;
u4 thisRead;
bool running;
- UCHAR *threadBuffer;
- UCHAR state;
- UCHAR requestState;
+ u1 *threadBuffer;
+ u1 state;
+ u1 requestState;
u8 streampos;
u8 lenInBytes;
u8 bytesWritten;
}
-int AudioWin::init(UCHAR tstreamType)
+int AudioWin::init(u1 tstreamType)
{
if (initted) return 0;
initFilterDatabase();
return 0; //write(fdAudio, buf, len);
}
-int AudioWin::setStreamType(UCHAR type)
+int AudioWin::setStreamType(u1 type)
{
((VideoWin*)VideoWin::getInstance())->setAudioStreamType(type);
aud_type=type;
return true;
}
-u4 AudioWin::DeliverMediaSample(UCHAR* buffer, u4 *samplepos)
+u4 AudioWin::DeliverMediaSample(u1* buffer, u4 *samplepos)
{
DeliverMediaPacket(mediapacket, buffer, samplepos);
if (*samplepos == mediapacket.length) {
}
u4 AudioWin::DeliverMediaPacket(const MediaPacket packet,
- UCHAR* buffer,
+ u1* buffer,
u4 *samplepos)
{
AudioWin();
~AudioWin();
- int init(UCHAR streamType);
+ int init(u1 streamType);
int shutdown();
- int setStreamType(UCHAR streamType);
+ int setStreamType(u1 streamType);
int setChannel();
int setSource();
int sync();
// Writing Data to Audiodevice
virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos);
- virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos);
- u4 DeliverMediaPacket(MediaPacket packet, UCHAR* buffer, u4 *samplepos);
+ virtual u4 DeliverMediaSample(u1* buffer, u4 *samplepos);
+ u4 DeliverMediaPacket(MediaPacket packet, u1* buffer, u4 *samplepos);
int dsInitAudioFilter(IGraphBuilder* dsgraphbuilder);
const AudioFilterDescList *getAudioFilterList(int &selected);
int mp3audiofilterselected;
bool firstsynched;
long winvolume;
- UCHAR aud_type;
+ u1 aud_type;
#ifdef DEV
int test();
#endif
windowh=575;
}
-Palette::Palette(UCHAR tBpp)
+Palette::Palette(u1 tBpp)
{
numColours = 0;
setBpp(tBpp);
}
-void Palette::argb2yrba(u4 argb, UCHAR& y, UCHAR& cr, UCHAR& cb, UCHAR& a)
+void Palette::argb2yrba(u4 argb, u1& y, u1& cr, u1& cb, u1& a)
{
- a = static_cast<UCHAR>((argb & 0xFF000000) >> 24);
+ a = static_cast<u1>((argb & 0xFF000000) >> 24);
int r = (argb & 0x00FF0000) >> 16;
int g = (argb & 0x0000FF00) >> 8;
int b = (argb & 0x000000FF);
- y = static_cast<UCHAR>((1052*r + 2065*g + 401*b + 4096*16 + 2048) / 4096);
- cr = static_cast<UCHAR>((1799*r - 1508*g - 291*b + 4096*128 + 2048) / 4096);
- cb = static_cast<UCHAR>((-608*r - 1191*g + 1799*b + 4096*128 + 2048) / 4096);
+ y = static_cast<u1>((1052*r + 2065*g + 401*b + 4096*16 + 2048) / 4096);
+ cr = static_cast<u1>((1799*r - 1508*g - 291*b + 4096*128 + 2048) / 4096);
+ cb = static_cast<u1>((-608*r - 1191*g + 1799*b + 4096*128 + 2048) / 4096);
}
-u4 Palette::yrba2argb(UCHAR y, UCHAR cr, UCHAR cb, UCHAR a)
+u4 Palette::yrba2argb(u1 y, u1 cr, u1 cb, u1 a)
{
int r, g, b;
r = (4769*(y-16) + 6537*(cr-128) + 2048) / 4096;
return (a << 24) + (r << 16) + (g << 8) + b;
}
-void Palette::setBpp(UCHAR tBpp)
+void Palette::setBpp(u1 tBpp)
{
bpp = tBpp;
if (bpp > MAX_DEPTH) bpp = MAX_DEPTH;
A.resize(maxColours,255);
}
-void Palette::setColour(UCHAR index, u4 tColour)
+void Palette::setColour(u1 index, u4 tColour)
{
if (index >= maxColours) return;
if (index >= numColours) numColours = index + 1;
argb2yrba(tColour, Y[index], Cr[index], Cb[index], A[index]);
}
-void Palette::setYCrCbA(UCHAR index, UCHAR tY, UCHAR tCr, UCHAR tCb, UCHAR tA)
+void Palette::setYCrCbA(u1 index, u1 tY, u1 tCr, u1 tCb, u1 tA)
{
if (index >= maxColours) return;
if (index >= numColours) numColours = index + 1;
colour[index] = yrba2argb(tY, tCr, tCb, tA);
}
-Bitmap::Bitmap(u4 tWidth, u4 tHeight, UCHAR tBpp)
+Bitmap::Bitmap(u4 tWidth, u4 tHeight, u1 tBpp)
{
setSize(tWidth, tHeight);
palette.setBpp(tBpp);
bitmap.assign(width * height, 0);
}
-bool Bitmap::setIndex(u4 x, u4 y, UCHAR index)
+bool Bitmap::setIndex(u4 x, u4 y, u1 index)
{
if (x <= width && y <= height)
{
else return false;
}
-UCHAR Bitmap::getIndex(u4 x, u4 y) const
+u1 Bitmap::getIndex(u4 x, u4 y) const
{
if (x > width || y > height)
return 0;
return palette.getColour(bitmap[x + y*width]);
}
-void Bitmap::setAllIndices(UCHAR index)
+void Bitmap::setAllIndices(u1 index)
{
bitmap.assign(width * height, index);
}
class Palette
{
public:
- Palette(UCHAR tBpp = 8);
- UCHAR getBpp() const { return bpp; }
+ Palette(u1 tBpp = 8);
+ u1 getBpp() const { return bpp; }
void reset() { numColours = 0; }
- void setBpp(UCHAR tBpp);
- u4 getColour(UCHAR index) const { return index < maxColours ? colour[index] : 0; }
- void setColour(UCHAR index, u4 tColour);
- void setYCrCbA(UCHAR index, UCHAR tY, UCHAR tCr, UCHAR tCb, UCHAR tA);
+ void setBpp(u1 tBpp);
+ u4 getColour(u1 index) const { return index < maxColours ? colour[index] : 0; }
+ void setColour(u1 index, u4 tColour);
+ void setYCrCbA(u1 index, u1 tY, u1 tCr, u1 tCb, u1 tA);
const std::vector<u4>& getColourVector() const { return colour; }
- const std::vector<UCHAR>& getYVector() const { return Y; }
- const std::vector<UCHAR>& getCrVector() const { return Cr; }
- const std::vector<UCHAR>& getCbVector() const { return Cb; }
- const std::vector<UCHAR>& getAVector() const { return A; }
+ const std::vector<u1>& getYVector() const { return Y; }
+ const std::vector<u1>& getCrVector() const { return Cr; }
+ const std::vector<u1>& getCbVector() const { return Cb; }
+ const std::vector<u1>& getAVector() const { return A; }
u4 getNumColours() const { return numColours; }
private:
const static u4 MAX_DEPTH = 8;
std::vector<u4> colour;
- std::vector<UCHAR> Y;
- std::vector<UCHAR> Cr;
- std::vector<UCHAR> Cb;
- std::vector<UCHAR> A;
- UCHAR bpp;
+ std::vector<u1> Y;
+ std::vector<u1> Cr;
+ std::vector<u1> Cb;
+ std::vector<u1> A;
+ u1 bpp;
u4 maxColours, numColours;
- void argb2yrba(u4 argb, UCHAR& y, UCHAR& cr, UCHAR& cb, UCHAR& a);
- u4 yrba2argb(UCHAR y, UCHAR cr, UCHAR cb, UCHAR a);
+ void argb2yrba(u4 argb, u1& y, u1& cr, u1& cb, u1& a);
+ u4 yrba2argb(u1 y, u1 cr, u1 cb, u1 a);
};
class Bitmap
{
private:
- std::vector<UCHAR> bitmap;
+ std::vector<u1> bitmap;
u4 width, height;
public:
- Bitmap(u4 tWidth = 0, u4 tHeight = 0, UCHAR tBpp = 8);
+ Bitmap(u4 tWidth = 0, u4 tHeight = 0, u1 tBpp = 8);
Palette palette;
u4 getWidth() const { return width; }
u4 getHeight() const { return height; }
- UCHAR getIndex(u4 x, u4 y) const;
+ u1 getIndex(u4 x, u4 y) const;
u4 getColour(u4 x, u4 y) const;
- const std::vector<UCHAR> & rawData() const { return bitmap; }
+ const std::vector<u1> & rawData() const { return bitmap; }
void setSize(u4 tWidth, u4 tHeight);
- bool setIndex(u4 x, u4 y, UCHAR index);
- void setAllIndices(UCHAR index);
+ bool setIndex(u4 x, u4 y, u1 index);
+ void setAllIndices(u1 index);
};
#endif
else if (surface) surface->drawJpeg(fileName, x, y, width, height);
}
-void Boxx::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour)
+void Boxx::drawMonoBitmap(u1* base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour)
{
if (parent) parent->drawMonoBitmap(base, area.x +dx, area.y + dy, height, width, nextColour);
else if (surface) surface->drawMonoBitmap(base, dx,dy, height, width, nextColour);
void drawJpeg(const char *fileName,int x, int y,int *width, int *height);
void drawTTChar(int ox, int oy,int x, int y, cTeletextChar c);
- void drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour);
+ void drawMonoBitmap(u1*base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour);
/* This is for system which need a locking of the drawing surface to speed up drawing */
void startFastDraw();
int index{-1};
u4 number{};
u4 type{};
- UCHAR vstreamtype{2}; //Mpeg2
+ u1 vstreamtype{2}; //Mpeg2
std::string name;
u4 vpid{};
#ifndef DEFINES_H
#define DEFINES_H
-typedef unsigned char UCHAR;
-
#include <stdint.h>
typedef int8_t i1;
class NALUUnit {
public:
- NALUUnit(const UCHAR* buf,u4 length_buf);
+ NALUUnit(const u1* buf,u4 length_buf);
~NALUUnit();
inline u4 getBits(u4 num_bits);
int getPos(){return pos;};
protected:
- UCHAR* nalu_buf;
+ u1* nalu_buf;
u4 nalu_length;
u4 pos;
- UCHAR bit_pos;
- UCHAR working_byte;
+ u1 bit_pos;
+ u1 working_byte;
u4 last_bytes;
bool eonalu;
};
-NALUUnit::NALUUnit(const UCHAR *buf, u4 length_buf)
+NALUUnit::NALUUnit(const u1 *buf, u4 length_buf)
{
nalu_length=0;
nalu_buf=NULL;
nalu_end=std::min(length_buf-1,nalu_end);
if (nalu_end <= nalu_start) return; // input buffer too small. corrupt data? ignore.
nalu_length=nalu_end-nalu_start;
- nalu_buf=(UCHAR*)malloc(nalu_length);
+ nalu_buf=(u1*)malloc(nalu_length);
memcpy(nalu_buf,buf+nalu_start,nalu_length);
pos=1;
}
PESPacket::PESPacket()
{
data_size = PESPacket_initial_size;
- data = (UCHAR*)malloc(data_size);
+ data = (u1*)malloc(data_size);
data[0] = 0x00;
data[1] = 0x00;
data[2] = 0x01;
substream = packet.substream;
seq_header = packet.seq_header;
data_size = size;
- data = (UCHAR*)malloc(data_size);
+ data = (u1*)malloc(data_size);
memcpy(data, packet.data, data_size);
}
-void PESPacket::init(UCHAR type, UCHAR sub)
+void PESPacket::init(u1 type, u1 sub)
{
length = 0;
size = 6;
-int PESPacket::write(const UCHAR *buf, int len)
+int PESPacket::write(const u1 *buf, int len)
{
u4 new_data_size = std::max(data_size + data_size / 2, data_size + len);
if (new_data_size > 0x10000) new_data_size = 0x10000;
data_size = new_data_size;
- data = (UCHAR*)realloc(data, data_size);
+ data = (u1*)realloc(data, data_size);
}
memcpy(data + size, buf, len);
length += len;
else return PTS_INVALID;
}
-UCHAR PESPacket::operator[] (u4 index) const
+u1 PESPacket::operator[] (u4 index) const
{
if (index >= size)
return 0;
bool Demuxer::submitPacket(PESPacket& packet)
{
u4 sent = 0;
- UCHAR packet_type = packet.getPacketType();
- const UCHAR* packetdata = packet.getData();
+ u1 packet_type = packet.getPacketType();
+ const u1* packetdata = packet.getData();
if (packet_type >= PESTYPE_VID0 && packet_type <= PESTYPE_VIDMAX)
{
if (video_current == -1) video_current = packet_type;
avail_mpaudchan[packet_type - PESTYPE_AUD0] = true;
if (audio_current == packet_type && !aud_seeking)
{
- UCHAR type=MPTYPE_MPEG_AUDIO;
+ u1 type=MPTYPE_MPEG_AUDIO;
switch (astreamtype)
{
case 3:
}
}
-u4 Demuxer::stripAudio(UCHAR* buf, u4 len)
+u4 Demuxer::stripAudio(u1* buf, u4 len)
{
u4 read_pos = 0, write_pos = 0;
u4 pattern, packet_length;
return write_pos;
}
-void Demuxer::changeTimes(UCHAR* buf, u4 len,u4 playtime)
+void Demuxer::changeTimes(u1* buf, u4 len,u4 playtime)
{
u4 pattern, packet_length;
u4 read_pos = 0;
}
-bool Demuxer::scanForVideo(UCHAR* buf, u4 len, bool &ish264)
+bool Demuxer::scanForVideo(u1* buf, u4 len, bool &ish264)
{
u4 pos = 3;
u4 pattern;
PESPacket(const PESPacket& packet);
PESPacket& operator=(const PESPacket& packet);
~PESPacket();
- void init(UCHAR type, UCHAR sub = 0);
+ void init(u1 type, u1 sub = 0);
void truncate();
- int write(const UCHAR* buf, int len);
+ int write(const u1* buf, int len);
- UCHAR operator[] (u4 index) const;
+ u1 operator[] (u4 index) const;
// return data[index] if in bounds, else 0
// so no proper error condition but never mind for now
- const UCHAR* getData() const { return data; }
+ const u1* getData() const { return data; }
u4 getLength() const { return length; }
u4 getSize() const { return size; }
- UCHAR getPacketType() const { return packetType; }
- void setSubstream(UCHAR s) { substream = s; }
- UCHAR getSubstream() const { return substream; }
+ u1 getPacketType() const { return packetType; }
+ void setSubstream(u1 s) { substream = s; }
+ u1 getSubstream() const { return substream; }
u8 getPTS() const;
bool hasPTS() const { return (getPTS() != PTS_INVALID); }
protected:
void copyFrom(const PESPacket& packet);
- UCHAR * data;
+ u1 * data;
u4 length, size;
u4 data_size;
- UCHAR packetType;
- UCHAR substream;
+ u1 packetType;
+ u1 substream;
u4 mutable seq_header; // 0 = no, 1 = unknown, else = header offset
};
bool writeVideo(bool * dataavail=NULL);
bool writeTeletext(bool * dataavail=NULL);
- virtual int scan(UCHAR* buf, int len) = 0;
- virtual int findPTS(UCHAR* buf, int len, u8* dest) = 0;
- virtual int put(UCHAR* buf, int len) = 0;
+ virtual int scan(u1* buf, int len) = 0;
+ virtual int findPTS(u1* buf, int len, u8* dest) = 0;
+ virtual int put(u1* buf, int len) = 0;
virtual void setFrameNum(u4 /* frame */) {}
virtual void setPacketNum(u4 /* packet */) {}
virtual u4 getFrameNumFromPTS(u8 /* pts */) { return 0; }
int getHorizontalSize() { return horizontal_size; }
int getVerticalSize() { return vertical_size; }
- UCHAR getAspectRatio(int *tparx,int *tpary) {
+ u1 getAspectRatio(int *tparx,int *tpary) {
*tparx=parx; *tpary=pary;return aspect_ratio; }
int getFrameRate() { return frame_rate; }
int getBitRate() { return bit_rate; }
u8 getVideoPTS() { return video_pts; }
u8 getAudioPTS() { return audio_pts; }
- enum AspectRatio : UCHAR
+ enum AspectRatio : u1
{
ASPECT_1_1 = 1,
ASPECT_4_3 = 2,
// Remove all data from a buffer apart from video PES packets.
// Returns the length of the reduced data.
// removed *static function*, due to DemuxerTS
- virtual u4 stripAudio(UCHAR* buf, u4 len);
- void changeTimes(UCHAR* buf, u4 len,u4 playtime);
+ virtual u4 stripAudio(u1* buf, u4 len);
+ void changeTimes(u1* buf, u4 len,u4 playtime);
// Scan a buffer to see if video packets are present.
// Returns true if video exists; false if not.
// removed *static function* for h264 detection
- static bool scanForVideo(UCHAR* buf, u4 len, bool &ish264);
+ static bool scanForVideo(u1* buf, u4 len, bool &ish264);
enum PESTYPE
{
class PacketBuffer {
public:
- PacketBuffer(Stream *as,UCHAR strtype) {
+ PacketBuffer(Stream *as,u1 strtype) {
log=Log::getInstance();
audio=as;
streamtype=strtype;
newStream();
}
//just handle the data (do not deal with headers)
- int putInternal(UCHAR* buf,int len,unsigned int &packetnum);
+ int putInternal(u1* buf,int len,unsigned int &packetnum);
void reset(){
partPacket=0;
bytesWritten=0;
reset();
}
bool doSkip();
- UCHAR store[DemuxerAudio::PACKET_SIZE]; // Storage for partial packets
+ u1 store[DemuxerAudio::PACKET_SIZE]; // Storage for partial packets
int partPacket; // Length of partial packet stored from previous put()
int bytesWritten; //if they are !=0 and != framelength the stream is full...
int framelen;
Log * log;
Stream * audio;
- UCHAR streamtype;
+ u1 streamtype;
//global counters
u4 numpackets;
u4 numbytes;
isStarting=true;
}
-int DemuxerAudio::scan(UCHAR *buf, int len)
+int DemuxerAudio::scan(u1 *buf, int len)
{
//no differend pids here
return 0;
/*11*/ {-1,-1,-1}};
//max 7 char!
-static const char * mpegString(UCHAR code) {
+static const char * mpegString(u1 code) {
switch(code) {
case 0:
return "MPEG2.5";
return "UNKNOWN";
}
-static const char * layerString(UCHAR code) {
+static const char * layerString(u1 code) {
switch(code) {
case 0:
return "Layer reserved";
*/
#define MAXLEN(tagtype) ((u4)frameLen<sizeof(tag->tagtype)-1?(u4)frameLen:sizeof(tag->tagtype)-1)
-bool DemuxerAudio::fillId3Tag(id3_tag * tag,UCHAR * frameData, int frameLen, int dataOffset, bool v23) {
+bool DemuxerAudio::fillId3Tag(id3_tag * tag,u1 * frameData, int frameLen, int dataOffset, bool v23) {
int tl=v23?4:3;
int tagIndex=-1;
if (tag == NULL) return false;
}
}
if (tagIndex < 0) return false;
- UCHAR encoding=*(frameData+dataOffset);
+ u1 encoding=*(frameData+dataOffset);
dataOffset++;
frameLen--;
if (encoding != 0) {
break;
case 3: //genre
{
- UCHAR * st=frameData+dataOffset;
+ u1 * st=frameData+dataOffset;
int genre=0;
if (*st=='(') {
genre=atoi((const char *)(st+1)) && 31;
- st=(UCHAR *)id3_1_genre[genre];
+ st=(u1 *)id3_1_genre[genre];
}
strncpy(tag->genre,(char*)st,MAXLEN(genre));
tag->genre[MAXLEN(genre)]=0;
* otherwise the id3 info is filled
*/
-int DemuxerAudio::parseID3V2(UCHAR *data, int len) {
+int DemuxerAudio::parseID3V2(u1 *data, int len) {
int debug=0;
- UCHAR * start=data;
+ u1 * start=data;
id3_header id3header;
id3_frame id3frame;
id3_tag * id3tag=NULL;
len-=id3header.extended_header.size+extended_hdr_hdr;
}
//set the end of the header
- UCHAR * eob=start+id3header.size+10;
+ u1 * eob=start+id3header.size+10;
bool readNext=true;
while (data < eob && readNext)
{
*/
#define MEMCPY(type,len,offset) {int type##max=sizeof(tag->type)-1<len?sizeof(tag->type)-1:len;strncpy(tag->type,(char*)&data[offset],type##max);tag->type[type##max]=0;}
-int DemuxerAudio::parseID3V1(UCHAR *data, int len) {
+int DemuxerAudio::parseID3V1(u1 *data, int len) {
int debug=1;
if (len < 128) return -1;
if(data[0]=='T' && data[1]=='A' && data[2]=='G')
}
//infos from http://www.multiweb.cz/twoinches/MP3inside.htm
-int DemuxerAudio::parseVBR(UCHAR *data, int len) {
- UCHAR *hdr=findHeader(data,len);
+int DemuxerAudio::parseVBR(u1 *data, int len) {
+ u1 *hdr=findHeader(data,len);
//we expect the header exactly here
if (hdr != data) return -1;
const static char * VBRHDR="Xing";
int vbridpos=36;
- UCHAR mpgtype=(data[1] & 0x18)>>3;
- UCHAR chmode=(data[2] & 0xc0) >> 6;
- UCHAR layer=(data[2] & 0x06) >>1;
+ u1 mpgtype=(data[1] & 0x18)>>3;
+ u1 chmode=(data[2] & 0xc0) >> 6;
+ u1 layer=(data[2] & 0x06) >>1;
if ( mpgtype == 3 && chmode == 11) vbridpos=21;
if ( mpgtype != 3 && chmode != 11) vbridpos=21;
if ( mpgtype != 3 && chmode == 11) vbridpos=13;
-UCHAR * DemuxerAudio::findHeader(UCHAR *buf, int len, bool writeInfo) {
+u1 * DemuxerAudio::findHeader(u1 *buf, int len, bool writeInfo) {
while (len >= 3) //assume hdr+crc
{
- UCHAR pattern=*buf;
+ u1 pattern=*buf;
buf++; len--;
if (pattern != HDRBYTE1 ) continue;
if ((*buf & HDRBYTE2MASK) != HDRBYTE2) continue;
-int DemuxerAudio::readHeader(UCHAR * hbuf,int len,bool writeInfo) {
+int DemuxerAudio::readHeader(u1 * hbuf,int len,bool writeInfo) {
int curFramelen=0;
int curBitrate=0;
int curSamplingRate=0;
if (*hbuf != HDRBYTE1) return -1;
hbuf++;
if ((*hbuf & HDRBYTE2MASK) != HDRBYTE2) return -1;
- UCHAR mpgtype=(*hbuf & 0x18)>>3;
+ u1 mpgtype=(*hbuf & 0x18)>>3;
if (mpgtype == 1) {
log->log("DemuxerAudio",Log::DEBUG,"header invalid mpgtype %s %i %i %i",
mpegString(mpgtype),*hbuf,*(hbuf+1),*(hbuf+2));
return 1;
}
- UCHAR layer=(*hbuf & 0x06) >>1;
+ u1 layer=(*hbuf & 0x06) >>1;
//bool hasCRC=!(*hbuf & 1);
hbuf++;
- UCHAR bitrateCode=(*hbuf & 0xf0) >>4;
- UCHAR samplingCode=(*hbuf & 0x0c) >> 2;
+ u1 bitrateCode=(*hbuf & 0xf0) >>4;
+ u1 samplingCode=(*hbuf & 0x0c) >> 2;
bool padding=*hbuf & 0x02;
hbuf++;
//0 Stereo, 1 JointStereo, 2 Dual, 3 Mono
- UCHAR chmode=(*hbuf & 0xc0) >> 6;
- //UCHAR extension=(*hbuf & 0x30) >> 4;
+ u1 chmode=(*hbuf & 0xc0) >> 6;
+ //u1 extension=(*hbuf & 0x30) >> 4;
//layercode: 1-L3, 2-L2, 3-L1
//columns 0,1,2 for MPEG1
- UCHAR bitrateColumn=3-layer;
+ u1 bitrateColumn=3-layer;
if (bitrateColumn > 2) {
log->log("DemuxerAudio",Log::DEBUG,"header invalid layer %s %i %i %i",
layerString(layer),*(hbuf-2),*(hbuf-1),*hbuf);
if (mpgtype != 3) bitrateColumn+=3;
if (bitrateColumn>4) bitrateColumn=4;
curBitrate=1000*bitrateTable[bitrateCode][bitrateColumn];
- UCHAR sampleRateColumn=0;
+ u1 sampleRateColumn=0;
if (mpgtype == 10) sampleRateColumn=1;
if (mpgtype == 0) sampleRateColumn=2;
curSamplingRate=samplingRateTable[samplingCode][sampleRateColumn];
return 0;
}
-int DemuxerAudio::findPTS(UCHAR* buf, int len, u8* dest)
+int DemuxerAudio::findPTS(u1* buf, int len, u8* dest)
{
//we have no PTS number ...
*dest=0;
}
// just handle the real stream without dealing with the header
-int PacketBuffer::putInternal(UCHAR * wbuf, int len,unsigned int &packetnum)
+int PacketBuffer::putInternal(u1 * wbuf, int len,unsigned int &packetnum)
{
/* Important, the type passed to stream must be a mediapacket type as defined in
Draintarget.h and not the device setting of the mvp, so we have to translate it here,
in order to get it working on windows
--MR */
- UCHAR mptype=0;
+ u1 mptype=0;
switch (streamtype) {
case Audio::MPEG1_PES: //?
case Audio::MPEG2_PES: //Important, this must be a PES !
more intelligent then we are...
We only loose a correct position display.
*/
-int DemuxerAudio::put(UCHAR* wbuf, int len)
+int DemuxerAudio::put(u1* wbuf, int len)
{
//return audiostream.put(wbuf,len,streamtype);
int framelen=PACKET_SIZE;
- UCHAR *hdr;
+ u1 *hdr;
int bytesConsumed=0;
int oldBytes=0;
if (tmpFill != 0 || (buffer->bufferEmpty() && len < HDRLEN)) {
return vbr;
}
-int DemuxerAudio::checkStart(UCHAR *b, int len) {
- UCHAR *start=b;
+int DemuxerAudio::checkStart(u1 *b, int len) {
+ u1 *start=b;
int id3len=parseID3V2(b,len);
if (id3len > 0) {
char * str=id3->toString();
b+=vbrlen;
len-=vbrlen;
}
- UCHAR * hdr=findHeader(b,len,true);
+ u1 * hdr=findHeader(b,len,true);
if (hdr == NULL) return -1;
return hdr-start;
}
-int DemuxerAudio::checkID3(UCHAR *b, int len) {
+int DemuxerAudio::checkID3(u1 *b, int len) {
if (len != 128) return -1;
int rt=parseID3V1(b,len);
if (rt >= 0) {
u4 numFrames;
u4 numBytes;
u4 fileSeconds;
- UCHAR table[100];
+ u1 table[100];
} vbrInfo;
DemuxerAudio(int p_vID = 0, int p_aID = 0);
virtual ~DemuxerAudio();
virtual void flush();
virtual void reset();
- virtual int scan(UCHAR* buf, int len);
- virtual int findPTS(UCHAR* buf, int len, u8* dest);
+ virtual int scan(u1* buf, int len);
+ virtual int findPTS(u1* buf, int len, u8* dest);
virtual void setVID(int p_vID);
virtual void setAID(int p_aID,int type);
- virtual int put(UCHAR* buf, int len);
+ virtual int put(u1* buf, int len);
//special functions for the audioplayer
bool isSync() ;
//will return the offset in buffer where the first valid
//header was found (with potentially skipping ID3 and VBR)
//return -1 if nothing found
- int checkStart(UCHAR * buffer, int len);
+ int checkStart(u1 * buffer, int len);
//check for ID3V1 (at the end)
//return 0 if found
- int checkID3(UCHAR * buffer, int len);
+ int checkID3(u1 * buffer, int len);
//return length if we can do this
//otherwise return 0
//try to read the iD3 tag value (V2xx) and
//fill it into the ID3 store
- bool fillId3Tag(id3_tag * tag,UCHAR * frameData, int frameLen, int dataOffset, bool v23);
+ bool fillId3Tag(id3_tag * tag,u1 * frameData, int frameLen, int dataOffset, bool v23);
const static u4 PACKET_SIZE=4096;
private:
*/
Log * log;
- int readHeader(UCHAR* buf, int len, bool writeInfo=false);
+ int readHeader(u1* buf, int len, bool writeInfo=false);
//info flags for the player
bool inSync; //set if we read a valid header
//search for the start of a header
//return NULL if none found
- UCHAR * findHeader(UCHAR * buf, int len, bool writeInfo=false);
+ u1 * findHeader(u1 * buf, int len, bool writeInfo=false);
//we need a buffer to be able to read at least a complete header
const static int HDRLEN=4;
- UCHAR tmpBuffer[PACKET_SIZE+HDRLEN];
+ u1 tmpBuffer[PACKET_SIZE+HDRLEN];
u4 tmpFill;
//compute the bytes/second from the BR info
//parse ID3V2 at the beginning
//set info if there
//return length of header, -1 if not found
- int parseID3V2(UCHAR *data, int len);
+ int parseID3V2(u1 *data, int len);
int id3_2_3_FrameParse(unsigned char buf[], id3_frame *frame);
int id3_2_2_FrameParse(unsigned char buf[], id3_frame *frame);
//parse ID3V1 at the end
//set info if there, return -1 otherwise
- int parseID3V1(UCHAR *data, int len) ;
+ int parseID3V1(u1 *data, int len) ;
//parse a VBR header and set VBR info
//input has to point to firts MPEG header in file
//potentially after ID3V2
- int parseVBR(UCHAR *data, int len);
+ int parseVBR(u1 *data, int len);
class PacketBuffer* buffer;
Demuxer::flush();
}
-int DemuxerMedia::scan(UCHAR *buf, int len)
+int DemuxerMedia::scan(u1 *buf, int len)
{
int ret = 0;
int astate=0; //hdrbyte
return ret;
}
-int DemuxerMedia::findPTS(UCHAR* buf, int len, u8* dest)
+int DemuxerMedia::findPTS(u1* buf, int len, u8* dest)
{
// nobody uses this
// No PTS found.
Log::getInstance()->log("Demuxer", Log::DEBUG, "setPacketNum %d", npacket);
}
-int DemuxerMedia::put(UCHAR* buf, int len)
+int DemuxerMedia::put(u1* buf, int len)
{
int ret = 0; // return number of bytes consumed
if (submitting)
//find a sequence header backward
//search for 00 00 01 <video> backwards
-u8 DemuxerMedia::findLastPTS(UCHAR *buffer, u4 len) {
+u8 DemuxerMedia::findLastPTS(u1 *buffer, u4 len) {
PESPacket pack;
int pstate=4;
u4 minlen=12;
if (len < minlen) return 0;
- UCHAR *curpos=buffer+len-minlen;
- UCHAR *packend=buffer+len;
+ u1 *curpos=buffer+len-minlen;
+ u1 *packend=buffer+len;
while ((curpos - pstate) > buffer) {
switch (pstate){
case 4:
DemuxerMedia();
void reset();
void flush();
- int scan(UCHAR* buf, int len);
- int findPTS(UCHAR* buf, int len, u8* dest);
- int put(UCHAR* buf, int len);
+ int scan(u1* buf, int len);
+ int findPTS(u1* buf, int len, u8* dest);
+ int put(u1* buf, int len);
void setFrameNum(u4 frame);
void setPacketNum(u4 npacket);
u4 getFrameNumFromPTS(u8 pts) {return 0;}
u4 getPacketNum();
u8 getLenPTS();
u8 getCurrentPTS();
- u8 findLastPTS(UCHAR *buf, u4 len);
+ u8 findLastPTS(u1 *buf, u4 len);
private:
int state;
pinfo.hasaccessunit=false;
}
-int DemuxerTS::scan(UCHAR* /*buf*/, int /*len*/)
+int DemuxerTS::scan(u1* /*buf*/, int /*len*/)
{
switch (atype)
{
-int DemuxerTS::findPTS(UCHAR* buf, int len, u8* dest)
+int DemuxerTS::findPTS(u1* buf, int len, u8* dest)
{
int scanaid=0;
int datalen = TS_SIZE - 4;
int pid = ( (buf[1] & 0x1F) << 8 ) | buf[2];
- UCHAR payload = buf[1] & 0x40;
+ u1 payload = buf[1] & 0x40;
if (buf[3] & 0x20) // Adaptation field is present
datalen -= (buf[4] + 1);
- UCHAR* curbuf =buf+ (TS_SIZE - datalen);
+ u1* curbuf =buf+ (TS_SIZE - datalen);
if (payload) {
LogNT::getInstance()->debug("DemuxerTS", "setPacketNum {}", npacket);
}
-int DemuxerTS::put(UCHAR* buf, int len)
+int DemuxerTS::put(u1* buf, int len)
{
int ret = 0; // return number of bytes consumed
}
-int DemuxerTS::processTS(UCHAR* buf)
+int DemuxerTS::processTS(u1* buf)
{
int datalen = TS_SIZE - 4;
int pid = ( (buf[1] & 0x1F) << 8 ) | buf[2];
- UCHAR payload = buf[1] & 0x40;
+ u1 payload = buf[1] & 0x40;
if (buf[3] & 0x20) // Adaptation field is present
if (submitPacket(*packet) == 0) return 0;
parsed = false;
packet->truncate();
- packet->write((UCHAR*)"\200\000\000", 3);
+ packet->write((u1*)"\200\000\000", 3);
packet->write(buf, datalen);
}
}
}
-bool DemuxerTS::scanForVideo(UCHAR* buf, u4 len, bool &ish264)
+bool DemuxerTS::scanForVideo(u1* buf, u4 len, bool &ish264)
{
int pmtpidy=0;
int datalen = TS_SIZE - 4;
int pid = ( (buf[1] & 0x1F) << 8 ) | buf[2];
- UCHAR payload = buf[1] & 0x40;
+ u1 payload = buf[1] & 0x40;
if (buf[3] & 0x20) // Adaptation field is present
datalen -= (buf[4] + 1);
- UCHAR* curbuf =buf+ (TS_SIZE - datalen);
+ u1* curbuf =buf+ (TS_SIZE - datalen);
if (payload) {
if (pid == 0x00) {//PAT, only take first program number, ignore the rest
return false;
}
-u4 DemuxerTS::stripAudio(UCHAR* buf, u4 len) //it has to be adapted
+u4 DemuxerTS::stripAudio(u1* buf, u4 len) //it has to be adapted
{
//This function strips all TS Headers and non video payload
u4 readpos=0;
int datalen = TS_SIZE - 4;
int pid = ( (buf[readpos+1] & 0x1F) << 8 ) | buf[readpos+2];
- UCHAR payload = buf[readpos+1] & 0x40;
+ u1 payload = buf[readpos+1] & 0x40;
if (buf[readpos+3] & 0x20) { // Adaptation field is present
datalen -= (buf[readpos+4] + 1);
}
memcpy(buf+writepos,destpaket.getData(),destpaket.getSize());
writepos+=destpaket.getSize();
destpaket.truncate();
- destpaket.write((UCHAR*)"\200\000\000", 3);
+ destpaket.write((u1*)"\200\000\000", 3);
destpaket.write(buf+readpos,towrite);
}
public:
DemuxerTS(int p_vID = 0, int p_aID = 0, int p_subID = 0, int p_tID = 0);
void flush();
- int scan(UCHAR* buf, int len);
- int findPTS(UCHAR* buf, int len, u8* dest);
+ int scan(u1* buf, int len);
+ int findPTS(u1* buf, int len, u8* dest);
void setVID(int p_vID);
void setTID(int p_tID);
void setAID(int p_aID, int type, int streamtype,bool slivetv);
int getTID() { return tID; }
int getAID() { return aID; }
int getSubID() { return subID; }
- int put(UCHAR* buf, int len);
+ int put(u1* buf, int len);
void setFrameNum(u4 frame);
void setPacketNum(u4 npacket);
u4 getFrameNumFromPTS(u8 pts);
u4 getPacketNum();
- u4 stripAudio(UCHAR* buf, u4 len);
- static bool scanForVideo(UCHAR* buf, u4 len, bool &ish264);
+ u4 stripAudio(u1* buf, u4 len);
+ static bool scanForVideo(u1* buf, u4 len, bool &ish264);
Channel *getChannelInfo() {return &channelinfo;};
private:
- int processTS(UCHAR* buf);
+ int processTS(u1* buf);
- UCHAR store[TS_SIZE]; // Storage for partial packets
+ u1 store[TS_SIZE]; // Storage for partial packets
int partPacket; // Length of partial packet stored from previous put()
bool parsed; // Whether PES packet to be submitted has been parsed yet
PESPacket vPacket; // Video PES packet under construction
Demuxer::flush();
}
-int DemuxerVDR::scan(UCHAR *buf, int len) {
+int DemuxerVDR::scan(u1 *buf, int len) {
// Temporarily, just look for the lowest audio stream and return it
- UCHAR HiByte = PESTYPE_AUDMAX;
+ u1 HiByte = PESTYPE_AUDMAX;
int ret = 0;
while (len >= 4) {
return ret;
}
-int DemuxerVDR::findPTS(UCHAR* buf, int len, u8* dest) {
+int DemuxerVDR::findPTS(u1* buf, int len, u8* dest) {
while (len >= 14) {
u4 pattern = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
buf++;
LogNT::getInstance()->debug(TAG, "setPacketNum {}", npacket);
}
-int DemuxerVDR::put(UCHAR* buf, int len)
+int DemuxerVDR::put(u1* buf, int len)
{
int ret = 0; // return number of bytes consumed
if (submitting)
void DemuxerVDR::dealWithSubtitlePacket()
{
- const UCHAR* data = packet.getData();
+ const u1* data = packet.getData();
u4 packetSize = packet.getSize();
if (packetSize < 9) return;
u4 payloadOffset = data[8] + 9;
subtitlePacket.write(&data[payloadOffset+4], packetSize-payloadOffset-4);
}
- const UCHAR* sub_data = subtitlePacket.getData();
+ const u1* sub_data = subtitlePacket.getData();
u4 subSize = subtitlePacket.getSize();
while (subtitlePacketPosition < subSize)
{
u4 payload_begin = packet[8] + 9;
if (packet.getSize() > payload_begin)
{
- UCHAR substream_type = packet[payload_begin] & 0xF0;
+ u1 substream_type = packet[payload_begin] & 0xF0;
if (substream_type == 0x20) // Subtitles
{
dealWithSubtitlePacket();
DemuxerVDR();
void reset();
void flush();
- int scan(UCHAR* buf, int len);
- int findPTS(UCHAR* buf, int len, u8* dest);
- int put(UCHAR* buf, int len);
+ int scan(u1* buf, int len);
+ int findPTS(u1* buf, int len, u8* dest);
+ int put(u1* buf, int len);
void setFrameNum(u4 frame);
void setPacketNum(u4 npacket);
u4 getFrameNumFromPTS(u8 pts);
u4 pos_buffer; //position in stream buffer
u4 length; //length of the packet
// The fields below are not needed by the MVP
- UCHAR type;
+ u1 type;
u8 pts;
u8 dts;
bool synched;
// processed from packet X (usually zero).
// It is allowed, that the draintarget modifies the part of the buffer, which belongs
// to the mediapackets it is processing.
- virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos)=0;
+ virtual u4 DeliverMediaSample(u1* buffer, u4 *samplepos)=0;
// The drain target might advice the feeder about free buffers with threadSignal
0xFF55557F, 0xFF7F557F, 0xFF557F7F, 0xFF7F7F7F, // 1111 1100
};
-void DVBSubtitleCLUT::setEntry(int bpp, u4 index, UCHAR Y, UCHAR Cr, UCHAR Cb, UCHAR T)
+void DVBSubtitleCLUT::setEntry(int bpp, u4 index, u1 Y, u1 Cr, u1 Cb, u1 T)
{
- UCHAR Y2 = Y;
- UCHAR A;
+ u1 Y2 = Y;
+ u1 A;
if (Y2 == 0) { Y2 = 16; A = 0; } else A = 255 - T;
switch (bpp)
{
serviceAcquired(false)
{}
-void DVBSubtitlePage::setState(UCHAR s)
+void DVBSubtitlePage::setState(u1 s)
{
state = s;
if (state == 1) // Acquisition point - page refresh
{
private:
u4 objectID;
- UCHAR nonModColourFlag;
+ u1 nonModColourFlag;
struct RegionRef
{
DVBSubtitleRegion* region;
};
typedef std::vector<struct RegionRef> UseList;
UseList useList;
- UCHAR map2to4[4];
- UCHAR map2to8[4];
- UCHAR map4to8[16];
+ u1 map2to4[4];
+ u1 map2to8[4];
+ u1 map4to8[16];
void initMapTables();
- UCHAR* currentMapTable;
+ u1* currentMapTable;
u4 bitPos;
- void drawLine(const RegionRef& use, u4 x, u4 y, UCHAR colour, u4 len);
- UCHAR get2Bits(const UCHAR* data, u4& index);
- UCHAR get4Bits(const UCHAR* data, u4& index);
- bool decode2BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y);
- bool decode4BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y);
- bool decode8BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y);
+ void drawLine(const RegionRef& use, u4 x, u4 y, u1 colour, u4 len);
+ u1 get2Bits(const u1* data, u4& index);
+ u1 get4Bits(const u1* data, u4& index);
+ bool decode2BppCodeString(const u1* data, u4& index, const struct RegionRef& use, u4& x, u4 y);
+ bool decode4BppCodeString(const u1* data, u4& index, const struct RegionRef& use, u4& x, u4 y);
+ bool decode8BppCodeString(const u1* data, u4& index, const struct RegionRef& use, u4& x, u4 y);
public:
DVBSubtitleObject(u4 id = 0);
- void setNonModColourFlag(UCHAR flag) { nonModColourFlag = flag; }
+ void setNonModColourFlag(u1 flag) { nonModColourFlag = flag; }
void findWhereUsed(DVBSubtitlePage&);
- void decodeSubBlock(const UCHAR* data, u4 length, bool even);
+ void decodeSubBlock(const u1* data, u4 length, bool even);
};
DVBSubtitleObject::DVBSubtitleObject(u4 id)
}
void DVBSubtitleObject::drawLine(const RegionRef& use, u4 x, u4 y,
- UCHAR colour, u4 len)
+ u1 colour, u4 len)
{
if (nonModColourFlag && colour == 1) return;
x += use.horizontalPosition;
use.region->setIndex(pos, y, colour);
}
-UCHAR DVBSubtitleObject::get2Bits(const UCHAR* data, u4& index)
+u1 DVBSubtitleObject::get2Bits(const u1* data, u4& index)
{
- UCHAR result = data[index];
+ u1 result = data[index];
if (!bitPos)
{
index++;
return (result >> bitPos) & 0x03;
}
-UCHAR DVBSubtitleObject::get4Bits(const UCHAR* data, u4& index)
+u1 DVBSubtitleObject::get4Bits(const u1* data, u4& index)
{
- UCHAR result = data[index];
+ u1 result = data[index];
if (!bitPos)
{
index++;
return result & 0x0F;
}
-bool DVBSubtitleObject::decode2BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
+bool DVBSubtitleObject::decode2BppCodeString(const u1* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
{
u4 rl = 0, colour = 0;
- UCHAR code = get2Bits(data, index);
+ u1 code = get2Bits(data, index);
if (code)
{
colour = code;
return true;
}
-bool DVBSubtitleObject::decode4BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
+bool DVBSubtitleObject::decode4BppCodeString(const u1* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
{
u4 rl = 0, colour = 0;
- UCHAR code = get4Bits(data, index);
+ u1 code = get4Bits(data, index);
if (code)
{
colour = code;
return true;
}
-bool DVBSubtitleObject::decode8BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
+bool DVBSubtitleObject::decode8BppCodeString(const u1* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
{
u4 rl = 0, colour = 0;
- UCHAR code = data[index++];
+ u1 code = data[index++];
if (code)
{
colour = code;
return true;
}
-void DVBSubtitleObject::decodeSubBlock(const UCHAR* data, u4 length, bool even)
+void DVBSubtitleObject::decodeSubBlock(const u1* data, u4 length, bool even)
{
UseList::const_iterator use;
for (use = useList.begin(); use != useList.end(); ++use)
bool DVBSubtitles::decodePacket(const PESPacket& packet)
{
- const UCHAR* data = packet.getData();
+ const u1* data = packet.getData();
u4 packetSize = packet.getSize();
if (packetSize < 9) return false;
u4 segmentOffset = data[8] + 11;
if (data[segmentOffset] == 0xFF) return true; // 'End of PES' marker
if (data[segmentOffset] != 0x0F) return false; // Out of sync
if (packetSize <= segmentOffset + 5) return false; // Packet truncated
- UCHAR segmentType = data[segmentOffset + 1];
+ u1 segmentType = data[segmentOffset + 1];
u4 pageID = (data[segmentOffset + 2] << 8)
+ data[segmentOffset + 3];
u4 segmentLength = (data[segmentOffset + 4] << 8)
if (pageOnDisplay == 65536) pageOnDisplay = pageID;
if (pageOnDisplay != pageID) return false;
if (packetSize <= segmentOffset + 5 + segmentLength) return false;
- const UCHAR* segmentData = &data[segmentOffset + 6];
+ const u1* segmentData = &data[segmentOffset + 6];
pages[pageID]; // Create this page if it doesn't exist
PageMap::iterator pageEntry = pages.find(pageID);
if (pageEntry == pages.end()) return false;
if (segmentLength < 2) break;
page.setState((segmentData[1] & 0x0C) >> 2);
if (!page.serviceAcquired) break;
- UCHAR pageVersion = (segmentData[1] & 0xF0) >> 4;
+ u1 pageVersion = (segmentData[1] & 0xF0) >> 4;
if (pageVersion == page.version) break; // No update
page.version = pageVersion;
page.timeout = segmentData[0];
u4 parsePos = 2;
while (segmentLength > parsePos + 5)
{
- UCHAR regionID = segmentData[parsePos];
+ u1 regionID = segmentData[parsePos];
page.regions[regionID]; // Create the region if it doesn't exist
DVBSubtitlePage::Coords coords;
coords.x = (segmentData[parsePos + 2] << 8) +
case 0x11: // Region composition
{
if (segmentLength < 10) break;
- UCHAR regionID = segmentData[0];
+ u1 regionID = segmentData[0];
page.regions[regionID]; // Create the region if it doesn't exist
DVBSubtitlePage::RegionMap::iterator regionEntry;
regionEntry = page.regions.find(regionID);
if (regionEntry == page.regions.end()) return false;
DVBSubtitleRegion& region = regionEntry->second;
- UCHAR regionVersion = (segmentData[1] & 0xF0) >> 4;
+ u1 regionVersion = (segmentData[1] & 0xF0) >> 4;
if (regionVersion == region.version) break; // No update
region.version = regionVersion;
bool regionFillFlag = (segmentData[1] & 0x08) >> 3;
case 0x12: // CLUT definition
{
if (segmentLength < 2) break;
- UCHAR CLUTid = segmentData[0];
+ u1 CLUTid = segmentData[0];
DVBSubtitlePage::CLUTMap::iterator clutEntry;
clutEntry = page.CLUTs.find(CLUTid);
if (clutEntry == page.CLUTs.end()) return false;
DVBSubtitleCLUT& clut = clutEntry->second;
clut.CLUTid = CLUTid;
- UCHAR clutVersion = (segmentData[1] & 0xF0) >> 4;
+ u1 clutVersion = (segmentData[1] & 0xF0) >> 4;
if (clutVersion == clut.version) break; // No update
clut.version = clutVersion;
u4 parsePos = 2;
while (segmentLength > parsePos + 3)
{
- UCHAR clutEntryID = segmentData[parsePos];
+ u1 clutEntryID = segmentData[parsePos];
bool fullRangeFlag = segmentData[parsePos + 1] & 0x01;
- UCHAR Y, Cr, Cb, T;
+ u1 Y, Cr, Cb, T;
if (fullRangeFlag)
{
if (segmentLength <= parsePos + 5) break;
Cb = (segmentData[parsePos + 3] & 0x3C) << 2;
T = (segmentData[parsePos + 3] & 0x03) << 6;
}
- UCHAR entryFlags = segmentData[parsePos + 1];
+ u1 entryFlags = segmentData[parsePos + 1];
if (entryFlags & 0x80) clut.setEntry(2, clutEntryID, Y,Cr,Cb,T);
if (entryFlags & 0x40) clut.setEntry(4, clutEntryID, Y,Cr,Cb,T);
if (entryFlags & 0x20) clut.setEntry(8, clutEntryID, Y,Cr,Cb,T);
u4 objectID = (segmentData[0] << 8) + segmentData[1];
DVBSubtitleObject object(objectID);
object.findWhereUsed(page);
- UCHAR codingMethod = (segmentData[2] & 0x0C) >> 2;
+ u1 codingMethod = (segmentData[2] & 0x0C) >> 2;
object.setNonModColourFlag(segmentData[2] & 0x01);
if (codingMethod == 0x00) // Coding of pixels
{
{
public:
DVBSubtitleCLUT();
- UCHAR CLUTid;
- UCHAR version;
- void setEntry(int bpp, u4 index, UCHAR Y, UCHAR Cr, UCHAR Cb, UCHAR T);
+ u1 CLUTid;
+ u1 version;
+ void setEntry(int bpp, u4 index, u1 Y, u1 Cr, u1 Cb, u1 T);
const Palette& getPalette(int bpp) const;
private:
Palette palette2;
{
public:
DVBSubtitleRegion();
- UCHAR version;
- UCHAR level;
- UCHAR CLUTid;
+ u1 version;
+ u1 level;
+ u1 CLUTid;
void setDepth(u4);
struct ObjectRef
{
DVBSubtitlePage();
u8 pts;
bool dirty;
- UCHAR version;
+ u1 version;
u4 timeout;
- UCHAR state;
+ u1 state;
bool serviceAcquired;
- typedef std::map<UCHAR, DVBSubtitleCLUT> CLUTMap;
+ typedef std::map<u1, DVBSubtitleCLUT> CLUTMap;
CLUTMap CLUTs;
- typedef std::map<UCHAR, DVBSubtitleRegion> RegionMap;
+ typedef std::map<u1, DVBSubtitleRegion> RegionMap;
RegionMap regions;
struct Coords { u4 x; u4 y; };
- typedef std::map<UCHAR, Coords> DisplayMap;
+ typedef std::map<u1, Coords> DisplayMap;
DisplayMap currentDisplay;
DisplayMap pendingDisplay;
- void setState(UCHAR s);
+ void setState(u1 s);
void updateRegionPalettes(const DVBSubtitleCLUT&);
};
public:
DVBSubtitleDisplayDefinition();
- UCHAR version;
+ u1 version;
bool displaywindow;
};
// Set up the common variables
Image image;
bool free_it = false;
- UCHAR* imageData{};
+ u1* imageData{};
u4 length{};
}
// the real entry for receiving data
-int ImageReader::getImageChunk(u8 offset,u4 len, u4 * rsize, UCHAR **buffer){
+int ImageReader::getImageChunk(u8 offset,u4 len, u4 * rsize, u1 **buffer){
logger->log("ImageReader", Log::DEBUG, "request chunk offset=%llu, len=%u",offset,len);
threadLock();
*buffer=NULL;
//rsize will return the received len: 0 on EOF, -1 on error
//the returned buffer has to be freed outside (really use free!)
//if the buffer is not filled it will wait until the chunk is received!
- int getImageChunk(u8 offset,u4 len, u4 * rsize,UCHAR **buffer);
+ int getImageChunk(u8 offset,u4 len, u4 * rsize,u1 **buffer);
//is the reader still running?
bool isReaderRunning();
class Chunk{
public:
- UCHAR * buffer; //receive buffer (to be deallocated with free)
+ u1 * buffer; //receive buffer (to be deallocated with free)
u8 offset; //offset within stream/file
u4 reqlen; //requested len
u4 len; //received len
InitHWCListwithDefaults();
}
-UCHAR Input::TranslateHWC(HWC_TYPE code)
+u1 Input::TranslateHWC(HWC_TYPE code)
{
- UCHAR ret = TranslateHWCFixed(code);
+ u1 ret = TranslateHWCFixed(code);
if (ret != NA_UNKNOWN) // Found in fixed list
{
return TranslateHWCList(code);
}
-UCHAR Input::TranslateHWCList(HWC_TYPE code)
+u1 Input::TranslateHWCList(HWC_TYPE code)
{
if (learnMode != NOLEARNMODE)
{
- setHWCtoCommand(code, static_cast<UCHAR>(learnMode));
+ setHWCtoCommand(code, static_cast<u1>(learnMode));
InputMan::getInstance()->cancelLearnMode();
return NA_LEARN;
}
}
}
-void Input::setHWCtoCommand(HWC_TYPE hcw, UCHAR command)
+void Input::setHWCtoCommand(HWC_TYPE hcw, u1 command)
{
translist[hcw] = command;
}
u4 ul1, ul2;
u4 uc;
if (sscanf(keytrans, "%lXI%lXK%lX", &ul1, &ul2, &uc) == 3) {
- translist[((u8) ul1) | ((u8) ul2) << 32] = (UCHAR) uc;
+ translist[((u8) ul1) | ((u8) ul2) << 32] = (u1) uc;
}
delete[] keytrans;
}
MessageQueue::getInstance()->postMessage(m);
}
-std::string Input::getAllHardwareKeyNamesAssignedToVompKey(UCHAR vompKey)
+std::string Input::getAllHardwareKeyNamesAssignedToVompKey(u1 vompKey)
{
std::string keyNames;
keyNames.reserve(50);
class VDR;
-typedef std::map<HWC_TYPE, UCHAR> RemoteTranslationList;
+typedef std::map<HWC_TYPE, u1> RemoteTranslationList;
class Input: public AbstractOption
{
static void sendInputKey(int key);
- void setHWCtoCommand(HWC_TYPE hcw, UCHAR command);
+ void setHWCtoCommand(HWC_TYPE hcw, u1 command);
void unsetHWC(HWC_TYPE hcw);
void LoadKeysConfig(VDR* vdr, const char* keynum);
void SaveKeysConfig();
virtual void changePowerState(bool /* poweron */) {}; //informs the remote control, that about vomp's power state, this is important e.g. for cec
virtual void InitHWCListwithDefaults()=0;
- std::string getAllHardwareKeyNamesAssignedToVompKey(UCHAR vompKey);
- char* CommandTranslateStr(UCHAR command);
- void EnterLearnMode(UCHAR /* command */ ) {}; // Override and set lernMode to command
+ std::string getAllHardwareKeyNamesAssignedToVompKey(u1 vompKey);
+ char* CommandTranslateStr(u1 command);
+ void EnterLearnMode(u1 /* command */ ) {}; // Override and set lernMode to command
void cancelLearnMode() { learnMode = NOLEARNMODE; }
void ResetToDefault();
virtual std::string getHardwareKeyName(HWC_TYPE hardwareKey) = 0;
const static u4 NOLEARNMODE = 256;
// Not buttons
- const static UCHAR NA_LEARN = 101;
- const static UCHAR NA_NONE = 98;
- const static UCHAR NA_UNKNOWN = 99;
+ const static u1 NA_LEARN = 101;
+ const static u1 NA_NONE = 98;
+ const static u1 NA_UNKNOWN = 99;
// Problem common buttons
- const static UCHAR VOLUMEUP = 16;
- const static UCHAR VOLUMEDOWN = 17;
- const static UCHAR CHANNELUP = 32;
- const static UCHAR CHANNELDOWN = 33;
+ const static u1 VOLUMEUP = 16;
+ const static u1 VOLUMEDOWN = 17;
+ const static u1 CHANNELUP = 32;
+ const static u1 CHANNELDOWN = 33;
// Common buttons
- const static UCHAR ZERO = 0;
- const static UCHAR ONE = 1;
- const static UCHAR TWO = 2;
- const static UCHAR THREE = 3;
- const static UCHAR FOUR = 4;
- const static UCHAR FIVE = 5;
- const static UCHAR SIX = 6;
- const static UCHAR SEVEN = 7;
- const static UCHAR EIGHT = 8;
- const static UCHAR NINE = 9;
- const static UCHAR POWER = 61;
- const static UCHAR GO = 59;
- const static UCHAR BACK = 31;
- const static UCHAR MENU = 13;
- const static UCHAR RED = 11;
- const static UCHAR GREEN = 46;
- const static UCHAR YELLOW = 56;
- const static UCHAR BLUE = 41;
- const static UCHAR MUTE = 15;
- const static UCHAR RADIO = 12; // The unlabelled button on old
- const static UCHAR REVERSE = 50;
- const static UCHAR PLAY = 53;
- const static UCHAR FORWARD = 52;
- const static UCHAR RECORD = 55;
- const static UCHAR STOP = 54;
- const static UCHAR PAUSE = 48;
- const static UCHAR SKIPBACK = 36;
- const static UCHAR SKIPFORWARD = 30;
- const static UCHAR OK = 37;
+ const static u1 ZERO = 0;
+ const static u1 ONE = 1;
+ const static u1 TWO = 2;
+ const static u1 THREE = 3;
+ const static u1 FOUR = 4;
+ const static u1 FIVE = 5;
+ const static u1 SIX = 6;
+ const static u1 SEVEN = 7;
+ const static u1 EIGHT = 8;
+ const static u1 NINE = 9;
+ const static u1 POWER = 61;
+ const static u1 GO = 59;
+ const static u1 BACK = 31;
+ const static u1 MENU = 13;
+ const static u1 RED = 11;
+ const static u1 GREEN = 46;
+ const static u1 YELLOW = 56;
+ const static u1 BLUE = 41;
+ const static u1 MUTE = 15;
+ const static u1 RADIO = 12; // The unlabelled button on old
+ const static u1 REVERSE = 50;
+ const static u1 PLAY = 53;
+ const static u1 FORWARD = 52;
+ const static u1 RECORD = 55;
+ const static u1 STOP = 54;
+ const static u1 PAUSE = 48;
+ const static u1 SKIPBACK = 36;
+ const static u1 SKIPFORWARD = 30;
+ const static u1 OK = 37;
// Old remote only
- const static UCHAR FULL = 60;
+ const static u1 FULL = 60;
// New remote only
- const static UCHAR TV = 28;
- const static UCHAR VIDEOS = 24;
- const static UCHAR MUSIC = 25;
- const static UCHAR PICTURES = 26;
- const static UCHAR GUIDE = 27;
- const static UCHAR UP = 20;
- const static UCHAR DOWN = 21;
- const static UCHAR LEFT = 22;
- const static UCHAR RIGHT = 23;
- const static UCHAR PREVCHANNEL = 18;
- const static UCHAR STAR = 10;
- const static UCHAR HASH = 14;
+ const static u1 TV = 28;
+ const static u1 VIDEOS = 24;
+ const static u1 MUSIC = 25;
+ const static u1 PICTURES = 26;
+ const static u1 GUIDE = 27;
+ const static u1 UP = 20;
+ const static u1 DOWN = 21;
+ const static u1 LEFT = 22;
+ const static u1 RIGHT = 23;
+ const static u1 PREVCHANNEL = 18;
+ const static u1 STAR = 10;
+ const static u1 HASH = 14;
// Android only
- const static UCHAR PLAYPAUSE = 201;
+ const static u1 PLAYPAUSE = 201;
// cec only
- const static UCHAR POWERON = 202;
- const static UCHAR POWEROFF = 203;
+ const static u1 POWERON = 202;
+ const static u1 POWEROFF = 203;
protected:
virtual const char* modName()=0;
RemoteTranslationList translist;
int learnMode{NOLEARNMODE};
- virtual UCHAR TranslateHWCFixed(HWC_TYPE code) = 0;
- UCHAR TranslateHWCList(HWC_TYPE code);
- UCHAR TranslateHWC(HWC_TYPE code);
+ virtual u1 TranslateHWCFixed(HWC_TYPE code) = 0;
+ u1 TranslateHWCList(HWC_TYPE code);
+ u1 TranslateHWC(HWC_TYPE code);
};
#endif
sendInputKey(TranslateHWC(key));
}
-void InputCEC::incomingPowerkey(UCHAR key)
+void InputCEC::incomingPowerkey(u1 key)
{
sendInputKey(key);
}
translist[CEC_USER_CONTROL_CODE_CHANNEL_DOWN] = CHANNELDOWN;
}
-UCHAR InputCEC::TranslateHWCFixed(int code)
+u1 InputCEC::TranslateHWCFixed(int code)
{
switch (code)
{
NAMETRICK2(CEC_USER_CONTROL_CODE_,MAX );
}
-const char* InputCEC::getHardCodedHardwareKeyNamesForVompKey(UCHAR /* vompKey */)
+const char* InputCEC::getHardCodedHardwareKeyNamesForVompKey(u1 /* vompKey */)
{
return ""; // FIXME
}
bool handleOptionChanges(Option* option);
std::string getHardwareKeyName(int hardwareKey);
- const char* getHardCodedHardwareKeyNamesForVompKey(UCHAR vompKey);
+ const char* getHardCodedHardwareKeyNamesForVompKey(u1 vompKey);
private:
static constexpr const char* myModName = "InputCEC";
const char* modName() { return myModName; }
void InitKeymap();
void InitHWCListwithDefaults();
- UCHAR TranslateHWCFixed(int code);
+ u1 TranslateHWCFixed(int code);
bool cechandlesvolume{};
CEC::ICECCallbacks cec_callbacks;
void incomingCECkey(int keys);
- void incomingPowerkey(UCHAR key);
+ void incomingPowerkey(u1 key);
static InputCEC* instance;
static void cecLogMessage(void *param, const CEC::cec_log_message* message);
initted = 0;
}
-UCHAR InputLinux::TranslateHWCFixed(int code)
+u1 InputLinux::TranslateHWCFixed(int code)
{
// Translate /dev/input codes to VOMP codes for the hard coded buttons
switch (code)
NAMETRICK(KEY_,NUMERIC_POUND);
}
-const char* InputLinux::getHardCodedHardwareKeyNamesForVompKey(UCHAR vompKey)
+const char* InputLinux::getHardCodedHardwareKeyNamesForVompKey(u1 vompKey)
{
switch (vompKey)
{
return retval;
}
-void InputLinux::EnterLearningMode(UCHAR vompKey)
+void InputLinux::EnterLearningMode(u1 vompKey)
{
learnMode = vompKey; // Armed
}
void shutdown();
std::string getHardwareKeyName(int hardwareKey);
- const char* getHardCodedHardwareKeyNamesForVompKey(UCHAR vompKey);
- void EnterLearningMode(UCHAR vompKey);
+ const char* getHardCodedHardwareKeyNamesForVompKey(u1 vompKey);
+ void EnterLearningMode(u1 vompKey);
bool start();
void stop();
void InitKeymap();
void InitHWCListwithDefaults();
- UCHAR TranslateHWCFixed(int code);
+ u1 TranslateHWCFixed(int code);
std::vector<int> devices;
bool objSuccess = Config::getInstance()->foreachPairInObject("input_lirc", remoteName, [&] (const std::string& lircName, const std::string& vompName)
{
- UCHAR keyNumber = InputMan::getVompKeyNumber(vompName.c_str());
+ u1 keyNumber = InputMan::getVompKeyNumber(vompName.c_str());
log->debug(TAG, " Lirc: {}, vomp: {}, vomp-number {}", lircName, vompName, keyNumber);
}
- using RemotesType = std::map<std::string, std::map<std::string, UCHAR>>;
- using ButtonsType = std::map<std::string, UCHAR>;
+ using RemotesType = std::map<std::string, std::map<std::string, u1>>;
+ using ButtonsType = std::map<std::string, u1>;
for(RemotesType::iterator i = remotes.begin(); i != remotes.end(); i++)
{
else
log->error(TAG, "Parse error");
- UCHAR button;
+ u1 button;
try
{
button = remotes.at(remoteName).at(remoteButton);
}
-// const char* InputLIRC::getHardCodedHardwareKeyNamesForVompKey(UCHAR /* vompKey */)
+// const char* InputLIRC::getHardCodedHardwareKeyNamesForVompKey(u1 /* vompKey */)
// {
// return "";
// }
bool threadReqStop{};
bool parse(const std::string& input, std::string& remoteName, std::string& remoteButton, int& repeatCount);
- UCHAR TranslateHWCFixed(HWC_TYPE code) { return static_cast<UCHAR>(code); };
+ u1 TranslateHWCFixed(HWC_TYPE code) { return static_cast<u1>(code); };
bool initted{};
TCP tcp;
- std::map<std::string, std::map<std::string, UCHAR>> remotes;
+ std::map<std::string, std::map<std::string, u1>> remotes;
};
#endif
return true; // FIXME
}
-const char* InputMan::getVompKeyName(UCHAR number)
+const char* InputMan::getVompKeyName(u1 number)
{
switch (number)
{
}
}
-UCHAR InputMan::getVompKeyNumber(const char* vompKeyName)
+u1 InputMan::getVompKeyNumber(const char* vompKeyName)
{
if (!strcmp(vompKeyName, "VOLUMEUP")) return Input::VOLUMEUP;
else if (!strcmp(vompKeyName, "VOLUMEDOWN")) return Input::VOLUMEDOWN;
else return Input::NA_UNKNOWN;
}
-std::string InputMan::getHardCodedHardwareKeyNamesForVompKey(UCHAR vompKey)
+std::string InputMan::getHardCodedHardwareKeyNamesForVompKey(u1 vompKey)
{
// Go through each active Input class and get the hardware key name for vompKey
return keyNames;
}
-std::string InputMan::getAllHardwareKeyNamesAssignedToVompKey(UCHAR vompKey)
+std::string InputMan::getAllHardwareKeyNamesAssignedToVompKey(u1 vompKey)
{
std::string keyNames;
if (inputUDP) inputUDP->ResetToDefault();
}
-void InputMan::EnterLearningMode(UCHAR vompKey)
+void InputMan::EnterLearningMode(u1 vompKey)
{
#ifdef VOMP_PLATFORM_RASPBERRY
if (inputLinux) inputLinux->EnterLearningMode(vompKey);
bool loadOptionsFromServer(VDR*);
bool saveOptionstoServer();
- static const char* getVompKeyName(UCHAR vompKey);
- static UCHAR getVompKeyNumber(const char* vompKeyName);
+ static const char* getVompKeyName(u1 vompKey);
+ static u1 getVompKeyNumber(const char* vompKeyName);
- std::string getHardCodedHardwareKeyNamesForVompKey(UCHAR vompKey);
- std::string getAllHardwareKeyNamesAssignedToVompKey(UCHAR vompKey);
+ std::string getHardCodedHardwareKeyNamesForVompKey(u1 vompKey);
+ std::string getAllHardwareKeyNamesAssignedToVompKey(u1 vompKey);
- void EnterLearningMode(UCHAR vompKey);
+ void EnterLearningMode(u1 vompKey);
void cancelLearnMode();
void ResetToDefault();
sendInputKey(command);
}
-const char* InputUDP::getHardCodedHardwareKeyNamesForVompKey(UCHAR /* vompKey */)
+const char* InputUDP::getHardCodedHardwareKeyNamesForVompKey(u1 /* vompKey */)
{
return "";
}
// InputUDP doesn't do any translation stuff so just keep everything happy here
void InitHWCListwithDefaults() {};
- UCHAR TranslateHWCFixed(HWC_TYPE code) { return static_cast<UCHAR>(code); };
- const char* getHardCodedHardwareKeyNamesForVompKey(UCHAR vompKey);
+ u1 TranslateHWCFixed(HWC_TYPE code) { return static_cast<u1>(code); };
+ const char* getHardCodedHardwareKeyNamesForVompKey(u1 vompKey);
std::string getHardwareKeyName(HWC_TYPE hardwareKey);
private:
}
/*
-UCHAR RemoteWin::getButtonPress(int waitType)
+u1 RemoteWin::getButtonPress(int waitType)
{
/ * how = 0 - block
how = 1 - start new wait
if (hascurevent) {
- UCHAR temp=curevent;
+ u1 temp=curevent;
hascurevent=false;
return temp;
return NA_NONE;
}
}
- UCHAR temp2=curevent;
+ u1 temp2=curevent;
hascurevent=false;
return temp2;
}
*/
-UCHAR InputWin::TranslateHWCFixed(HWC_TYPE code)
+u1 InputWin::TranslateHWCFixed(HWC_TYPE code)
{
switch (code)
{
}
}
-const char* InputWin::getHardCodedHardwareKeyNameForVompKey(UCHAR vompKey)
+const char* InputWin::getHardCodedHardwareKeyNameForVompKey(u1 vompKey)
{
switch (vompKey)
{
int InputWin::ReceiveButtonVK(u4 button)
{
-/* UCHAR pb=NA_NONE;
+/* u1 pb=NA_NONE;
//should we use a translation table ? No APPCOMMAND iS DWORD!
switch (button) { //Processing VK_Messages
case VK_DOWN:
}; //All other commands are process via APPCOMMAND_MESSAGES
if (pb==NA_NONE) return 0;*/
- UCHAR pb = TranslateHWC(W_G_HCW(W_HCW_VK,button));
+ u1 pb = TranslateHWC(W_G_HCW(W_HCW_VK,button));
if (pb==NA_UNKNOWN || pb==NA_NONE) return 0;
sendInputKey(pb);
return 1;
int InputWin::ReceiveButtonCH(u4 button)
{
- UCHAR pb = TranslateHWC(W_G_HCW(W_HCW_CH,button));
+ u1 pb = TranslateHWC(W_G_HCW(W_HCW_CH,button));
if (pb==NA_UNKNOWN || pb==NA_NONE) return 0;
sendInputKey(pb);
return 1;
int InputWin::ReceiveButtonAP(u4 button)
{
-/* UCHAR pb=NA_NONE;
+/* u1 pb=NA_NONE;
//should we use a translation table ? No APPCOMMAND iS DWORD!
switch (button) { //Processing VK_Messages
case APPCOMMAND_BROWSER_BACKWARD:
//if (pb==NA_NONE) return 0;
- UCHAR pb = TranslateHWC(W_G_HCW(W_HCW_AP,button));
+ u1 pb = TranslateHWC(W_G_HCW(W_HCW_AP,button));
if (pb==NA_UNKNOWN || pb==NA_NONE) return 0;
sendInputKey(pb);
return 1;
int InputWin::ReceiveButtonRI(u4 button)
{
- //UCHAR pb=NA_NONE;
+ //u1 pb=NA_NONE;
//Raw Input
/* Note Codes above 0x29c are not listed in the specs on usb.org
therefore they are used by try, they might be device dependent
};
if (pb==NA_NONE) return 0;*/
- UCHAR pb = TranslateHWC(W_G_HCW(W_HCW_RI,button));
+ u1 pb = TranslateHWC(W_G_HCW(W_HCW_RI,button));
if (pb==NA_UNKNOWN || pb==NA_NONE) return 0;
sendInputKey(pb);
return 1;
bool init();
void shutdown();
//int getDevice();
- //UCHAR getButtonPress(int how);
+ //u1 getButtonPress(int how);
// void Signal();
int ReceiveButtonVK(u4 button); //Windows Message from WND_PROC (Virtual Key)
int ReceiveButtonCH(u4 button); //Windows Message from WND_PROC (char)
int ReceiveButtonAP(u4 button); // (App command)
int ReceiveButtonRI(u4 button); // (Remote control)
void InitHWCListwithDefaults();
- const char* getHardCodedHardwareKeyNameForVompKey(UCHAR vompKey);
+ const char* getHardCodedHardwareKeyNameForVompKey(u1 vompKey);
std::string getHardwareKeyName(HWC_TYPE hardwareKey);
private:
bool initted{};
bool signal{};
- UCHAR curevent{};
+ u1 curevent{};
bool hascurevent{};
HANDLE event;
- UCHAR TranslateHWCFixed(HWC_TYPE code);
+ u1 TranslateHWCFixed(HWC_TYPE code);
};
#endif
*/
int MediaInfo::deserializeImpl(SerializeBuffer *b) {
if (b->decodeLongLong(size) != 0) return -1;
- UCHAR cp=0;
+ u1 cp=0;
if (b->decodeByte(cp) != 0) return -1;
canPosition=cp!=0;
if (b->decodeLong(type) != 0) return -1;
u4 nlen=0;
if (b->decodeString(nlen,fileName) != 0) return -1;
if (b->decodeString(nlen,displayName) != 0) return -1;
- UCHAR hasURI=0;
+ u1 hasURI=0;
if (b->decodeByte(hasURI) != 0) return -1;
if (hasURI!=0) {
uri=new MediaURI();
emptyList();
u4 numelem;
if (b->decodeLong(numelem) != 0) return -1;
- UCHAR hasRoot=0;
+ u1 hasRoot=0;
if (b->decodeByte(hasRoot) != 0) return -1;
if (hasRoot!=0) {
_root=new MediaURI();
Log::getInstance()->log("Client", Log::DEBUG, "getMediaBlock pos = %llu not available", offset);
return -1;
}
- if (*buffer == NULL) *buffer=(UCHAR *)malloc(len);
+ if (*buffer == NULL) *buffer=(u1 *)malloc(len);
if (*buffer == NULL) {
Log::getInstance()->log("Media::getMediaBlock",Log::ERR,"uanble to allocate buffer");
return -1;
std::string originalTitle;
std::string tagline;
std::string overview;
- UCHAR adult{};
+ u1 adult{};
std::string collectionName;
int budget{};
#include "option.h"
#include "vdr.h"
-Option::Option(u4 ID, const char* DISPLAYTEXT, const char* CONFIGSECTION, const char* CONFIGKEY, UCHAR OPTIONTYPE,
+Option::Option(u4 ID, const char* DISPLAYTEXT, const char* CONFIGSECTION, const char* CONFIGKEY, u1 OPTIONTYPE,
u4 NUMCHOICES, u4 DEFAULTCHOICE, u4 STARTINT,
const char * const * OPTIONS, const char * const * OPTIONKEYS, bool DELETESTRINGS, AbstractOption* handler)
: id(ID), displayText(DISPLAYTEXT), configSection(CONFIGSECTION), configKey(CONFIGKEY), optionType(OPTIONTYPE),
class Option
{
public:
- Option(u4 id, const char* displayText, const char* configSection, const char* configKey, UCHAR optionType,
+ Option(u4 id, const char* displayText, const char* configSection, const char* configKey, u1 optionType,
u4 numChoices, u4 defaultChoice, u4 startInt,
const char * const * options, const char * const * optionkeys = NULL, bool deletestrings = false, AbstractOption* handler = NULL);
~Option();
const char* displayText;
const char* configSection;
const char* configKey;
- UCHAR optionType;
+ u1 optionType;
u4 numChoices;
u4 defaultChoice;
int startInt;
u4 configChoice;
u4 userSetChoice;
- const static UCHAR TYPE_TEXT = 1;
- const static UCHAR TYPE_INT = 2;
- const static UCHAR TYPE_KEYED_TEXT = 3;
+ const static u1 TYPE_TEXT = 1;
+ const static u1 TYPE_INT = 2;
+ const static u1 TYPE_KEYED_TEXT = 3;
};
#endif
putOpenVGCommand(comm, false);
}
-bool OsdOpenVG::getStaticImageData(unsigned int static_id, UCHAR** userdata, u4* length)
+bool OsdOpenVG::getStaticImageData(unsigned int static_id, u1** userdata, u4* length)
{
if (sa_MAX > static_id)
{
VectorHandleImage createImagePalette(int width, int height, const unsigned char* image_data, const unsigned int* palette_data);
void destroyDrawStyleHandle(VectorHandle index);
VectorHandle createDrawStyleHandle(const DrawStyle& c);
- bool getStaticImageData(unsigned int static_id, UCHAR** userdata, u4* length);
+ bool getStaticImageData(unsigned int static_id, u1** userdata, u4* length);
void drawSetTrans(SurfaceInfo& sc);
void executeDrawCommand(SVGCommand& command);
virtual void getScreenSize(int& width, int& height) = 0;
virtual void getRealScreenSize(int& width, int& height) = 0;
- virtual bool getStaticImageData(unsigned int static_id, UCHAR** userdata, u4* length) = 0;
+ virtual bool getStaticImageData(unsigned int static_id, u1** userdata, u4* length) = 0;
// Used only by OsdVector and SurfaceVector
void removeImageRef(const VectorHandleImage ref);
}
-bool OsdWinVector::getStaticImageData(unsigned int static_id, UCHAR **userdata, u4 *length)
+bool OsdWinVector::getStaticImageData(unsigned int static_id, u1 **userdata, u4 *length)
{
if (sa_MAX>static_id) {
HRSRC hrc = FindResource(GetModuleHandle(NULL), ext_pict_name[static_id], RT_RCDATA);
*length = SizeofResource(GetModuleHandle(NULL), hrc);
- *userdata = (UCHAR*) LockResource(LoadResource(GetModuleHandle(NULL), hrc));
+ *userdata = (u1*) LockResource(LoadResource(GetModuleHandle(NULL), hrc));
return true;
}
void createPicture(struct PictureInfo& pict_inf);
void destroyDrawStyleHandle(VectorHandle index);
VectorHandle createDrawStyleHandle(const DrawStyle &c);
- bool getStaticImageData(unsigned int static_id, UCHAR **userdata, u4 *length);
+ bool getStaticImageData(unsigned int static_id, u1 **userdata, u4 *length);
int loadFont(bool fontchange);
struct PLInstruction
{
- UCHAR instruction;
+ u1 instruction;
u4 channelIndex;
};
return playerRunnig;
}
-int PlayerMedia::setRequestedState(UCHAR rstate) {
+int PlayerMedia::setRequestedState(u1 rstate) {
int rt=0;
threadLock();
requestState=rstate;
}
-UCHAR PlayerMedia::getState() {
- UCHAR rt=0;
+u1 PlayerMedia::getState() {
+ u1 rt=0;
threadLock();
rt=state;
threadUnlock();
return rt;
}
-void PlayerMedia::setState(UCHAR s) {
+void PlayerMedia::setState(u1 s) {
threadLock();
state=s;
threadUnlock();
canPosition=mi.canPosition;
if (rt == 0 && mi.canPosition) {
//try to get the len
- UCHAR buf[STARTBUFLEN];
- UCHAR *bpointer=buf;
+ u1 buf[STARTBUFLEN];
+ u1 *bpointer=buf;
u4 rtlen=0;
logger->log("PlayerMedia", Log::DEBUG, "try to find last PTS with %lu bytes", STARTBUFLEN);
int rb=MediaPlayer::getInstance()->getMediaBlock(mChannel,lBytes-STARTBUFLEN,STARTBUFLEN,&rtlen,&bpointer);
//method called by the playing thread to handle
//"commands" by the frontend
-UCHAR PlayerMedia::checkState()
+u1 PlayerMedia::checkState()
{
threadLock();
- UCHAR rstate=requestState;
- UCHAR cstate=state;
+ u1 rstate=requestState;
+ u1 cstate=state;
int rseq=requestedSequence;
int cseq=sequence;
threadUnlock();
int retrycount=0;
while(1)
{
- UCHAR cstate=checkState();
+ u1 cstate=checkState();
if (! running) {
break;
}
virtual void call(void * caller);
- UCHAR getState() ;
+ u1 getState() ;
- const static UCHAR S_PLAY = 1;
- const static UCHAR S_PAUSE = 2;
- const static UCHAR S_POSITION = 3;
- const static UCHAR S_DONE=5;
- const static UCHAR S_STOP = 6;
- const static UCHAR S_ERROR = 8;
- const static UCHAR S_FF = 9;
- const static UCHAR S_BACK = 10;
- const static UCHAR S_SEEK = 11;
+ const static u1 S_PLAY = 1;
+ const static u1 S_PAUSE = 2;
+ const static u1 S_POSITION = 3;
+ const static u1 S_DONE=5;
+ const static u1 S_STOP = 6;
+ const static u1 S_ERROR = 8;
+ const static u1 S_FF = 9;
+ const static u1 S_BACK = 10;
+ const static u1 S_SEEK = 11;
//message parameters for frontend messages
int feederState;
//synchronized get/set methods for states
- int setRequestedState(UCHAR st);
- void setState(UCHAR st);
+ int setRequestedState(u1 st);
+ void setState(u1 st);
//to be called from within the thread
- UCHAR checkState();
+ u1 checkState();
//variables used by the thread
u4 thisWrite;
bool running;
bool onStartup; //set for the firts chunk to find the audio channel
- UCHAR *threadBuffer;
- UCHAR state;
- UCHAR requestState;
+ u1 *threadBuffer;
+ u1 state;
+ u1 requestState;
u8 streampos;
u8 bytesWritten;
u8 requestedStreampos;
StreamChunk s = streamChunks.front();
streamChunks.pop();
//logger->debug(TAG, "About to call demuxer with {} {}", (void*)s.data, s.len);
- /*int a =*/ demuxer->put(static_cast<UCHAR*>(s.data), s.len);
+ /*int a =*/ demuxer->put(static_cast<u1*>(s.data), s.len);
//logger->debug(TAG, "put {} to demuxer", a);
free(s.data);
}
-void PlayerRadioLive::switchState(UCHAR newState)
+void PlayerRadioLive::switchState(u1 newState)
{
logger->debug(TAG, "Switch from state {} to state {}", state, newState);
// FIXME so far this just duplicates the old system + the wss
- const static UCHAR CONNECTION_LOST = 1;
- const static UCHAR STOP_PLAYBACK = 2;
- const static UCHAR STREAM_END = 3;
- const static UCHAR ASPECT43 = 4;
- const static UCHAR ASPECT169 = 5;
- const static UCHAR PREBUFFERING = 6;
+ const static u1 CONNECTION_LOST = 1;
+ const static u1 STOP_PLAYBACK = 2;
+ const static u1 STREAM_END = 3;
+ const static u1 ASPECT43 = 4;
+ const static u1 ASPECT169 = 5;
+ const static u1 PREBUFFERING = 6;
private:
MessageQueue* messageQueue;
std::shared_ptr<ChannelList> chanList;
std::queue<PLInstruction> instructions;
- const static UCHAR I_SETCHANNEL = 1;
- const static UCHAR I_STOP = 2;
+ const static u1 I_SETCHANNEL = 1;
+ const static u1 I_STOP = 2;
std::queue<StreamChunk> streamChunks;
bool initted{};
- UCHAR state{S_STOP};
- const static UCHAR S_STOP = 1;
- const static UCHAR S_PREBUFFERING = 2;
- const static UCHAR S_PLAY = 3;
- void switchState(UCHAR newState);
+ u1 state{S_STOP};
+ const static u1 S_STOP = 1;
+ const static u1 S_PREBUFFERING = 2;
+ const static u1 S_PLAY = 3;
+ void switchState(u1 newState);
bool checkError();
int preBufferCount;
u4 thisRead = 0;
int success;
- UCHAR* buffer = vdr->getBlock(0, 10000, &thisRead);
+ u1* buffer = vdr->getBlock(0, 10000, &thisRead);
if (!buffer)
{
logger->error(TAG, "Failed to get start block");
int success;
u8 endPTS = 0;
u4 thisRead = 0;
- UCHAR* buffer = vdr->getBlock(lengthBytes - 10000, 10000, &thisRead);
+ u1* buffer = vdr->getBlock(lengthBytes - 10000, 10000, &thisRead);
if (!buffer)
{
logger->error(TAG, "Failed to get end block");
// ----------------------------------- Implementations called events
-void PlayerRadioRec::switchState(UCHAR toState, u4 jumpToFrame)
+void PlayerRadioRec::switchState(u1 toState, u4 jumpToFrame)
{
if (!initted) return;
void skipForward(u4 seconds);
void skipBackward(u4 seconds);
- UCHAR getState() { return state; }
+ u1 getState() { return state; }
u4 getCurrentSeconds();
u4 getLengthSeconds();
void call(void*); // for callback interface
- const static UCHAR S_PLAY = 1;
- const static UCHAR S_PAUSE_P = 2;
- const static UCHAR S_PAUSE_I = 3;
- const static UCHAR S_STOP = 6;
- const static UCHAR S_JUMP = 7;
+ const static u1 S_PLAY = 1;
+ const static u1 S_PAUSE_P = 2;
+ const static u1 S_PAUSE_I = 3;
+ const static u1 S_STOP = 6;
+ const static u1 S_JUMP = 7;
// Player events
- const static UCHAR CONNECTION_LOST = 1;
- const static UCHAR STOP_PLAYBACK = 2;
- const static UCHAR STREAM_END = 3;
+ const static u1 CONNECTION_LOST = 1;
+ const static u1 STOP_PLAYBACK = 2;
+ const static u1 STREAM_END = 3;
private:
- void switchState(UCHAR newState, u4 jumpToFrame=0);
+ void switchState(u1 newState, u4 jumpToFrame=0);
void threadMethod();
void doConnectionLost();
u4 currentFrameNumber{};
static const u4 blockSize{10000};
static const u4 startupBlockSize{20000};
- UCHAR state{S_STOP};
+ u1 state{S_STOP};
};
#endif
logger->debug(TAG, "Callback from demuxer");
int parx,pary;
- UCHAR dxCurrentAspect = demuxer->getAspectRatio(&parx, &pary);
+ u1 dxCurrentAspect = demuxer->getAspectRatio(&parx, &pary);
if (dxCurrentAspect == Demuxer::ASPECT_4_3)
{
if (video->getTVsize() == Video::ASPECT16X9)
StreamChunk s = streamChunks.front();
streamChunks.pop();
// logger->log("PlayerVideoLive", Log::DEBUG, "About to call demuxer with %p %lu", s.data, s.len);
- /* int a =*/ demuxer->put(static_cast<UCHAR*>(s.data), toi4(s.len));
+ /* int a =*/ demuxer->put(static_cast<u1*>(s.data), toi4(s.len));
// logger->log("PlayerVideoLive", Log::DEBUG, "put %i to demuxer", a);
free(s.data);
if (pendingAudioPlay && (demuxer->getHorizontalSize() || !video->independentAVStartUp())) //Horizontal Size is zero, if not parsed
}
}
-void PlayerVideoLive::switchState(UCHAR newState)
+void PlayerVideoLive::switchState(u1 newState)
{
logger->debug(TAG, "Switch from state {} to state {}", state, newState);
// FIXME so far this just duplicates the old system + the wss
- const static UCHAR CONNECTION_LOST = 1;
- const static UCHAR STOP_PLAYBACK = 2;
- const static UCHAR STREAM_END = 3;
- const static UCHAR ASPECT43 = 4;
- const static UCHAR ASPECT169 = 5;
- const static UCHAR PREBUFFERING = 6;
+ const static u1 CONNECTION_LOST = 1;
+ const static u1 STOP_PLAYBACK = 2;
+ const static u1 STREAM_END = 3;
+ const static u1 ASPECT43 = 4;
+ const static u1 ASPECT169 = 5;
+ const static u1 PREBUFFERING = 6;
private:
VFeed vfeed;
VDR* vdr;
std::queue<PLInstruction> instructions;
- const static UCHAR I_SETCHANNEL = 1;
- const static UCHAR I_STOP = 2;
+ const static u1 I_SETCHANNEL = 1;
+ const static u1 I_STOP = 2;
std::queue<StreamChunk> streamChunks;
std::condition_variable playerThreadCond;
void threadMethod();
- const static UCHAR S_STOP = 1;
- const static UCHAR S_VIDEOSTARTUP = 2;
- const static UCHAR S_PREBUFFERING = 3;
- const static UCHAR S_PLAY = 4;
- void switchState(UCHAR newState);
+ const static u1 S_STOP = 1;
+ const static u1 S_VIDEOSTARTUP = 2;
+ const static u1 S_PREBUFFERING = 3;
+ const static u1 S_PLAY = 4;
+ void switchState(u1 newState);
bool checkError();
bool initted{};
- UCHAR state{S_STOP};
+ u1 state{S_STOP};
bool subtitlesShowing{};
bool firstStart{true};
bool videoStartup{};
// ----------------------------------- Implementations called events
-void PlayerVideoRec::switchState(UCHAR toState, u4 jumpFrame)
+void PlayerVideoRec::switchState(u1 toState, u4 jumpFrame)
{
if (!initted) return;
u4 iframeLength;
u4 iframeNumber;
- UCHAR* buffer;
+ u1* buffer;
u4 amountReceived;
u4 videoLength;
}
int parx,pary;
- UCHAR dxCurrentAspect = demuxer->getAspectRatio(&parx,&pary);
+ u1 dxCurrentAspect = demuxer->getAspectRatio(&parx,&pary);
if (dxCurrentAspect == Demuxer::ASPECT_4_3)
{
logger->debug(TAG, "Demuxer said video is 4:3 aspect, switching TV");
else
{
logger->debug(TAG, "Demuxer said video is something else... setting it anyway");
- video->setAspectRatio(static_cast<UCHAR>(dxCurrentAspect), parx, pary);
+ video->setAspectRatio(static_cast<u1>(dxCurrentAspect), parx, pary);
}
}
void jumpToMark(int mark);
void jumpToFrameP(int newFrame);
- UCHAR getState() { return state; }
+ u1 getState() { return state; }
u4 getCurrentFrameNum();
u4 getLengthFrames();
- UCHAR getIScanRate() { return ifactor; }
+ u1 getIScanRate() { return ifactor; }
bool* getDemuxerMpegAudioChannels();
bool* getDemuxerAc3AudioChannels();
bool* getDemuxerSubtitleChannels();
void call(void*); // for callback interface
- const static UCHAR S_PLAY = 1;
- const static UCHAR S_PAUSE_P = 2;
- const static UCHAR S_PAUSE_I = 3;
- const static UCHAR S_FFWD = 4;
- const static UCHAR S_FBWD = 5;
- const static UCHAR S_STOP = 6;
- const static UCHAR S_JUMP = 7;
- const static UCHAR S_JUMP_PI = 8; // Jump to Pause_I mode
+ const static u1 S_PLAY = 1;
+ const static u1 S_PAUSE_P = 2;
+ const static u1 S_PAUSE_I = 3;
+ const static u1 S_FFWD = 4;
+ const static u1 S_FBWD = 5;
+ const static u1 S_STOP = 6;
+ const static u1 S_JUMP = 7;
+ const static u1 S_JUMP_PI = 8; // Jump to Pause_I mode
// Player events
// FIXME so far this just duplicates the old system + the wss
- const static UCHAR CONNECTION_LOST = 1;
- const static UCHAR STOP_PLAYBACK = 2;
- const static UCHAR STREAM_END = 3;
- const static UCHAR ASPECT43 = 4;
- const static UCHAR ASPECT169 = 5;
+ const static u1 CONNECTION_LOST = 1;
+ const static u1 STOP_PLAYBACK = 2;
+ const static u1 STREAM_END = 3;
+ const static u1 ASPECT43 = 4;
+ const static u1 ASPECT169 = 5;
#ifdef DEV
void test1();
#endif
private:
- void switchState(UCHAR newState, u4 jumpFrame=0);
+ void switchState(u1 newState, u4 jumpFrame=0);
void threadMethod();
void threadFeedPlay();
u4 currentFrameNumber{};
u4 blockSize{100000};
u4 startupBlockSize{250000};
- UCHAR state{S_STOP};
- UCHAR ifactor{4}; // 4, 8, 16, 32
+ u1 state{S_STOP};
+ u1 ifactor{4}; // 4, 8, 16, 32
};
#endif
numComponents = tnumComponents;
languages = new char*[numComponents];
descriptions = new char*[numComponents];
- streams = new UCHAR[numComponents];
- types = new UCHAR[numComponents];
+ streams = new u1[numComponents];
+ types = new u1[numComponents];
}
-void RecInfo::addComponent(u4 componentNum, UCHAR tstream, UCHAR ttype, char* tlanguage, char* tdescription)
+void RecInfo::addComponent(u4 componentNum, u1 tstream, u1 ttype, char* tlanguage, char* tdescription)
{
if (componentNum >= numComponents) return;
streams[componentNum] = tstream;
double fps;
u4 numComponents;
- UCHAR* streams;
- UCHAR* types;
+ u1* streams;
+ u1* types;
char** languages;
char** descriptions;
u4 lifetime;
void setNumComponents(u4);
- void addComponent(u4 componentNum, UCHAR tstream, UCHAR ttype, char* tlanguage, char* tdescription);
+ void addComponent(u4 componentNum, u1 tstream, u1 ttype, char* tlanguage, char* tdescription);
// addComponent accepts a pointer to a buffer that RecInfo will free, not the caller
char* buildSummaryWithDetails(bool forceRefresh = false);
if (!lengthBytes || !lengthFrames) return false;
u4 thisRead;
- UCHAR* buffer = vdr->getBlock(0ULL, 10000U, &thisRead);
+ u1* buffer = vdr->getBlock(0ULL, 10000U, &thisRead);
if (!buffer) return false;
if (!thisRead)
#define BUFFERINCREASE 1024
int SerializeBuffer::seek(int amount) {
- UCHAR *np=current+amount;
+ u1 *np=current+amount;
if (np < start || np > end) return -1;
current=np;
return 0;
end=start+size;
return 0;
}
- UCHAR *ns=new UCHAR[size+BUFFERINCREASE];
+ u1 *ns=new u1[size+BUFFERINCREASE];
if (!ns) return -1;
memcpy(ns,start,end-start);
size=size+BUFFERINCREASE;
autoincrease=ai;
useMalloc=isMalloc;
if (isMalloc) {
- start=(UCHAR *)malloc(sz);
+ start=(u1 *)malloc(sz);
}
else {
- start=new UCHAR[sz];
+ start=new u1[sz];
}
end=start;
current=start;
owning=true;
}
//constructor for SerializeBuffers with external buffers
-SerializeBuffer::SerializeBuffer(UCHAR *buffer,u4 sz,bool ow,bool isMalloc,bool ai) {
+SerializeBuffer::SerializeBuffer(u1 *buffer,u4 sz,bool ow,bool isMalloc,bool ai) {
useMalloc=isMalloc;
autoincrease=ai;
owning=ow;
current+=sizeof(u2);
return 0;
}
-int SerializeBuffer::encodeByte(UCHAR data) {
- if (checkSpace( (int)sizeof(UCHAR))!=0) return -1;
- *((UCHAR *)(current))=data;
- current+=sizeof(UCHAR);
+int SerializeBuffer::encodeByte(u1 data) {
+ if (checkSpace( (int)sizeof(u1))!=0) return -1;
+ *((u1 *)(current))=data;
+ current+=sizeof(u1);
return 0;
}
int SerializeBuffer::encodeLongLong(u8 data) {
current+=sizeof(u2);
return 0;
}
-int SerializeBuffer::decodeByte(UCHAR &data) {
- if (checkSpace( (int)sizeof(UCHAR))!=0) return -1;
- data=*((UCHAR *)current);
- current+=sizeof(UCHAR);
+int SerializeBuffer::decodeByte(u1 &data) {
+ if (checkSpace( (int)sizeof(u1))!=0) return -1;
+ data=*((u1 *)current);
+ current+=sizeof(u1);
return 0;
}
int SerializeBuffer::decodeLongLong(u8 &data) {
}
-UCHAR * SerializeBuffer::steelBuffer() {
- UCHAR *rt=start;
+u1 * SerializeBuffer::steelBuffer() {
+ u1 *rt=start;
owning=false;
autoincrease=false;
return rt;
return 6 + getSerializedLenImpl();
}
int Serializable::serialize(SerializeBuffer *b) {
- UCHAR *ptr=b->getCurrent();
+ u1 *ptr=b->getCurrent();
if (b->encodeShort(version) != 0) return -1;
if (b->encodeLong(0) != 0) return -1; //dummy len
if (serializeImpl(b) != 0) return -1;
- UCHAR *ep=b->getCurrent();
+ u1 *ep=b->getCurrent();
//now write the len
int len=ep-ptr-6;
if (len < 0) return -1 ; //internal error
if (b->decodeShort(vers) != 0) return -1;
u4 len=0;
if (b->decodeLong(len) != 0) return -1;
- UCHAR *data=b->getCurrent();
+ u1 *data=b->getCurrent();
if (data+len > b->getEnd()) return -1;
//TODO: set end temp. to current+len
//for better error handling in deserializeImpl
//constructor for send buffers
SerializeBuffer(u4 size,bool isMalloc=false,bool autoincrease=false);
//constructor for SerializeBuffers with external buffers
- SerializeBuffer(UCHAR *buffer,u4 size,bool owning=false,bool isMalloc=true,bool autoincrease=false);
+ SerializeBuffer(u1 *buffer,u4 size,bool owning=false,bool isMalloc=true,bool autoincrease=false);
~SerializeBuffer();
//access to bufferpointer
- UCHAR * getStart(){ return start;}
- UCHAR * getCurrent(){ return current;}
- UCHAR * getEnd(){ return end;}
+ u1 * getStart(){ return start;}
+ u1 * getCurrent(){ return current;}
+ u1 * getEnd(){ return end;}
//get the buffer and take it away from this object
- UCHAR * steelBuffer();
+ u1 * steelBuffer();
//seek relative to current
int seek(int amount);
void rewind();
int encodeLongLong(u8 data);
int encodeShort(u2 data);
int encodeString(const char *data);
- int encodeByte(UCHAR data);
+ int encodeByte(u1 data);
int decodeLong(u4 & data);
int decodeLong(int & data);
int decodeLongLong(u8 & data);
int decodeShort(u2 & data);
int decodeString(u4 &len,char * &data);
- int decodeByte(UCHAR &data);
+ int decodeByte(u1 &data);
private:
- UCHAR* start;
- UCHAR* end;
- UCHAR* current;
+ u1* start;
+ u1* end;
+ u1* current;
u4 size;
bool useMalloc;
bool owning;
int Stream::init(DrainTarget* tdt, int bufsize)
{
- outbuf = static_cast<UCHAR*>(malloc(bufsize));
+ outbuf = static_cast<u1*>(malloc(bufsize));
if (!outbuf) return 0;
if (draintarget) draintarget->ResetTimeOffsets();
}
-int Stream::put(const UCHAR* inbuf, int len, UCHAR type, unsigned int index)
+int Stream::put(const u1* inbuf, int len, u1 type, unsigned int index)
{
int ret = 0;
int init(DrainTarget* tdt, int bufsize);
void shutdown();
void flush();
- int put(const UCHAR* inbuf, int len, UCHAR type, u4 index);
+ int put(const u1* inbuf, int len, u1 type, u4 index);
bool drain(bool* dataavail = NULL);
private:
std::mutex mutex;
DrainTarget* draintarget{};
int initted{};
- UCHAR* outbuf;
+ u1* outbuf;
int bufferSize;
};
endFastDraw();
}
-void Surface::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,
+void Surface::drawMonoBitmap(u1* base, int dx, int dy, unsigned int height,
unsigned int width, const DrawStyle& nextColour)
{
startFastDraw();
virtual void drawVertLine(int x, int y1, int y2, const DrawStyle& c) = 0;
virtual void drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegion& region) = 0;
virtual void drawPoint(int x, int y, const DrawStyle& c, bool fastdraw = false); // This draws a point, must not be a pixel
- virtual void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour);
+ virtual void drawMonoBitmap(u1* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour);
virtual int updateToScreen(int sx, int sy, int w, int h, int dx, int dy) = 0;
virtual void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b) = 0;
virtual bool screenShot(const char* fileName) = 0;
line = surface.sfc.width;
else
line = surface.sfc.width + (4 - remainder);
- const std::vector<UCHAR>& bmdata = bm.rawData();
- const std::vector<UCHAR>& Y = bm.palette.getYVector();
- const std::vector<UCHAR>& Cr = bm.palette.getCrVector();
- const std::vector<UCHAR>& Cb = bm.palette.getCbVector();
- const std::vector<UCHAR>& A = bm.palette.getAVector();
+ const std::vector<u1>& bmdata = bm.rawData();
+ const std::vector<u1>& Y = bm.palette.getYVector();
+ const std::vector<u1>& Cr = bm.palette.getCrVector();
+ const std::vector<u1>& Cb = bm.palette.getCbVector();
+ const std::vector<u1>& A = bm.palette.getAVector();
u4 b_offset = 0;
u4 s_offset = x + y*line;
u4 plotWidth = bmw;
u4 i = 0;
if (x & 1) // odd x - need to plot first column separately
{
- UCHAR index = bmdata[b_offset];
+ u1 index = bmdata[b_offset];
*(surface.base[0] + s_offset) = Y[index];
*(surface.base[1] + s_offset - 1) = Cb[index];
*(surface.base[1] + s_offset) = Cr[index];
// Now, plot pairs of pixels with averaged chroma values
while (i < plotWidth - 1)
{
- UCHAR index1 = bmdata[b_offset + i];
- UCHAR index2 = bmdata[b_offset + i + 1];
+ u1 index1 = bmdata[b_offset + i];
+ u1 index2 = bmdata[b_offset + i + 1];
*(surface.base[0] + s_offset + i) = Y[index1];
*(surface.base[0] + s_offset + i + 1) = Y[index2];
*(surface.base[1] + s_offset + i) = (Cb[index1] + Cb[index2]) / 2;
}
if (i == plotWidth - 1) // One column left to do
{
- UCHAR index = bmdata[b_offset + i];
+ u1 index = bmdata[b_offset + i];
*(surface.base[0] + s_offset + i) = Y[index];
*(surface.base[1] + s_offset + i) = Cb[index];
*(surface.base[1] + s_offset + i + 1) = Cr[index];
if (!fastdraw) command_mutex.unlock();
}
-void SurfaceVector::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour)
+void SurfaceVector::drawMonoBitmap(u1* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour)
{
command_mutex.lock();
VectorHandleImage handle = osd->getMonoBitmapRef(base, width, height);
void drawVertLine(int x, int y1, int y2, const DrawStyle& c);
void drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegion& region);
void drawPoint(int x, int y, const DrawStyle& c, bool fastdraw = false); // This draws a point, must not be a pixel
- void drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour);
+ void drawMonoBitmap(u1* base, int dx, int dy, unsigned int height, unsigned int width, const DrawStyle& nextColour);
int updateToScreen(int sx, int sy, int w, int h, int dx, int dy);
/* This is for system which need a locking of the drawing surface to speed up drawing */
tbIcon = ticon;
}
-void TBBoxx::setTitleBarOn(UCHAR on)
+void TBBoxx::setTitleBarOn(u1 on)
{
titleBarOn = on;
}
-void TBBoxx::setBorderOn(UCHAR on)
+void TBBoxx::setBorderOn(u1 on)
{
borderOn = on;
}
virtual ~TBBoxx();
virtual void draw();
- void setBorderOn(UCHAR on);
- void setTitleBarOn(UCHAR on);
+ void setBorderOn(u1 on);
+ void setTitleBarOn(u1 on);
void setTitleText(const char* title, int width=0);
void setTitleBarColour(const DrawStyle& colour);
private:
char* titleText;
- UCHAR borderOn;
+ u1 borderOn;
int titleBarTextWidth;
Image tbIcon;
protected:
DrawStyle titleBarColour;
- UCHAR titleBarOn;
+ u1 titleBarOn;
};
#endif
struct MACAddress
{
- UCHAR mac[6];
+ u1 mac[6];
};
class LogNT;
return -pts1 + pts2;
}
-u4 TeletextDecoderVBIEBU::DeliverMediaSample(UCHAR* buffer, u4 *samplepos)
+u4 TeletextDecoderVBIEBU::DeliverMediaSample(u1* buffer, u4 *samplepos)
{
if (mediapacket.type != MPTYPE_TELETEXT)
{
}
// This part is inspired by the vdr-plugin-osdteletext of Udo Richter and Marcel Wiesweg
-void TeletextDecoderVBIEBU::DecodeTeletext(const UCHAR* buffer, unsigned int /* field */) //needs to be exactly 42 byte long!!
+void TeletextDecoderVBIEBU::DecodeTeletext(const u1* buffer, unsigned int /* field */) //needs to be exactly 42 byte long!!
{
- UCHAR hdrbuf[5];
- for (int i=0;i<5;i++) hdrbuf[i] = static_cast<UCHAR>( (unhamtab[buffer[2*i]]&0xF) | ((unhamtab[buffer[2*i+1]]&0xF)<< 4) );
+ u1 hdrbuf[5];
+ for (int i=0;i<5;i++) hdrbuf[i] = static_cast<u1>( (unhamtab[buffer[2*i]]&0xF) | ((unhamtab[buffer[2*i+1]]&0xF)<< 4) );
int header=hdrbuf[0];
int magazin=header & 0x7;
int line = (header>>3) & 0x1f;
virtual void PrepareMediaSample(const MediaPacketList& mplist, u4 samplepos);
- virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos);
+ virtual u4 DeliverMediaSample(u1* buffer, u4 *samplepos);
void registerTeletextView(VTeletextView* view) {txtview=view;};
void unRegisterTeletextView(VTeletextView* view) {if (txtview==view) txtview=NULL;};
protected:
- void DecodeTeletext(const UCHAR* buffer, unsigned int field);
+ void DecodeTeletext(const u1* buffer, unsigned int field);
void RenderTeletextCode(bool renderfirstlineonly);
void CleanPage();
int selectedpage;
int lang;
int flags;
- UCHAR curpage[25][40]; //Line DataCache
+ u1 curpage[25][40]; //Line DataCache
cTeletextChar Page[40][25];
char keyindigits[3];
void dump(void* vdata, int remaining)
{
- UCHAR* data = reinterpret_cast<UCHAR*>(vdata);
+ u1* data = reinterpret_cast<u1*>(vdata);
int pos{}, ntp, spaces;
std::stringstream ascii;
logger->debug("VDPC4", "goto waitformessage");
#ifdef WIN32
- UCHAR retval = udp4.waitforMessage(3, quitPipe);
+ u1 retval = udp4.waitforMessage(3, quitPipe);
#else
- UCHAR retval = udp4.waitforMessage(3, pfdsUDP4[0]);
+ u1 retval = udp4.waitforMessage(3, pfdsUDP4[0]);
#endif
logger->debug("VDPC4", "backfrom waitformessage");
{
logger->debug("VDPC6", "goto waitformessage");
- UCHAR retval = udp6.waitforMessage(3, pfdsUDP6[0]);
+ u1 retval = udp6.waitforMessage(3, pfdsUDP6[0]);
logger->debug("VDPC6", "backfrom waitformessage");
if (retval == 2) // we got a reply
}
vresp = new VDR_ResponsePacket();
- vresp->setResponse(requestID, reinterpret_cast<UCHAR*>(userData), userDataLength);
+ vresp->setResponse(requestID, reinterpret_cast<u1*>(userData), userDataLength);
// vresp now owns userData unless something calls vresp->getUserData()
// logger->debug(TAG, "Rxd a response packet, requestID={}, len={}", requestID, userDataLength);
}
vresp = new VDR_ResponsePacket();
- vresp->setStream(streamID, flag, reinterpret_cast<UCHAR*>(userData), userDataLength, channelID);
+ vresp->setStream(streamID, flag, reinterpret_cast<u1*>(userData), userDataLength, channelID);
//logger->debug(TAG, "Rxd a stream packet, streamID={}, flag={}, len={}", streamID, flag, userDataLength);
if (!edFindAndCall(vresp)) // makes ED lock, find receiver for vresp (using ed_cb_find() ) and then call (using ed_cb_call() )
if (!vrp.init(VDR_LOGIN, true, 6)) return false;
MACAddress myMAC = tcp.getMAC();
- if (!vrp.copyin(reinterpret_cast<UCHAR*>(&myMAC), 6)) return false;
+ if (!vrp.copyin(reinterpret_cast<u1*>(&myMAC), 6)) return false;
VDR_ResponsePacket* vresp = RequestResponse(&vrp);
if (vresp->noResponse()) { delete vresp; return false; }
recman->setStats(totalSpace, freeSpace, percent);
u4 start;
- UCHAR isNew;
+ u1 isNew;
char* name;
char* fileName;
while (!vresp->end())
{
start = vresp->extractu4();
- isNew = vresp->extractUCHAR();
+ isNew = vresp->extractu1();
name = vresp->extractString();
fileName = vresp->extractString();
recman->addEntry(isNew, start, name, fileName);
chan->number = vresp->extractu4();
chan->type = vresp->extractu4();
chan->name = vresp->extractString();
- chan->vstreamtype = static_cast<UCHAR>(vresp->extractu4());
+ chan->vstreamtype = static_cast<u1>(vresp->extractu4());
if (chan->type == type && ((chan->vstreamtype==0x1b && h264support)|| (chan->vstreamtype!=0x1b &&mpeg2support)) )
{
return toReturn;
}
-UCHAR* VDR::getBlock(u8 position, u4 maxAmount, u4* amountReceived)
+u1* VDR::getBlock(u8 position, u4 maxAmount, u4* amountReceived)
{
VDR_RequestPacket vrp;
if (!vrp.init(VDR_GETBLOCK, true, sizeof(u8) + sizeof(u4))) return NULL;
}
// Special handling for getblock
- UCHAR* toReturn = vresp->getUserData();
+ u1* toReturn = vresp->getUserData();
*amountReceived = vresp->getUserDataLength();
delete vresp;
u8 lengthBytes = vresp->extractu8();
u4 lengthFrames = vresp->extractu4();
- UCHAR isPesRecording = vresp->extractUCHAR();
+ u1 isPesRecording = vresp->extractu1();
delete vresp;
*totalFrames = lengthFrames;
recInfo->setNumComponents(numComponents);
for (u4 i = 0; i < numComponents; i++)
{
- recInfo->streams[i] = vresp->extractUCHAR();
- recInfo->types[i] = vresp->extractUCHAR();
+ recInfo->streams[i] = vresp->extractu1();
+ recInfo->types[i] = vresp->extractu1();
recInfo->languages[i] = vresp->extractString();
recInfo->descriptions[i] = vresp->extractString();
}
// }
channel->vpid = vresp->extractu4();
- channel->vstreamtype = static_cast<UCHAR>(vresp->extractu4());
+ channel->vstreamtype = static_cast<u1>(vresp->extractu4());
channel->numAPids = vresp->extractu4();
for (u4 i = 0; i < channel->numAPids; i++)
VDR_ResponsePacket* vresp = RequestResponse(&vrp);
logger->debug(TAG, "After response");
if (vresp->noResponse()) { delete vresp; return ; }
- int type = vresp->extractUCHAR();
+ int type = vresp->extractu1();
if (type == 0) //serie
{
seriesID = vresp->extractLONG();
VDR_ResponsePacket* vresp = RequestResponse(&vrp);
logger->debug(TAG, "After response");
if (vresp->noResponse()) { delete vresp; return ; }
- int type = vresp->extractUCHAR();
+ int type = vresp->extractu1();
if (type == 0) //serie
{
seriesID = vresp->extractLONG();
movieinf->originalTitle = vresp->extractStdString();
movieinf->tagline = vresp->extractStdString();
movieinf->overview = vresp->extractStdString();
- movieinf->adult = vresp->extractUCHAR();
+ movieinf->adult = vresp->extractu1();
movieinf->collectionName = vresp->extractStdString();
movieinf->budget = vresp->extractLONG();
int streamChannel(u4 number, StreamReceiver*);
int streamChannel(u4 number);
void getChannelPids(Channel* channel);
- UCHAR* getBlock(u8 position, u4 maxAmount, u4* amountReceived);
+ u1* getBlock(u8 position, u4 maxAmount, u4* amountReceived);
//get image blocks separate - we can do this in parallel
int stopStreaming();
EventList* getChannelSchedule(u4 number);
static VDR* instance;
VDR_ResponsePacket* RequestResponse(VDR_RequestPacket* request);
- UCHAR* getBlock(u8 position, u4 maxAmount, u4* amountReceived, u4 cmd);
+ u1* getBlock(u8 position, u4 maxAmount, u4* amountReceived, u4 cmd);
void connectionDied();
bool sendKA(u4 timeStamp);
userDataLength = 0; // so the below will write a zero
}
- buffer = static_cast<UCHAR*>(malloc(bufSize));
+ buffer = static_cast<u1*>(malloc(bufSize));
if (!buffer) return false;
channel = VDR::CHANNEL_REQUEST_RESPONSE;
return true;
}
-bool VDR_RequestPacket::copyin(const UCHAR* src, u4 len)
+bool VDR_RequestPacket::copyin(const u1* src, u4 len)
{
if (!checkExtend(len)) return false;
memcpy(buffer + bufUsed, src, len);
{
if (lengthSet) return true;
if ((bufUsed + by) < bufSize) return true;
- UCHAR* newBuf = (UCHAR*)realloc(buffer, bufSize + 512);
+ u1* newBuf = (u1*)realloc(buffer, bufSize + 512);
if (!newBuf) return false;
buffer = newBuf;
bufSize += 512;
~VDR_RequestPacket();
bool init(u4 opcode, bool setUserDataLength, u4 userDataLength);
- bool copyin(const UCHAR* src, u4 len);
+ bool copyin(const u1* src, u4 len);
bool addString(const char* string);
bool addu4(u4 ul);
bool addu8(u8 ull);
- UCHAR* getPtr() { return buffer; }
+ u1* getPtr() { return buffer; }
u4 getLen() { return bufUsed; }
u4 getChannel() { return channel; }
u4 getSerial() { return serialNumber; }
private:
static u4 serialNumberCounter;
- UCHAR* buffer;
+ u1* buffer;
u4 bufSize;
u4 bufUsed;
bool lengthSet;
if (userData) free(userData);
}
-void VDR_ResponsePacket::setResponse(u4 trequestID, UCHAR* tuserData, u4 tuserDataLength)
+void VDR_ResponsePacket::setResponse(u4 trequestID, u1* tuserData, u4 tuserDataLength)
{
channelID = VDR::CHANNEL_REQUEST_RESPONSE;
requestID = trequestID;
userDataLength = tuserDataLength;
}
-void VDR_ResponsePacket::setStream(u4 tstreamID, u4 tflag, UCHAR* tuserData, u4 tuserDataLength, u4 tchannelID)
+void VDR_ResponsePacket::setStream(u4 tstreamID, u4 tflag, u1* tuserData, u4 tuserDataLength, u4 tchannelID)
{
channelID = tchannelID;
streamID = tstreamID;
return str;
}
-UCHAR VDR_ResponsePacket::extractUCHAR()
+u1 VDR_ResponsePacket::extractu1()
{
- if ((packetPos + sizeof(UCHAR)) > userDataLength) return 0;
- UCHAR uc = userData[packetPos];
- packetPos += sizeof(UCHAR);
+ if ((packetPos + sizeof(u1)) > userDataLength) return 0;
+ u1 uc = userData[packetPos];
+ packetPos += sizeof(u1);
return uc;
}
return l;
}
-UCHAR* VDR_ResponsePacket::getUserData()
+u1* VDR_ResponsePacket::getUserData()
{
ownBlock = false;
return userData;
VDR_ResponsePacket();
~VDR_ResponsePacket();
- void setResponse(u4 requestID, UCHAR* packet, u4 packetLength);
- void setStream(u4 streamID, u4 flag, UCHAR* packet, u4 packetLength, u4 tchannelID);
+ void setResponse(u4 requestID, u1* packet, u4 packetLength);
+ void setStream(u4 streamID, u4 flag, u1* packet, u4 packetLength, u4 tchannelID);
bool noResponse() { return (userData == NULL); };
int serverError();
char* extractString();
std::string extractStdString();
- UCHAR extractUCHAR();
+ u1 extractu1();
u4 extractu4();
u8 extractu8();
long extractLONG();
void dumpUD();
// If you call this, the memory becomes yours. Free with free()
- UCHAR* getUserData();
+ u1* getUserData();
private:
- UCHAR* userData;
+ u1* userData;
u4 userDataLength;
u4 packetPos;
// This lot is borrowed from VQuestion
// A shame not to use it, but this view will probably get
// a whole load more controls on it some day
- const static UCHAR NO = 0;
- const static UCHAR YES = 1;
+ const static u1 NO = 0;
+ const static u1 YES = 1;
- UCHAR selectedOption;
+ u1 selectedOption;
WButton buttonYes;
WButton buttonNo;
static Video* getInstance();
//static void setInstance(Video*);
- virtual int init(UCHAR format)=0;
+ virtual int init(u1 format)=0;
virtual int shutdown()=0;
- virtual int setFormat(UCHAR format)=0;
- virtual UCHAR getSupportedFormats() { return COMPOSITERGB | SVIDEO;}; // if it returns zero there are no different formats
+ virtual int setFormat(u1 format)=0;
+ virtual u1 getSupportedFormats() { return COMPOSITERGB | SVIDEO;}; // if it returns zero there are no different formats
virtual u4 supportedTVsize() { return 0; }; // if no selection is allowed
- virtual UCHAR supportedTVFormats() { return 0; }; // if no selection is allowed
+ virtual u1 supportedTVFormats() { return 0; }; // if no selection is allowed
- virtual int setConnection(UCHAR connection)=0;
- virtual int setAspectRatio(UCHAR aspectRatio, int tparx,int tpary)=0; // This one does the pin 8 scart widescreen switching
- virtual int setMode(UCHAR mode)=0;
- virtual int setTVsize(UCHAR size)=0; // Is the TV a widescreen?
+ virtual int setConnection(u1 connection)=0;
+ virtual int setAspectRatio(u1 aspectRatio, int tparx,int tpary)=0; // This one does the pin 8 scart widescreen switching
+ virtual int setMode(u1 mode)=0;
+ virtual int setTVsize(u1 size)=0; // Is the TV a widescreen?
virtual void executePendingModeChanges() {}; // This is called if you change the output mode and the device take a while for reinitialization
virtual int setDefaultAspect()=0;
virtual int setSource()=0;
virtual int attachFrameBuffer()=0; // What does this do?
// virtual u4 timecodeToFrameNumber(u8 timecode)=0; //Obsolete and not HD compatible
virtual u8 getCurrentTimestamp()=0;
- virtual bool displayIFrame(const UCHAR* buffer, u4 length)=0;
+ virtual bool displayIFrame(const u1* buffer, u4 length)=0;
virtual int EnterIframePlayback() {return 1;}; // Must not be implemented
virtual bool supportsh264() { return false; };
#endif
int getMode() { return mode; }
- UCHAR getFormat() { return format; }
+ u1 getFormat() { return format; }
u4 getScreenWidth() { return screenWidth; }
u4 getScreenHeight() { return screenHeight; }
- virtual UCHAR getTVsize() { return tvsize; }
+ virtual u1 getTVsize() { return tvsize; }
virtual bool setVideoDisplay(VideoDisplay display);
// u4 getFPS(); //removed
// Video formats - AV_SET_VID_DISP_FMT
- const static UCHAR NTSC = 0;
- const static UCHAR PAL = 1;
- const static UCHAR PAL_M = 2;
- const static UCHAR NTSC_J = 4;
+ const static u1 NTSC = 0;
+ const static u1 PAL = 1;
+ const static u1 PAL_M = 2;
+ const static u1 NTSC_J = 4;
// Video connections - AV_SET_VID_OUTPUT
- const static UCHAR COMPOSITERGB = 1;
- const static UCHAR SVIDEO = 2;
- const static UCHAR HDMI = 4;
- const static UCHAR HDMI3D = 16; //For future use
+ const static u1 COMPOSITERGB = 1;
+ const static u1 SVIDEO = 2;
+ const static u1 HDMI = 4;
+ const static u1 HDMI3D = 16; //For future use
// Video aspect ratios - AV_SET_VID_RATIO
- const static UCHAR ASPECT4X3 = 0;
- const static UCHAR ASPECT16X9 = 1;
- const static UCHAR ASPECT14X9 = 2; //future use
+ const static u1 ASPECT4X3 = 0;
+ const static u1 ASPECT16X9 = 1;
+ const static u1 ASPECT14X9 = 2; //future use
// Video modes - AV_SET_VID_MODE
- const static UCHAR NORMAL = 0;
- const static UCHAR LETTERBOX = 1;
+ const static u1 NORMAL = 0;
+ const static u1 LETTERBOX = 1;
/*
Actual Source Aspect Aspect IOCTL Mode IOCTL MODE A MODE B
To switch to MODE B, set the aspect ioctl to 16:9 and reopen the FD.
*/
- const static UCHAR UNKNOWN2 = 2;
- const static UCHAR QUARTER = 3;
- const static UCHAR EIGHTH = 4;
- const static UCHAR ZOOM = 5;
- const static UCHAR UNKNOWN6 = 6;
+ const static u1 UNKNOWN2 = 2;
+ const static u1 QUARTER = 3;
+ const static u1 EIGHTH = 4;
+ const static u1 ZOOM = 5;
+ const static u1 UNKNOWN6 = 6;
int initted;
int fdVideo;
- UCHAR tvsize;
- UCHAR format;
- UCHAR connection;
- UCHAR aspectRatio;
+ u1 tvsize;
+ u1 format;
+ u1 connection;
+ u1 aspectRatio;
int parx,pary;
- UCHAR mode;
+ u1 mode;
bool h264;
instance = NULL;
}
-int VideoOMX::init(UCHAR tformat)
+int VideoOMX::init(u1 tformat)
{
if (initted) return 0;
initted = 1;
-int VideoOMX::setTVsize(UCHAR ttvsize)
+int VideoOMX::setTVsize(u1 ttvsize)
{
if (tvsize!=ttvsize) pendingmodechange=true;
tvsize=ttvsize;
return 1;
}
-UCHAR VideoOMX::getTVsize() {
+u1 VideoOMX::getTVsize() {
/*if (hdmi)*/
return ASPECT16X9; // in order that aspect ratio changes are reported
//return tvsize;
-int VideoOMX::setFormat(UCHAR tformat)
+int VideoOMX::setFormat(u1 tformat)
{
if (!initted) return 0;
if ((tformat != PAL) && (tformat != NTSC)
}
-int VideoOMX::setConnection(UCHAR tconnection)
+int VideoOMX::setConnection(u1 tconnection)
{
if (!initted) return 0;
if ((tconnection != COMPOSITERGB) && (tconnection != HDMI)) return 0;
return 1;
}
-int VideoOMX::setAspectRatio(UCHAR taspectRatio, int tparx,int tpary)
+int VideoOMX::setAspectRatio(u1 taspectRatio, int tparx,int tpary)
{
if (!initted) return 0;
//if ((taspectRatio != ASPECT4X3) && (taspectRatio != ASPECT16X9)) return 0;
return 1;
}
-int VideoOMX::setMode(UCHAR tmode)
+int VideoOMX::setMode(u1 tmode)
{
if (!initted) return 0;
if (tmode==LETTERBOX || tmode==NORMAL) mode=tmode;
return ret_val;
}
-bool VideoOMX::detectIFrame(const UCHAR *buffer,unsigned int length)
+bool VideoOMX::detectIFrame(const u1 *buffer,unsigned int length)
{
- const UCHAR* curbuf=buffer;
- const UCHAR* curbufend=buffer+length;
+ const u1* curbuf=buffer;
+ const u1* curbufend=buffer+length;
unsigned int detector=0xFFFFFFFF;
bool gotaud=false; // have seen access unit delimiter
}
-u4 VideoOMX::DeliverMediaSample(UCHAR* buffer, u4 *samplepos)
+u4 VideoOMX::DeliverMediaSample(u1* buffer, u4 *samplepos)
{
u4 consumed=0;
while (consumed < mediapackets.size()) {
}
u4 VideoOMX::DeliverMediaPacket(MediaPacket packet,
- const UCHAR* buffer,
+ const u1* buffer,
u4 *samplepos)
{
if (packet.type == MPTYPE_VIDEO_H264)
-bool VideoOMX::displayIFrame(const UCHAR* buffer, u4 length) {
+bool VideoOMX::displayIFrame(const u1* buffer, u4 length) {
if (!omx_running) return false;
if (!iframemode)
EnterIframePlayback();
VideoOMX();
virtual ~VideoOMX();
- int init(UCHAR format);
+ int init(u1 format);
int shutdown();
- UCHAR getSupportedFormats() { return COMPOSITERGB | HDMI;};
+ u1 getSupportedFormats() { return COMPOSITERGB | HDMI;};
u4 supportedTVsize() { return ASPECT4X3|ASPECT16X9|ASPECT14X9 ;};
- UCHAR supportedTVFormats() { return NTSC|PAL|PAL_M|NTSC_J;};
+ u1 supportedTVFormats() { return NTSC|PAL|PAL_M|NTSC_J;};
- int setFormat(UCHAR format);
- int setConnection(UCHAR connection);
- int setAspectRatio(UCHAR aspectRatio, int tparx,int tpary); // This one does the pin 8 scart widescreen switching
- int setMode(UCHAR mode);
+ int setFormat(u1 format);
+ int setConnection(u1 connection);
+ int setAspectRatio(u1 aspectRatio, int tparx,int tpary); // This one does the pin 8 scart widescreen switching
+ int setMode(u1 mode);
bool setVideoDisplay(VideoDisplay display);
- int setTVsize(UCHAR size); // Is the TV a widescreen?
- UCHAR getTVsize();
+ int setTVsize(u1 size); // Is the TV a widescreen?
+ u1 getTVsize();
void executePendingModeChanges();
int setDefaultAspect();
int attachFrameBuffer(); // What does this do?
u4 timecodeToFrameNumber(u8 timecode);
u8 getCurrentTimestamp();
- bool displayIFrame(const UCHAR* bulibaver, u4 length);
+ bool displayIFrame(const u1* bulibaver, u4 length);
virtual bool dtsTimefix(){return false;} //please we need dts time values
virtual int getTeletextBufferFaktor(){return 5;};
// Writing Data to Videodevice
virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos);
- virtual u4 DeliverMediaSample(UCHAR* bulibaver, u4* samplepos);
+ virtual u4 DeliverMediaSample(u1* bulibaver, u4* samplepos);
virtual bool supportsh264(){return true;};
virtual bool DrainTargetBufferFull();
- u4 DeliverMediaPacket(MediaPacket packet,const UCHAR* bulibaver,u4 *samplepos);
+ u4 DeliverMediaPacket(MediaPacket packet,const u1* bulibaver,u4 *samplepos);
#define VPE_DECODER_OMX 1
static OMX_ERRORTYPE FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
u4 DeliverMediaPacketOMX(MediaPacket packet,
- const UCHAR* bulibaver,
+ const u1* bulibaver,
u4 *samplepos);
- bool detectIFrame(const UCHAR *buffer,unsigned int length);
+ bool detectIFrame(const u1 *buffer,unsigned int length);
int PrepareInputBufsOMX();
int DestroyInputBufsOMX();
void updateMode();//called internally to adjust for different parameters
void selectVideoMode(int interlaced);
- UCHAR tvsystem;
+ u1 tvsystem;
bool signalon;
bool pendingmodechange;
bool hdmi;
instance = NULL;
}
-int VideoWin::init(UCHAR tformat)
+int VideoWin::init(u1 tformat)
{
if (initted) return 0;
-int VideoWin::setTVsize(UCHAR ttvsize)
+int VideoWin::setTVsize(u1 ttvsize)
{
pseudotvsize=ttvsize;
return 1;
return 1;
}
-int VideoWin::setFormat(UCHAR tformat)
+int VideoWin::setFormat(u1 tformat)
{
if (!initted) return 0;
if ((tformat != PAL) && (tformat != NTSC)) return 0;
return 1;
}
-int VideoWin::setConnection(UCHAR tconnection)
+int VideoWin::setConnection(u1 tconnection)
{
if (!initted) return 0;
if ((tconnection != COMPOSITERGB) && (tconnection != SVIDEO)) return 0;
return 1;
}
-int VideoWin::setAspectRatio(UCHAR taspectRatio, int tparx,int tpary)
+int VideoWin::setAspectRatio(u1 taspectRatio, int tparx,int tpary)
{
if (!initted) return 0;
parx=tparx;
return 1;
}
-int VideoWin::setMode(UCHAR tmode)
+int VideoWin::setMode(u1 tmode)
{
if (!initted) return 0;
return 1;
}
-int VideoWin::setAudioStreamType(UCHAR type)
+int VideoWin::setAudioStreamType(u1 type)
{
aud_type=type;
if (!initted) return 0;
mediapacket = mplist.front();
}
-u4 VideoWin::DeliverMediaSample(UCHAR* buffer, u4 *samplepos)
+u4 VideoWin::DeliverMediaSample(u1* buffer, u4 *samplepos)
{
DeliverMediaPacket(mediapacket, buffer, samplepos);
if (*samplepos == mediapacket.length) {
}
u4 VideoWin::DeliverMediaPacket(MediaPacket packet,
- const UCHAR* buffer,
+ const u1* buffer,
u4 *samplepos)
{
if (dsbasicaudio) dsbasicaudio->put_Volume(volume);
}
-bool VideoWin::displayIFrame(const UCHAR* buffer, u4 length)
+bool VideoWin::displayIFrame(const u1* buffer, u4 length)
{
if (!iframemode) EnterIframePlayback();
if (!isdsinited()) return false;
VideoWin();
virtual ~VideoWin();
- int init(UCHAR format);
+ int init(u1 format);
int shutdown();
- int setFormat(UCHAR format);
- UCHAR getSupportedFormats() { return 0;};
+ int setFormat(u1 format);
+ u1 getSupportedFormats() { return 0;};
u4 supportedTVsize() { return ASPECT4X3|ASPECT16X9;};
- UCHAR supportedTVFormats() { return 0;};
-
- int setConnection(UCHAR connection);
- int setAspectRatio(UCHAR aspectRatio, int tparx,int tpary); // This one does the pin 8 scart widescreen switching
- UCHAR getAspectRatio(){return aspectRatio;};
- UCHAR getMode(){return mode;};
- UCHAR getPseudoTVsize() {return pseudotvsize;};
- int setMode(UCHAR mode);
- int setTVsize(UCHAR size); // Is the TV a widescreen?
+ u1 supportedTVFormats() { return 0;};
+
+ int setConnection(u1 connection);
+ int setAspectRatio(u1 aspectRatio, int tparx,int tpary); // This one does the pin 8 scart widescreen switching
+ u1 getAspectRatio(){return aspectRatio;};
+ u1 getMode(){return mode;};
+ u1 getPseudoTVsize() {return pseudotvsize;};
+ int setMode(u1 mode);
+ int setTVsize(u1 size); // Is the TV a widescreen?
int setDefaultAspect();
int setSource();
int sync();
//Writing Data to Videodevice
virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos);
- virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos);
- u4 DeliverMediaPacket(const MediaPacket packet, const UCHAR* buffer, u4 *samplepos);
+ virtual u4 DeliverMediaSample(u1* buffer, u4 *samplepos);
+ u4 DeliverMediaPacket(const MediaPacket packet, const u1* buffer, u4 *samplepos);
virtual bool dtsTimefix() {if (h264)return videoH264dtsfix; else return videompeg2dtsfix;}
virtual bool supportsh264();
int getCurrentVideoMediaSample(IMediaSample** ms);
int DeliverVideoMediaSample();
- int setAudioStreamType(UCHAR type);
+ int setAudioStreamType(u1 type);
virtual long long SetStartOffset(long long curreftime, bool *rsync);
long long SetStartAudioOffset(long long curreftime, bool *rsync);
void turnVideoOn(){videoon=true;};
void turnVideoOff(){videoon=false;};
- virtual bool displayIFrame(const UCHAR* buffer, u4 length);
+ virtual bool displayIFrame(const u1* buffer, u4 length);
const VideoDisplay & getVideoDisplay() { return vd; };
bool isVideoOn() {return videoon;};
bool audioon;
bool videoon;
bool iframemode;
- UCHAR pseudotvsize;
+ u1 pseudotvsize;
REFERENCE_TIME lastreftimeRT;
u8 lastreftimePTS;
int lastaudiomode;
int audiovolume;
- UCHAR aud_type;
+ u1 aud_type;
unsigned int vmrdeinterlacing;
VideoPresenter currentpresenter;
#ifdef DS_DEBUG
protected:
std::string mainText;
- UCHAR exitable;
- UCHAR dropThrough;
- UCHAR mainTextType;
+ u1 exitable;
+ u1 dropThrough;
+ u1 mainTextType;
WButton okbutton;
- const static UCHAR NORMAL = 1;
- const static UCHAR ONELINER = 2;
+ const static u1 NORMAL = 1;
+ const static u1 ONELINER = 2;
};
#endif
rt=-1;
}
else {
- rt=reader->getImageChunk((u8)offset,(u4)len,&numrec,(UCHAR **)buf);
+ rt=reader->getImageChunk((u8)offset,(u4)len,&numrec,(u1 **)buf);
}
}
Log::getInstance()->log("VMediaView::jpegReader", Log::DEBUG, "got n=%d,buf=%p,rt=%d",
return BoxStack::ABANDON_COMMAND;
}
-void VQuestion::setDefault(UCHAR option)
+void VQuestion::setDefault(u1 option)
{
selectedOption = option;
}
public:
VQuestion(MessageReceiver* replyTo);
~VQuestion();
- void setDefault(UCHAR option);
+ void setDefault(u1 option);
void setMainText(const char* title);
int handleCommand(int command);
void processMessage(Message* m);
void draw();
- const static UCHAR NO = 0;
- const static UCHAR YES = 1;
+ const static u1 NO = 0;
+ const static u1 YES = 1;
private:
MessageReceiver* replyTo;
void swap();
- UCHAR selectedOption{NO};
+ u1 selectedOption{NO};
WButton buttonYes;
WButton buttonNo;
w.nextSymbol = 0;
w.setPosition(barRegion.x + 66, barRegion.y + 16);
- UCHAR playerState = 0;
+ u1 playerState = 0;
if (action)
{
}
}
-bool VVideoLiveTV::channelChange(UCHAR changeType, u4 newData)
+bool VVideoLiveTV::channelChange(u1 changeType, u4 newData)
{
u4 newChannel = 0;
if (streamType == VDR::VIDEO)
void go();
- bool channelChange(UCHAR changeType, u4 newData);
+ bool channelChange(u1 changeType, u4 newData);
// changeType = INDEX = (newData is a channel index in the list)
// = NUMBER = (newData is a real channel number)
// = OFFSET = (newData is UP or DOWN)
- const static UCHAR INDEX = 1;
- const static UCHAR NUMBER = 2;
- const static UCHAR OFFSET = 3;
- const static UCHAR PREVIOUS = 4;
- const static UCHAR UP = 1;
- const static UCHAR DOWN = 2;
+ const static u1 INDEX = 1;
+ const static u1 NUMBER = 2;
+ const static u1 OFFSET = 3;
+ const static u1 PREVIOUS = 4;
+ const static u1 UP = 1;
+ const static u1 DOWN = 2;
void timercall(int ref);
w.nextSymbol = 0;
w.setPosition(barRegion.x + 66, barRegion.y + 16);
- UCHAR playerState = 0;
+ u1 playerState = 0;
if (action)
{
if ((playerState == PlayerMedia::S_FF) || (playerState == PlayerMedia::S_BACK))
{
// draw blips to show how fast the scan is
- UCHAR scanrate = 2;//player->getIScanRate();
+ u1 scanrate = 2;//player->getIScanRate();
if (scanrate >= 2)
{
char text[5];
{
if (barScanHold)
{
- UCHAR playerState = player->getState();
+ u1 playerState = player->getState();
// sticky bar is set if we are in ffwd/fbwd mode
// if player has gone to S_PLAY then kill stickyBar, and run doBar(0) which
// will repaint all the bar (it will call this function again, but
DrawStyle barBlue;
- UCHAR videoMode;
+ u1 videoMode;
void toggleChopSides();
bool playing;
w.nextSymbol = 0;
w.setPosition(barRegion.x + 66, barRegion.y + 16);
- UCHAR playerState = 0;
+ u1 playerState = 0;
if (action)
{
if ((playerState == PlayerVideoRec::S_FFWD) || (playerState == PlayerVideoRec::S_FBWD))
{
// draw blips to show how fast the scan is
- UCHAR scanrate = player->getIScanRate();
+ u1 scanrate = player->getIScanRate();
if (scanrate >= 2)
{
char text[5];
{
if (barScanHold)
{
- UCHAR playerState = player->getState();
+ u1 playerState = player->getState();
// sticky bar is set if we are in ffwd/fbwd mode
// if player has gone to S_PLAY then kill stickyBar, and run doBar(0) which
// will repaint all the bar (it will call this function again, but
mytext = takeText;
}
-void WButton::setActive(UCHAR tactive)
+void WButton::setActive(u1 tactive)
{
dimmed = false;
active = tactive;
public:
WButton();
void setText(const char* text);
- void setActive(UCHAR tactive);
+ void setActive(u1 tactive);
void dim();
void draw();
void setTag(int tag);
private:
std::string mytext;
- UCHAR active{};
+ u1 active{};
bool dimmed{};
int tag{};
};
}
width=size->right-size->left-adjwidth;
height=size->bottom-size->top-adjheight;
- UCHAR mode=Video::PAL;
- UCHAR aspect=Video::ASPECT4X3;
- UCHAR tvsize=Video::ASPECT4X3;
+ u1 mode=Video::PAL;
+ u1 aspect=Video::ASPECT4X3;
+ u1 tvsize=Video::ASPECT4X3;
Video* video = Video::getInstance();
if (video) {
mode=video->getMode();
rightArrow.setPosition(w - 18, 2);
}
-void WOptionBox::setActive(UCHAR tactive)
+void WOptionBox::setActive(u1 tactive)
{
active = tactive;
setData();
void addOption(const char* newOption);
void setSelected(const char* selectedOption);
- void setActive(UCHAR tactive);
+ void setActive(u1 tactive);
void left();
void right();
void cycle();
const static int MODE_INT = 2;
private:
- UCHAR active;
+ u1 active;
u4 numOptions;
char** options;
u4 currentOption;
for (u4 i = 0; i < 256; i++)
{
- const char* vompKeyName = InputMan::getVompKeyName(static_cast<UCHAR>(i));
+ const char* vompKeyName = InputMan::getVompKeyName(static_cast<u1>(i));
if (vompKeyName != NULL)
{
std::string line;
line.reserve(150);
line += vompKeyName;
line += ": \t";
- line += inputMan->getHardCodedHardwareKeyNamesForVompKey(static_cast<UCHAR>(i));
+ line += inputMan->getHardCodedHardwareKeyNamesForVompKey(static_cast<u1>(i));
line += " \t"; // FIXME extra spaces for braindead strtok. Ditch strtok.
- line += inputMan->getAllHardwareKeyNamesAssignedToVompKey(static_cast<UCHAR>(i));
+ line += inputMan->getAllHardwareKeyNamesAssignedToVompKey(static_cast<u1>(i));
sl.addOption(line, reinterpret_cast<void*>(i), 0);
}
}
case Input::OK:
{
learnmode = true;
- // Two casts to get from void* to UCHAR. Wow. First reinterpret from void* to u4, then static to UCHAR
+ // Two casts to get from void* to u1. Wow. First reinterpret from void* to u4, then static to u1
InputMan::getInstance()->EnterLearningMode(
- static_cast<UCHAR>(reinterpret_cast<u4>(sl.getCurrentOptionData())));
+ static_cast<u1>(reinterpret_cast<u4>(sl.getCurrentOptionData())));
return 1;
}
case Input::BACK:
#include "colour.h"
-UCHAR WSymbol::widths[] = { 2, 2, 4, 4, 1, 1, 3, 3, 3, 3, 3, 4, 4, 2, 2, 3, 5, 5, 4, 4, 2, 2, 5, 5, 4, 4, 5};
-UCHAR WSymbol::heights[] = { 8, 8, 12, 12, 24, 4, 18, 18, 18, 18, 18, 30, 30, 16, 16, 18, 18, 18, 16, 16, 8, 8, 16, 16, 16, 16, 26};
+u1 WSymbol::widths[] = { 2, 2, 4, 4, 1, 1, 3, 3, 3, 3, 3, 4, 4, 2, 2, 3, 5, 5, 4, 4, 2, 2, 5, 5, 4, 4, 5};
+u1 WSymbol::heights[] = { 8, 8, 12, 12, 24, 4, 18, 18, 18, 18, 18, 30, 30, 16, 16, 18, 18, 18, 16, 16, 8, 8, 16, 16, 16, 16, 26};
-UCHAR WSymbol::symbols[] = {
+u1 WSymbol::symbols[] = {
/*
00000000 00000011
offset += (widths[i]) * heights[i];
}
- UCHAR* base = symbols + offset;
+ u1* base = symbols + offset;
int widthBytes = widths[nextSymbol];
int widthBits = widthBytes * 8;
int sHeight = heights[nextSymbol];
//TODO add vector based Symbols
void draw();
- UCHAR nextSymbol;
+ u1 nextSymbol;
DrawStyle nextColour;
bool mouseLBDOWN(int x, int y);
- const static UCHAR VOLUME = 0;
- const static UCHAR TEST = 1;
- const static UCHAR TEST2 = 2;
- const static UCHAR VOLUME2 = 3;
- const static UCHAR VOLBAR = 4;
- const static UCHAR VOLDOT = 5;
- const static UCHAR SKIPBACK = 6;
- const static UCHAR SKIPFORWARD = 7;
- const static UCHAR UP = 8;
- const static UCHAR DOWN = 9;
- const static UCHAR PLAY = 10;
- const static UCHAR MUTE = 11;
- const static UCHAR UNMUTE = 12;
- const static UCHAR LEFTARROW = 13;
- const static UCHAR RIGHTARROW = 14;
- const static UCHAR PAUSE = 15;
- const static UCHAR SKIPBACK2 = 16;
- const static UCHAR SKIPFORWARD2 = 17;
- const static UCHAR FBWD = 18;
- const static UCHAR FFWD = 19;
- const static UCHAR SMALLUP = 20;
- const static UCHAR SMALLDOWN = 21;
- const static UCHAR VIDEOASPECT43 = 22;
- const static UCHAR VIDEOASPECT169 = 23;
- const static UCHAR SINGLEAUDIO = 24;
- const static UCHAR MULTIAUDIO = 25;
- const static UCHAR CLOCK = 26;
+ const static u1 VOLUME = 0;
+ const static u1 TEST = 1;
+ const static u1 TEST2 = 2;
+ const static u1 VOLUME2 = 3;
+ const static u1 VOLBAR = 4;
+ const static u1 VOLDOT = 5;
+ const static u1 SKIPBACK = 6;
+ const static u1 SKIPFORWARD = 7;
+ const static u1 UP = 8;
+ const static u1 DOWN = 9;
+ const static u1 PLAY = 10;
+ const static u1 MUTE = 11;
+ const static u1 UNMUTE = 12;
+ const static u1 LEFTARROW = 13;
+ const static u1 RIGHTARROW = 14;
+ const static u1 PAUSE = 15;
+ const static u1 SKIPBACK2 = 16;
+ const static u1 SKIPFORWARD2 = 17;
+ const static u1 FBWD = 18;
+ const static u1 FFWD = 19;
+ const static u1 SMALLUP = 20;
+ const static u1 SMALLDOWN = 21;
+ const static u1 VIDEOASPECT43 = 22;
+ const static u1 VIDEOASPECT169 = 23;
+ const static u1 SINGLEAUDIO = 24;
+ const static u1 MULTIAUDIO = 25;
+ const static u1 CLOCK = 26;
private:
- static UCHAR symbols[];
- static UCHAR widths[];
- static UCHAR heights[];
+ static u1 symbols[];
+ static u1 widths[];
+ static u1 heights[];
};
#endif