return true;
}
-/*Option(UINT id, const char* displayText, const char* configSection, const char* configKey, UINT optionType,
- UINT numChoices, UINT defaultChoice, UINT startInt,
+/*Option(u4 id, const char* displayText, const char* configSection, const char* configKey, u4 optionType,
+ u4 numChoices, u4 defaultChoice, u4 startInt,
const char * const * options, const char * const * optionkeys = NULL, AbstractOption* handler=NULL);*/
bool AudioOMX::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane)
cur_input_buf_omx=NULL;
input_bufs_omx_mutex.lock();
- for (UINT i=0; i< input_bufs_omx_all.size();i++) {
+ for (u4 i=0; i< input_bufs_omx_all.size();i++) {
error=OMX_FreeBuffer(omx_aud_rend/*dec*/,omx_rend_input_port/*codec*/,input_bufs_omx_all[i]);
if (error!=OMX_ErrorNone){
LogNT::getInstance()->debug(TAG, "Use OMX_FreeBuffer failed {:#x}", error);
}
-void AudioOMX::PrepareMediaSample(const MediaPacketList& mplist, UINT /* samplepos */)
+void AudioOMX::PrepareMediaSample(const MediaPacketList& mplist, u4 /* samplepos */)
{
packet = mplist.front();
}
-UINT AudioOMX::DeliverMediaSample(UCHAR* buffer, UINT* samplepos) {
+u4 AudioOMX::DeliverMediaSample(UCHAR* buffer, u4* samplepos) {
DeliverMediaPacket(packet, buffer, samplepos);
if (*samplepos == packet.length) {
*samplepos = 0;
}
-UINT AudioOMX::DeliverMediaPacket(MediaPacket mpacket, const UCHAR* buffer,
- UINT *samplepos) {
+u4 AudioOMX::DeliverMediaPacket(MediaPacket mpacket, const UCHAR* buffer,
+ u4 *samplepos) {
/*First Check, if we have an audio sample*/
VideoOMX* vw = static_cast<VideoOMX*>(Video::getInstance());
bool achange=false;
//LogNT::getInstance()->debug(TAG, "DMP mark 2");
- UINT headerstrip = 0;
+ u4 headerstrip = 0;
if (mpacket.disconti) {
firstsynched = false;
decompress_buffer_filled=0;
//Writing Data to Audiodevice
- virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
- virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
- UINT DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer,UINT *samplepos);
+ virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos);
+ virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos);
+ u4 DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer,u4 *samplepos);
virtual long long SetStartOffset(long long curreftime, bool *rsync);
virtual void ResetTimeOffsets();
bool firstsynched;
MediaPacket packet;
- UINT packetpos;
+ u4 packetpos;
bool hdmi; // use hdmi as audio output
if (! canPosition) return 1;
threadLock();
u4 curr=demuxer->getSecondsFromLen(streampos);
- u4 dest=demuxer->positionFromSeconds(curr+(UINT)seconds);
+ u4 dest=demuxer->positionFromSeconds(curr+(u4)seconds);
if (dest != 0) {
logger->log("AudioPlayer",Log::DEBUG,"new pos %ld skip %ds",dest,seconds);
requestedStreampos=dest;
if (! canPosition) return 1;
threadLock();
u4 curr=demuxer->getSecondsFromLen(streampos);
- if (curr > (UINT)seconds) {
- u4 dest=demuxer->positionFromSeconds(curr-(UINT)seconds);
+ if (curr > (u4)seconds) {
+ u4 dest=demuxer->positionFromSeconds(curr-(u4)seconds);
if (dest != 0) {
logger->log("AudioPlayer",Log::DEBUG,"new pos %ld skip %ds",dest,seconds);
requestedStreampos=dest;
MediaPacketList pl;
pl.push_back(p);
audio->PrepareMediaSample(pl,0);
- UINT bytesWritten=0;
- UINT rt=audio->DeliverMediaSample(threadBuffer,&bytesWritten);
+ u4 bytesWritten=0;
+ u4 rt=audio->DeliverMediaSample(threadBuffer,&bytesWritten);
u4 written=thisRead;
if (rt == 0)
written=bytesWritten;
return 1;
}
-void AudioWin::PrepareMediaSample(const MediaPacketList& mplist,UINT samplepos)
+void AudioWin::PrepareMediaSample(const MediaPacketList& mplist,u4 samplepos)
{
mediapacket = mplist.front();
}
return true;
}
-UINT AudioWin::DeliverMediaSample(UCHAR* buffer, UINT *samplepos)
+u4 AudioWin::DeliverMediaSample(UCHAR* buffer, u4 *samplepos)
{
DeliverMediaPacket(mediapacket, buffer, samplepos);
if (*samplepos == mediapacket.length) {
else return 0;
}
-UINT AudioWin::DeliverMediaPacket(const MediaPacket packet,
+u4 AudioWin::DeliverMediaPacket(const MediaPacket packet,
UCHAR* buffer,
- UINT *samplepos)
+ u4 *samplepos)
{
/*First Check, if we have an audio sample*/
REFERENCE_TIME reftime1=0;
REFERENCE_TIME reftime2=0;
- UINT headerstrip=0;
+ u4 headerstrip=0;
if (packet.disconti) {
firstsynched=false;
vw->DeliverAudioMediaSample();
/*Inspect PES-Header */
-/* UINT header_length=buffer[(packet.pos_buffer+8)%bufferlength]+8/*is this right*;
+/* u4 header_length=buffer[(packet.pos_buffer+8)%bufferlength]+8/*is this right*;
*/
if (*samplepos==0 && packet.type!=MPTYPE_MPEG_AUDIO_LAYER3) {//stripheader
headerstrip=buffer[packet.pos_buffer+8]+9;
}
}
BYTE *ms_buf;
- UINT ms_length;
- UINT ms_pos;
- UINT haveToCopy;
+ u4 ms_length;
+ u4 ms_pos;
+ u4 haveToCopy;
if (!vw->getCurrentAudioMediaSample(&ms) || ms==NULL) {// get the current sample
//samplepos=0;
//MILLISLEEP(10);
bool addOptionPagesToWTB(WTabBar *wtb);
// Writing Data to Audiodevice
- virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
- virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
- UINT DeliverMediaPacket(MediaPacket packet, UCHAR* buffer, UINT *samplepos);
+ virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos);
+ virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos);
+ u4 DeliverMediaPacket(MediaPacket packet, UCHAR* buffer, u4 *samplepos);
int dsInitAudioFilter(IGraphBuilder* dsgraphbuilder);
const AudioFilterDescList *getAudioFilterList(int &selected);
colour[index] = yrba2argb(tY, tCr, tCb, tA);
}
-Bitmap::Bitmap(UINT tWidth, UINT tHeight, UCHAR tBpp)
+Bitmap::Bitmap(u4 tWidth, u4 tHeight, UCHAR tBpp)
{
setSize(tWidth, tHeight);
palette.setBpp(tBpp);
}
-void Bitmap::setSize(UINT tWidth, UINT tHeight)
+void Bitmap::setSize(u4 tWidth, u4 tHeight)
{
if (width == tWidth && height == tHeight) return;
width = tWidth; height = tHeight;
bitmap.assign(width * height, 0);
}
-bool Bitmap::setIndex(UINT x, UINT y, UCHAR index)
+bool Bitmap::setIndex(u4 x, u4 y, UCHAR index)
{
if (x <= width && y <= height)
{
else return false;
}
-UCHAR Bitmap::getIndex(UINT x, UINT y) const
+UCHAR Bitmap::getIndex(u4 x, u4 y) const
{
if (x > width || y > height)
return 0;
return bitmap[x + y*width];
}
-u4 Bitmap::getColour(UINT x, UINT y) const
+u4 Bitmap::getColour(u4 x, u4 y) const
{
if (x > width || y > height)
return 0;
{
public:
DisplayRegion();
- UINT windowx, windowy, windoww, windowh;
- UINT framewidth,frameheight;
+ u4 windowx, windowy, windoww, windowh;
+ u4 framewidth,frameheight;
};
class Palette
const std::vector<UCHAR>& getCrVector() const { return Cr; }
const std::vector<UCHAR>& getCbVector() const { return Cb; }
const std::vector<UCHAR>& getAVector() const { return A; }
- UINT getNumColours() const { return numColours; }
+ u4 getNumColours() const { return numColours; }
private:
- const static UINT MAX_DEPTH = 8;
+ 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;
- UINT maxColours, numColours;
+ 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);
};
{
private:
std::vector<UCHAR> bitmap;
- UINT width, height;
+ u4 width, height;
public:
- Bitmap(UINT tWidth = 0, UINT tHeight = 0, UCHAR tBpp = 8);
+ Bitmap(u4 tWidth = 0, u4 tHeight = 0, UCHAR tBpp = 8);
Palette palette;
- UINT getWidth() const { return width; }
- UINT getHeight() const { return height; }
- UCHAR getIndex(UINT x, UINT y) const;
- u4 getColour(UINT x, UINT y) const;
+ u4 getWidth() const { return width; }
+ u4 getHeight() const { return height; }
+ UCHAR getIndex(u4 x, u4 y) const;
+ u4 getColour(u4 x, u4 y) const;
const std::vector<UCHAR> & rawData() const { return bitmap; }
- void setSize(UINT tWidth, UINT tHeight);
- bool setIndex(UINT x, UINT y, UCHAR index);
+ void setSize(u4 tWidth, u4 tHeight);
+ bool setIndex(u4 x, u4 y, UCHAR index);
void setAllIndices(UCHAR index);
};
}
}
-void Boxx::setSize(UINT w, UINT h)
+void Boxx::setSize(u4 w, u4 h)
{
area.w = w;
area.h = h;
}
-void Boxx::setPosition(UINT x, UINT y)
+void Boxx::setPosition(u4 x, u4 y)
{
area.x = x;
area.y = y;
return visible;
}
-void Boxx::setGap(UINT gap)
+void Boxx::setGap(u4 gap)
{
paraVSpace = gap;
}
return area.y + area.h;
}
-UINT Boxx::getWidth() const
+u4 Boxx::getWidth() const
{
return area.w;
}
-UINT Boxx::getHeight() const
+u4 Boxx::getHeight() const
{
return area.h;
}
int Boxx::drawPara(const char* text, int x, int y, const DrawStyle& colour, unsigned int skiplines)
{
char line[256];
- UINT lineHeight = getFontHeight() + paraVSpace;
+ u4 lineHeight = getFontHeight() + paraVSpace;
float lineWidth;
float thisCharWidth;
int textPos = 0;
int textLength = strlen(text);
int linePos;
- UINT ypos = y;
+ u4 ypos = y;
int printLine;
int leftlines = 0;
int drawLinePos = -skiplines;
// Level 0 drawing functions
-void Boxx::rectangle(UINT x, UINT y, UINT w, UINT h, const DrawStyle& colour)
+void Boxx::rectangle(u4 x, u4 y, u4 w, u4 h, const DrawStyle& colour)
{
if (parent) parent->rectangle(area.x + x, area.y + y, w, h, colour);
else surface->fillblt(x, y, w, h, colour);
// Now deprecated
/*
-void Boxx::drawPixelAlpha(UINT x, UINT y, const Colour& colour,bool fastdraw)
+void Boxx::drawPixelAlpha(u4 x, u4 y, const Colour& colour,bool fastdraw)
{
if (parent) parent->drawPixelAlpha(area.x + x, area.y + y, colour,fastdraw);
else
}
}
-void Boxx::drawPixel(UINT x, UINT y, const Colour& colour, bool fastdraw)
+void Boxx::drawPixel(u4 x, u4 y, const Colour& colour, bool fastdraw)
{
if (parent) parent->drawPixel(area.x + x, area.y + y, colour,fastdraw);
else
else if (surface) surface->drawTTChar(ox, oy,x,y,c);
}
-void Boxx::drawBitmap(UINT x, UINT y, const Bitmap& bm, const DisplayRegion & region)
+void Boxx::drawBitmap(u4 x, u4 y, const Bitmap& bm, const DisplayRegion & region)
{
if (parent) parent->drawBitmap(area.x + x, area.y + y, bm, region);
else if (surface) surface->drawBitmap(x, y, bm, region);
Boxx();
virtual ~Boxx();
- virtual void setSize(UINT w, UINT h); // virtual? really?
- void setPosition(UINT x, UINT y); // Set position on parent. Even numbers only!!!
+ virtual void setSize(u4 w, u4 h); // virtual? really?
+ void setPosition(u4 x, u4 y); // Set position on parent. Even numbers only!!!
void createBuffer(); // Make this a root view that goes in the BoxStack
virtual void draw();
- void setGap(UINT gap);
+ void setGap(u4 gap);
void setBackgroundColour(const DrawStyle& colour);
void setVisible(bool isVisible);
void setVideoBackground();
int getX2() const; // .. and the right edge
int getY() const;
int getY2() const;
- UINT getWidth() const;
- UINT getHeight() const;
+ u4 getWidth() const;
+ u4 getHeight() const;
bool getVisible() const;
const Region* getRegion() const;
Region getRegionR() const; // Same but as an object
int drawPara(const char* text, int x, int y, const DrawStyle& colour, unsigned int skiplines=0);
// Drawing functions level 0
- void rectangle(UINT x, UINT y, UINT w, UINT h, const DrawStyle& colour);
+ void rectangle(u4 x, u4 y, u4 w, u4 h, const DrawStyle& colour);
void rectangle(Region& region, const DrawStyle& colour);
void drawText(const char* text, int x, int y, const DrawStyle& colour);
void drawTextRJ(const std::string& text, int x, int y, const DrawStyle& colour);
void drawTextCentre(const std::string& text, int x, int y, const DrawStyle& colour);
//Now deprecated
- //void drawPixel(UINT x, UINT y, const Colour& colour, bool fastdraw=false);
- void drawBitmap(UINT x, UINT y, const Bitmap& bm, const DisplayRegion& region);
+ //void drawPixel(u4 x, u4 y, const Colour& colour, bool fastdraw=false);
+ void drawBitmap(u4 x, u4 y, const Bitmap& bm, const DisplayRegion& region);
//Now deprecated
- // void drawPixelAlpha(UINT x, UINT y, const Colour& colour,bool fastdraw=false);
+ // void drawPixelAlpha(u4 x, u4 y, const Colour& colour,bool fastdraw=false);
void drawImage(Image& image, float x, float y, float width, float height, Corner corner=TopLeft);
void drawClippingRectangle(float x, float y, float w, float h);
int getFontHeight();
void removeVisibleChilds(Region & r);
static const int paraMargin = 10;
- UINT paraVSpace{6}; // default gap for drawPara
+ u4 paraVSpace{6}; // default gap for drawPara
DrawStyle backgroundColour;
bool backgroundColourSet{};
if (chanList && chanList->size())
{
Channel* chan = NULL;
- for (UINT i = 0; i < chanList->size(); i++)
+ for (u4 i = 0; i < chanList->size(); i++)
{
if ((*chanList)[i]->number == static_cast<u4>(startToLiveTV))
{
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
-typedef unsigned int UINT;
-
#include <stdint.h>
#else
- int min(UINT, int);
+ int min(u4, int);
/*#ifdef _MIPS_ARCH
#define Surface_TYPE SurfaceDirectFB
#else
/*
typedef struct
{
- UINT id; // Used for working out what has changed at the end
+ u4 id; // Used for working out what has changed at the end
char *title; // Name of the option
char *configSection; // Which section of the config file
char *configParam; // Parameter name in the config file
- UINT optionType; // 1 for text, 2 for int
- UINT optionCount; // How many choices?
- UINT defaultOption; // Serial of the default choice (base 0), or actual option in int mode
+ u4 optionType; // 1 for text, 2 for int
+ u4 optionCount; // How many choices?
+ u4 defaultOption; // Serial of the default choice (base 0), or actual option in int mode
int startInt; // Starting int for int mode
const char * const * options; // Text for the options (null for int mode)
} OPTIONDATA;
class NALUUnit {
public:
- NALUUnit(const UCHAR* buf,UINT length_buf);
+ NALUUnit(const UCHAR* buf,u4 length_buf);
~NALUUnit();
-inline UINT getBits(UINT num_bits);
- UINT getUe();
+inline u4 getBits(u4 num_bits);
+ u4 getUe();
int getSe();
bool isEonalu() {return eonalu;};
int getPos(){return pos;};
protected:
UCHAR* nalu_buf;
- UINT nalu_length;
- UINT pos;
+ u4 nalu_length;
+ u4 pos;
UCHAR bit_pos;
UCHAR working_byte;
- UINT last_bytes;
+ u4 last_bytes;
bool eonalu;
};
-NALUUnit::NALUUnit(const UCHAR *buf, UINT length_buf)
+NALUUnit::NALUUnit(const UCHAR *buf, u4 length_buf)
{
nalu_length=0;
nalu_buf=NULL;
last_bytes=0;
eonalu=false;
- UINT nalu_start=0;
- UINT nalu_end=0;
- UINT pattern =(((UINT)buf[ 0] << 16) |
- ((UINT)buf[1] << 8) |
- (UINT)buf[2] );
+ u4 nalu_start=0;
+ u4 nalu_end=0;
+ u4 pattern =(((u4)buf[ 0] << 16) |
+ ((u4)buf[1] << 8) |
+ (u4)buf[2] );
nalu_start=3;
while (pattern != 0x000001)
{
if (nalu_buf) free(nalu_buf);
}
-inline UINT NALUUnit::getBits(UINT num_bits)
+inline u4 NALUUnit::getBits(u4 num_bits)
{
if (num_bits==0) return 0; //???
- UINT remain_bits=num_bits;
- UINT work=0;
+ u4 remain_bits=num_bits;
+ u4 work=0;
//May be slow, but should work!
while (remain_bits>0) {
if (bit_pos==0) {
}
}
- UINT fetch_bits=std::min(remain_bits, static_cast<UINT>(8-bit_pos));
+ u4 fetch_bits=std::min(remain_bits, static_cast<u4>(8-bit_pos));
work=work <<fetch_bits;
//work|=((working_byte>>bit_pos) & (0xFF>>(8-fetch_bits)));
work|=(working_byte &(0xFF>>(bit_pos)))>>(8-fetch_bits-bit_pos);
return work;
}
-UINT NALUUnit::getUe()
+u4 NALUUnit::getUe()
{
int leadbits=-1;
bool bit;
int NALUUnit::getSe()
{
- UINT input=getUe();
+ u4 input=getUe();
if (input==0) return 0;
int output=((input+1)>>1);
if (input & 0x1) output*=-1;
if (size + len > 0x10000) return 0;
if (size + len > data_size)
{ // Reallocate
- UINT new_data_size = std::max(data_size + data_size / 2, data_size + 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);
else return PTS_INVALID;
}
-UCHAR PESPacket::operator[] (UINT index) const
+UCHAR PESPacket::operator[] (u4 index) const
{
if (index >= size)
return 0;
return data[index];
}
-UINT PESPacket::findPictureHeader(bool h264) const
+u4 PESPacket::findPictureHeader(bool h264) const
{
if (size < 12) return 0;
- UINT pattern = ( ((UINT)data[ 8] << 24) |
- ((UINT)data[ 9] << 16) |
- ((UINT)data[10] << 8) |
- (UINT)data[11] );
- UINT pos = 11;
+ u4 pattern = ( ((u4)data[ 8] << 24) |
+ ((u4)data[ 9] << 16) |
+ ((u4)data[10] << 8) |
+ (u4)data[11] );
+ u4 pos = 11;
if (h264) {
while (pattern != DEMUXER_H264_ACCESS_UNIT)
}
}
-UINT PESPacket::countPictureHeaders(bool h264, struct PictCountInfo& pinfo) const
+u4 PESPacket::countPictureHeaders(bool h264, struct PictCountInfo& pinfo) const
{
if (size < 12) return 0;
- UINT pattern = ( ((UINT)data[ 8] << 24) |
- ((UINT)data[ 9] << 16) |
- ((UINT)data[10] << 8) |
- (UINT)data[11] );
- UINT pos = 11;
- UINT count=0;
+ u4 pattern = ( ((u4)data[ 8] << 24) |
+ ((u4)data[ 9] << 16) |
+ ((u4)data[10] << 8) |
+ (u4)data[11] );
+ u4 pos = 11;
+ u4 count=0;
if (h264) {
//inspired by vdr algorithm for frame couting by Klaus Schmidinger
while (pos<size)
pos++;
pattern = (pattern << 8) | data[pos];
if ((pattern &0xFFFFFF00)==0x00000100) {
- UINT testpattern=(pattern& 0xFFFFFF1f);
+ u4 testpattern=(pattern& 0xFFFFFF1f);
if (testpattern==DEMUXER_H264_ACCESS_UNIT) pinfo.hasaccessunit=true;
else if (testpattern==DEMUXER_H264_SEQ_PARAMETER_SET ) {
pinfo.hassps=true;
{
if (i<6)
{
- UINT lastscale=8;
- UINT nextscale=8;
+ u4 lastscale=8;
+ u4 nextscale=8;
for (int j=0;j<16;j++) {
if (nextscale!=0) {
- UINT delta=nalu.getSe();
+ u4 delta=nalu.getSe();
nextscale=(lastscale+delta+256)%256;
}
lastscale=(nextscale==0)?lastscale:nextscale;
}
else
{
- UINT lastscale=8;
- UINT nextscale=8;
+ u4 lastscale=8;
+ u4 nextscale=8;
for (int j=0;j<64;j++) {
if (nextscale!=0) {
- UINT delta=nalu.getSe();
+ u4 delta=nalu.getSe();
nextscale=(lastscale+delta+256)%256;
}
lastscale=(nextscale==0)?lastscale:nextscale;
}
}
- UINT checkMaxFrameNum = nalu.getUe() + 4; //log2framenum
+ u4 checkMaxFrameNum = nalu.getUe() + 4; //log2framenum
if (checkMaxFrameNum < 13) {
pinfo.log2_max_frame_num = checkMaxFrameNum;
continue;
}
- UINT temp=nalu.getUe();
+ u4 temp=nalu.getUe();
if (temp==0) //pict order
nalu.getUe();
else if (temp==1) {
nalu.getBits(1);
nalu.getSe();
nalu.getSe();
- UINT temp2=nalu.getUe();
- for (UINT i=0;i<temp2;i++)
+ u4 temp2=nalu.getUe();
+ for (u4 i=0;i<temp2;i++)
nalu.getSe();
}
nalu.getUe(); //Num refframes
}
}
-UINT PESPacket::findSeqHeader(bool h264) const
+u4 PESPacket::findSeqHeader(bool h264) const
{
if (seq_header != 1) return seq_header;
if (size < 12) return 0;
- UINT pattern = ( ((UINT)data[ 8] << 24) |
- ((UINT)data[ 9] << 16) |
- ((UINT)data[10] << 8) |
- (UINT)data[11] );
- UINT pos = 11;
+ u4 pattern = ( ((u4)data[ 8] << 24) |
+ ((u4)data[ 9] << 16) |
+ ((u4)data[10] << 8) |
+ (u4)data[11] );
+ u4 pos = 11;
if (h264) {
while ((pattern & 0xFFFFFF1F) != DEMUXER_H264_SEQ_PARAMETER_SET)
{
return seq_header;
}
-UINT PESPacket::findSeqExtHeader(bool h264) const
+u4 PESPacket::findSeqExtHeader(bool h264) const
{
if (seq_header != 1) return seq_header;
if (size < 12) return 0;
- UINT pattern = ( ((UINT)data[ 8] << 24) |
- ((UINT)data[ 9] << 16) |
- ((UINT)data[10] << 8) |
- (UINT)data[11] );
- UINT pos = 11;
+ u4 pattern = ( ((u4)data[ 8] << 24) |
+ ((u4)data[ 9] << 16) |
+ ((u4)data[10] << 8) |
+ (u4)data[11] );
+ u4 pos = 11;
if (h264) {
while ((pattern & 0xFFFFFF1F) != DEMUXER_H264_SUB_ENHANCEMENT_INF)
{
bool Demuxer::submitPacket(PESPacket& packet)
{
- UINT sent = 0;
+ u4 sent = 0;
UCHAR packet_type = packet.getPacketType();
const UCHAR* packetdata = packet.getData();
if (packet_type >= PESTYPE_VID0 && packet_type <= PESTYPE_VIDMAX)
if (packet.hasPTS()) video_pts = packet.getPTS();
// If there is a sequence header, extract information
- UINT pos = packet.findSeqHeader(h264);
+ u4 pos = packet.findSeqHeader(h264);
if (pos > 1)
{
if (!h264) {
{
if (i<6)
{
- UINT lastscale=8;
- UINT nextscale=8;
+ u4 lastscale=8;
+ u4 nextscale=8;
for (int j=0;j<16;j++) {
if (nextscale!=0) {
- UINT delta=nalu.getSe();
+ u4 delta=nalu.getSe();
nextscale=(lastscale+delta+256)%256;
}
lastscale=(nextscale==0)?lastscale:nextscale;
}
else
{
- UINT lastscale=8;
- UINT nextscale=8;
+ u4 lastscale=8;
+ u4 nextscale=8;
for (int j=0;j<64;j++) {
if (nextscale!=0) {
- UINT delta=nalu.getSe();
+ u4 delta=nalu.getSe();
nextscale=(lastscale+delta+256)%256;
}
lastscale=(nextscale==0)?lastscale:nextscale;
};
nalu.getUe(); //log2framenum
- UINT temp=nalu.getUe();
+ u4 temp=nalu.getUe();
if (temp==0) //pict order
nalu.getUe();
else if (temp==1) {
nalu.getBits(1);
nalu.getSe();
nalu.getSe();
- UINT temp2=nalu.getUe();
- for (UINT i=0;i<temp2;i++)
+ u4 temp2=nalu.getUe();
+ for (u4 i=0;i<temp2;i++)
nalu.getSe();
}
nalu.getUe(); //Num refframes
{
if (nalu.getBits(1))
{
- UINT aspectratioidc=nalu.getBits(8);
+ u4 aspectratioidc=nalu.getBits(8);
bool hasaspect=false;
int aspectx,aspecty;
const float aspects[]={1., 1./1.,12./11.,10./11.,16./11.,40./33.,
}
}
- UINT posext = packet.findSeqExtHeader(h264);
+ u4 posext = packet.findSeqExtHeader(h264);
if (posext>1) {
if (!h264) {
interlaced=!(packet[pos+1] & 0x08); //really simple
}
}
-UINT Demuxer::stripAudio(UCHAR* buf, UINT len)
+u4 Demuxer::stripAudio(UCHAR* buf, u4 len)
{
- UINT read_pos = 0, write_pos = 0;
- UINT pattern, packet_length;
+ u4 read_pos = 0, write_pos = 0;
+ u4 pattern, packet_length;
if (len < 4) return 0;
pattern = (buf[0] << 16) | (buf[1] << 8) | (buf[2]);
while (read_pos + 7 <= len)
return write_pos;
}
-void Demuxer::changeTimes(UCHAR* buf, UINT len,UINT playtime)
+void Demuxer::changeTimes(UCHAR* buf, u4 len,u4 playtime)
{
- UINT pattern, packet_length;
- UINT read_pos = 0;
+ u4 pattern, packet_length;
+ u4 read_pos = 0;
if (len < 4) return;
pattern = (buf[0] << 16) | (buf[1] << 8) | (buf[2]);
while (read_pos + 7 <= len)
}
-bool Demuxer::scanForVideo(UCHAR* buf, UINT len, bool &ish264)
+bool Demuxer::scanForVideo(UCHAR* buf, u4 len, bool &ish264)
{
- UINT pos = 3;
- UINT pattern;
+ u4 pos = 3;
+ u4 pattern;
ish264=false;
if (len < 4) return false;
pattern = (buf[0] << 16) | (buf[1] << 8) | (buf[2]);
void truncate();
int write(const UCHAR* buf, int len);
- UCHAR operator[] (UINT index) const;
+ UCHAR 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; }
- UINT getLength() const { return length; }
- UINT getSize() const { return size; }
+ 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; }
u8 getPTS() const;
bool hasPTS() const { return (getPTS() != PTS_INVALID); }
- UINT findPictureHeader(bool h264) const;
- UINT findSeqHeader(bool h264) const;
- UINT findSeqExtHeader(bool h264) const;
- UINT countPictureHeaders(bool h264, struct PictCountInfo& pinfo) const;
+ u4 findPictureHeader(bool h264) const;
+ u4 findSeqHeader(bool h264) const;
+ u4 findSeqExtHeader(bool h264) const;
+ u4 countPictureHeaders(bool h264, struct PictCountInfo& pinfo) const;
static const u8 PTS_INVALID = (1LL << 33);
protected:
void copyFrom(const PESPacket& packet);
UCHAR * data;
- UINT length, size;
- UINT data_size;
+ u4 length, size;
+ u4 data_size;
UCHAR packetType;
UCHAR substream;
- UINT mutable seq_header; // 0 = no, 1 = unknown, else = header offset
+ u4 mutable seq_header; // 0 = no, 1 = unknown, else = header offset
};
class Demuxer
// 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 UINT stripAudio(UCHAR* buf, UINT len);
- void changeTimes(UCHAR* buf, UINT len,UINT playtime);
+ virtual u4 stripAudio(UCHAR* buf, u4 len);
+ void changeTimes(UCHAR* 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, UINT len, bool &ish264);
+ static bool scanForVideo(UCHAR* buf, u4 len, bool &ish264);
enum PESTYPE
{
framelen is the len without header (10 Bytes for V23, 6 Bytes for v2x)
*/
-#define MAXLEN(tagtype) ((UINT)frameLen<sizeof(tag->tagtype)-1?(UINT)frameLen:sizeof(tag->tagtype)-1)
+#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) {
int tl=v23?4:3;
int tagIndex=-1;
if (tag == NULL) return false;
if (frameLen < 2) return false;
- for (UINT i=0;i< NUMKNOWN;i++) {
+ for (u4 i=0;i< NUMKNOWN;i++) {
if(strncmp((char *)frameData,knownFrames[i].bytes,tl) == 0) {
tagIndex=knownFrames[i].index;
break;
int oldBytes=0;
if (tmpFill != 0 || (buffer->bufferEmpty() && len < HDRLEN)) {
//OK we have to copy everything to the tmp buffer
- int cp=(UINT)len<(PACKET_SIZE-tmpFill)?(UINT)len:(PACKET_SIZE-tmpFill);
+ int cp=(u4)len<(PACKET_SIZE-tmpFill)?(u4)len:(PACKET_SIZE-tmpFill);
memcpy(&tmpBuffer[tmpFill],wbuf,cp);
oldBytes=tmpFill;
tmpFill+=cp;
return inSync;
}
-UINT DemuxerAudio::getSyncErrors() {
+u4 DemuxerAudio::getSyncErrors() {
return outOfSync;
}
//special functions for the audioplayer
bool isSync() ;
- UINT getSyncErrors();
+ u4 getSyncErrors();
//set the skip factor
void setSkipFactor(int faktor);
//how many bytes do we need at the file start
//ID3V2, VBR + some spare to detect a first header
- static UINT headerBytes() {
+ static u4 headerBytes() {
return 4096;
}
//how many bytes do we need at the end
- static UINT footerBytes() {
+ static u4 footerBytes() {
return 128;
}
//return a reference to an ID3 tag
//fill it into the ID3 store
bool fillId3Tag(id3_tag * tag,UCHAR * frameData, int frameLen, int dataOffset, bool v23);
- const static UINT PACKET_SIZE=4096;
+ const static u4 PACKET_SIZE=4096;
private:
/*max size of a packet
see http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm
//info flags for the player
bool inSync; //set if we read a valid header
- UINT outOfSync; //counts each invalid read headers
+ u4 outOfSync; //counts each invalid read headers
bool hasHdrInfo; //if we have been able to successfully
//parse the first header
bool hasVBRInfo; //we have VBR and the necessary info
//we need a buffer to be able to read at least a complete header
const static int HDRLEN=4;
UCHAR tmpBuffer[PACKET_SIZE+HDRLEN];
- UINT tmpFill;
+ u4 tmpFill;
//compute the bytes/second from the BR info
//return 0 if not there;
buf++; len--; ret++;
break;
case -4:
- packetLength = ((UINT)*buf) << 8;
+ packetLength = ((u4)*buf) << 8;
state--;
buf++; len--; ret++;
break;
p += eslength; //skip es descriptor
}
} else if (pid == scanaid) {
- // UINT framelength = ((UINT)curbuf[4] << 8) | curbuf[5]; UNUSED?
+ // u4 framelength = ((u4)curbuf[4] << 8) | curbuf[5]; UNUSED?
if ( curbuf[7] & 0x80 ) // PTS_DTS_flags indicate that PTS is present
{
{
packetNumber++;
}
- UINT pictsinpacket=packet.countPictureHeaders(h264,pinfo);
+ u4 pictsinpacket=packet.countPictureHeaders(h264,pinfo);
- UINT numpicts=0;
+ u4 numpicts=0;
/* if (!doubledframerate)
{*/
numpicts=pictsinpacket;
me = pts_map.front();
pts_map_mutex.unlock();
- //UINT fps = Video::getInstance()->getFPS();
+ //u4 fps = Video::getInstance()->getFPS();
double tfps=fps;
// if (doubledframerate) tfps*=2.;
long long pts_expected = me.pts + 90000LL*((long long)(((double)(frame_num - me.frame)) / tfps));
}
-bool DemuxerTS::scanForVideo(UCHAR* buf, UINT len, bool &ish264)
+bool DemuxerTS::scanForVideo(UCHAR* buf, u4 len, bool &ish264)
{
int pmtpidy=0;
return false;
}
-UINT DemuxerTS::stripAudio(UCHAR* buf, UINT len) //it has to be adapted
+u4 DemuxerTS::stripAudio(UCHAR* buf, u4 len) //it has to be adapted
{
//This function strips all TS Headers and non video payload
- UINT readpos=0;
- UINT writepos=0;
+ u4 readpos=0;
+ u4 writepos=0;
PESPacket destpaket;
bool started=true;
while (readpos < len ) {
if (buf[readpos] != TS_SIG) {readpos++; continue;}
- UINT oldreadpos=readpos;
+ u4 oldreadpos=readpos;
int datalen = TS_SIZE - 4;
int pid = ( (buf[readpos+1] & 0x1F) << 8 ) | buf[readpos+2];
continue;
}
readpos += (TS_SIZE - datalen);
- UINT towrite=min(datalen,len-readpos);
+ u4 towrite=min(datalen,len-readpos);
if (pid == vID) {
if (payload) {
if (started) {
void setPacketNum(u4 npacket);
u4 getFrameNumFromPTS(u8 pts);
u4 getPacketNum();
- UINT stripAudio(UCHAR* buf, UINT len);
- static bool scanForVideo(UCHAR* buf, UINT len, bool &ish264);
+ u4 stripAudio(UCHAR* buf, u4 len);
+ static bool scanForVideo(UCHAR* buf, u4 len, bool &ish264);
Channel *getChannelInfo() {return &channelinfo;};
int atype;
bool subActive; // Same for subtitles
- UINT subLength; // Expected length of subtitle packet
+ u4 subLength; // Expected length of subtitle packet
bool vActive, aActive, tActive; // Whether video/audio is actively being captured
bool havechannelinfo;
int ret = 0;
while (len >= 4) {
- UINT pattern = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
+ u4 pattern = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
buf++;
len--;
- if (pattern < (UINT)(0x100 | PESTYPE_AUD0) || pattern > (UINT)(
+ if (pattern < (u4)(0x100 | PESTYPE_AUD0) || pattern > (u4)(
0x100 | HiByte))
continue;
HiByte = pattern & 0xFF;
int DemuxerVDR::findPTS(UCHAR* buf, int len, u8* dest) {
while (len >= 14) {
- UINT pattern = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
+ u4 pattern = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
buf++;
len--;
if (pattern < (0x100 | PESTYPE_AUD0) || pattern > (0x100
if ((buf[5] & 0xC0) != 0x80)
continue;
- UINT packetlength = ((UINT) buf[3] << 8) | buf[4];
+ u4 packetlength = ((u4) buf[3] << 8) | buf[4];
if (buf[6] & 0x80) // PTS_DTS_flags indicate that PTS is present
{
buf++; len--; ret++;
break;
case -4:
- packetLength = ((UINT)*buf) << 8;
+ packetLength = ((u4)*buf) << 8;
state--;
buf++; len--; ret++;
break;
void DemuxerVDR::dealWithSubtitlePacket()
{
const UCHAR* data = packet.getData();
- UINT packetSize = packet.getSize();
+ u4 packetSize = packet.getSize();
if (packetSize < 9) return;
- UINT payloadOffset = data[8] + 9;
+ u4 payloadOffset = data[8] + 9;
if (packetSize < payloadOffset + 5) return;
if (data[payloadOffset + 3] == 0x00)
{ // Not a continuation packet
}
const UCHAR* sub_data = subtitlePacket.getData();
- UINT subSize = subtitlePacket.getSize();
+ u4 subSize = subtitlePacket.getSize();
while (subtitlePacketPosition < subSize)
{
if (sub_data[subtitlePacketPosition] == 0xFF)
break;
}
if (subSize < subtitlePacketPosition + 6) break;
- UINT segmentLength = (sub_data[subtitlePacketPosition + 4] << 8)
+ u4 segmentLength = (sub_data[subtitlePacketPosition + 4] << 8)
+ sub_data[subtitlePacketPosition + 5];
subtitlePacketPosition += segmentLength + 6;
}
{
if (packet.getPacketType() == PESTYPE_PRIVATE_1 && packet.getSize() > 8)
{
- UINT payload_begin = packet[8] + 9;
+ u4 payload_begin = packet[8] + 9;
if (packet.getSize() > payload_begin)
{
UCHAR substream_type = packet[payload_begin] & 0xF0;
me = pts_map.front();
pts_map_mutex.unlock();
-// UINT fps = Video::getInstance()->getFPS();
+// u4 fps = Video::getInstance()->getFPS();
u8 pts_expected = me.pts + 90000*((u4)((double)(frame_num - me.frame)) / fps);
while (pts_expected > (1LL<<33)) pts_expected -= (1LL<<33);
int packetLength;
PESPacket packet;
PESPacket subtitlePacket;
- UINT subtitlePacketPosition;
+ u4 subtitlePacketPosition;
u4 frameNumber, packetNumber;
bool frameCounting, packetCounting;
if (name) delete[] name;
name = NULL;
index = -1; // just in case // FIXME remove this
- UINT i;
+ u4 i;
for (i = 0; i < dirList.size(); i++)
{
Directory* Directory::getDirByName(char* dirName)
{
- for(UINT i = 0; i < dirList.size(); i++)
+ for(u4 i = 0; i < dirList.size(); i++)
{
if (!strcmp(dirName, dirList[i]->name)) return dirList[i];
}
u4 Directory::getNumRecordings()
{
u4 total = recList.size();
- for(UINT i = 0; i < dirList.size(); i++)
+ for(u4 i = 0; i < dirList.size(); i++)
{
total += dirList[i]->getNumRecordings();
}
u4 Directory::getNumNewRecordings()
{
u4 total = 0;
- for (UINT i = 0; i < recList.size(); i++)
+ for (u4 i = 0; i < recList.size(); i++)
{
if (recList[i]->getNew()) ++total;
}
- for(UINT i = 0; i < dirList.size(); i++)
+ for(u4 i = 0; i < dirList.size(); i++)
{
total += dirList[i]->getNumNewRecordings();
}
std::sort(recList.begin(), recList.end(), RecordingSorterAlpha());
// Now get the dirs to sort themselves! oh I love recursion.
- for(UINT i = 0; i < dirList.size(); i++) dirList[i]->sort(chronoSortOrder);
+ for(u4 i = 0; i < dirList.size(); i++) dirList[i]->sort(chronoSortOrder);
}
// samplepos is equal to the number of bytes from the first MediaPacket
// in the list that have already been consumed in a previous call.
- virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos)=0;
+ virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos)=0;
// The Stream guarantees that the value of *samplepos passed to
// DeliverMediaSample will be equal to the value of samplepos passed to
// 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 UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos)=0;
+ virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos)=0;
// The drain target might advice the feeder about free buffers with threadSignal
mixtype->Release();
continue;
}
- UINT32 helper;
- mixtype->GetUINT32(MF_MT_INTERLACE_MODE,&helper);
+ u432 helper;
+ mixtype->Getu432(MF_MT_INTERLACE_MODE,&helper);
if (helper!=MFVideoInterlace_Progressive) {
Log::getInstance()->log("DsAllocator", Log::DEBUG , "Skip media type interlaced!");
mixtype->Release();
{
LARGE_INTEGER temp64;
- mfmediatype->GetUINT64(MF_MT_FRAME_SIZE, (UINT64*)&temp64);
+ mfmediatype->Getu464(MF_MT_FRAME_SIZE, (u464*)&temp64);
vwidth=temp64.HighPart;
vheight=temp64.LowPart;
GUID subtype;
#include "dssourcepin.h"
struct mptype_video_detail{ //here should be all information added the Video Draintarget needs for rendering, to be extended in the future
- UINT width;
- UINT height;
+ u4 width;
+ u4 height;
};
[uuid("EB87AB22-7A95-49c3-8CCE-2F6D61A87009")]
0xFF55557F, 0xFF7F557F, 0xFF557F7F, 0xFF7F7F7F, // 1111 1100
};
-void DVBSubtitleCLUT::setEntry(int bpp, UINT index, UCHAR Y, UCHAR Cr, UCHAR Cb, UCHAR T)
+void DVBSubtitleCLUT::setEntry(int bpp, u4 index, UCHAR Y, UCHAR Cr, UCHAR Cb, UCHAR T)
{
UCHAR Y2 = Y;
UCHAR A;
CLUTid(0)
{}
-void DVBSubtitleRegion::setDepth(UINT d)
+void DVBSubtitleRegion::setDepth(u4 d)
{
if (d < 4) palette.setBpp(1 << d);
}
class DVBSubtitleObject
{
private:
- UINT objectID;
+ u4 objectID;
UCHAR nonModColourFlag;
struct RegionRef
{
DVBSubtitleRegion* region;
- UINT horizontalPosition;
- UINT verticalPosition;
+ u4 horizontalPosition;
+ u4 verticalPosition;
};
typedef std::vector<struct RegionRef> UseList;
UseList useList;
UCHAR map4to8[16];
void initMapTables();
UCHAR* currentMapTable;
- UINT bitPos;
- void drawLine(const RegionRef& use, UINT x, UINT y, UCHAR colour, UINT len);
- UCHAR get2Bits(const UCHAR* data, UINT& index);
- UCHAR get4Bits(const UCHAR* data, UINT& index);
- bool decode2BppCodeString(const UCHAR* data, UINT& index, const struct RegionRef& use, UINT& x, UINT y);
- bool decode4BppCodeString(const UCHAR* data, UINT& index, const struct RegionRef& use, UINT& x, UINT y);
- bool decode8BppCodeString(const UCHAR* data, UINT& index, const struct RegionRef& use, UINT& x, UINT y);
+ 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);
public:
- DVBSubtitleObject(UINT id = 0);
+ DVBSubtitleObject(u4 id = 0);
void setNonModColourFlag(UCHAR flag) { nonModColourFlag = flag; }
void findWhereUsed(DVBSubtitlePage&);
- void decodeSubBlock(const UCHAR* data, UINT length, bool even);
+ void decodeSubBlock(const UCHAR* data, u4 length, bool even);
};
-DVBSubtitleObject::DVBSubtitleObject(UINT id)
+DVBSubtitleObject::DVBSubtitleObject(u4 id)
: objectID(id),
nonModColourFlag(0),
currentMapTable(NULL),
}
}
-void DVBSubtitleObject::drawLine(const RegionRef& use, UINT x, UINT y,
- UCHAR colour, UINT len)
+void DVBSubtitleObject::drawLine(const RegionRef& use, u4 x, u4 y,
+ UCHAR colour, u4 len)
{
if (nonModColourFlag && colour == 1) return;
x += use.horizontalPosition;
y += use.verticalPosition;
- for (UINT pos = x; pos < x + len; ++pos)
+ for (u4 pos = x; pos < x + len; ++pos)
use.region->setIndex(pos, y, colour);
}
-UCHAR DVBSubtitleObject::get2Bits(const UCHAR* data, UINT& index)
+UCHAR DVBSubtitleObject::get2Bits(const UCHAR* data, u4& index)
{
UCHAR result = data[index];
if (!bitPos)
return (result >> bitPos) & 0x03;
}
-UCHAR DVBSubtitleObject::get4Bits(const UCHAR* data, UINT& index)
+UCHAR DVBSubtitleObject::get4Bits(const UCHAR* data, u4& index)
{
UCHAR result = data[index];
if (!bitPos)
return result & 0x0F;
}
-bool DVBSubtitleObject::decode2BppCodeString(const UCHAR* data, UINT& index, const struct RegionRef& use, UINT& x, UINT y)
+bool DVBSubtitleObject::decode2BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
{
- UINT rl = 0, colour = 0;
+ u4 rl = 0, colour = 0;
UCHAR code = get2Bits(data, index);
if (code)
{
return true;
}
-bool DVBSubtitleObject::decode4BppCodeString(const UCHAR* data, UINT& index, const struct RegionRef& use, UINT& x, UINT y)
+bool DVBSubtitleObject::decode4BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
{
- UINT rl = 0, colour = 0;
+ u4 rl = 0, colour = 0;
UCHAR code = get4Bits(data, index);
if (code)
{
return true;
}
-bool DVBSubtitleObject::decode8BppCodeString(const UCHAR* data, UINT& index, const struct RegionRef& use, UINT& x, UINT y)
+bool DVBSubtitleObject::decode8BppCodeString(const UCHAR* data, u4& index, const struct RegionRef& use, u4& x, u4 y)
{
- UINT rl = 0, colour = 0;
+ u4 rl = 0, colour = 0;
UCHAR code = data[index++];
if (code)
{
return true;
}
-void DVBSubtitleObject::decodeSubBlock(const UCHAR* data, UINT length, bool even)
+void DVBSubtitleObject::decodeSubBlock(const UCHAR* data, u4 length, bool even)
{
UseList::const_iterator use;
for (use = useList.begin(); use != useList.end(); ++use)
{
- UINT x = 0; UINT y = even ? 0 : 1; UINT index = 0;
+ u4 x = 0; u4 y = even ? 0 : 1; u4 index = 0;
while (index < length)
{
switch (data[index++])
bool DVBSubtitles::decodePacket(const PESPacket& packet)
{
const UCHAR* data = packet.getData();
- UINT packetSize = packet.getSize();
+ u4 packetSize = packet.getSize();
if (packetSize < 9) return false;
- UINT segmentOffset = data[8] + 11;
+ u4 segmentOffset = data[8] + 11;
while (packetSize > segmentOffset)
{
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];
- UINT pageID = (data[segmentOffset + 2] << 8)
+ u4 pageID = (data[segmentOffset + 2] << 8)
+ data[segmentOffset + 3];
- UINT segmentLength = (data[segmentOffset + 4] << 8)
+ u4 segmentLength = (data[segmentOffset + 4] << 8)
+ data[segmentOffset + 5];
if (pageOnDisplay == 65536) pageOnDisplay = pageID;
if (pageOnDisplay != pageID) return false;
page.version = pageVersion;
page.timeout = segmentData[0];
page.pendingDisplay.clear();
- UINT parsePos = 2;
+ u4 parsePos = 2;
while (segmentLength > parsePos + 5)
{
UCHAR regionID = segmentData[parsePos];
if (regionVersion == region.version) break; // No update
region.version = regionVersion;
bool regionFillFlag = (segmentData[1] & 0x08) >> 3;
- UINT regionWidth = (segmentData[2] << 8) + segmentData[3];
- UINT regionHeight = (segmentData[4] << 8) + segmentData[5];
+ u4 regionWidth = (segmentData[2] << 8) + segmentData[3];
+ u4 regionHeight = (segmentData[4] << 8) + segmentData[5];
region.setSize(regionWidth, regionHeight);
region.level = (segmentData[6] & 0xE0) >> 5;
region.setDepth((segmentData[6] & 0x1C) >> 2);
case 8: region.setAllIndices(segmentData[8]); break;
}
region.objects.clear();
- UINT parsePos = 10;
+ u4 parsePos = 10;
while (segmentLength > parsePos + 5)
{
- UINT objectID = (segmentData[parsePos] << 8) +
+ u4 objectID = (segmentData[parsePos] << 8) +
segmentData[parsePos + 1];
DVBSubtitleRegion::ObjectRef objref;
objref.objectID = objectID;
- UINT objectType = (segmentData[parsePos + 2] & 0xC0) >> 6;
+ u4 objectType = (segmentData[parsePos + 2] & 0xC0) >> 6;
objref.horizontalPosition = ((segmentData[parsePos + 2] & 0x0F) << 8) +
segmentData[parsePos + 3];
objref.verticalPosition = ((segmentData[parsePos + 4] & 0x0F) << 8) +
UCHAR clutVersion = (segmentData[1] & 0xF0) >> 4;
if (clutVersion == clut.version) break; // No update
clut.version = clutVersion;
- UINT parsePos = 2;
+ u4 parsePos = 2;
while (segmentLength > parsePos + 3)
{
UCHAR clutEntryID = segmentData[parsePos];
case 0x13: // Object data
{
if (segmentLength < 3) break;
- UINT objectID = (segmentData[0] << 8) + segmentData[1];
+ u4 objectID = (segmentData[0] << 8) + segmentData[1];
DVBSubtitleObject object(objectID);
object.findWhereUsed(page);
UCHAR codingMethod = (segmentData[2] & 0x0C) >> 2;
if (codingMethod == 0x00) // Coding of pixels
{
if (segmentLength < 7) break;
- UINT topFieldLen = (segmentData[3] << 8) + segmentData[4];
- UINT bottomFieldLen = (segmentData[5] << 8) + segmentData[6];
+ u4 topFieldLen = (segmentData[3] << 8) + segmentData[4];
+ u4 bottomFieldLen = (segmentData[5] << 8) + segmentData[6];
if (segmentLength < 7 + topFieldLen + bottomFieldLen) break;
object.decodeSubBlock(segmentData + 7, topFieldLen, true);
if (bottomFieldLen)
}
case 0x14: {// Display definition
if (segmentLength<5) break;
- UINT ddsversion=(segmentData[0]&0xf0)>>4;
+ u4 ddsversion=(segmentData[0]&0xf0)>>4;
if (ddsversion==dds.version) break; // no update ncessary
dds.version=ddsversion;
dds.displaywindow=!(!(segmentData[0]&0x08));
DVBSubtitleCLUT();
UCHAR CLUTid;
UCHAR version;
- void setEntry(int bpp, UINT index, UCHAR Y, UCHAR Cr, UCHAR Cb, UCHAR T);
+ void setEntry(int bpp, u4 index, UCHAR Y, UCHAR Cr, UCHAR Cb, UCHAR T);
const Palette& getPalette(int bpp) const;
private:
Palette palette2;
UCHAR version;
UCHAR level;
UCHAR CLUTid;
- void setDepth(UINT);
+ void setDepth(u4);
struct ObjectRef
{
- UINT objectID;
- UINT horizontalPosition;
- UINT verticalPosition;
+ u4 objectID;
+ u4 horizontalPosition;
+ u4 verticalPosition;
};
typedef std::vector<struct ObjectRef> ObjectList;
ObjectList objects;
u8 pts;
bool dirty;
UCHAR version;
- UINT timeout;
+ u4 timeout;
UCHAR state;
bool serviceAcquired;
typedef std::map<UCHAR, DVBSubtitleCLUT> CLUTMap;
CLUTMap CLUTs;
typedef std::map<UCHAR, DVBSubtitleRegion> RegionMap;
RegionMap regions;
- struct Coords { UINT x; UINT y; };
+ struct Coords { u4 x; u4 y; };
typedef std::map<UCHAR, Coords> DisplayMap;
DisplayMap currentDisplay;
DisplayMap pendingDisplay;
private:
OSDReceiver* osd;
std::deque<PESPacket> worklist;
- typedef std::map<UINT, DVBSubtitlePage> PageMap;
+ typedef std::map<u4, DVBSubtitlePage> PageMap;
PageMap pages;
- UINT pageOnDisplay;
+ u4 pageOnDisplay;
bool decodePacket(const PESPacket&);
void finishPage(const DVBSubtitlePage&);
void clearDisplayedPages();
MovieInfo* Event::movieInfo = NULL;
SeriesInfo* Event::seriesInfo = NULL;
-void Event::loadinfos(UINT channelid)
+void Event::loadinfos(u4 channelid)
{
VDR* vdr = VDR::getInstance();
if (movieInfo) delete movieInfo;
class Event
{
public:
- void loadinfos(UINT channelid);
+ void loadinfos(u4 channelid);
u4 id{};
u4 time{};
OMX_ERRORTYPE error;
input_bufs_omx_mutex.lock();
- for (UINT i=0; i< input_bufs_omx_all.size();i++) {
+ for (u4 i=0; i< input_bufs_omx_all.size();i++) {
LogNT::getInstance()->debug(TAG, "OMX_FreeBuffer mark");
//if (input_bufs_omx_all[i]->pBuffer) free(input_bufs_omx_all[i]->pBuffer);
input_bufs_omx_all[i]->pBuffer=NULL;
}
// the real entry for receiving data
-int ImageReader::getImageChunk(u8 offset,UINT len, UINT * rsize, UCHAR **buffer){
+int ImageReader::getImageChunk(u8 offset,u4 len, u4 * rsize, UCHAR **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,UINT len, UINT * rsize,UCHAR **buffer);
+ int getImageChunk(u8 offset,u4 len, u4 * rsize,UCHAR **buffer);
//is the reader still running?
bool isReaderRunning();
public:
UCHAR * buffer; //receive buffer (to be deallocated with free)
u8 offset; //offset within stream/file
- UINT reqlen; //requested len
+ u4 reqlen; //requested len
u4 len; //received len
rstate state; //current state
Chunk() {
bool InputLIRC::parse(const std::string& input, std::string& remoteName, std::string& remoteButton, int& repeatCount)
{
- UINT pos{}, found{};
+ u4 pos{}, found{};
found = input.find(" ", pos);
if (found == std::string::npos) return false;
pos = found + 1; // pos at 00
}
}
-void InputUDP::processRequest(const void* data, UINT length)
+void InputUDP::processRequest(const void* data, u4 length)
{
log->debug(TAG, "Got request");
char* temp = new char[length + 1];
memcpy(temp, data, length);
temp[length] = '\0';
- UINT command = static_cast<UINT>(atoi(temp));
+ u4 command = static_cast<u4>(atoi(temp));
delete[] temp;
log->debug(TAG, "Command {} recieved", command);
int pfds[2];
#endif
- void processRequest(const void* data, UINT length);
+ void processRequest(const void* data, u4 length);
};
#endif
return retval;
}
-int InputWin::ReceiveButtonVK(UINT button)
+int InputWin::ReceiveButtonVK(u4 button)
{
/* UCHAR pb=NA_NONE;
//should we use a translation table ? No APPCOMMAND iS DWORD!
return 1; */
}
-int InputWin::ReceiveButtonCH(UINT button)
+int InputWin::ReceiveButtonCH(u4 button)
{
UCHAR pb = TranslateHWC(W_G_HCW(W_HCW_CH,button));
if (pb==NA_UNKNOWN || pb==NA_NONE) return 0;
return 1; */
}
-int InputWin::ReceiveButtonAP(UINT button)
+int InputWin::ReceiveButtonAP(u4 button)
{
/* UCHAR pb=NA_NONE;
//should we use a translation table ? No APPCOMMAND iS DWORD!
return 1; */
}
-int InputWin::ReceiveButtonRI(UINT button)
+int InputWin::ReceiveButtonRI(u4 button)
{
//UCHAR pb=NA_NONE;
//Raw Input
//int getDevice();
//UCHAR getButtonPress(int how);
// void Signal();
- int ReceiveButtonVK(UINT button); //Windows Message from WND_PROC (Virtual Key)
- int ReceiveButtonCH(UINT button); //Windows Message from WND_PROC (char)
- int ReceiveButtonAP(UINT button); // (App command)
- int ReceiveButtonRI(UINT button); // (Remote control)
+ 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);
std::string getHardwareKeyName(HWC_TYPE hardwareKey);
}
void MediaList::emptyList(){
if (_owning) {
- for (UINT i = 0; i < size(); i++)
+ for (u4 i = 0; i < size(); i++)
{
delete (*this)[i];
}
{
bool rt=true;
Log::getInstance()->log("MediaOptions", Log::DEBUG, "save for %i options", myOptions.size());
- for (UINT i = 0; i < myOptions.size(); i++)
+ for (u4 i = 0; i < myOptions.size(); i++)
{
if (! saveOption(myOptions[i])) rt=false;
Log::getInstance()->log("MediaOptions",Log::DEBUG,"option value for %s is %d",name,rt);
return rt;
}
-bool MediaOptions::setIntOption(const char * name, UINT value) {
+bool MediaOptions::setIntOption(const char * name, u4 value) {
Option *o=findOption(name);
if (!o) return false;
if (! o->optionType == Option::TYPE_INT) return false;
if (!o) return false;
if (! o->optionType == Option::TYPE_TEXT) return false;
bool rt=false;
- for (UINT i = 0; i < o->numChoices; i++) {
+ for (u4 i = 0; i < o->numChoices; i++) {
if (!STRCASECMP(value, o->options[i]))
{
o->configChoice = i;
const char * getStringOption(const char * name);
int getIntOption(const char * name);
bool setStringOption(const char * name, const char * value) ;
- bool setIntOption(const char * name, UINT value) ;
+ bool setIntOption(const char * name, u4 value) ;
private:
bool saveOption(Option *option);
std::vector<Option*> myOptions;
#include "option.h"
#include "vdr.h"
-Option::Option(UINT ID, const char* DISPLAYTEXT, const char* CONFIGSECTION, const char* CONFIGKEY, UCHAR OPTIONTYPE,
- UINT NUMCHOICES, UINT DEFAULTCHOICE, UINT STARTINT,
+Option::Option(u4 ID, const char* DISPLAYTEXT, const char* CONFIGSECTION, const char* CONFIGKEY, UCHAR 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),
numChoices(NUMCHOICES), defaultChoice(DEFAULTCHOICE), startInt(STARTINT),
{
const char * const * list;
list = (optionType == TYPE_TEXT) ? options : optionkeys;
- for (UINT i = 0; i < numChoices; i++)
+ for (u4 i = 0; i < numChoices; i++)
{
if (!STRCASECMP(config, list[i]))
{
{
if (deletestrings && (optionType == TYPE_TEXT))
{
- for (UINT i = 0; i < numChoices; i++)
+ for (u4 i = 0; i < numChoices; i++)
{
delete[] options[i];
}
class Option
{
public:
- Option(UINT id, const char* displayText, const char* configSection, const char* configKey, UCHAR optionType,
- UINT numChoices, UINT defaultChoice, UINT startInt,
+ Option(u4 id, const char* displayText, const char* configSection, const char* configKey, UCHAR optionType,
+ u4 numChoices, u4 defaultChoice, u4 startInt,
const char * const * options, const char * const * optionkeys = NULL, bool deletestrings = false, AbstractOption* handler = NULL);
~Option();
- UINT id;
+ u4 id;
const char* displayText;
const char* configSection;
const char* configKey;
UCHAR optionType;
- UINT numChoices;
- UINT defaultChoice;
+ u4 numChoices;
+ u4 defaultChoice;
int startInt;
const char * const * options;
const char * const * optionkeys;
bool deletestrings;
AbstractOption* opthandler;
- UINT configChoice;
- UINT userSetChoice;
+ u4 configChoice;
+ u4 userSetChoice;
const static UCHAR TYPE_TEXT = 1;
const static UCHAR TYPE_INT = 2;
}
}
-UINT OsdOpenVG::putOpenVGCommand(OpenVGCommand& comm, bool wait)
+u4 OsdOpenVG::putOpenVGCommand(OpenVGCommand& comm, bool wait)
{
if (wait) comm.response = new OpenVGResponse;
// Now response->done = true, mutex is locked, we have been signalled
ul.unlock();
- UINT toReturn = comm.response->result;
+ u4 toReturn = comm.response->result;
delete comm.response;
return toReturn;
}
taskmutex.unlock();
vgmutex.lock();
- UINT vgResult = handleOpenVGCommand(comm);
+ u4 vgResult = handleOpenVGCommand(comm);
vgmutex.unlock();
taskmutex.lock();
struct OpenVGResponse
{
bool done{};
- UINT result;
+ u4 result;
std::condition_variable doneCond;
};
class OSDReceiver
{
public:
- virtual void drawOSDBitmap(UINT posX, UINT posY, const Bitmap&, const DisplayRegion& region)=0;
+ virtual void drawOSDBitmap(u4 posX, u4 posY, const Bitmap&, const DisplayRegion& region)=0;
virtual void clearOSD()=0;
- virtual void clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, const DisplayRegion& region)=0;
+ virtual void clearOSDArea(u4 posX, u4 posY, u4 width, u4 height, const DisplayRegion& region)=0;
};
#endif
Log::getInstance()->log("OSD", Log::WARN, "Could not get System Font Collection!");
return 0;
}
- UINT num_font = fontcol->GetFontFamilyCount();
- for (UINT i = 0; i < num_font; i++) {
+ u4 num_font = fontcol->GetFontFamilyCount();
+ for (u4 i = 0; i < num_font; i++) {
IDWriteFontFamily * family=NULL;
if (fontcol->GetFontFamily(i, &family)!=S_OK) continue;
IDWriteLocalizedStrings* fam_name=NULL;
family->Release();
continue;
}
- UINT32 id = 0;
+ u432 id = 0;
BOOL exist = false;
if (fam_name->FindLocaleName(L"en-us", &id, &exist) == S_OK) {
if (!exist) id = 0;
- UINT32 strlen=0;
+ u432 strlen=0;
fam_name->GetStringLength(id, &strlen);
wchar_t * stringbuf = new wchar_t[strlen + 1];
fontaspect_corr = ((float)OSD_BUFFER_HEIGHT) / ((float)OSD_BUFFER_WIDTH) * 720.f / 576.f;
- for (UINT32 i = 0; i<256; i++) {
+ for (u432 i = 0; i<256; i++) {
DWRITE_GLYPH_METRICS glyph_metrics;
- UINT16 glyph_index;
+ u416 glyph_index;
fontface->GetGlyphIndices(&i, 1, &glyph_index);
HRESULT hres=fontface->GetDesignGlyphMetrics(&glyph_index, 1, &glyph_metrics, FALSE);
matrix = D2D1::Matrix3x2F::Scale(fontaspect_corr, 1.f)*
D2D1::Matrix3x2F::Translation(command.x, command.y + fontzero)*save_matrix;
currentosd_backbuffer.rendtarget2D->SetTransform(matrix);
- UINT32 tchar = command.target.textchar;
- UINT16 glyphindex;
+ u432 tchar = command.target.textchar;
+ u416 glyphindex;
DWRITE_GLYPH_RUN glyph_run;
glyph_run.fontEmSize = 13.f / (74.f / 96.f);
glyph_run.fontFace=fontface;
DWRITE_GLYPH_METRICS glyph_metrics;
- UINT16 glyph_index;
- UINT32 tchar = c;
+ u416 glyph_index;
+ u432 tchar = c;
fontface->GetGlyphIndices(&tchar, 1, &glyph_index);
fontface->GetDesignGlyphMetrics(&glyph_index, 1, &glyph_metrics, FALSE);
LockOsdDrawing();
int x, y;
- UINT32 *mem = (UINT32*)malloc(width*height*sizeof(UINT32));
- UINT32 *memrun = mem;
+ u432 *mem = (u432*)malloc(width*height*sizeof(u432));
+ u432 *memrun = mem;
const unsigned char* image_run = image_data;
for (y = 0; y < height; y++) {
ID2D1Bitmap *bitmap = NULL;
- HRESULT hres = currentosd_backbuffer.rendtarget2D->CreateBitmap(size, mem, width*sizeof(UINT32), bitmap_prop, &bitmap);
+ HRESULT hres = currentosd_backbuffer.rendtarget2D->CreateBitmap(size, mem, width*sizeof(u432), bitmap_prop, &bitmap);
if (hres != S_OK) {
Log::getInstance()->log("OsdWinVector", Log::DEBUG, "CreateBitmap failed %d", hres);
MediaPacketList pl;
pl.push_back(p);
audio->PrepareMediaSample(pl,0);
- UINT bytesWritten=0;
- UINT rt=audio->DeliverMediaSample(threadBuffer,&bytesWritten);
+ u4 bytesWritten=0;
+ u4 rt=audio->DeliverMediaSample(threadBuffer,&bytesWritten);
u4 written=thisRead;
if (rt == 0)
written=bytesWritten;
logger->debug(TAG, "PlayerRadioRec has received length bytes of {}", lengthBytes);
- UINT thisRead = 0;
+ u4 thisRead = 0;
int success;
UCHAR* buffer = vdr->getBlock(0, 10000, &thisRead);
{
int success;
u8 endPTS = 0;
- UINT thisRead = 0;
+ u4 thisRead = 0;
UCHAR* buffer = vdr->getBlock(lengthBytes - 10000, 10000, &thisRead);
if (!buffer)
{
stateLock.unlock();
}
-void PlayerRadioRec::skipForward(UINT seconds)
+void PlayerRadioRec::skipForward(u4 seconds)
{
std::lock_guard<std::mutex> lg(stateLock);
logger->debug(TAG, "SKIP FORWARD {} SECONDS", seconds);
else switchState(S_JUMP, newFrame);
}
-void PlayerRadioRec::skipBackward(UINT seconds)
+void PlayerRadioRec::skipBackward(u4 seconds)
{
std::lock_guard<std::mutex> lg(stateLock);
logger->debug(TAG, "SKIP BACKWARD {} SECONDS", seconds);
if (state != S_PLAY) return;
u8 feedPosition;
- UINT thisRead, writeLength, thisWrite, askFor;
+ u4 thisRead, writeLength, thisWrite, askFor;
time_t lastRescan = time(NULL);
feedPosition = vdr->positionFromFrameNumber(currentFrameNumber);
if (startup)
{
if (startupBlockSize > lengthBytes)
- askFor = static_cast<UINT>(lengthBytes); // is a very small recording!
+ askFor = static_cast<u4>(lengthBytes); // is a very small recording!
else
askFor = startupBlockSize; // normal, but a startup sized block to detect all the audio streams
}
else
{
if ((feedPosition + blockSize) > lengthBytes) // last block of recording
- askFor = static_cast<UINT>(lengthBytes - feedPosition);
+ askFor = static_cast<u4>(lengthBytes - feedPosition);
else // normal
askFor = blockSize;
}
void pause();
void playpause();
void jumpToPercent(double percent);
- void skipForward(UINT seconds);
- void skipBackward(UINT seconds);
+ void skipForward(u4 seconds);
+ void skipBackward(u4 seconds);
UCHAR getState() { return state; }
u4 getCurrentSeconds();
u8 lengthBytes{};
u4 lengthFrames{};
u4 currentFrameNumber{};
- static const UINT blockSize{10000};
- static const UINT startupBlockSize{20000};
+ static const u4 blockSize{10000};
+ static const u4 startupBlockSize{20000};
UCHAR state{S_STOP};
};
u4 iframeNumber;
UCHAR* buffer;
- UINT amountReceived;
- UINT videoLength;
+ u4 amountReceived;
+ u4 videoLength;
// newFrame could be anywhere, go forwards to next I-Frame
if (!vdr->getNextIFrame(newFrame, 1, &filePos, &nextiframeNumber, &iframeLength)) return;
void PlayerVideoRec::threadFeedPlay()
{
u8 feedPosition;
- UINT thisRead, writeLength, thisWrite, askFor;
+ u4 thisRead, writeLength, thisWrite, askFor;
time_t lastRescan = time(NULL);
feedPosition = vdr->positionFromFrameNumber(currentFrameNumber);
if (startup)
{
if (startupBlockSize > lengthBytes)
- askFor = static_cast<UINT>(lengthBytes); // is a very small recording!
+ askFor = static_cast<u4>(lengthBytes); // is a very small recording!
else
askFor = startupBlockSize; // normal, but a startup sized block to detect all the audio streams
}
else
{
if ((feedPosition + blockSize) > lengthBytes) // last block of recording
- askFor = static_cast<UINT>(lengthBytes - feedPosition);
+ askFor = static_cast<u4>(lengthBytes - feedPosition);
else // normal
askFor = blockSize;
}
u4 currentfeedFrameNumber=currentFrameNumber;
u4 firstFrameNumber=currentFrameNumber;
u8 filePos;
- UINT amountReceived;
- UINT videoLength;
+ u4 amountReceived;
+ u4 videoLength;
- UINT playtime=0;
+ u4 playtime=0;
int frameTimeOffset = 0; // Time in msec between frames
u4 iframeNumber = 0;
u4 iframeLength = 0;
u8 filePos;
- UINT amountReceived;
- UINT videoLength;
+ u4 amountReceived;
+ u4 videoLength;
#ifndef WIN32
struct timeval clock0 = {0,0}; // Time stamp after fetching I-frame info
u8 lengthBytes{};
u4 lengthFrames{};
u4 currentFrameNumber{};
- UINT blockSize{100000};
- UINT startupBlockSize{250000};
+ u4 blockSize{100000};
+ u4 startupBlockSize{250000};
UCHAR state{S_STOP};
UCHAR ifactor{4}; // 4, 8, 16, 32
};
typedef struct _hmsf
{
- UINT hours;
- UINT minutes;
- UINT seconds;
- UINT frames;
+ u4 hours;
+ u4 minutes;
+ u4 seconds;
+ u4 frames;
} hmsf;
class RecInfo
if (markList && markList->size())
{
- for(UINT i = 0; i < markList->size(); i++)
+ for(u4 i = 0; i < markList->size(); i++)
{
delete (*markList)[i];
}
u8 lengthBytes = vdr->streamRecording(getFileName(), &lengthFrames, &IsPesRecording);
if (!lengthBytes || !lengthFrames) return false;
- UINT thisRead;
+ u4 thisRead;
UCHAR* buffer = vdr->getBlock(0ULL, 10000U, &thisRead);
if (!buffer) return false;
(d.y2() >= y) );
}
-UINT Region::x2()
+u4 Region::x2()
{
return x + w - 1;
}
-UINT Region::y2()
+u4 Region::y2()
{
return y + h - 1;
}
{
public:
Region() = default;
- Region(UINT ix, UINT iy, UINT iw, UINT ih) : x(ix), y(iy), w(iw), h(ih) {}
+ Region(u4 ix, u4 iy, u4 iw, u4 ih) : x(ix), y(iy), w(iw), h(ih) {}
bool overlappedBy(Region& doesthisOverlap);
Region subtract(Region& other);
|| (test.y+test.h) < y || (y+h) < test.y);
}
- UINT x2();
- UINT y2();
+ u4 x2();
+ u4 y2();
- UINT x{};
- UINT y{};
- UINT w{};
- UINT h{};
+ u4 x{};
+ u4 y{};
+ u4 w{};
+ u4 h{};
int z{};
};
std::chrono::system_clock::time_point endTime;
std::mutex stateLock;
- UINT state{0};
+ u4 state{0};
/* 0 = inactive
* 1 = counting - no displays
* 2 = counting - modify display showing
if (draintarget->DrainTargetBufferFull()) return false; //We are full, no need to do something else
mutex.lock();
- UINT listlength = mediapackets.size();
+ u4 listlength = mediapackets.size();
if (listlength != 0)
{
if (dataavail && draintarget->DrainTargetReady()) *dataavail = true;
- UINT consumed = draintarget->DeliverMediaSample(outbuf, &cur_packet_pos);
+ u4 consumed = draintarget->DeliverMediaSample(outbuf, &cur_packet_pos);
mutex.lock();
if (consumed != 0) ret = true;
int init(DrainTarget* tdt, int bufsize);
void shutdown();
void flush();
- int put(const UCHAR* inbuf, int len, UCHAR type, UINT index);
+ int put(const UCHAR* inbuf, int len, UCHAR type, u4 index);
bool drain(bool* dataavail = NULL);
private:
MediaPacketList mediapackets;
- UINT cur_packet_pos{};
+ u4 cur_packet_pos{};
std::mutex mutex;
DrainTarget* draintarget{};
int initted{};
virtual void drawJpeg(const char* /* fileName */, int /* x */, int /* y */, int* /* width */, int* /* height */) {}
- virtual int create(UINT width, UINT height) = 0;
+ virtual int create(u4 width, u4 height) = 0;
virtual void display() = 0;
virtual int fillblt(int x, int y, int width, int height, const DrawStyle& c) = 0;
}
-int SurfaceDirectFB::create(UINT width, UINT height)
+int SurfaceDirectFB::create(u4 width, u4 height)
{
int counter=0;
while (!Osd::getInstance()->isInitted() && counter<2000) {
void SurfaceDirectFB::drawBitmap(int x, int y, const Bitmap& bm)
{/*
- UINT bmw = bm.getWidth(); UINT bmh = bm.getHeight();
+ u4 bmw = bm.getWidth(); u4 bmh = bm.getHeight();
if (bmw == 0 || bmh == 0) return;
if ((x >= (int)surface.sfc.width) || (y >= (int)surface.sfc.height)) return;
int remainder = (surface.sfc.width % 4);
- UINT line;
+ u4 line;
if (remainder == 0)
line = surface.sfc.width;
else
const std::vector<UCHAR>& Cr = bm.palette.getCrVector();
const std::vector<UCHAR>& Cb = bm.palette.getCbVector();
const std::vector<UCHAR>& A = bm.palette.getAVector();
- UINT b_offset = 0;
- UINT s_offset = x + y*line;
- UINT plotWidth = bmw;
- UINT plotHeight = bmh;
+ u4 b_offset = 0;
+ u4 s_offset = x + y*line;
+ u4 plotWidth = bmw;
+ u4 plotHeight = bmh;
if (x + plotWidth - 1 > surface.sfc.width)
plotWidth = surface.sfc.width - x + 1;
if (y + plotHeight - 1 > surface.sfc.height)
plotHeight = surface.sfc.height - y + 1;
- for (UINT j = 0; j < plotHeight; ++j)
+ for (u4 j = 0; j < plotHeight; ++j)
{
- UINT i = 0;
+ u4 i = 0;
if (x & 1) // odd x - need to plot first column separately
{
UCHAR index = bmdata[b_offset];
SurfaceDirectFB(int id = 0);
virtual ~SurfaceDirectFB();
- int create(UINT width, UINT height);
+ int create(u4 width, u4 height);
void display();
int fillblt(int x, int y, int width, int height, unsigned int rgba);
srf_mutex.unlock();
}
-int SurfaceOpenGL::create(UINT width, UINT height)
+int SurfaceOpenGL::create(u4 width, u4 height)
{
OsdOpenGL* osd=((OsdOpenGL*)(Osd::getInstance()));
//osd->BeginPainting();
{
// Temporary code? Draw one pixel at a time using drawPixel()
startFastDraw();
- for (UINT j = 0; j < bm.getHeight(); ++j)
- for (UINT i = 0; i < bm.getWidth(); ++i)
+ for (u4 j = 0; j < bm.getHeight(); ++j)
+ for (u4 i = 0; i < bm.getWidth(); ++i)
drawPixel(x+i, y+j, bm.getColour(i,j),true);
endFastDraw();
}
SurfaceOpenGL(int id = 0);
virtual ~SurfaceOpenGL();
- int create(UINT width, UINT height);
+ int create(u4 width, u4 height);
void display();
void startFastDraw();
private:
GLuint gltexture;
- UINT sheight,swidth;
+ u4 sheight,swidth;
char * data;
command_mutex.unlock();
}
-int SurfaceVector::create(UINT width, UINT height)
+int SurfaceVector::create(u4 width, u4 height)
{
sheight = height;
swidth = width;
command_mutex.lock();
/*
unsigned int * data=(unsigned int*)malloc(sizeof(unsigned int)*bm.getWidth()*bm.getHeight());
- for (UINT j = 0; j < bm.getHeight(); ++j){
- for (UINT i = 0; i < bm.getWidth(); ++i)
+ for (u4 j = 0; j < bm.getHeight(); ++j){
+ for (u4 i = 0; i < bm.getWidth(); ++i)
{
data[i+j*bm.getHeight()]=bm.getColour(i,j);
}
// set w and h to 0, for unsetting clipping, use correct x and y parameter so that cleanup of commands works
void drawClippingRectangle(float x, float y, float w, float h);
- int create(UINT width, UINT height);
+ int create(u4 width, u4 height);
void display();
int fillblt(int x, int y, int width, int height, const DrawStyle& c);
CloseHandle(event);
}
-int SurfaceWin::create(UINT width, UINT height)
+int SurfaceWin::create(u4 width, u4 height)
{
OsdWinPixel* osd=((OsdWinPixel*)(Osd::getInstance()));
{
// Temporary code? Draw one pixel at a time using drawPixel()
startFastDraw();
- for (UINT j = 0; j < bm.getHeight(); ++j)
- for (UINT i = 0; i < bm.getWidth(); ++i)
+ for (u4 j = 0; j < bm.getHeight(); ++j)
+ for (u4 i = 0; i < bm.getWidth(); ++i)
drawPixel(x+i, y+j, bm.getColour(i,j),true);
endFastDraw();
}
SurfaceWin(int id = 0);
~SurfaceWin();
- int create(UINT width, UINT height);
+ int create(u4 width, u4 height);
void display();
void startFastDraw();
LPDIRECT3DSURFACE9 d3dsurface;
LPDIRECT3DTEXTURE9 d3dtexture;
D3DLOCKED_RECT lockrect;
- UINT sheight,swidth;
+ u4 sheight,swidth;
HANDLE event;
protected:
void drawPixel(int x, int y, Colour& c, bool fastdraw=false);
*/
// Measured sizeof(struct sockaddr_in) = 16, and in6 = 28
- UINT buflen = 50;
+ u4 buflen = 50;
unsigned char gsnBuffer[buflen];
struct sockaddr* sap = reinterpret_cast<struct sockaddr*>(gsnBuffer);
if (getsockname(sockfd, sap, &buflen) == -1) return macerror;
}
}
-void TeletextDecoderVBIEBU::PrepareMediaSample(const MediaPacketList& mplist, UINT /* samplepos */)
+void TeletextDecoderVBIEBU::PrepareMediaSample(const MediaPacketList& mplist, u4 /* samplepos */)
{
mediapacket = mplist.front();
}
return -pts1 + pts2;
}
-UINT TeletextDecoderVBIEBU::DeliverMediaSample(UCHAR* buffer, UINT *samplepos)
+u4 TeletextDecoderVBIEBU::DeliverMediaSample(UCHAR* buffer, u4 *samplepos)
{
if (mediapacket.type != MPTYPE_TELETEXT)
{
int *getSubtitlePages() {return record_pages;};
- virtual void PrepareMediaSample(const MediaPacketList& mplist, UINT samplepos);
- virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
+ virtual void PrepareMediaSample(const MediaPacketList& mplist, u4 samplepos);
+ virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos);
void registerTeletextView(VTeletextView* view) {txtview=view;};
void unRegisterTeletextView(VTeletextView* view) {if (txtview==view) txtview=NULL;};
*/
}
-UINT UDP4::getDataLength(void) const
+u4 UDP4::getDataLength(void) const
{
- return static_cast<UINT>(mlength);
+ return static_cast<u4>(mlength);
}
const void* UDP4::getData() const { return buf; }
#else
unsigned char waitforMessage(unsigned char, int quitPipe = 0); // uchar =0-block =1-new wait =2-continue wait
#endif
- UINT getDataLength() const;
+ u4 getDataLength() const;
const void* getData() const; // returns a pointer to the data
const char* getFromIPA() const; // returns a pointer to from IP address
short getFromPort() const;
*/
}
-UINT UDP6::getDataLength(void) const
+u4 UDP6::getDataLength(void) const
{
- return static_cast<UINT>(mlength);
+ return static_cast<u4>(mlength);
}
const void* UDP6::getData() const { return buf; }
if (mcast)
{
struct if_nameindex* ifs = if_nameindex();
- UINT ifIndex;
+ u4 ifIndex;
for(int i = 0; ifs[i].if_index > 0; i++)
{
#else
unsigned char waitforMessage(unsigned char, int quitPipe = 0); // uchar =0-block =1-new wait =2-continue wait
#endif
- UINT getDataLength() const;
+ u4 getDataLength() const;
const void* getData() const; // returns a pointer to the data
const char* getFromIPA() const; // returns a pointer to from IP address
short getFromPort() const;
*/
-int min(UINT a, int b)
+int min(u4 a, int b)
{
if (a > b) return b;
else return a;
//u8 ntohll(u8 a);
[[deprecated]]
-int min(UINT a, int b);
+int min(u4 a, int b);
#endif
}
int numchan_recinfo = recInfo->numComponents;
- UINT mp_audcounter = 0;
- UINT ac3_counter = 0;
+ u4 mp_audcounter = 0;
+ u4 ac3_counter = 0;
int ac3_offset = 0;
- UINT dvb_subcounter = 1;
+ u4 dvb_subcounter = 1;
for (auto& ac : acl)
{
VAudioSelector::VAudioSelector(MessageReceiver* tparent, Channel* channel, int currentAudioChannel, int currentSubtitletype, int currentSubtitleChannel, int* ttxtpages)
: parent(tparent), liveMode(true)
{
- UINT i;
+ u4 i;
for (i = 0; i < channel->numSPids; i++)
{
if (chanList)
{
- for (UINT i = 0; i < chanList->size(); i++)
+ for (u4 i = 0; i < chanList->size(); i++)
{
chan = (*chanList)[i];
std::ostringstream os;
{
LogNT::getInstance()->debug(TAG, "Channel change {}", m->parameter);
Channel* chan = NULL;
- for (UINT i = 0; i < chanList->size(); i++)
+ for (u4 i = 0; i < chanList->size(); i++)
{
if ((*chanList)[i]->number == m->parameter)
{
return toReturn;
}
-UCHAR* VDR::getBlock(u8 position, UINT maxAmount, UINT* amountReceived)
+UCHAR* VDR::getBlock(u8 position, u4 maxAmount, u4* amountReceived)
{
VDR_RequestPacket vrp;
if (!vrp.init(VDR_GETBLOCK, true, sizeof(u8) + sizeof(u4))) return NULL;
}
-void VDR::getScraperEventType(UINT channelid, UINT eventid, int & movieID,
+void VDR::getScraperEventType(u4 channelid, u4 eventid, int & movieID,
int & seriesID, int & episodeID, int & epgImage )
{
movieID = 0;
int streamChannel(u4 number, StreamReceiver*);
int streamChannel(u4 number);
void getChannelPids(Channel* channel);
- UCHAR* getBlock(u8 position, UINT maxAmount, UINT* amountReceived);
+ UCHAR* getBlock(u8 position, u4 maxAmount, u4* amountReceived);
//get image blocks separate - we can do this in parallel
int stopStreaming();
EventList* getChannelSchedule(u4 number);
//TV Scraper support
void getScraperEventType(char * fileName, int & movieID, int & seriesID, int & episodeID);
- void getScraperEventType(UINT eventid, UINT channelid, int & movieID, int & seriesID, int & episodeID, int & epgImage);
+ void getScraperEventType(u4 eventid, u4 channelid, int & movieID, int & seriesID, int & episodeID, int & epgImage);
MovieInfo* getScraperMovieInfo(int movieID);
SeriesInfo* getScraperSeriesInfo(int seriesID, int episodeID);
static VDR* instance;
VDR_ResponsePacket* RequestResponse(VDR_RequestPacket* request);
- UCHAR* getBlock(u8 position, UINT maxAmount, UINT* amountReceived, u4 cmd);
+ UCHAR* getBlock(u8 position, u4 maxAmount, u4* amountReceived, u4 cmd);
void connectionDied();
bool sendKA(u4 timeStamp);
VEpg* VEpg::instance = NULL;
-VEpg::VEpg(MessageReceiver* tparent, UINT tcurrentChannelIndex, std::shared_ptr<ChannelList> tchanList)
+VEpg::VEpg(MessageReceiver* tparent, u4 tcurrentChannelIndex, std::shared_ptr<ChannelList> tchanList)
{
instance = this;
currentChannelIndex = tcurrentChannelIndex;
//int summaryLines, summaryLowerPadding;
//int chanNameYpos;
int fontHeight=getFontHeight() + 4;
- //UINT gridRows; // is a class member
+ //u4 gridRows; // is a class member
if (Video::getInstance()->getFormat() == Video::PAL)
e = 0;
eventLista.resize(gridRows);
- for(UINT listIndex = 0; listIndex < gridRows; listIndex++)
+ for(u4 listIndex = 0; listIndex < gridRows; listIndex++)
{
// initialise array of pointers to eventlist structures
eventLista[listIndex] = NULL;
{
Channel* chan;
int first = 1;
- for (UINT i = 0; i < chanList->size(); i++)
+ for (u4 i = 0; i < chanList->size(); i++)
{
chan = (*chanList)[i];
if (i == currentChannelIndex)
instance = NULL;
- for(UINT listIndex = 0; listIndex < gridRows; listIndex++)
+ for(u4 listIndex = 0; listIndex < gridRows; listIndex++)
{
if (eventLista[listIndex])
{
// Display the status and key stuff at the bottom
- UINT keyx = chanListbox.getRootBoxOffsetX() + chanListbox.getColumn(0);
- UINT keyy = chanListbox.getRootBoxOffsetY() + chanListbox.getHeight() + 2;
+ u4 keyx = chanListbox.getRootBoxOffsetX() + chanListbox.getColumn(0);
+ u4 keyy = chanListbox.getRootBoxOffsetY() + chanListbox.getHeight() + 2;
rectangle (0, keyy, Video::getInstance()->getScreenWidth() ,
Video::getInstance()->getScreenHeight()-keyy, DrawStyle::DARKGREY);
int y = chanListbox.getRootBoxOffsetY() + 5; // vertical position of cell
DrawStyle bg, fg; // background colour of cells in grid
// for each displayed channel, find programmes that fall in 2.5 hour time window
- for(UINT listIndex = 0; listIndex < gridRows; listIndex++)
+ for(u4 listIndex = 0; listIndex < gridRows; listIndex++)
{
if (listTop + (int)listIndex >= chanListbox.getBottomOption())
continue; // ensure nothing populates grid below last channel
event = (*eventLista[listIndex])[e];
if (event)
{
- UINT end = event->time + event->duration; // programme end time
- if(event->time >= UINT(ltime) + (window_width * 60)) // programme starts after RHS of window
+ u4 end = event->time + event->duration; // programme end time
+ if(event->time >= u4(ltime) + (window_width * 60)) // programme starts after RHS of window
continue; // that's enough of this channel's events
- if(end <= UINT(ltime)) // programme ends before LHS of window
+ if(end <= u4(ltime)) // programme ends before LHS of window
continue; // this event is before the window - let's try the next event
// this event is one we are interested in
bg = (swapColour)?DrawStyle::PROGRAMMEA:DrawStyle::PROGRAMMEB; // alternate cell colour
swapColour = !swapColour; // it wil be the other colour next time
- if(event->time <= UINT(selTime) && end > UINT(selTime) && currentRow)
+ if(event->time <= u4(selTime) && end > u4(selTime) && currentRow)
{
// this is the selected programme
thisEvent.description = event->description;
{
if (currentRow && thisEvent.id == 0)
{
- if (end <= UINT(selTime) && end > UINT(thisEvent.time))
+ if (end <= u4(selTime) && end > u4(thisEvent.time))
thisEvent.time = end;
- if (event->time > UINT(selTime) && event->time < thisEvent.time + thisEvent.duration)
+ if (event->time > u4(selTime) && event->time < thisEvent.time + thisEvent.duration)
thisEvent.duration = event->time - thisEvent.time;
}
}
{
if (!chanList) return;
Channel* chan;
- for(UINT listIndex = 0; listIndex < gridRows; listIndex++)
+ for(u4 listIndex = 0; listIndex < gridRows; listIndex++)
{
- if(listTop + listIndex >= UINT(chanListbox.getBottomOption()))
+ if(listTop + listIndex >= u4(chanListbox.getBottomOption()))
continue;
chan = (*chanList)[listTop + listIndex];
if (eventLista[listIndex])
w = x = 0; // keep compiler happy
y =yOffset;
h = getFontHeight(); // TODO if want border around text, need to increae this and wselectlist line height
- UINT end = event->time + event->duration; // programme end time
- if(event->time <= UINT(ltime) && end > UINT(ltime)) // spans start of displayed window
+ u4 end = event->time + event->duration; // programme end time
+ if(event->time <= u4(ltime) && end > u4(ltime)) // spans start of displayed window
{
x = 155; // LHS of window
- if (end > (UINT(ltime) + (window_width * 60)))
+ if (end > (u4(ltime) + (window_width * 60)))
w = window_width * MINUTE_SCALE; // spans full 2 hour window
else
w = MINUTE_SCALE * (event->time + event->duration - ltime ) / 60; // get width of remaining programme
}
- if((event->time >= UINT(ltime)) && (event->time <= UINT(ltime) + (window_width * 60))) // starts within window
+ if((event->time >= u4(ltime)) && (event->time <= u4(ltime) + (window_width * 60))) // starts within window
{
x = 155 + (MINUTE_SCALE * (event->time - ltime) / 60);
w = MINUTE_SCALE * event->duration / 60;
mbstate_t state;
memset((void*)&state,0,sizeof(state));
- UINT textPos;
+ u4 textPos;
for (textPos = 0; textPos <text_max; textPos+=cur_length)
{
wchar_t cur_char;
class VEpg : public Boxx, public MessageReceiver, public TimerReceiver
{
public:
- VEpg(MessageReceiver* parent, UINT currentChannel, std::shared_ptr<ChannelList> tchanList);
+ VEpg(MessageReceiver* parent, u4 currentChannel, std::shared_ptr<ChannelList> tchanList);
~VEpg();
static VEpg* getInstance();
EventList* eventList; // list of events (programmes) for a channel
Event thisEvent; // the selected event
time_t selTime; // current selection time
- UINT e; // temp used to point to an event
+ u4 e; // temp used to point to an event
std::shared_ptr<ChannelList> chanList; // list of available channels
tm* epgtime; // selected time within epg
tm* Ltime; // time of LHS of epg view
time_t prevHour(time_t* t);
MessageReceiver* parent;
BoxStack* boxstack;
- UINT gridRows;
- UINT currentChannelIndex;
- UINT window_width;
- UINT window_x;
+ u4 gridRows;
+ u4 currentChannelIndex;
+ u4 window_width;
+ u4 window_x;
};
#endif
epg.setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
epgTVmedia.setPosition(epg.getRegionR().w - 100 - 10, 10);
- epgTVmedia.setSize(100, static_cast<UINT>(150 / Osd::getInstance()->getPixelAspect()));
+ epgTVmedia.setSize(100, static_cast<u4>(150 / Osd::getInstance()->getPixelAspect()));
epg.add(&epgTVmedia);
boxRed.setBackgroundColour(DrawStyle::RED);
LogNT::getInstance()->debug(TAG, "Found the option you pointed at. {} {}", current->title, current->id);
unsigned int chanlistsize = chanList->size();
Channel* chan;
- UINT listIndex;
+ u4 listIndex;
for (listIndex = 0; listIndex < chanlistsize; listIndex++)
{
channelNumber = chan->number;
}
- UINT listIndex;
+ u4 listIndex;
unsigned int chanlistsize = chanList->size();
Channel* chan;
*
* if (!chanList) return;
Channel* chan;
- for(UINT listIndex = 0; listIndex < gridRows; listIndex++)
+ for(u4 listIndex = 0; listIndex < gridRows; listIndex++)
{
- if(listTop + listIndex >= UINT(chanListbox.getBottomOption()))
+ if(listTop + listIndex >= u4(chanListbox.getBottomOption()))
continue;
chan = (*chanList)[listTop + listIndex];
eventLista[listIndex] = VDR::getInstance()->getChannelSchedule(chan->number, ltime - 1, window_width * 60 + 2); // ltime - 1 to get prog before window (allows cursor left past ltime). + 2 to get prog after window
int startupdate = 0;
int endupdate = 0;
- UINT chanlistsize = chanList->size();
+ u4 chanlistsize = chanList->size();
if (changeState)
{
eventLista.resize(chanList->size());
Channel* chan;
- for (UINT listIndex = 0; listIndex < chanlistsize; listIndex++)
+ for (u4 listIndex = 0; listIndex < chanlistsize; listIndex++)
{
if (listIndex >= chanlistsize) continue;
Event* currentEvent = NULL;
EventList::iterator j;
- UINT minevents = 1;
+ u4 minevents = 1;
if (next) minevents++;
std::string eventText;
- for (UINT listIndex = 0; listIndex < chanlistsize; listIndex++)
+ for (u4 listIndex = 0; listIndex < chanlistsize; listIndex++)
{
Channel* chan;
chan = (*chanList)[listIndex];
char tempA[300];
unsigned int chanlistsize = chanList->size();
Channel* chan;
- UINT listIndex;
+ u4 listIndex;
for (listIndex = 0; listIndex < chanlistsize; listIndex++)
{
LogNT::getInstance()->debug(TAG, "Found the option you pointed at. {} {}", current->title.c_str(), current->id);
unsigned int chanlistsize = chanList->size();
Channel* chan;
- UINT listIndex;
+ u4 listIndex;
for (listIndex = 0; listIndex < chanlistsize; listIndex++)
{
eventTitle = new char[strlen(event->title.c_str()) + 1];
strcpy(eventTitle, event->title.c_str());
- for(UINT i=0; i < strlen(eventTitle); i++) if (eventTitle[i] == ':') eventTitle[i] = '|';
+ for(u4 i=0; i < strlen(eventTitle); i++) if (eventTitle[i] == ':') eventTitle[i] = '|';
SNPRINTF(timerString, 1023, "%i:%lu:%s:%s:%s:%s:%s:%s:",
flags, channel->number, dateString,
}
epgTVmedia.setPosition(summary->getRegionR().w-130-10,0);
- epgTVmedia.setSize(130, static_cast<UINT>(195 / Osd::getInstance()->getPixelAspect()));
+ epgTVmedia.setSize(130, static_cast<u4>(195 / Osd::getInstance()->getPixelAspect()));
summary->add(&epgTVmedia);
if (movieview) movieview->add(&epgTVmedia);
if (seriesview) seriesview->add(&epgTVmedia);
}*/
/*
-UINT Video::getFPS()
+u4 Video::getFPS()
{
if (format == NTSC) return 30;
else return 25;
typedef struct _VideoDisplay {
enum VideoMode mode;
enum VideoMode fallbackMode;
- UINT x,y;
- UINT width,height;
+ u4 x,y;
+ u4 width,height;
} VideoDisplay;
class Video: public DrainTarget, public AbstractOption
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 UINT supportedTVsize() { return 0; }; // if no selection is allowed
+ virtual u4 supportedTVsize() { return 0; }; // if no selection is allowed
virtual UCHAR supportedTVFormats() { return 0; }; // if no selection is allowed
virtual int setConnection(UCHAR connection)=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, UINT length)=0;
+ virtual bool displayIFrame(const UCHAR* buffer, u4 length)=0;
virtual int EnterIframePlayback() {return 1;}; // Must not be implemented
virtual bool supportsh264() { return false; };
int getMode() { return mode; }
UCHAR getFormat() { return format; }
- UINT getScreenWidth() { return screenWidth; }
- UINT getScreenHeight() { return screenHeight; }
+ u4 getScreenWidth() { return screenWidth; }
+ u4 getScreenHeight() { return screenHeight; }
virtual UCHAR getTVsize() { return tvsize; }
virtual bool setVideoDisplay(VideoDisplay display);
- // UINT getFPS(); //removed
+ // u4 getFPS(); //removed
// Video formats - AV_SET_VID_DISP_FMT
const static UCHAR NTSC = 0;
bool h264;
- UINT screenWidth;
- UINT screenHeight;
+ u4 screenWidth;
+ u4 screenHeight;
};
#endif
return true;
}
-/*Option(UINT id, const char* displayText, const char* configSection, const char* configKey, UINT optionType,
- UINT numChoices, UINT defaultChoice, UINT startInt,
+/*Option(u4 id, const char* displayText, const char* configSection, const char* configKey, u4 optionType,
+ u4 numChoices, u4 defaultChoice, u4 startInt,
const char * const * options, const char * const * optionkeys = NULL, AbstractOption* handler=NULL);*/
bool VideoOMX::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane)
cur_input_buf_omx=NULL;
input_bufs_omx_mutex.lock();
- for (UINT i=0; i< input_bufs_omx_all.size();i++) {
+ for (u4 i=0; i< input_bufs_omx_all.size();i++) {
// free(input_bufs_omx_all[i]->pBuffer);
// input_bufs_omx_all[i]->pBuffer=NULL;
error=OMX_FreeBuffer(omx_vid_dec,omx_codec_input_port,input_bufs_omx_all[i]);
}
-void VideoOMX::PrepareMediaSample(const MediaPacketList& mplist, UINT /* samplepos */)
+void VideoOMX::PrepareMediaSample(const MediaPacketList& mplist, u4 /* samplepos */)
{
mediapackets.clear();
}
-UINT VideoOMX::DeliverMediaSample(UCHAR* buffer, UINT *samplepos)
+u4 VideoOMX::DeliverMediaSample(UCHAR* buffer, u4 *samplepos)
{
- UINT consumed=0;
+ u4 consumed=0;
while (consumed < mediapackets.size()) {
DeliverMediaPacket(mediapackets[consumed], buffer, samplepos);
if (*samplepos == mediapackets[consumed].length) {
return consumed;
}
-UINT VideoOMX::DeliverMediaPacket(MediaPacket packet,
+u4 VideoOMX::DeliverMediaPacket(MediaPacket packet,
const UCHAR* buffer,
- UINT *samplepos)
+ u4 *samplepos)
{
if (packet.type == MPTYPE_VIDEO_H264)
{
return 0; //Not in iframe mode!
}
- UINT headerstrip=0;
+ u4 headerstrip=0;
if (packet.disconti) {
firstsynched=false;
if (cur_input_buf_omx) {
-bool VideoOMX::displayIFrame(const UCHAR* buffer, UINT length) {
+bool VideoOMX::displayIFrame(const UCHAR* buffer, u4 length) {
if (!omx_running) return false;
if (!iframemode)
EnterIframePlayback();
input_bufs_omx_mutex.unlock();
}
- UINT read_pos = 0;
+ u4 read_pos = 0;
unsigned int pattern, packet_length;
unsigned int headerstrip = 0;
bool first = true;
int shutdown();
UCHAR getSupportedFormats() { return COMPOSITERGB | HDMI;};
- UINT supportedTVsize() { return ASPECT4X3|ASPECT16X9|ASPECT14X9 ;};
+ u4 supportedTVsize() { return ASPECT4X3|ASPECT16X9|ASPECT14X9 ;};
UCHAR supportedTVFormats() { return NTSC|PAL|PAL_M|NTSC_J;};
int setFormat(UCHAR format);
int attachFrameBuffer(); // What does this do?
u4 timecodeToFrameNumber(u8 timecode);
u8 getCurrentTimestamp();
- bool displayIFrame(const UCHAR* bulibaver, UINT length);
+ bool displayIFrame(const UCHAR* 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&, UINT samplepos);
- virtual UINT DeliverMediaSample(UCHAR* bulibaver, UINT* samplepos);
+ virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos);
+ virtual u4 DeliverMediaSample(UCHAR* bulibaver, u4* samplepos);
virtual bool supportsh264(){return true;};
virtual bool DrainTargetBufferFull();
- UINT DeliverMediaPacket(MediaPacket packet,const UCHAR* bulibaver,UINT *samplepos);
+ u4 DeliverMediaPacket(MediaPacket packet,const UCHAR* bulibaver,u4 *samplepos);
#define VPE_DECODER_OMX 1
static OMX_ERRORTYPE EmptyBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp,OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
static OMX_ERRORTYPE FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE hcomp, OMX_IN OMX_PTR appdata,OMX_IN OMX_BUFFERHEADERTYPE* bulibaver);
- UINT DeliverMediaPacketOMX(MediaPacket packet,
+ u4 DeliverMediaPacketOMX(MediaPacket packet,
const UCHAR* bulibaver,
- UINT *samplepos);
+ u4 *samplepos);
bool detectIFrame(const UCHAR *buffer,unsigned int length);
return true;
}
-/*Option(UINT id, const char* displayText, const char* configSection, const char* configKey, UINT optionType,
- UINT numChoices, UINT defaultChoice, UINT startInt,
+/*Option(u4 id, const char* displayText, const char* configSection, const char* configKey, u4 optionType,
+ u4 numChoices, u4 defaultChoice, u4 startInt,
const char * const * options, const char * const * optionkeys = NULL, AbstractOption* handler=NULL);*/
bool VideoWin::addOptionsToPanes(int panenumber,Options *options,WOptionPane* pane)
}
void VideoWin::PrepareMediaSample(const MediaPacketList& mplist,
- UINT samplepos)
+ u4 samplepos)
{
mediapacket = mplist.front();
}
-UINT VideoWin::DeliverMediaSample(UCHAR* buffer, UINT *samplepos)
+u4 VideoWin::DeliverMediaSample(UCHAR* buffer, u4 *samplepos)
{
DeliverMediaPacket(mediapacket, buffer, samplepos);
if (*samplepos == mediapacket.length) {
else return 0;
}
-UINT VideoWin::DeliverMediaPacket(MediaPacket packet,
+u4 VideoWin::DeliverMediaPacket(MediaPacket packet,
const UCHAR* buffer,
- UINT *samplepos)
+ u4 *samplepos)
{
/*First Check, if we have an audio sample*/
REFERENCE_TIME reftime1=0;
REFERENCE_TIME reftime2=0;
- UINT headerstrip=0;
+ u4 headerstrip=0;
if (packet.disconti) {
firstsynched=false;
DeliverVideoMediaSample();
}
}
BYTE *ms_buf;
- UINT ms_length;
- UINT ms_pos;
- UINT haveToCopy;
+ u4 ms_length;
+ u4 ms_pos;
+ u4 haveToCopy;
if (!getCurrentVideoMediaSample(&ms) || ms==NULL) {// get the current sample
//samplepos=0;
if (dsbasicaudio) dsbasicaudio->put_Volume(volume);
}
-bool VideoWin::displayIFrame(const UCHAR* buffer, UINT length)
+bool VideoWin::displayIFrame(const UCHAR* buffer, u4 length)
{
if (!iframemode) EnterIframePlayback();
if (!isdsinited()) return false;
int setFormat(UCHAR format);
UCHAR getSupportedFormats() { return 0;};
- UINT supportedTVsize() { return ASPECT4X3|ASPECT16X9;};
+ u4 supportedTVsize() { return ASPECT4X3|ASPECT16X9;};
UCHAR supportedTVFormats() { return 0;};
int setConnection(UCHAR connection);
bool handleOptionChanges(Option* option);
//Writing Data to Videodevice
- virtual void PrepareMediaSample(const MediaPacketList&, UINT samplepos);
- virtual UINT DeliverMediaSample(UCHAR* buffer, UINT *samplepos);
- UINT DeliverMediaPacket(const MediaPacket packet, const UCHAR* buffer, UINT *samplepos);
+ 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 bool dtsTimefix() {if (h264)return videoH264dtsfix; else return videompeg2dtsfix;}
virtual bool supportsh264();
void turnVideoOn(){videoon=true;};
void turnVideoOff(){videoon=false;};
- virtual bool displayIFrame(const UCHAR* buffer, UINT length);
+ virtual bool displayIFrame(const UCHAR* buffer, u4 length);
const VideoDisplay & getVideoDisplay() { return vd; };
bool isVideoOn() {return videoon;};
if (_list) delete _list;
}
private:
- UINT _ref;
+ u4 _ref;
MediaList *_list;
};
int first = 1;
if (h && h->list())
{
- for (UINT i = 0; i < h->list()->size(); i++)
+ for (u4 i = 0; i < h->list()->size(); i++)
{
media = (*h->list())[i];
if (media->getMediaType() == MEDIA_TYPE_DIR) {
virtual u4 readChunk(u4 offset,u4 len,char ** buf) {
Log::getInstance()->log("VMediaView::jpegReader", Log::DEBUG, "read chunk o=%d,len=%d,buf=%p",
offset,len,*buf);
- UINT numrec=0;
+ u4 numrec=0;
int rt=0;
for (int trycount=0;trycount < MAXTRY && ! dobreak && numrec == 0 && rt == 0;trycount++) {
if (dobreak) {
rt=-1;
}
else {
- rt=reader->getImageChunk((u8)offset,(UINT)len,&numrec,(UCHAR **)buf);
+ rt=reader->getImageChunk((u8)offset,(u4)len,&numrec,(UCHAR **)buf);
}
}
Log::getInstance()->log("VMediaView::jpegReader", Log::DEBUG, "got n=%d,buf=%p,rt=%d",
playerInfo=getPlayer()->getID3Info();drawText(tr("Loading"),5,3,DrawStyle::LIGHTTEXT);
len=strlen(currentAudio->getDisplayName())+strlen(pl)+30+strlen(parent->getDirname(MEDIA_TYPE_AUDIO))+Media::TIMEBUFLEN+110;
if (playerInfo) {
- for (UINT i=0;i<strlen(playerInfo);i++)
+ for (u4 i=0;i<strlen(playerInfo);i++)
if (playerInfo[i] == '\n') numlines++;
len+=strlen(playerInfo);
first=playerInfo;
}
destroyInfo();
info=new VInfo();
- UINT height=numlines*30+60;
- UINT vheight=Video::getInstance()->getScreenHeight();
- UINT vwidth=Video::getInstance()->getScreenWidth();
+ u4 height=numlines*30+60;
+ u4 vheight=Video::getInstance()->getScreenHeight();
+ u4 vwidth=Video::getInstance()->getScreenWidth();
if (height > vheight-2*AUDIOBANNER_BOTTOM_MARGIN)
height=vheight-2*AUDIOBANNER_BOTTOM_MARGIN;
info->setSize(vwidth -2*AUDIOBANNER_X_MARGIN, height);
bool secondSurface(){
return surface == sfc2;
}
- UINT originalw;
- UINT originalh;
+ u4 originalw;
+ u4 originalh;
bool bannerEnabled;
DrawingThread *drawingThread;
options2 = new const char*[LangCode.size()];
options2keys = new const char*[LangCode.size()];
I18n::lang_code_list::const_iterator iter;
- UINT LangNumber = 0;
+ u4 LangNumber = 0;
for (iter = LangCode.begin(); iter != LangCode.end(); ++iter,++LangNumber)
{
options2[LangNumber] = iter->second.c_str();
options.push_back(option);
wop->addOptionLine(option);
- UINT suppconn = Video::getInstance()->getSupportedFormats();
+ u4 suppconn = Video::getInstance()->getSupportedFormats();
if (suppconn) {
- UINT defaultch = 0;
+ u4 defaultch = 0;
if (suppconn & Video::COMPOSITERGB) {
defaultch = 0;
options3.push_back("RGB+composite");
wop->addOptionLine(option);
}
- UINT suppformats = Video::getInstance()->supportedTVFormats();
+ u4 suppformats = Video::getInstance()->supportedTVFormats();
if (suppformats) {
- UINT defaultch = 0;
+ u4 defaultch = 0;
options16.push_back("NTSC");
options16keys.push_back("NTSC");
if (suppformats & Video::PAL) {
wop->addOptionLine(option);
}
- UINT supptvsize=Video::getInstance()->supportedTVsize();
+ u4 supptvsize=Video::getInstance()->supportedTVsize();
if (supptvsize) {
- UINT defaultch=0;
+ u4 defaultch=0;
options4.push_back("4:3");
options4keys.push_back("4:3");
if (Video::ASPECT16X9 & supptvsize) {
wop->saveOpts();
- for (UINT i = 0; i < options.size(); i++)
+ for (u4 i = 0; i < options.size(); i++)
{
if (options[i]->configChoice == options[i]->userSetChoice) continue; // no change
{
if (m->message == Message::MOUSE_LBDOWN)
{
- UINT x = m->parameter - getScreenX();
- UINT y = m->tag - getScreenY();
+ u4 x = m->parameter - getScreenX();
+ u4 y = m->tag - getScreenY();
if (!barShowing)
{
boxstack->handleCommand(Input::OK); //simulate rok press
&& ((barRegion.x + barRegion.w) >= x)
&& ((barRegion.y + barRegion.h) >= y))
{
- UINT progBarXbase = barRegion.x + 300;
+ u4 progBarXbase = barRegion.x + 300;
if ( x >= barRegion.x + progBarXbase + 24
&& x <= barRegion.x + progBarXbase + 4 + 302
&& y >= barRegion.y + 12 - 2
Region barRegion;
Region clocksRegion;
- UINT startMargin;
- UINT endMargin;
+ u4 startMargin;
+ u4 endMargin;
};
#endif
epg.setBackgroundColour(DrawStyle::VIEWBACKGROUND);
epgTVmedia.setPosition(epg.getRegionR().w-100-10,10);
- epgTVmedia.setSize(100, static_cast<UINT>(150/Osd::getInstance()->getPixelAspect()));
+ epgTVmedia.setSize(100, static_cast<u4>(150/Osd::getInstance()->getPixelAspect()));
epg.add(&epgTVmedia);
}
add(&sl);
sl.addOption(servers[0].name, 0, 1);
- for(UINT k = 1; k < servers.numServers(); k++)
+ for(u4 k = 1; k < servers.numServers(); k++)
{
sl.addOption(servers[k].name, 0, 0);
}
MessageReceiver* vTimerList;
WButton buttonBack;
WButton buttonDelete;
- UINT selectedButton;
+ u4 selectedButton;
};
#endif
if (recTimerList)
{
- for (UINT i = 0; i < recTimerList->size(); i++)
+ for (u4 i = 0; i < recTimerList->size(); i++)
{
delete (*recTimerList)[i];
}
RecTimer* recTimer;
int first = 1;
- for (UINT i = 0; i < recTimerList->size(); i++)
+ for (u4 i = 0; i < recTimerList->size(); i++)
{
recTimer = (*recTimerList)[i];
time_t rectime = recTimer->startTime;
if (recTimerList)
{
- for (UINT i = 0; i < recTimerList->size(); i++)
+ for (u4 i = 0; i < recTimerList->size(); i++)
{
delete (*recTimerList)[i];
}
playing = false;
// Convert channel number to index
- for(UINT i = 0; i < chanList->size(); i++)
+ for(u4 i = 0; i < chanList->size(); i++)
{
if ((*chanList)[i]->number == initialChannelNumber)
{
{
if (keying)
{
- UINT newChannel = 0;
+ u4 newChannel = 0;
for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * toi4(pow(10.f, i));
channelChange(NUMBER, newChannel);
if (keying == numberWidth)
{
- UINT newChannel = 0;
+ u4 newChannel = 0;
for(i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * toi4(pow(10.f, i));
channelChange(NUMBER, newChannel);
if (keying)
{
LogNT::getInstance()->debug(TAG, "Timer Call 1 key start.");
- UINT newChannel = 0;
+ u4 newChannel = 0;
for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * toi4(pow(10.f, i));
Message* m = new Message();
}
}
-bool VVideoLiveTV::channelChange(UCHAR changeType, UINT newData)
+bool VVideoLiveTV::channelChange(UCHAR changeType, u4 newData)
{
- UINT newChannel = 0;
+ u4 newChannel = 0;
if (streamType == VDR::VIDEO)
{
VTeletextView* vtxt = static_cast<PlayerVideoLive*>(player)->getTeletextDecoder()->getTeletxtView();
}
else if (changeType == NUMBER)
{
- UINT i;
+ u4 i;
for(i = 0; i < chanList->size(); i++)
{
if ((*chanList)[i]->number == newData)
}
}
-UINT VVideoLiveTV::upChannel(UINT index)
+u4 VVideoLiveTV::upChannel(u4 index)
{
if (index == (chanList->size() - 1)) // at the end
return 0; // so go to start
return index + 1;
}
-UINT VVideoLiveTV::downChannel(UINT index)
+u4 VVideoLiveTV::downChannel(u4 index)
{
if (index == 0) // at the start
return chanList->size() - 1; // so go to end
}
-void VVideoLiveTV::drawOSDBitmap(UINT posX, UINT posY, const Bitmap& bm, const DisplayRegion& region)
+void VVideoLiveTV::drawOSDBitmap(u4 posX, u4 posY, const Bitmap& bm, const DisplayRegion& region)
{
drawBitmap(posX, posY, bm,region);
Region r;
boxstack->update(this, &area);
}
-void VVideoLiveTV::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, const DisplayRegion& region)
+void VVideoLiveTV::clearOSDArea(u4 posX, u4 posY, u4 width, u4 height, const DisplayRegion& region)
{
Region r;
r.x = posX+region.windowx; r.y = posY+region.windowy; r.w = width; r.h = height;
//now convert to our display
float scalex = 720.f / static_cast<float>(region.framewidth + 1);
float scaley = 576.f / static_cast<float>(region.frameheight + 1);
- r.x = static_cast<UINT>(floor(scalex * static_cast<float>(r.x)));
- r.y = static_cast<UINT>(floor(scaley * static_cast<float>(r.y)));
- r.w = static_cast<UINT>(ceil(scalex * static_cast<float>(r.w)) + 1.f);
- r.h = static_cast<UINT>(ceil(scaley * static_cast<float>(r.h)) + 1.f);
+ r.x = static_cast<u4>(floor(scalex * static_cast<float>(r.x)));
+ r.y = static_cast<u4>(floor(scaley * static_cast<float>(r.y)));
+ r.w = static_cast<u4>(ceil(scalex * static_cast<float>(r.w)) + 1.f);
+ r.h = static_cast<u4>(ceil(scaley * static_cast<float>(r.h)) + 1.f);
rectangle(r, DrawStyle::TRANSPARENT);
boxstack->update(this, &r);
}
void go();
- bool channelChange(UCHAR changeType, UINT newData);
+ bool channelChange(UCHAR 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)
void timercall(int ref);
- void drawOSDBitmap(UINT posX, UINT posY, const Bitmap&, const DisplayRegion& region);
+ void drawOSDBitmap(u4 posX, u4 posY, const Bitmap&, const DisplayRegion& region);
void clearOSD();
- void clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, const DisplayRegion& region);
+ void clearOSDArea(u4 posX, u4 posY, u4 width, u4 height, const DisplayRegion& region);
private:
BoxStack* boxstack;
u4 streamType;
u4 preBuffering;
- UINT currentChannelIndex;
- UINT previousChannelIndex;
- UINT osdChannelIndex;
+ u4 currentChannelIndex;
+ u4 previousChannelIndex;
+ u4 osdChannelIndex;
int keying;
int keyingInput[10];
void doAudioSelector();
void doTeletext(bool subtitle=false);
void stop();
- UINT upChannel(UINT index);
- UINT downChannel(UINT index);
+ u4 upChannel(u4 index);
+ u4 downChannel(u4 index);
void toggleChopSides();
void updatePosterBanner();
if (m->message == Message::MOUSE_LBDOWN)
{
- UINT x = m->parameter - getScreenX();
- UINT y = m->tag - getScreenY();
+ u4 x = m->parameter - getScreenX();
+ u4 y = m->tag - getScreenY();
if (!barShowing)
{
return rt;
}
-char * VVideoMedia::shortendedText(const char * title, const char * title2,const char * intext,char *buffer,UINT width) {
+char * VVideoMedia::shortendedText(const char * title, const char * title2,const char * intext,char *buffer,u4 width) {
if (! intext) {
intext="";
}
- UINT twidth=0;
- for (const char *p=title;*p!=0;p++) twidth+=(UINT)charWidth(*p);
- for (const char *p=title2;*p!=0;p++) twidth+=(UINT)charWidth(*p);
+ u4 twidth=0;
+ for (const char *p=title;*p!=0;p++) twidth+=(u4)charWidth(*p);
+ for (const char *p=title2;*p!=0;p++) twidth+=(u4)charWidth(*p);
const char *prfx="...";
- UINT prfwidth=(UINT)(3*charWidth('.'));
+ u4 prfwidth=(u4)(3*charWidth('.'));
const char *istart=intext+strlen(intext);
- UINT iwidth=0;
+ u4 iwidth=0;
while (twidth+iwidth+prfwidth < width-2*paraMargin && istart> intext) {
istart--;
- iwidth+=(UINT)charWidth(*istart);
+ iwidth+=(u4)charWidth(*istart);
}
if (twidth+iwidth+prfwidth >= width-2*paraMargin && istart < intext+strlen(intext)) istart++;
if (istart == intext) prfx="";
//create an abbreviated text
//buffer must be len(title,intext)+3
//returns buffer
- char * shortendedText(const char *title,const char *title2,const char *intext,char *buffer,UINT width);
+ char * shortendedText(const char *title,const char *title2,const char *intext,char *buffer,u4 width);
hmsf ptsToHMS(u8 pts);
Region barRegion;
Region clocksRegion;
if (m->message == Message::MOUSE_LBDOWN)
{
- UINT x = m->parameter - getScreenX();
- UINT y = m->tag - getScreenY();
+ u4 x = m->parameter - getScreenX();
+ u4 y = m->tag - getScreenY();
if (!barShowing)
{
}
}
-void VVideoRec::drawOSDBitmap(UINT posX, UINT posY, const Bitmap& bm, const DisplayRegion& region)
+void VVideoRec::drawOSDBitmap(u4 posX, u4 posY, const Bitmap& bm, const DisplayRegion& region)
{
drawBitmap(posX, posY, bm, region);
Region r;
boxstack->update(this, &area);
}
-void VVideoRec::clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, const DisplayRegion& region)
+void VVideoRec::clearOSDArea(u4 posX, u4 posY, u4 width, u4 height, const DisplayRegion& region)
{
Region r(r.x = posX + region.windowx, posY + region.windowy, width, height);
//now convert to our display
float scalex = 720.f / static_cast<float>(region.framewidth + 1);
float scaley = 576.f / static_cast<float>(region.frameheight + 1);
- r.x = static_cast<UINT>(floor(scalex * static_cast<float>(r.x)));
- r.y = static_cast<UINT>(floor(scaley * static_cast<float>(r.y)));
- r.w = static_cast<UINT>(ceil(scalex * static_cast<float>(r.w)) + 1.f);
- r.h = static_cast<UINT>(ceil(scaley * static_cast<float>(r.h)) + 1.f);
+ r.x = static_cast<u4>(floor(scalex * static_cast<float>(r.x)));
+ r.y = static_cast<u4>(floor(scaley * static_cast<float>(r.y)));
+ r.w = static_cast<u4>(ceil(scalex * static_cast<float>(r.w)) + 1.f);
+ r.h = static_cast<u4>(ceil(scaley * static_cast<float>(r.h)) + 1.f);
rectangle(r, DrawStyle::TRANSPARENT);
boxstack->update(this, &r);
void timercall(int clientReference);
void processMessage(Message* m);
- void drawOSDBitmap(UINT posX, UINT posY, const Bitmap&, const DisplayRegion& region);
+ void drawOSDBitmap(u4 posX, u4 posY, const Bitmap&, const DisplayRegion& region);
void clearOSD();
- void clearOSDArea(UINT posX, UINT posY, UINT width, UINT height, const DisplayRegion& region);
+ void clearOSDArea(u4 posX, u4 posY, u4 width, u4 height, const DisplayRegion& region);
void doTeletext();
Region barRegion;
Region clocksRegion;
- UINT startMargin{};
- UINT endMargin{};
+ u4 startMargin{};
+ u4 endMargin{};
int lastbar{-1};
#include "oldlog.h"
#include "colour.h"
-typedef HRESULT(__stdcall *FCT_DXVA2CreateDirect3DDeviceManager9)(UINT* pResetToken, IDirect3DDeviceManager9** ppDeviceManager);
+typedef HRESULT(__stdcall *FCT_DXVA2CreateDirect3DDeviceManager9)(u4* pResetToken, IDirect3DDeviceManager9** ppDeviceManager);
typedef HRESULT(__stdcall *FCT_MFCreateVideoSampleFromSurface)(IUnknown* pUnkSurface, IMFSample** ppSample);
FCT_DXVA2CreateDirect3DDeviceManager9 ptrDXVA2CreateDirect3DDeviceManager9 = NULL;
LPDIRECT3DSURFACE9 swapsurf;
LPDIRECT3DSURFACE9 d3drtsurf;
- UINT dxvatoken;
+ u4 dxvatoken;
IDirect3DDeviceManager9 *d3ddevman;
HANDLE dxvadevicehandle;
bool cmenu=false;
HMODULE user32dll;
-typedef UINT (WINAPI *GETRAWINPUTDATAFNC) (HRAWINPUT,UINT,LPVOID,PUINT,UINT);
-typedef UINT (WINAPI *REGISTERRAWINPUTDEVICEFNC) (PCRAWINPUTDEVICE,UINT,UINT);
+typedef u4 (WINAPI *GETRAWINPUTDATAFNC) (HRAWINPUT,u4,LPVOID,Pu4,u4);
+typedef u4 (WINAPI *REGISTERRAWINPUTDEVICEFNC) (PCRAWINPUTDEVICE,u4,u4);
GETRAWINPUTDATAFNC dynGetRawInputData=NULL;
REGISTERRAWINPUTDEVICEFNC dynRegisterRawInputDevices=NULL;
return true;
}
-LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam)
+LONG FAR PASCAL WindowProc(HWND wind, u4 msg, WPARAM wparam, LPARAM lparam)
{
switch (msg) {
if (remotefnc ) {
//only on XP!
LPRAWINPUT lpit;
- UINT risize;
+ u4 risize;
dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,NULL,&risize,sizeof(RAWINPUTHEADER));
lpit=(LPRAWINPUT)malloc(risize);
dynGetRawInputData((HRAWINPUT)lparam,RID_INPUT,lpit,&risize,sizeof(RAWINPUTHEADER));
//the scale factors supported by the jpeg lib
struct scale{
- UINT num;
- UINT denom;
+ u4 num;
+ u4 denom;
};
// list of available jpeg scale factors
//out: scalenum,scaledenom,scaleafter
- UINT picturew=ctl->picw;
- UINT pictureh=ctl->pich;
+ u4 picturew=ctl->picw;
+ u4 pictureh=ctl->pich;
switch (ctl->finalRotation){
case ROT_90:
case ROT_270:
default:
break;
}
- UINT scalenum=1;
- UINT scaledenom=1;
- UINT scaleafter=1;
+ u4 scalenum=1;
+ u4 scaledenom=1;
+ u4 scaleafter=1;
if (! ctl->enlarge) {
//scale - compute the factors to fit 100%
int scalew=1000*picturew/ctl->area.w;
int minDiff=1000;
logger->log("BJpeg", Log::DEBUG, "start scaling screenw=%u, screenh=%u, pw=%u,ph=%u, scale=%d, mode=%d, %%=%u, after=%u",
ctl->area.w,ctl->area.h,picturew,pictureh,scale,(int)ctl->mode,ctl->scaleAmount, ctl->scaleafter);
- for (UINT j=0;j<sizeof(jpegFactors)/sizeof(jpegFactors[0]);j++) {
- for (UINT sa=1;sa<=ctl->scaleafter;sa++) {
+ for (u4 j=0;j<sizeof(jpegFactors)/sizeof(jpegFactors[0]);j++) {
+ for (u4 sa=1;sa<=ctl->scaleafter;sa++) {
int curf=(scale*jpegFactors[j].num)/(jpegFactors[j].denom*sa);
bool setThis=false;
logger->log("BJpeg", Log::DEBUG, "testing scale curf=%d,num=%u,denom=%u,after=%u,minDiff=%d",
xpos+=ctl->area.x;
ypos+=ctl->area.y;
//remember the jpeg dimensions for computing the buffer
- UINT jpegwidth=cinfo.output_width;
- UINT jpegheight=cinfo.output_height;
+ u4 jpegwidth=cinfo.output_width;
+ u4 jpegheight=cinfo.output_height;
logger->log("BJpeg", Log::DEBUG, "JPEG startup done pw=%i ph=%i, xo=%i,yo=%i, jw=%i, jh=%i, rot=%d",
picturew, pictureh,xpos,ypos,jpegwidth,jpegheight,(int)ctl->finalRotation*90);
//unsigned char lbuf[linelen];
unsigned char *lbuf=new unsigned char[linelen*scaleafter];
unsigned char * ptr=lbuf;
- UINT outy=0;
+ u4 outy=0;
#else
unsigned char * ptr=buffer;
#endif
sfc->startFastDraw();//Tell the surface, that we will draw a lot of pixel,
//so that performance, can be optimized
logger->log("BJpeg", Log::DEBUG, "start drawing ");
- UINT colincr=0;
+ u4 colincr=0;
//factors to base 1024
- UINT fac=1024;
+ u4 fac=1024;
if (scaleafter > 1) {
colincr=3*scaleafter-3;
fac=1024/(scaleafter*scaleafter);
rdr->drawingDone();
#ifdef USE_BUFFER
- UINT y;
+ u4 y;
//Tell the surface, that we will draw a lot of pixel,
//so that performance, can be optimized
sfc->startFastDraw();
logger->log("BJpeg", Log::DEBUG, "jpeg start buffer draw" );
unsigned char* p=buffer; //start of first row
- UINT rowincr=linelen*scaleafter;
+ u4 rowincr=linelen*scaleafter;
//for simplicity omit last line to avoid running out of buffer
for (y = 0; y < pictureh-1 ;y++)
{
Region area;
bool enlarge;
//the maximum allowed scale factor after decompress
- UINT scaleafter;
+ u4 scaleafter;
//the scale mode
enum ScaleMode mode;
//the size value if scaleMode==cropPercent
//%of the drawing area size
- UINT scaleAmount;
+ u4 scaleAmount;
//the rotation (user defined as input)
//if exif rotation is found this will be added
enum Rotation rotation;
enum Rotation exifRotation;
char exifDate[30];
char error[100];
- UINT picw;
- UINT pich;
+ u4 picw;
+ u4 pich;
u4 compressedSize;
//parameters computed to display picture
enum Rotation finalRotation;
//scale in %
- UINT scale;
+ u4 scale;
JpegControl() {
area.x=0;
area.y=0;
if (xb < 0 || yb < 0 ) {
return;
}
- sfc->drawPixel((UINT)xb,(UINT)yb,c,true);
+ sfc->drawPixel((u4)xb,(u4)yb,c,true);
}
/**
if scaleafter > 1 we draw that many lines (numlines is the# lines in the buffer)
picturew is the resulting width of the picture
**/
- inline static void drawLine(Surface *sfc,enum Rotation rotate, unsigned char *cp,UINT scaleafter,UINT picturew,UINT pictureh,
- UINT xpos, UINT ypos, UINT outy, UINT linelen,UINT pixeloffset, UINT numlines, UINT fac) {
+ inline static void drawLine(Surface *sfc,enum Rotation rotate, unsigned char *cp,u4 scaleafter,u4 picturew,u4 pictureh,
+ u4 xpos, u4 ypos, u4 outy, u4 linelen,u4 pixeloffset, u4 numlines, u4 fac) {
Colour c;
- for (UINT x = 0; x < picturew; x++)
+ for (u4 x = 0; x < picturew; x++)
{
if (scaleafter > 1 ) {
//boxfilter scalefactor*scalefactor
//take 0...scalefactor pixels in x and y direction
for (int colornum=0;colornum<3;colornum++) {
- UINT comp=0;
+ u4 comp=0;
unsigned char * accp=cp;
- for (UINT rows=0;rows<scaleafter;rows++) {
+ for (u4 rows=0;rows<scaleafter;rows++) {
unsigned char * pp=accp;
- for (UINT cols=0;cols<scaleafter;cols++) {
- comp+=(UINT)*pp;
+ for (u4 cols=0;cols<scaleafter;cols++) {
+ comp+=(u4)*pp;
if (pp-accp < (int)linelen-3) pp+=3;
}
if (rows < numlines) accp+=linelen;
{
if (!options) return;
- for(UINT i = 0; i < numOptions; i++) delete[] options[i];
+ for(u4 i = 0; i < numOptions; i++) delete[] options[i];
free(options);
}
-void WOptionBox::setSize(UINT w, UINT h)
+void WOptionBox::setSize(u4 w, u4 h)
{
Boxx::setSize(w, h);
textbox.setSize(w - 40, getFontHeight());
void WOptionBox::setSelected(const char* toSelect)
{
- for(UINT i = 0; i < numOptions; i++)
+ for(u4 i = 0; i < numOptions; i++)
{
if (!strcmp(toSelect, options[i]))
{
void WOptionBox::setSelected(int toSelect)
{
- for(UINT i = 0; i < numOptions; i++)
+ for(u4 i = 0; i < numOptions; i++)
{
if (atoi(options[i]) == toSelect)
{
void cycle();
int getSelectedIndex();
- virtual void setSize(UINT w, UINT h);
+ virtual void setSize(u4 w, u4 h);
virtual bool mouseMove(int x, int y);
virtual bool mouseLBDOWN(int x, int y);
private:
UCHAR active;
- UINT numOptions;
+ u4 numOptions;
char** options;
- UINT currentOption;
+ u4 currentOption;
int mode;
if (option->optionType == Option::TYPE_TEXT ||
option->optionType == Option::TYPE_KEYED_TEXT)
{
- for (UINT j = 0; j < option->numChoices; j++)
+ for (u4 j = 0; j < option->numChoices; j++)
{
LogNT::getInstance()->debug("Options", "Add option: {}", option->options[j]);
ob->addOption(tr(option->options[j]));
height += fontHeight*1.f;
}
- rem_scroll_line = (UINT)ceil((height - area.h -cur_scroll_line * fontHeight*8.f)/fontHeight/8.f);
+ rem_scroll_line = (u4)ceil((height - area.h -cur_scroll_line * fontHeight*8.f)/fontHeight/8.f);
// Log::getInstance()->log("WActorGallery", Log::DEBUG, "TVMedia rml %d",rem_scroll_line);
drawClippingRectangle(0,0,0,0);
#include "wprogressbar.h"
-void WProgressBar::setPercent(UINT tpercent)
+void WProgressBar::setPercent(u4 tpercent)
{
percent = tpercent;
if (percent > 100) percent = 0;
class WProgressBar : public Boxx
{
public:
- void setPercent(UINT percent);
+ void setPercent(u4 percent);
void draw();
private:
- UINT percent{};
+ u4 percent{};
};
#endif
sl.addColumn(150);
sl.addColumn(300);
- for (UINT i = 0; i < 256; i++)
+ for (u4 i = 0; i < 256; i++)
{
const char* vompKeyName = InputMan::getVompKeyName(static_cast<UCHAR>(i));
if (vompKeyName != NULL)
}
}
-void WRemoteConfig::setSize(UINT w, UINT h)
+void WRemoteConfig::setSize(u4 w, u4 h)
{
Boxx::setSize(w, h);
sl.setSize(area.w - 20, area.h - 70);
bool mouseMove(int x, int y);
bool mouseLBDOWN(int x, int y);
- void setSize(UINT w, UINT h);
+ void setSize(u4 w, u4 h);
int handleCommand(int command);
void draw();
fillColour(backgroundColour);
- UINT ypos = 5;
+ u4 ypos = 5;
for (int i = topOption; i < (topOption + numOptionsDisplayable); i++)
{
if (i == toi4(options.size())) return;
if (i == selectedOption && showseloption)
{
- rectangle(0, ypos, area.w, static_cast<UINT>(static_cast<float>(fontHeight) * linesPerOption) - 1, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT : DrawStyle::SELECTHIGHLIGHT);
+ rectangle(0, ypos, area.w, static_cast<u4>(static_cast<float>(fontHeight) * linesPerOption) - 1, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT : DrawStyle::SELECTHIGHLIGHT);
drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::DARKTEXT, options[i].image);
}
else
{
- rectangle(0, ypos, area.w, static_cast<UINT>(static_cast<float>(fontHeight) * linesPerOption) - 1, DrawStyle::SELECTBACKGROUND);
+ rectangle(0, ypos, area.w, static_cast<u4>(static_cast<float>(fontHeight) * linesPerOption) - 1, DrawStyle::SELECTBACKGROUND);
drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::LIGHTTEXT, options[i].image);
}
ypos += ySeparation;
void WSelectList::drawOptionLine(const std::string& text, int xpos, int ypos, int width, const DrawStyle& colour, Image& image)
{
- UINT curline = 0;
- UINT taboffset = 0;
+ u4 curline = 0;
+ u4 taboffset = 0;
int fontHeight = getFontHeight();
float ypos_mod = static_cast<float>(ypos) + (linesPerOption - floor(linesPerOption)) * static_cast<float>(fontHeight) * 0.5f;
int WSelectList::getBottomOption()
{
- UINT retval = topOption + numOptionsDisplayable;
+ u4 retval = topOption + numOptionsDisplayable;
if (retval > options.size()) return options.size();
else return retval;
}
bool showseloption{true};
bool darkseloption{};
float linesPerOption{1};
- UINT gap{1};
+ u4 gap{1};
};
#endif
WTabBar::~WTabBar()
{
- for (UINT i = 0; i < tabs.size(); i++)
+ for (u4 i = 0; i < tabs.size(); i++)
{
delete tabs[i].button;
delete tabs[i].pane; //moved from vopts MR
td.name = name;
td.nameWidth = 0;
- for(UINT i = 0; i < strlen(name); i++)
+ for(u4 i = 0; i < strlen(name); i++)
{
- td.nameWidth += static_cast<UINT>(charWidth(name[i]));
+ td.nameWidth += static_cast<u4>(charWidth(name[i]));
}
- UINT newButtonX = 22;
- for(UINT i = 0; i < tabs.size(); i++) newButtonX += tabs[i].button->getWidth() + 10;
+ u4 newButtonX = 22;
+ for(u4 i = 0; i < tabs.size(); i++) newButtonX += tabs[i].button->getWidth() + 10;
WButton* newButton = new WButton();
newButton->setText(name);
{
tabs[visiblePane].button->setVisible(true);
// We have gone << past the last visible button
- UINT newButtonX = 22;
- UINT j;
+ u4 newButtonX = 22;
+ u4 j;
for(j = visiblePane; j < tabs.size(); j++) // start with the button just uncovered
{
if ((newButtonX + tabs[j].button->getWidth()) > (getWidth() - 22)) break; // this one too big.
tabs[visiblePane].button->setVisible(true);
// We have gone >> past the last visible button
// Move all buttons left, but need to work out which one to finally display as first on the left
- UINT displayWidth = getWidth() - 44;
- UINT widthSum = tabs[visiblePane].button->getWidth(); // start with width of newly shown button (on the right)
+ u4 displayWidth = getWidth() - 44;
+ u4 widthSum = tabs[visiblePane].button->getWidth(); // start with width of newly shown button (on the right)
int startWith = 0;
int i;
for(i = visiblePane - 1; i >= 0; i--)
tabs[i].button->setVisible(false);
}
- UINT newButtonX = 22;
- for(UINT j = startWith; j <= visiblePane; j++) // startWith -> the one we just uncovered
+ u4 newButtonX = 22;
+ for(u4 j = startWith; j <= visiblePane; j++) // startWith -> the one we just uncovered
{
tabs[j].button->setPosition(newButtonX, 2);
newButtonX += tabs[j].button->getWidth() + 10;
}
bool WTabBar::mouseLBDOWN(int x, int y) {
- UINT i;
+ u4 i;
for (i=0;i<tabs.size();i++) {
if (tabs[i].button->getVisible()) {
if (tabs[i].button->mouseMove(x,y)) {
typedef struct sTabDetails
{
const char* name;
- UINT nameWidth;
+ u4 nameWidth;
WButton* button;
Boxx* pane;
} TabDetails;
bool left();
bool right();
- UINT visiblePane;
+ u4 visiblePane;
bool buttonBarActive;
std::vector<TabDetails> tabs;
}
}
-void WWinAudioFilter::setSize(UINT w, UINT h)
+void WWinAudioFilter::setSize(u4 w, u4 h)
{
Boxx::setSize(w, h);
sl.setSize(area.w - 240, area.h - 30-15-30);
WWinAudioFilter ();
~WWinAudioFilter ();
- void setSize(UINT w, UINT h);
+ void setSize(u4 w, u4 h);
int handleCommand(int command);
bool mouseMove(int x, int y) ;
}
}
-void WWinMp3AudioFilter::setSize(UINT w, UINT h)
+void WWinMp3AudioFilter::setSize(u4 w, u4 h)
{
Boxx::setSize(w, h);
sl.setSize(area.w - 240, area.h - 30-15-30);
WWinMp3AudioFilter ();
~WWinMp3AudioFilter ();
- void setSize(UINT w, UINT h);
+ void setSize(u4 w, u4 h);
int handleCommand(int command);
bool mouseMove(int x, int y) ;
}
}
-void WWinVideoFilter::setSize(UINT w, UINT h)
+void WWinVideoFilter::setSize(u4 w, u4 h)
{
Boxx::setSize(w, h);
sl.setSize(area.w - 240, area.h - 30-15-30);
WWinVideoFilter ();
~WWinVideoFilter ();
- void setSize(UINT w, UINT h);
+ void setSize(u4 w, u4 h);
int handleCommand(int command);
bool mouseMove(int x, int y) ;
}
}
-void WWinVideoH264Filter::setSize(UINT w, UINT h)
+void WWinVideoH264Filter::setSize(u4 w, u4 h)
{
Boxx::setSize(w, h);
sl.setSize(area.w - 240, area.h - 30-15-30);
WWinVideoH264Filter ();
~WWinVideoH264Filter ();
- void setSize(UINT w, UINT h);
+ void setSize(u4 w, u4 h);
int handleCommand(int command);
bool mouseMove(int x, int y) ;