From 2677210d66ea715fc79d9f26cdf5996b76c98159 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 14 Aug 2022 17:08:35 +0000 Subject: [PATCH] Type change: UCHAR -> u1 --- src/audio.h | 16 ++--- src/audioomx.cc | 16 ++--- src/audioomx.h | 22 +++---- src/audioplayer.cc | 18 +++--- src/audioplayer.h | 30 ++++----- src/audiowin.cc | 8 +-- src/audiowin.h | 10 +-- src/bitmap.cc | 28 ++++---- src/bitmap.h | 46 +++++++------- src/boxx.cc | 2 +- src/boxx.h | 2 +- src/channel.h | 2 +- src/defines.h | 2 - src/demuxer.cc | 36 +++++------ src/demuxer.h | 36 +++++------ src/demuxeraudio.cc | 80 +++++++++++------------ src/demuxeraudio.h | 26 ++++---- src/demuxermedia.cc | 12 ++-- src/demuxermedia.h | 8 +-- src/demuxerts.cc | 28 ++++---- src/demuxerts.h | 14 ++-- src/demuxervdr.cc | 14 ++-- src/demuxervdr.h | 6 +- src/draintarget.h | 4 +- src/dvbsubtitles.cc | 84 ++++++++++++------------ src/dvbsubtitles.h | 26 ++++---- src/imageloader.cc | 2 +- src/imagereader.cc | 2 +- src/imagereader.h | 4 +- src/input.cc | 14 ++-- src/input.h | 120 +++++++++++++++++------------------ src/inputcec.cc | 6 +- src/inputcec.h | 6 +- src/inputlinux.cc | 6 +- src/inputlinux.h | 6 +- src/inputlirc.cc | 10 +-- src/inputlirc.h | 4 +- src/inputman.cc | 10 +-- src/inputman.h | 10 +-- src/inputudp.cc | 2 +- src/inputudp.h | 4 +- src/inputwin.cc | 24 +++---- src/inputwin.h | 8 +-- src/media.cc | 6 +- src/mediafile.cc | 2 +- src/movieinfo.h | 2 +- src/option.cc | 2 +- src/option.h | 10 +-- src/osdopenvg.cc | 2 +- src/osdopenvg.h | 2 +- src/osdvector.h | 2 +- src/osdwinvector.cc | 4 +- src/osdwinvector.h | 2 +- src/playerlive.h | 2 +- src/playermedia.cc | 20 +++--- src/playermedia.h | 32 +++++----- src/playerradiolive.cc | 4 +- src/playerradiolive.h | 26 ++++---- src/playerradiorec.cc | 6 +- src/playerradiorec.h | 22 +++---- src/playervideolive.cc | 6 +- src/playervideolive.h | 28 ++++---- src/playervideorec.cc | 8 +-- src/playervideorec.h | 36 +++++------ src/recinfo.cc | 6 +- src/recinfo.h | 6 +- src/recording.cc | 2 +- src/serialize.cc | 36 +++++------ src/serialize.h | 20 +++--- src/stream.cc | 4 +- src/stream.h | 4 +- src/surface.cc | 2 +- src/surface.h | 2 +- src/surfacedirectfb.cc | 18 +++--- src/surfacevector.cc | 2 +- src/surfacevector.h | 2 +- src/tbboxx.cc | 4 +- src/tbboxx.h | 8 +-- src/tcp.h | 2 +- src/teletextdecodervbiebu.cc | 8 +-- src/teletextdecodervbiebu.h | 6 +- src/util.cc | 2 +- src/vdpc.cc | 6 +- src/vdr.cc | 30 ++++----- src/vdr.h | 4 +- src/vdrrequestpacket.cc | 6 +- src/vdrrequestpacket.h | 6 +- src/vdrresponsepacket.cc | 14 ++-- src/vdrresponsepacket.h | 10 +-- src/vepgsettimer.h | 6 +- src/video.h | 68 ++++++++++---------- src/videoomx.cc | 26 ++++---- src/videoomx.h | 30 ++++----- src/videowin.cc | 20 +++--- src/videowin.h | 36 +++++------ src/vinfo.h | 10 +-- src/vmediaview.cc | 2 +- src/vquestion.cc | 2 +- src/vquestion.h | 8 +-- src/vradiorec.cc | 2 +- src/vvideolivetv.cc | 2 +- src/vvideolivetv.h | 14 ++-- src/vvideomedia.cc | 6 +- src/vvideomedia.h | 2 +- src/vvideorec.cc | 6 +- src/wbutton.cc | 2 +- src/wbutton.h | 4 +- src/winmain.cc | 6 +- src/woptionbox.cc | 2 +- src/woptionbox.h | 4 +- src/wremoteconfig.cc | 10 +-- src/wsymbol.cc | 8 +-- src/wsymbol.h | 62 +++++++++--------- 113 files changed, 792 insertions(+), 794 deletions(-) diff --git a/src/audio.h b/src/audio.h index 4a3342b..23948f6 100644 --- a/src/audio.h +++ b/src/audio.h @@ -44,9 +44,9 @@ class Audio : public DrainTarget, public AbstractOption static Audio* getInstance(); // static void setInstance(Audio* ); - virtual int init(UCHAR streamType)=0; + virtual int init(u1 streamType)=0; virtual int shutdown()=0; - virtual int setStreamType(UCHAR streamType)=0; + virtual int setStreamType(u1 streamType)=0; virtual int setChannel()=0; virtual int setSource()=0; virtual int sync()=0; @@ -80,9 +80,9 @@ class Audio : public DrainTarget, public AbstractOption int doMuting(); // Audio stream type // FIXME these are MVP specific (probably!) - const static UCHAR MPEG2_PES = 2; - const static UCHAR MPEG1_PES = 3; // unused - const static UCHAR MP3 = 0; //media player + const static u1 MPEG2_PES = 2; + const static u1 MPEG1_PES = 3; // unused + const static u1 MP3 = 0; //media player #ifdef DEV virtual int test()=0; @@ -91,9 +91,9 @@ class Audio : public DrainTarget, public AbstractOption protected: static Audio* instance; int initted; - UCHAR userMute; - UCHAR systemMute; - UCHAR muted; + u1 userMute; + u1 systemMute; + u1 muted; int volume; audio_volume Aoffset; diff --git a/src/audioomx.cc b/src/audioomx.cc index 6ea9803..ece2aa7 100644 --- a/src/audioomx.cc +++ b/src/audioomx.cc @@ -84,7 +84,7 @@ AudioOMX::~AudioOMX() { } -int AudioOMX::init(UCHAR tstreamType) { +int AudioOMX::init(u1 tstreamType) { if (initted) return 0; initted = 1; @@ -99,7 +99,7 @@ int AudioOMX::init(UCHAR tstreamType) { unMute(); decompress_buffer_size=20000; - decompress_buffer=static_cast(malloc(decompress_buffer_size)); + decompress_buffer=static_cast(malloc(decompress_buffer_size)); decompress_buffer_filled=0; #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100) @@ -530,7 +530,7 @@ OMX_ERRORTYPE AudioOMX::FillBufferDone_OMX(OMX_IN OMX_HANDLETYPE /* hcomp */, OM return OMX_ErrorNone; } -int AudioOMX::setStreamType(UCHAR /* type */) +int AudioOMX::setStreamType(u1 /* type */) { if (!initted) return 0; @@ -1614,7 +1614,7 @@ int AudioOMX::test() } #endif -unsigned int AudioOMX::AdvanceMpAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize) +unsigned int AudioOMX::AdvanceMpAudioSync(const u1 *data,unsigned int size,unsigned int *framesize) { if (size<=2) return size; // silly; unsigned int atest=0; @@ -1690,7 +1690,7 @@ unsigned int AudioOMX::AdvanceMpAudioSync(const UCHAR *data,unsigned int size,un return size; } -unsigned int AudioOMX::AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize) +unsigned int AudioOMX::AdvanceAc3AudioSync(const u1 *data,unsigned int size,unsigned int *framesize) { if (size<=4) return size; // silly; const int frm_size_tab[] = { 64, 64, 80, 80, 96, 96, 112, 112, 128, 128, @@ -1714,7 +1714,7 @@ unsigned int AudioOMX::AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,u return size; } -unsigned int AudioOMX::AdvanceAacLatmAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize) +unsigned int AudioOMX::AdvanceAacLatmAudioSync(const u1 *data,unsigned int size,unsigned int *framesize) { if (size<=4) return size; // silly; unsigned int atest=0; @@ -1737,7 +1737,7 @@ void AudioOMX::PrepareMediaSample(const MediaPacketList& mplist, u4 /* samplepos packet = mplist.front(); } -u4 AudioOMX::DeliverMediaSample(UCHAR* buffer, u4* samplepos) { +u4 AudioOMX::DeliverMediaSample(u1* buffer, u4* samplepos) { DeliverMediaPacket(packet, buffer, samplepos); if (*samplepos == packet.length) { *samplepos = 0; @@ -1792,7 +1792,7 @@ bool AudioOMX::DrainTargetBufferFull() } -u4 AudioOMX::DeliverMediaPacket(MediaPacket mpacket, const UCHAR* buffer, +u4 AudioOMX::DeliverMediaPacket(MediaPacket mpacket, const u1* buffer, u4 *samplepos) { /*First Check, if we have an audio sample*/ VideoOMX* vw = static_cast(Video::getInstance()); diff --git a/src/audioomx.h b/src/audioomx.h index 27e9650..c36314c 100644 --- a/src/audioomx.h +++ b/src/audioomx.h @@ -43,10 +43,10 @@ class AudioOMX : public Audio AudioOMX(); virtual ~AudioOMX(); - int init(UCHAR streamType); + int init(u1 streamType); int shutdown(); - int setStreamType(UCHAR streamType); + int setStreamType(u1 streamType); int setChannel(); int setSource(); int sync(); @@ -76,8 +76,8 @@ class AudioOMX : public Audio //Writing Data to Audiodevice virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos); - virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos); - u4 DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer,u4 *samplepos); + virtual u4 DeliverMediaSample(u1* buffer, u4 *samplepos); + u4 DeliverMediaPacket(MediaPacket packet, const u1* buffer,u4 *samplepos); virtual long long SetStartOffset(long long curreftime, bool *rsync); virtual void ResetTimeOffsets(); @@ -86,7 +86,7 @@ class AudioOMX : public Audio virtual bool DrainTargetBufferFull(); - UCHAR getLastAType() {return lastAType;} + u1 getLastAType() {return lastAType;} bool loadOptionsFromServer(VDR* vdr); bool saveOptionstoServer(); @@ -100,8 +100,8 @@ class AudioOMX : public Audio private: int initAllParams(); - UCHAR streamType; - UCHAR lastAType; + u1 streamType; + u1 lastAType; bool firstsynched; MediaPacket packet; @@ -130,9 +130,9 @@ class AudioOMX : public Audio - unsigned int AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize); - unsigned int AdvanceAacLatmAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize); - unsigned int AdvanceMpAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize); + unsigned int AdvanceAc3AudioSync(const u1 *data,unsigned int size,unsigned int *framesize); + unsigned int AdvanceAacLatmAudioSync(const u1 *data,unsigned int size,unsigned int *framesize); + unsigned int AdvanceMpAudioSync(const u1 *data,unsigned int size,unsigned int *framesize); void ReturnEmptyOMXBuffer(OMX_BUFFERHEADERTYPE* bulibaver); @@ -183,7 +183,7 @@ class AudioOMX : public Audio SwrContext* resam_con_libav; - UCHAR * decompress_buffer; + u1 * decompress_buffer; unsigned int decompress_buffer_size; unsigned int decompress_buffer_filled; bool lsync; diff --git a/src/audioplayer.cc b/src/audioplayer.cc index 4c42116..1708305 100644 --- a/src/audioplayer.cc +++ b/src/audioplayer.cc @@ -150,7 +150,7 @@ bool AudioPlayer::isPlayerRunning() { return playerRunnig; } -int AudioPlayer::setRequestedState(UCHAR rstate) { +int AudioPlayer::setRequestedState(u1 rstate) { int rt=0; threadLock(); requestState=rstate; @@ -161,15 +161,15 @@ int AudioPlayer::setRequestedState(UCHAR rstate) { } -UCHAR AudioPlayer::getState() { - UCHAR rt=0; +u1 AudioPlayer::getState() { + u1 rt=0; threadLock(); rt=state; threadUnlock(); return rt; } -void AudioPlayer::setState(UCHAR s) { +void AudioPlayer::setState(u1 s) { threadLock(); state=s; threadUnlock(); @@ -317,7 +317,7 @@ int AudioPlayer::openFile() { rt=MediaPlayer::getInstance()->getMediaInfo(2,&mi); canPosition=mi.canPosition; u4 rsize=0; - UCHAR *idbuf=NULL; + u1 *idbuf=NULL; if (canPosition) { rt=MediaPlayer::getInstance()->getMediaBlock(2,0,demuxer->headerBytes(),&rsize,&idbuf); } @@ -357,11 +357,11 @@ int AudioPlayer::openFile() { } //method called by the playing thread to handle //"commands" by the frontend -UCHAR AudioPlayer::checkState() +u1 AudioPlayer::checkState() { threadLock(); - UCHAR rstate=requestState; - UCHAR cstate=state; + u1 rstate=requestState; + u1 cstate=state; int rseq=requestedSequence; int cseq=sequence; int fseq=playSequence; @@ -543,7 +543,7 @@ void AudioPlayer::threadMethod() int retrycount=0; while(1) { - UCHAR cstate=checkState(); + u1 cstate=checkState(); if (! running) { break; } diff --git a/src/audioplayer.h b/src/audioplayer.h index 2fe1223..699f056 100644 --- a/src/audioplayer.h +++ b/src/audioplayer.h @@ -106,17 +106,17 @@ class AudioPlayer : public Thread_TYPE, public Callback, public TimerReceiver virtual void call(void * caller); - UCHAR getState() ; + u1 getState() ; - const static UCHAR S_PLAY = 1; - const static UCHAR S_PAUSE = 2; - const static UCHAR S_POSITION = 3; + const static u1 S_PLAY = 1; + const static u1 S_PAUSE = 2; + const static u1 S_POSITION = 3; //player finished a song - no reset, next will follow - const static UCHAR S_DONE=5; - const static UCHAR S_STOP = 6; - const static UCHAR S_ERROR = 8; - const static UCHAR S_FF = 9; - const static UCHAR S_BACK = 10; + const static u1 S_DONE=5; + const static u1 S_STOP = 6; + const static u1 S_ERROR = 8; + const static u1 S_FF = 9; + const static u1 S_BACK = 10; //message parameters for frontend messages const static u4 CONNECTION_LOST=1; @@ -156,20 +156,20 @@ class AudioPlayer : public Thread_TYPE, public Callback, public TimerReceiver int feederState; //synchronized get/set methods for states - int setRequestedState(UCHAR st); - void setState(UCHAR st); + int setRequestedState(u1 st); + void setState(u1 st); //to be called from within the thread - UCHAR checkState(); + u1 checkState(); //variables used by the thread u4 thisWrite; u4 thisRead; bool running; - UCHAR *threadBuffer; - UCHAR state; - UCHAR requestState; + u1 *threadBuffer; + u1 state; + u1 requestState; u8 streampos; u8 lenInBytes; u8 bytesWritten; diff --git a/src/audiowin.cc b/src/audiowin.cc index 247a7e8..fc4977d 100644 --- a/src/audiowin.cc +++ b/src/audiowin.cc @@ -61,7 +61,7 @@ AudioWin::~AudioWin() } -int AudioWin::init(UCHAR tstreamType) +int AudioWin::init(u1 tstreamType) { if (initted) return 0; initFilterDatabase(); @@ -82,7 +82,7 @@ int AudioWin::write(char *buf, int len) return 0; //write(fdAudio, buf, len); } -int AudioWin::setStreamType(UCHAR type) +int AudioWin::setStreamType(u1 type) { ((VideoWin*)VideoWin::getInstance())->setAudioStreamType(type); aud_type=type; @@ -353,7 +353,7 @@ bool AudioWin::saveOptionstoServer() return true; } -u4 AudioWin::DeliverMediaSample(UCHAR* buffer, u4 *samplepos) +u4 AudioWin::DeliverMediaSample(u1* buffer, u4 *samplepos) { DeliverMediaPacket(mediapacket, buffer, samplepos); if (*samplepos == mediapacket.length) { @@ -364,7 +364,7 @@ u4 AudioWin::DeliverMediaSample(UCHAR* buffer, u4 *samplepos) } u4 AudioWin::DeliverMediaPacket(const MediaPacket packet, - UCHAR* buffer, + u1* buffer, u4 *samplepos) { diff --git a/src/audiowin.h b/src/audiowin.h index c48376d..8cc8a21 100644 --- a/src/audiowin.h +++ b/src/audiowin.h @@ -41,10 +41,10 @@ class AudioWin : public Audio AudioWin(); ~AudioWin(); - int init(UCHAR streamType); + int init(u1 streamType); int shutdown(); - int setStreamType(UCHAR streamType); + int setStreamType(u1 streamType); int setChannel(); int setSource(); int sync(); @@ -64,8 +64,8 @@ class AudioWin : public Audio // Writing Data to Audiodevice virtual void PrepareMediaSample(const MediaPacketList&, u4 samplepos); - virtual u4 DeliverMediaSample(UCHAR* buffer, u4 *samplepos); - u4 DeliverMediaPacket(MediaPacket packet, UCHAR* buffer, u4 *samplepos); + virtual u4 DeliverMediaSample(u1* buffer, u4 *samplepos); + u4 DeliverMediaPacket(MediaPacket packet, u1* buffer, u4 *samplepos); int dsInitAudioFilter(IGraphBuilder* dsgraphbuilder); const AudioFilterDescList *getAudioFilterList(int &selected); @@ -107,7 +107,7 @@ private: int mp3audiofilterselected; bool firstsynched; long winvolume; - UCHAR aud_type; + u1 aud_type; #ifdef DEV int test(); #endif diff --git a/src/bitmap.cc b/src/bitmap.cc index 28d9fab..2a54456 100644 --- a/src/bitmap.cc +++ b/src/bitmap.cc @@ -30,24 +30,24 @@ DisplayRegion::DisplayRegion() windowh=575; } -Palette::Palette(UCHAR tBpp) +Palette::Palette(u1 tBpp) { numColours = 0; setBpp(tBpp); } -void Palette::argb2yrba(u4 argb, UCHAR& y, UCHAR& cr, UCHAR& cb, UCHAR& a) +void Palette::argb2yrba(u4 argb, u1& y, u1& cr, u1& cb, u1& a) { - a = static_cast((argb & 0xFF000000) >> 24); + a = static_cast((argb & 0xFF000000) >> 24); int r = (argb & 0x00FF0000) >> 16; int g = (argb & 0x0000FF00) >> 8; int b = (argb & 0x000000FF); - y = static_cast((1052*r + 2065*g + 401*b + 4096*16 + 2048) / 4096); - cr = static_cast((1799*r - 1508*g - 291*b + 4096*128 + 2048) / 4096); - cb = static_cast((-608*r - 1191*g + 1799*b + 4096*128 + 2048) / 4096); + y = static_cast((1052*r + 2065*g + 401*b + 4096*16 + 2048) / 4096); + cr = static_cast((1799*r - 1508*g - 291*b + 4096*128 + 2048) / 4096); + cb = static_cast((-608*r - 1191*g + 1799*b + 4096*128 + 2048) / 4096); } -u4 Palette::yrba2argb(UCHAR y, UCHAR cr, UCHAR cb, UCHAR a) +u4 Palette::yrba2argb(u1 y, u1 cr, u1 cb, u1 a) { int r, g, b; r = (4769*(y-16) + 6537*(cr-128) + 2048) / 4096; @@ -62,7 +62,7 @@ u4 Palette::yrba2argb(UCHAR y, UCHAR cr, UCHAR cb, UCHAR a) return (a << 24) + (r << 16) + (g << 8) + b; } -void Palette::setBpp(UCHAR tBpp) +void Palette::setBpp(u1 tBpp) { bpp = tBpp; if (bpp > MAX_DEPTH) bpp = MAX_DEPTH; @@ -75,7 +75,7 @@ void Palette::setBpp(UCHAR tBpp) A.resize(maxColours,255); } -void Palette::setColour(UCHAR index, u4 tColour) +void Palette::setColour(u1 index, u4 tColour) { if (index >= maxColours) return; if (index >= numColours) numColours = index + 1; @@ -83,7 +83,7 @@ void Palette::setColour(UCHAR index, u4 tColour) argb2yrba(tColour, Y[index], Cr[index], Cb[index], A[index]); } -void Palette::setYCrCbA(UCHAR index, UCHAR tY, UCHAR tCr, UCHAR tCb, UCHAR tA) +void Palette::setYCrCbA(u1 index, u1 tY, u1 tCr, u1 tCb, u1 tA) { if (index >= maxColours) return; if (index >= numColours) numColours = index + 1; @@ -91,7 +91,7 @@ void Palette::setYCrCbA(UCHAR index, UCHAR tY, UCHAR tCr, UCHAR tCb, UCHAR tA) colour[index] = yrba2argb(tY, tCr, tCb, tA); } -Bitmap::Bitmap(u4 tWidth, u4 tHeight, UCHAR tBpp) +Bitmap::Bitmap(u4 tWidth, u4 tHeight, u1 tBpp) { setSize(tWidth, tHeight); palette.setBpp(tBpp); @@ -107,7 +107,7 @@ void Bitmap::setSize(u4 tWidth, u4 tHeight) bitmap.assign(width * height, 0); } -bool Bitmap::setIndex(u4 x, u4 y, UCHAR index) +bool Bitmap::setIndex(u4 x, u4 y, u1 index) { if (x <= width && y <= height) { @@ -117,7 +117,7 @@ bool Bitmap::setIndex(u4 x, u4 y, UCHAR index) else return false; } -UCHAR Bitmap::getIndex(u4 x, u4 y) const +u1 Bitmap::getIndex(u4 x, u4 y) const { if (x > width || y > height) return 0; @@ -133,7 +133,7 @@ u4 Bitmap::getColour(u4 x, u4 y) const return palette.getColour(bitmap[x + y*width]); } -void Bitmap::setAllIndices(UCHAR index) +void Bitmap::setAllIndices(u1 index) { bitmap.assign(width * height, index); } diff --git a/src/bitmap.h b/src/bitmap.h index 5a9246c..250d28c 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -35,48 +35,48 @@ class DisplayRegion class Palette { public: - Palette(UCHAR tBpp = 8); - UCHAR getBpp() const { return bpp; } + Palette(u1 tBpp = 8); + u1 getBpp() const { return bpp; } void reset() { numColours = 0; } - void setBpp(UCHAR tBpp); - u4 getColour(UCHAR index) const { return index < maxColours ? colour[index] : 0; } - void setColour(UCHAR index, u4 tColour); - void setYCrCbA(UCHAR index, UCHAR tY, UCHAR tCr, UCHAR tCb, UCHAR tA); + void setBpp(u1 tBpp); + u4 getColour(u1 index) const { return index < maxColours ? colour[index] : 0; } + void setColour(u1 index, u4 tColour); + void setYCrCbA(u1 index, u1 tY, u1 tCr, u1 tCb, u1 tA); const std::vector& getColourVector() const { return colour; } - const std::vector& getYVector() const { return Y; } - const std::vector& getCrVector() const { return Cr; } - const std::vector& getCbVector() const { return Cb; } - const std::vector& getAVector() const { return A; } + const std::vector& getYVector() const { return Y; } + const std::vector& getCrVector() const { return Cr; } + const std::vector& getCbVector() const { return Cb; } + const std::vector& getAVector() const { return A; } u4 getNumColours() const { return numColours; } private: const static u4 MAX_DEPTH = 8; std::vector colour; - std::vector Y; - std::vector Cr; - std::vector Cb; - std::vector A; - UCHAR bpp; + std::vector Y; + std::vector Cr; + std::vector Cb; + std::vector A; + u1 bpp; u4 maxColours, numColours; - void argb2yrba(u4 argb, UCHAR& y, UCHAR& cr, UCHAR& cb, UCHAR& a); - u4 yrba2argb(UCHAR y, UCHAR cr, UCHAR cb, UCHAR a); + void argb2yrba(u4 argb, u1& y, u1& cr, u1& cb, u1& a); + u4 yrba2argb(u1 y, u1 cr, u1 cb, u1 a); }; class Bitmap { private: - std::vector bitmap; + std::vector bitmap; u4 width, height; public: - Bitmap(u4 tWidth = 0, u4 tHeight = 0, UCHAR tBpp = 8); + Bitmap(u4 tWidth = 0, u4 tHeight = 0, u1 tBpp = 8); Palette palette; u4 getWidth() const { return width; } u4 getHeight() const { return height; } - UCHAR getIndex(u4 x, u4 y) const; + u1 getIndex(u4 x, u4 y) const; u4 getColour(u4 x, u4 y) const; - const std::vector & rawData() const { return bitmap; } + const std::vector & rawData() const { return bitmap; } void setSize(u4 tWidth, u4 tHeight); - bool setIndex(u4 x, u4 y, UCHAR index); - void setAllIndices(UCHAR index); + bool setIndex(u4 x, u4 y, u1 index); + void setAllIndices(u1 index); }; #endif diff --git a/src/boxx.cc b/src/boxx.cc index 7120a0e..9568302 100644 --- a/src/boxx.cc +++ b/src/boxx.cc @@ -526,7 +526,7 @@ void Boxx::drawJpeg(const char* fileName, int x, int y, int *width, int *height) else if (surface) surface->drawJpeg(fileName, x, y, width, height); } -void Boxx::drawMonoBitmap(UCHAR* base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour) +void Boxx::drawMonoBitmap(u1* base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour) { if (parent) parent->drawMonoBitmap(base, area.x +dx, area.y + dy, height, width, nextColour); else if (surface) surface->drawMonoBitmap(base, dx,dy, height, width, nextColour); diff --git a/src/boxx.h b/src/boxx.h index 57f5013..e46ffc9 100644 --- a/src/boxx.h +++ b/src/boxx.h @@ -120,7 +120,7 @@ class Boxx void drawJpeg(const char *fileName,int x, int y,int *width, int *height); void drawTTChar(int ox, int oy,int x, int y, cTeletextChar c); - void drawMonoBitmap(UCHAR*base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour); + void drawMonoBitmap(u1*base, int dx, int dy, unsigned int height,unsigned int width, const DrawStyle& nextColour); /* This is for system which need a locking of the drawing surface to speed up drawing */ void startFastDraw(); diff --git a/src/channel.h b/src/channel.h index 84280de..5adc383 100644 --- a/src/channel.h +++ b/src/channel.h @@ -46,7 +46,7 @@ class Channel int index{-1}; u4 number{}; u4 type{}; - UCHAR vstreamtype{2}; //Mpeg2 + u1 vstreamtype{2}; //Mpeg2 std::string name; u4 vpid{}; diff --git a/src/defines.h b/src/defines.h index a835c96..3b0951b 100644 --- a/src/defines.h +++ b/src/defines.h @@ -20,8 +20,6 @@ #ifndef DEFINES_H #define DEFINES_H -typedef unsigned char UCHAR; - #include typedef int8_t i1; diff --git a/src/demuxer.cc b/src/demuxer.cc index 0d2400d..a9e176e 100644 --- a/src/demuxer.cc +++ b/src/demuxer.cc @@ -50,7 +50,7 @@ Demuxer* Demuxer::instance = NULL; class NALUUnit { public: - NALUUnit(const UCHAR* buf,u4 length_buf); + NALUUnit(const u1* buf,u4 length_buf); ~NALUUnit(); inline u4 getBits(u4 num_bits); @@ -60,16 +60,16 @@ inline u4 getBits(u4 num_bits); int getPos(){return pos;}; protected: - UCHAR* nalu_buf; + u1* nalu_buf; u4 nalu_length; u4 pos; - UCHAR bit_pos; - UCHAR working_byte; + u1 bit_pos; + u1 working_byte; u4 last_bytes; bool eonalu; }; -NALUUnit::NALUUnit(const UCHAR *buf, u4 length_buf) +NALUUnit::NALUUnit(const u1 *buf, u4 length_buf) { nalu_length=0; nalu_buf=NULL; @@ -103,7 +103,7 @@ NALUUnit::NALUUnit(const UCHAR *buf, u4 length_buf) nalu_end=std::min(length_buf-1,nalu_end); if (nalu_end <= nalu_start) return; // input buffer too small. corrupt data? ignore. nalu_length=nalu_end-nalu_start; - nalu_buf=(UCHAR*)malloc(nalu_length); + nalu_buf=(u1*)malloc(nalu_length); memcpy(nalu_buf,buf+nalu_start,nalu_length); pos=1; } @@ -180,7 +180,7 @@ static const int PESPacket_initial_size = 2000; PESPacket::PESPacket() { data_size = PESPacket_initial_size; - data = (UCHAR*)malloc(data_size); + data = (u1*)malloc(data_size); data[0] = 0x00; data[1] = 0x00; data[2] = 0x01; @@ -215,11 +215,11 @@ void PESPacket::copyFrom(const PESPacket& packet) substream = packet.substream; seq_header = packet.seq_header; data_size = size; - data = (UCHAR*)malloc(data_size); + data = (u1*)malloc(data_size); memcpy(data, packet.data, data_size); } -void PESPacket::init(UCHAR type, UCHAR sub) +void PESPacket::init(u1 type, u1 sub) { length = 0; size = 6; @@ -238,7 +238,7 @@ void PESPacket::truncate() -int PESPacket::write(const UCHAR *buf, int len) +int PESPacket::write(const u1 *buf, int len) { @@ -248,7 +248,7 @@ int PESPacket::write(const UCHAR *buf, int len) u4 new_data_size = std::max(data_size + data_size / 2, data_size + len); if (new_data_size > 0x10000) new_data_size = 0x10000; data_size = new_data_size; - data = (UCHAR*)realloc(data, data_size); + data = (u1*)realloc(data, data_size); } memcpy(data + size, buf, len); length += len; @@ -281,7 +281,7 @@ u8 PESPacket::getPTS() const else return PTS_INVALID; } -UCHAR PESPacket::operator[] (u4 index) const +u1 PESPacket::operator[] (u4 index) const { if (index >= size) return 0; @@ -702,8 +702,8 @@ bool Demuxer::writeTeletext(bool * dataavail) bool Demuxer::submitPacket(PESPacket& packet) { u4 sent = 0; - UCHAR packet_type = packet.getPacketType(); - const UCHAR* packetdata = packet.getData(); + u1 packet_type = packet.getPacketType(); + const u1* packetdata = packet.getData(); if (packet_type >= PESTYPE_VID0 && packet_type <= PESTYPE_VIDMAX) { if (video_current == -1) video_current = packet_type; @@ -722,7 +722,7 @@ bool Demuxer::submitPacket(PESPacket& packet) avail_mpaudchan[packet_type - PESTYPE_AUD0] = true; if (audio_current == packet_type && !aud_seeking) { - UCHAR type=MPTYPE_MPEG_AUDIO; + u1 type=MPTYPE_MPEG_AUDIO; switch (astreamtype) { case 3: @@ -1134,7 +1134,7 @@ void Demuxer::parsePacketDetails(PESPacket& packet) } } -u4 Demuxer::stripAudio(UCHAR* buf, u4 len) +u4 Demuxer::stripAudio(u1* buf, u4 len) { u4 read_pos = 0, write_pos = 0; u4 pattern, packet_length; @@ -1164,7 +1164,7 @@ u4 Demuxer::stripAudio(UCHAR* buf, u4 len) return write_pos; } -void Demuxer::changeTimes(UCHAR* buf, u4 len,u4 playtime) +void Demuxer::changeTimes(u1* buf, u4 len,u4 playtime) { u4 pattern, packet_length; u4 read_pos = 0; @@ -1204,7 +1204,7 @@ void Demuxer::changeTimes(UCHAR* buf, u4 len,u4 playtime) } -bool Demuxer::scanForVideo(UCHAR* buf, u4 len, bool &ish264) +bool Demuxer::scanForVideo(u1* buf, u4 len, bool &ish264) { u4 pos = 3; u4 pattern; diff --git a/src/demuxer.h b/src/demuxer.h index a68071c..b235e35 100644 --- a/src/demuxer.h +++ b/src/demuxer.h @@ -52,19 +52,19 @@ class PESPacket PESPacket(const PESPacket& packet); PESPacket& operator=(const PESPacket& packet); ~PESPacket(); - void init(UCHAR type, UCHAR sub = 0); + void init(u1 type, u1 sub = 0); void truncate(); - int write(const UCHAR* buf, int len); + int write(const u1* buf, int len); - UCHAR operator[] (u4 index) const; + u1 operator[] (u4 index) const; // return data[index] if in bounds, else 0 // so no proper error condition but never mind for now - const UCHAR* getData() const { return data; } + const u1* getData() const { return data; } u4 getLength() const { return length; } u4 getSize() const { return size; } - UCHAR getPacketType() const { return packetType; } - void setSubstream(UCHAR s) { substream = s; } - UCHAR getSubstream() const { return substream; } + u1 getPacketType() const { return packetType; } + void setSubstream(u1 s) { substream = s; } + u1 getSubstream() const { return substream; } u8 getPTS() const; bool hasPTS() const { return (getPTS() != PTS_INVALID); } @@ -78,11 +78,11 @@ class PESPacket protected: void copyFrom(const PESPacket& packet); - UCHAR * data; + u1 * data; u4 length, size; u4 data_size; - UCHAR packetType; - UCHAR substream; + u1 packetType; + u1 substream; u4 mutable seq_header; // 0 = no, 1 = unknown, else = header offset }; @@ -110,9 +110,9 @@ class Demuxer bool writeVideo(bool * dataavail=NULL); bool writeTeletext(bool * dataavail=NULL); - virtual int scan(UCHAR* buf, int len) = 0; - virtual int findPTS(UCHAR* buf, int len, u8* dest) = 0; - virtual int put(UCHAR* buf, int len) = 0; + virtual int scan(u1* buf, int len) = 0; + virtual int findPTS(u1* buf, int len, u8* dest) = 0; + virtual int put(u1* buf, int len) = 0; virtual void setFrameNum(u4 /* frame */) {} virtual void setPacketNum(u4 /* packet */) {} virtual u4 getFrameNumFromPTS(u8 /* pts */) { return 0; } @@ -128,7 +128,7 @@ class Demuxer int getHorizontalSize() { return horizontal_size; } int getVerticalSize() { return vertical_size; } - UCHAR getAspectRatio(int *tparx,int *tpary) { + u1 getAspectRatio(int *tparx,int *tpary) { *tparx=parx; *tpary=pary;return aspect_ratio; } int getFrameRate() { return frame_rate; } int getBitRate() { return bit_rate; } @@ -136,7 +136,7 @@ class Demuxer u8 getVideoPTS() { return video_pts; } u8 getAudioPTS() { return audio_pts; } - enum AspectRatio : UCHAR + enum AspectRatio : u1 { ASPECT_1_1 = 1, ASPECT_4_3 = 2, @@ -147,13 +147,13 @@ 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 u4 stripAudio(UCHAR* buf, u4 len); - void changeTimes(UCHAR* buf, u4 len,u4 playtime); + virtual u4 stripAudio(u1* buf, u4 len); + void changeTimes(u1* buf, u4 len,u4 playtime); // Scan a buffer to see if video packets are present. // Returns true if video exists; false if not. // removed *static function* for h264 detection - static bool scanForVideo(UCHAR* buf, u4 len, bool &ish264); + static bool scanForVideo(u1* buf, u4 len, bool &ish264); enum PESTYPE { diff --git a/src/demuxeraudio.cc b/src/demuxeraudio.cc index 57bc65e..08df047 100644 --- a/src/demuxeraudio.cc +++ b/src/demuxeraudio.cc @@ -32,14 +32,14 @@ class PacketBuffer { public: - PacketBuffer(Stream *as,UCHAR strtype) { + PacketBuffer(Stream *as,u1 strtype) { log=Log::getInstance(); audio=as; streamtype=strtype; newStream(); } //just handle the data (do not deal with headers) - int putInternal(UCHAR* buf,int len,unsigned int &packetnum); + int putInternal(u1* buf,int len,unsigned int &packetnum); void reset(){ partPacket=0; bytesWritten=0; @@ -86,13 +86,13 @@ class PacketBuffer { reset(); } bool doSkip(); - UCHAR store[DemuxerAudio::PACKET_SIZE]; // Storage for partial packets + u1 store[DemuxerAudio::PACKET_SIZE]; // Storage for partial packets int partPacket; // Length of partial packet stored from previous put() int bytesWritten; //if they are !=0 and != framelength the stream is full... int framelen; Log * log; Stream * audio; - UCHAR streamtype; + u1 streamtype; //global counters u4 numpackets; u4 numbytes; @@ -156,7 +156,7 @@ void DemuxerAudio::reset() { isStarting=true; } -int DemuxerAudio::scan(UCHAR *buf, int len) +int DemuxerAudio::scan(u1 *buf, int len) { //no differend pids here return 0; @@ -281,7 +281,7 @@ static int samplingRateTable[4][3]={ /*11*/ {-1,-1,-1}}; //max 7 char! -static const char * mpegString(UCHAR code) { +static const char * mpegString(u1 code) { switch(code) { case 0: return "MPEG2.5"; @@ -295,7 +295,7 @@ static const char * mpegString(UCHAR code) { return "UNKNOWN"; } -static const char * layerString(UCHAR code) { +static const char * layerString(u1 code) { switch(code) { case 0: return "Layer reserved"; @@ -386,7 +386,7 @@ static struct tagid { */ #define MAXLEN(tagtype) ((u4)frameLentagtype)-1?(u4)frameLen:sizeof(tag->tagtype)-1) -bool DemuxerAudio::fillId3Tag(id3_tag * tag,UCHAR * frameData, int frameLen, int dataOffset, bool v23) { +bool DemuxerAudio::fillId3Tag(id3_tag * tag,u1 * frameData, int frameLen, int dataOffset, bool v23) { int tl=v23?4:3; int tagIndex=-1; if (tag == NULL) return false; @@ -398,7 +398,7 @@ bool DemuxerAudio::fillId3Tag(id3_tag * tag,UCHAR * frameData, int frameLen, int } } if (tagIndex < 0) return false; - UCHAR encoding=*(frameData+dataOffset); + u1 encoding=*(frameData+dataOffset); dataOffset++; frameLen--; if (encoding != 0) { @@ -417,11 +417,11 @@ bool DemuxerAudio::fillId3Tag(id3_tag * tag,UCHAR * frameData, int frameLen, int break; case 3: //genre { - UCHAR * st=frameData+dataOffset; + u1 * st=frameData+dataOffset; int genre=0; if (*st=='(') { genre=atoi((const char *)(st+1)) && 31; - st=(UCHAR *)id3_1_genre[genre]; + st=(u1 *)id3_1_genre[genre]; } strncpy(tag->genre,(char*)st,MAXLEN(genre)); tag->genre[MAXLEN(genre)]=0; @@ -461,9 +461,9 @@ bool DemuxerAudio::fillId3Tag(id3_tag * tag,UCHAR * frameData, int frameLen, int * otherwise the id3 info is filled */ -int DemuxerAudio::parseID3V2(UCHAR *data, int len) { +int DemuxerAudio::parseID3V2(u1 *data, int len) { int debug=0; - UCHAR * start=data; + u1 * start=data; id3_header id3header; id3_frame id3frame; id3_tag * id3tag=NULL; @@ -517,7 +517,7 @@ int DemuxerAudio::parseID3V2(UCHAR *data, int len) { len-=id3header.extended_header.size+extended_hdr_hdr; } //set the end of the header - UCHAR * eob=start+id3header.size+10; + u1 * eob=start+id3header.size+10; bool readNext=true; while (data < eob && readNext) { @@ -603,7 +603,7 @@ int DemuxerAudio::parseID3V2(UCHAR *data, int len) { */ #define MEMCPY(type,len,offset) {int type##max=sizeof(tag->type)-1type)-1:len;strncpy(tag->type,(char*)&data[offset],type##max);tag->type[type##max]=0;} -int DemuxerAudio::parseID3V1(UCHAR *data, int len) { +int DemuxerAudio::parseID3V1(u1 *data, int len) { int debug=1; if (len < 128) return -1; if(data[0]=='T' && data[1]=='A' && data[2]=='G') @@ -635,15 +635,15 @@ int DemuxerAudio::parseID3V1(UCHAR *data, int len) { } //infos from http://www.multiweb.cz/twoinches/MP3inside.htm -int DemuxerAudio::parseVBR(UCHAR *data, int len) { - UCHAR *hdr=findHeader(data,len); +int DemuxerAudio::parseVBR(u1 *data, int len) { + u1 *hdr=findHeader(data,len); //we expect the header exactly here if (hdr != data) return -1; const static char * VBRHDR="Xing"; int vbridpos=36; - UCHAR mpgtype=(data[1] & 0x18)>>3; - UCHAR chmode=(data[2] & 0xc0) >> 6; - UCHAR layer=(data[2] & 0x06) >>1; + u1 mpgtype=(data[1] & 0x18)>>3; + u1 chmode=(data[2] & 0xc0) >> 6; + u1 layer=(data[2] & 0x06) >>1; if ( mpgtype == 3 && chmode == 11) vbridpos=21; if ( mpgtype != 3 && chmode != 11) vbridpos=21; if ( mpgtype != 3 && chmode == 11) vbridpos=13; @@ -709,10 +709,10 @@ int DemuxerAudio::parseVBR(UCHAR *data, int len) { -UCHAR * DemuxerAudio::findHeader(UCHAR *buf, int len, bool writeInfo) { +u1 * DemuxerAudio::findHeader(u1 *buf, int len, bool writeInfo) { while (len >= 3) //assume hdr+crc { - UCHAR pattern=*buf; + u1 pattern=*buf; buf++; len--; if (pattern != HDRBYTE1 ) continue; if ((*buf & HDRBYTE2MASK) != HDRBYTE2) continue; @@ -724,33 +724,33 @@ UCHAR * DemuxerAudio::findHeader(UCHAR *buf, int len, bool writeInfo) { -int DemuxerAudio::readHeader(UCHAR * hbuf,int len,bool writeInfo) { +int DemuxerAudio::readHeader(u1 * hbuf,int len,bool writeInfo) { int curFramelen=0; int curBitrate=0; int curSamplingRate=0; if (*hbuf != HDRBYTE1) return -1; hbuf++; if ((*hbuf & HDRBYTE2MASK) != HDRBYTE2) return -1; - UCHAR mpgtype=(*hbuf & 0x18)>>3; + u1 mpgtype=(*hbuf & 0x18)>>3; if (mpgtype == 1) { log->log("DemuxerAudio",Log::DEBUG,"header invalid mpgtype %s %i %i %i", mpegString(mpgtype),*hbuf,*(hbuf+1),*(hbuf+2)); return 1; } - UCHAR layer=(*hbuf & 0x06) >>1; + u1 layer=(*hbuf & 0x06) >>1; //bool hasCRC=!(*hbuf & 1); hbuf++; - UCHAR bitrateCode=(*hbuf & 0xf0) >>4; - UCHAR samplingCode=(*hbuf & 0x0c) >> 2; + u1 bitrateCode=(*hbuf & 0xf0) >>4; + u1 samplingCode=(*hbuf & 0x0c) >> 2; bool padding=*hbuf & 0x02; hbuf++; //0 Stereo, 1 JointStereo, 2 Dual, 3 Mono - UCHAR chmode=(*hbuf & 0xc0) >> 6; - //UCHAR extension=(*hbuf & 0x30) >> 4; + u1 chmode=(*hbuf & 0xc0) >> 6; + //u1 extension=(*hbuf & 0x30) >> 4; //layercode: 1-L3, 2-L2, 3-L1 //columns 0,1,2 for MPEG1 - UCHAR bitrateColumn=3-layer; + u1 bitrateColumn=3-layer; if (bitrateColumn > 2) { log->log("DemuxerAudio",Log::DEBUG,"header invalid layer %s %i %i %i", layerString(layer),*(hbuf-2),*(hbuf-1),*hbuf); @@ -759,7 +759,7 @@ int DemuxerAudio::readHeader(UCHAR * hbuf,int len,bool writeInfo) { if (mpgtype != 3) bitrateColumn+=3; if (bitrateColumn>4) bitrateColumn=4; curBitrate=1000*bitrateTable[bitrateCode][bitrateColumn]; - UCHAR sampleRateColumn=0; + u1 sampleRateColumn=0; if (mpgtype == 10) sampleRateColumn=1; if (mpgtype == 0) sampleRateColumn=2; curSamplingRate=samplingRateTable[samplingCode][sampleRateColumn]; @@ -821,7 +821,7 @@ int DemuxerAudio::readHeader(UCHAR * hbuf,int len,bool writeInfo) { return 0; } -int DemuxerAudio::findPTS(UCHAR* buf, int len, u8* dest) +int DemuxerAudio::findPTS(u1* buf, int len, u8* dest) { //we have no PTS number ... *dest=0; @@ -842,13 +842,13 @@ bool PacketBuffer::doSkip() { } // just handle the real stream without dealing with the header -int PacketBuffer::putInternal(UCHAR * wbuf, int len,unsigned int &packetnum) +int PacketBuffer::putInternal(u1 * wbuf, int len,unsigned int &packetnum) { /* Important, the type passed to stream must be a mediapacket type as defined in Draintarget.h and not the device setting of the mvp, so we have to translate it here, in order to get it working on windows --MR */ - UCHAR mptype=0; + u1 mptype=0; switch (streamtype) { case Audio::MPEG1_PES: //? case Audio::MPEG2_PES: //Important, this must be a PES ! @@ -912,11 +912,11 @@ int PacketBuffer::putInternal(UCHAR * wbuf, int len,unsigned int &packetnum) more intelligent then we are... We only loose a correct position display. */ -int DemuxerAudio::put(UCHAR* wbuf, int len) +int DemuxerAudio::put(u1* wbuf, int len) { //return audiostream.put(wbuf,len,streamtype); int framelen=PACKET_SIZE; - UCHAR *hdr; + u1 *hdr; int bytesConsumed=0; int oldBytes=0; if (tmpFill != 0 || (buffer->bufferEmpty() && len < HDRLEN)) { @@ -1068,8 +1068,8 @@ const DemuxerAudio::vbrInfo * DemuxerAudio::getVBRINfo() { return vbr; } -int DemuxerAudio::checkStart(UCHAR *b, int len) { - UCHAR *start=b; +int DemuxerAudio::checkStart(u1 *b, int len) { + u1 *start=b; int id3len=parseID3V2(b,len); if (id3len > 0) { char * str=id3->toString(); @@ -1085,12 +1085,12 @@ int DemuxerAudio::checkStart(UCHAR *b, int len) { b+=vbrlen; len-=vbrlen; } - UCHAR * hdr=findHeader(b,len,true); + u1 * hdr=findHeader(b,len,true); if (hdr == NULL) return -1; return hdr-start; } -int DemuxerAudio::checkID3(UCHAR *b, int len) { +int DemuxerAudio::checkID3(u1 *b, int len) { if (len != 128) return -1; int rt=parseID3V1(b,len); if (rt >= 0) { diff --git a/src/demuxeraudio.h b/src/demuxeraudio.h index bd9a3d1..ad98706 100644 --- a/src/demuxeraudio.h +++ b/src/demuxeraudio.h @@ -44,17 +44,17 @@ class DemuxerAudio : public Demuxer u4 numFrames; u4 numBytes; u4 fileSeconds; - UCHAR table[100]; + u1 table[100]; } vbrInfo; DemuxerAudio(int p_vID = 0, int p_aID = 0); virtual ~DemuxerAudio(); virtual void flush(); virtual void reset(); - virtual int scan(UCHAR* buf, int len); - virtual int findPTS(UCHAR* buf, int len, u8* dest); + virtual int scan(u1* buf, int len); + virtual int findPTS(u1* buf, int len, u8* dest); virtual void setVID(int p_vID); virtual void setAID(int p_aID,int type); - virtual int put(UCHAR* buf, int len); + virtual int put(u1* buf, int len); //special functions for the audioplayer bool isSync() ; @@ -83,10 +83,10 @@ class DemuxerAudio : public Demuxer //will return the offset in buffer where the first valid //header was found (with potentially skipping ID3 and VBR) //return -1 if nothing found - int checkStart(UCHAR * buffer, int len); + int checkStart(u1 * buffer, int len); //check for ID3V1 (at the end) //return 0 if found - int checkID3(UCHAR * buffer, int len); + int checkID3(u1 * buffer, int len); //return length if we can do this //otherwise return 0 @@ -98,7 +98,7 @@ class DemuxerAudio : public Demuxer //try to read the iD3 tag value (V2xx) and //fill it into the ID3 store - bool fillId3Tag(id3_tag * tag,UCHAR * frameData, int frameLen, int dataOffset, bool v23); + bool fillId3Tag(id3_tag * tag,u1 * frameData, int frameLen, int dataOffset, bool v23); const static u4 PACKET_SIZE=4096; private: @@ -112,7 +112,7 @@ class DemuxerAudio : public Demuxer */ Log * log; - int readHeader(UCHAR* buf, int len, bool writeInfo=false); + int readHeader(u1* buf, int len, bool writeInfo=false); //info flags for the player bool inSync; //set if we read a valid header @@ -135,10 +135,10 @@ class DemuxerAudio : public Demuxer //search for the start of a header //return NULL if none found - UCHAR * findHeader(UCHAR * buf, int len, bool writeInfo=false); + u1 * findHeader(u1 * buf, int len, bool writeInfo=false); //we need a buffer to be able to read at least a complete header const static int HDRLEN=4; - UCHAR tmpBuffer[PACKET_SIZE+HDRLEN]; + u1 tmpBuffer[PACKET_SIZE+HDRLEN]; u4 tmpFill; //compute the bytes/second from the BR info @@ -148,18 +148,18 @@ class DemuxerAudio : public Demuxer //parse ID3V2 at the beginning //set info if there //return length of header, -1 if not found - int parseID3V2(UCHAR *data, int len); + int parseID3V2(u1 *data, int len); int id3_2_3_FrameParse(unsigned char buf[], id3_frame *frame); int id3_2_2_FrameParse(unsigned char buf[], id3_frame *frame); //parse ID3V1 at the end //set info if there, return -1 otherwise - int parseID3V1(UCHAR *data, int len) ; + int parseID3V1(u1 *data, int len) ; //parse a VBR header and set VBR info //input has to point to firts MPEG header in file //potentially after ID3V2 - int parseVBR(UCHAR *data, int len); + int parseVBR(u1 *data, int len); class PacketBuffer* buffer; diff --git a/src/demuxermedia.cc b/src/demuxermedia.cc index 285df3a..98c82fb 100644 --- a/src/demuxermedia.cc +++ b/src/demuxermedia.cc @@ -70,7 +70,7 @@ void DemuxerMedia::flush() Demuxer::flush(); } -int DemuxerMedia::scan(UCHAR *buf, int len) +int DemuxerMedia::scan(u1 *buf, int len) { int ret = 0; int astate=0; //hdrbyte @@ -118,7 +118,7 @@ int DemuxerMedia::scan(UCHAR *buf, int len) return ret; } -int DemuxerMedia::findPTS(UCHAR* buf, int len, u8* dest) +int DemuxerMedia::findPTS(u1* buf, int len, u8* dest) { // nobody uses this // No PTS found. @@ -139,7 +139,7 @@ void DemuxerMedia::setPacketNum(u4 npacket) Log::getInstance()->log("Demuxer", Log::DEBUG, "setPacketNum %d", npacket); } -int DemuxerMedia::put(UCHAR* buf, int len) +int DemuxerMedia::put(u1* buf, int len) { int ret = 0; // return number of bytes consumed if (submitting) @@ -282,13 +282,13 @@ void DemuxerMedia::parseVDRPacketDetails() //find a sequence header backward //search for 00 00 01