mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
libarmbox: some manual code nicenings
Origin commit data
------------------
Branch: master
Commit: cc247d723e
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-11-07 (Sun, 07 Nov 2021)
Origin message was:
------------------
- libarmbox: some manual code nicenings
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -32,11 +32,11 @@ class cAudio
|
||||
bool Muted;
|
||||
|
||||
int clipfd; /* for pcm playback */
|
||||
int mixer_fd; /* if we are using the OSS mixer */
|
||||
int mixer_fd; /* if we are using the OSS mixer */
|
||||
int mixer_num; /* oss mixer to use, if any */
|
||||
|
||||
int StreamType;
|
||||
AUDIO_SYNC_MODE SyncMode;
|
||||
AUDIO_SYNC_MODE SyncMode;
|
||||
bool started;
|
||||
|
||||
int volume;
|
||||
@@ -57,40 +57,22 @@ class cAudio
|
||||
|
||||
void setAVInput(int val);
|
||||
|
||||
void *GetHandle()
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
void *GetHandle() { return NULL; };
|
||||
/* shut up */
|
||||
int mute(bool remember = true)
|
||||
{
|
||||
return do_mute(true, remember);
|
||||
};
|
||||
int unmute(bool remember = true)
|
||||
{
|
||||
return do_mute(false, remember);
|
||||
};
|
||||
int mute(bool remember = true) { return do_mute(true, remember); };
|
||||
int unmute(bool remember = true) { return do_mute(false, remember); };
|
||||
|
||||
/* volume, min = 0, max = 255 */
|
||||
int setVolume(unsigned int left, unsigned int right);
|
||||
int getVolume(void)
|
||||
{
|
||||
return volume;
|
||||
}
|
||||
bool getMuteStatus(void)
|
||||
{
|
||||
return Muted;
|
||||
};
|
||||
int getVolume(void) { return volume; }
|
||||
bool getMuteStatus(void) { return Muted; };
|
||||
|
||||
/* start and stop audio */
|
||||
int Start(void);
|
||||
int Stop(void);
|
||||
bool Pause(bool Pcm = true);
|
||||
void SetStreamType(int bypass);
|
||||
int GetStreamType(void)
|
||||
{
|
||||
return StreamType;
|
||||
}
|
||||
int GetStreamType(void) { return StreamType; }
|
||||
void SetSyncMode(AVSYNC_TYPE Mode);
|
||||
|
||||
/* select channels */
|
||||
@@ -100,10 +82,7 @@ class cAudio
|
||||
int StopClip();
|
||||
void getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &mode);
|
||||
void SetSRS(int iq_enable, int nmgr_enable, int iq_mode, int iq_level);
|
||||
bool IsHdmiDDSupported()
|
||||
{
|
||||
return true;
|
||||
};
|
||||
bool IsHdmiDDSupported() { return true; };
|
||||
void SetHdmiDD(bool enable);
|
||||
void SetSpdifDD(bool enable);
|
||||
void ScheduleMute(bool On);
|
||||
|
@@ -96,18 +96,9 @@ class hdmi_cec : public OpenThreads::Thread
|
||||
void vol_up();
|
||||
void vol_down();
|
||||
void toggle_mute();
|
||||
int GetVolume()
|
||||
{
|
||||
return volume;
|
||||
};
|
||||
bool isMuted()
|
||||
{
|
||||
return muted;
|
||||
};
|
||||
int GetAudioDestination()
|
||||
{
|
||||
return (int)audio_destination;
|
||||
}
|
||||
int GetVolume() { return volume; };
|
||||
bool isMuted() { return muted; };
|
||||
int GetAudioDestination() { return (int)audio_destination; }
|
||||
void SetAudioDestination(int audio_dest);
|
||||
};
|
||||
|
||||
|
@@ -8,35 +8,35 @@
|
||||
#define HI_FORMAT_MAX_LANGUAGE_NUM (4)
|
||||
#define HI_FORMAT_SERVICE_DESCRIPT_LEN (64)
|
||||
|
||||
typedef uint8_t HI_U8;
|
||||
typedef uint16_t HI_U16;
|
||||
typedef uint32_t HI_U32;
|
||||
typedef int8_t HI_S8;
|
||||
typedef int16_t HI_S16;
|
||||
typedef int32_t HI_S32;
|
||||
typedef uint64_t HI_U64;
|
||||
typedef int64_t HI_S64;
|
||||
typedef uint8_t HI_U8;
|
||||
typedef uint16_t HI_U16;
|
||||
typedef uint32_t HI_U32;
|
||||
typedef int8_t HI_S8;
|
||||
typedef int16_t HI_S16;
|
||||
typedef int32_t HI_S32;
|
||||
typedef uint64_t HI_U64;
|
||||
typedef int64_t HI_S64;
|
||||
typedef void HI_VOID;
|
||||
typedef char HI_CHAR;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HI_FALSE = 0,
|
||||
HI_TRUE = 1,
|
||||
HI_FALSE = 0,
|
||||
HI_TRUE = 1,
|
||||
} HI_BOOL;
|
||||
|
||||
typedef enum hiFORMAT_SUBTITLE_TYPE_E
|
||||
{
|
||||
HI_FORMAT_SUBTITLE_ASS = 0x0, /**< ASS subtitle */
|
||||
HI_FORMAT_SUBTITLE_ASS = 0x0, /**< ASS subtitle */
|
||||
HI_FORMAT_SUBTITLE_LRC, /**< LRC subtitle */
|
||||
HI_FORMAT_SUBTITLE_SRT, /**< SRT subtitle */
|
||||
HI_FORMAT_SUBTITLE_SMI, /**< SMI subtitle */
|
||||
HI_FORMAT_SUBTITLE_SUB, /**< SUB subtitle */
|
||||
HI_FORMAT_SUBTITLE_TXT, /**< RAW UTF8 subtitle */
|
||||
HI_FORMAT_SUBTITLE_HDMV_PGS, /**< pgs subtitle */
|
||||
HI_FORMAT_SUBTITLE_DVB_SUB, /**< DVB subtitle */
|
||||
HI_FORMAT_SUBTITLE_DVD_SUB, /**< DVD subtitle */
|
||||
HI_FORMAT_SUBTITLE_TTML, /**< TTML subtitle */
|
||||
HI_FORMAT_SUBTITLE_HDMV_PGS, /**< pgs subtitle */
|
||||
HI_FORMAT_SUBTITLE_DVB_SUB, /**< DVB subtitle */
|
||||
HI_FORMAT_SUBTITLE_DVD_SUB, /**< DVD subtitle */
|
||||
HI_FORMAT_SUBTITLE_TTML, /**< TTML subtitle */
|
||||
HI_FORMAT_SUBTITLE_WEBVTT,
|
||||
HI_FORMAT_SUBTITLE_BUTT
|
||||
} HI_FORMAT_SUBTITLE_TYPE_E;
|
||||
@@ -75,7 +75,7 @@ typedef enum hiFORMAT_AUDIO_TYPE_E
|
||||
HI_FORMAT_AUDIO_IMC,
|
||||
HI_FORMAT_AUDIO_MUSEPACK7,
|
||||
HI_FORMAT_AUDIO_MLP,
|
||||
HI_FORMAT_AUDIO_GSM_MS, /**< as found in WAV.*/
|
||||
HI_FORMAT_AUDIO_GSM_MS, /**< as found in WAV.*/
|
||||
HI_FORMAT_AUDIO_ATRAC3,
|
||||
HI_FORMAT_AUDIO_VOXWARE,
|
||||
HI_FORMAT_AUDIO_APE,
|
||||
@@ -98,12 +98,12 @@ typedef enum hiFORMAT_AUDIO_TYPE_E
|
||||
HI_FORMAT_AUDIO_DRA,
|
||||
HI_FORMAT_AUDIO_DTS_EXPRESS,
|
||||
|
||||
HI_FORMAT_AUDIO_PCM = 0x100, /**< various PCM codecs. */
|
||||
HI_FORMAT_AUDIO_PCM = 0x100, /**< various PCM codecs. */
|
||||
HI_FORMAT_AUDIO_PCM_BLURAY = 0x121,
|
||||
|
||||
HI_FORMAT_AUDIO_ADPCM = 0x130, /**< various ADPCM codecs. */
|
||||
|
||||
HI_FORMAT_AUDIO_AMR_NB = 0x160,/**< various AMR codecs. */
|
||||
HI_FORMAT_AUDIO_AMR_NB = 0x160, /**< various AMR codecs. */
|
||||
HI_FORMAT_AUDIO_AMR_WB,
|
||||
HI_FORMAT_AUDIO_AMR_AWB,
|
||||
|
||||
@@ -165,7 +165,7 @@ typedef enum hiFORMAT_VIDEO_TYPE_E
|
||||
HI_FORMAT_VIDEO_HEVC, /**< HEVC(H265)*/
|
||||
HI_FORMAT_VIDEO_DV,
|
||||
HI_FORMAT_VIDEO_HUFFYUV,
|
||||
HI_FORMAT_VIDEO_DIVX, /**< DIVX,not supported*/
|
||||
HI_FORMAT_VIDEO_DIVX, /**< DIVX,not supported*/
|
||||
HI_FORMAT_VIDEO_REALMAGICMPEG4, /**< REALMAGIC MPEG4,not supported*/
|
||||
HI_FORMAT_VIDEO_VP9, /**<VP9*/
|
||||
HI_FORMAT_VIDEO_WMV3,
|
||||
@@ -175,9 +175,9 @@ typedef enum hiFORMAT_VIDEO_TYPE_E
|
||||
|
||||
typedef enum hiFORMAT_SOURCE_TYPE_E
|
||||
{
|
||||
HI_FORMAT_SOURCE_LOCAL = 0x0, /**< Local file */
|
||||
HI_FORMAT_SOURCE_NET_VOD, /**< Net VOD file */
|
||||
HI_FORMAT_SOURCE_NET_LIVE, /**< Net Live stream */
|
||||
HI_FORMAT_SOURCE_LOCAL = 0x0, /**< Local file */
|
||||
HI_FORMAT_SOURCE_NET_VOD, /**< Net VOD file */
|
||||
HI_FORMAT_SOURCE_NET_LIVE, /**< Net Live stream */
|
||||
HI_FORMAT_SOURCE_BUTT
|
||||
} HI_FORMAT_SOURCE_TYPE_E;
|
||||
|
||||
@@ -207,7 +207,7 @@ typedef struct hiFORMAT_AUD_INFO_S
|
||||
HI_U32 u32Role; /**< Role descriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, the descriptor value may be the bitwise '|' result of value define in HI_FORMAT_ROLE_VALUE_E*/
|
||||
HI_U32 u32Accessibility; /**< Accessbilitydescriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, the descriptor value type is number*/
|
||||
HI_S64 s64Duration; /**< Duration of audio stream, in the unit of ms. */
|
||||
HI_U32 u32CodecTag; /**< Codec tag of audio stream format, fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). */
|
||||
HI_U32 u32CodecTag; /**< Codec tag of audio stream format, fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). */
|
||||
} HI_FORMAT_AUD_INFO_S;
|
||||
|
||||
typedef struct hiFORMAT_VID_INFO_S
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -81,15 +81,9 @@ class cPlayback
|
||||
int GetSubtitlePid(void);
|
||||
bool SetPosition(int position, bool absolute = false);
|
||||
void FindAllPids(int *apids, unsigned int *ac3flags, unsigned int *numpida, std::string *language);
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language)
|
||||
{
|
||||
FindAllPids((int *) apids, (unsigned int *) ac3flags, (unsigned int *) numpida, language);
|
||||
};
|
||||
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language) { FindAllPids((int *) apids, (unsigned int *) ac3flags, (unsigned int *) numpida, language); };
|
||||
void FindAllSubs(int *pids, unsigned int *supported, unsigned int *numpida, std::string *language);
|
||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language)
|
||||
{
|
||||
FindAllSubs((int *) pids, (unsigned int *) supported, (unsigned int *) numpida, language);
|
||||
};
|
||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language) { FindAllSubs((int *) pids, (unsigned int *) supported, (unsigned int *) numpida, language); };
|
||||
bool SelectSubtitles(int pid, std::string charset = "");
|
||||
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
||||
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage, int *mags, int *pages);
|
||||
|
@@ -83,18 +83,9 @@ class cPlayback
|
||||
bool SetVPid(int /*pid*/);
|
||||
bool SetSubtitlePid(int pid);
|
||||
bool SetTeletextPid(int pid);
|
||||
int GetAPid(void)
|
||||
{
|
||||
return mAudioStream;
|
||||
}
|
||||
int GetVPid(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int GetSubtitlePid(void)
|
||||
{
|
||||
return mSubtitleStream;
|
||||
}
|
||||
int GetAPid(void) { return mAudioStream; }
|
||||
int GetVPid(void) { return 0; }
|
||||
int GetSubtitlePid(void) { return mSubtitleStream; }
|
||||
int GetTeletextPid(void);
|
||||
bool SetSpeed(int speed);
|
||||
bool GetSpeed(int &speed) const;
|
||||
@@ -133,7 +124,9 @@ class netlink_event : public OpenThreads::Thread
|
||||
int m_player_state;
|
||||
enum
|
||||
{
|
||||
stIdle, stRunning, stStopped,
|
||||
stIdle,
|
||||
stRunning,
|
||||
stStopped,
|
||||
};
|
||||
struct streamid
|
||||
{
|
||||
@@ -157,10 +150,7 @@ class netlink_event : public OpenThreads::Thread
|
||||
void Receive();
|
||||
public:
|
||||
static netlink_event *getInstance();
|
||||
uint64_t getDuration()
|
||||
{
|
||||
return fileinfo.s64Duration;
|
||||
};
|
||||
uint64_t getDuration() { return fileinfo.s64Duration; };
|
||||
bool Start(cPlayback *player);
|
||||
bool Stop();
|
||||
};
|
||||
|
@@ -48,18 +48,9 @@ class cPlayback
|
||||
bool SetVPid(int /*pid*/);
|
||||
bool SetSubtitlePid(int pid);
|
||||
bool SetTeletextPid(int pid);
|
||||
int GetAPid(void)
|
||||
{
|
||||
return mAudioStream;
|
||||
}
|
||||
int GetVPid(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int GetSubtitlePid(void)
|
||||
{
|
||||
return mSubtitleStream;
|
||||
}
|
||||
int GetAPid(void) { return mAudioStream; }
|
||||
int GetVPid(void) { return 0; }
|
||||
int GetSubtitlePid(void) { return mSubtitleStream; }
|
||||
int GetTeletextPid(void);
|
||||
bool SetSpeed(int speed);
|
||||
bool GetSpeed(int &speed) const;
|
||||
@@ -92,7 +83,7 @@ class cPlayback
|
||||
void *GetHandle(void);
|
||||
void *GetDmHandle(void);
|
||||
int GetCurrPlaybackSpeed(void) const;
|
||||
void PlaybackNotify(int Event, void *pData, void *pTag);
|
||||
void PlaybackNotify(int Event, void *pData, void *pTag);
|
||||
void DMNotify(int Event, void *pTsBuf, void *Tag);
|
||||
#endif
|
||||
};
|
||||
|
@@ -16,7 +16,7 @@ typedef enum
|
||||
RECORD_FAILED_READ, /* failed to read from DMX */
|
||||
RECORD_FAILED_OVERFLOW, /* cannot write fast enough */
|
||||
RECORD_FAILED_FILE, /* cannot write to file */
|
||||
RECORD_FAILED_MEMORY /* out of memory */
|
||||
RECORD_FAILED_MEMORY /* out of memory */
|
||||
} record_state_t;
|
||||
|
||||
class cRecord
|
||||
@@ -40,18 +40,14 @@ class cRecord
|
||||
size_t io_len[RECORD_WRITER_CHUNKS];
|
||||
public:
|
||||
cRecord(int num = 0, int bs_dmx = 2048 * 1024, int bs = 4096 * 1024);
|
||||
void setFailureCallback(void (*f)(void *), void *d)
|
||||
{
|
||||
failureCallback = f;
|
||||
failureData = d;
|
||||
}
|
||||
void setFailureCallback(void (*f)(void *), void *d) { failureCallback = f; failureData = d; }
|
||||
~cRecord();
|
||||
|
||||
bool Open();
|
||||
bool Start(int fd, unsigned short vpid, unsigned short *apids, int numapids, uint64_t ch = 0);
|
||||
bool Stop(void);
|
||||
bool AddPid(unsigned short pid);
|
||||
int GetStatus();
|
||||
int GetStatus();
|
||||
void ResetStatus();
|
||||
bool ChangePids(unsigned short vpid, unsigned short *apids, int numapids);
|
||||
|
||||
|
@@ -222,14 +222,8 @@ class cVideo
|
||||
|
||||
void setAVInput(int val);
|
||||
|
||||
void *GetTVEnc()
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
void *GetTVEncSD()
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
void *GetTVEnc() { return NULL; };
|
||||
void *GetTVEncSD() { return NULL; };
|
||||
|
||||
/* aspect ratio */
|
||||
int getAspectRatio(void);
|
||||
@@ -263,7 +257,7 @@ class cVideo
|
||||
bool SetCECMode(VIDEO_HDMI_CEC_MODE);
|
||||
void SetCECAutoView(bool);
|
||||
void SetCECAutoStandby(bool);
|
||||
int GetAudioDestination();
|
||||
int GetAudioDestination();
|
||||
void SetAudioDestination(int audio_dest);
|
||||
bool ShowPicture(const char *fname);
|
||||
void StopPicture();
|
||||
@@ -274,34 +268,13 @@ class cVideo
|
||||
void setContrast(int val);
|
||||
void SetVideoMode(analog_mode_t mode);
|
||||
void QuadPiP(bool active = false, int _x = 0, int _y = 0, int _w = 360, int _h = 288);
|
||||
void SetDBDR(int)
|
||||
{
|
||||
return;
|
||||
};
|
||||
void SetAudioHandle(void *)
|
||||
{
|
||||
return;
|
||||
};
|
||||
void SetAutoModes(int [VIDEO_STD_MAX])
|
||||
{
|
||||
return;
|
||||
};
|
||||
int OpenVBI(int)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
int CloseVBI(void)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
int StartVBI(unsigned short)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
int StopVBI(void)
|
||||
{
|
||||
return 0;
|
||||
};
|
||||
void SetDBDR(int) { return; };
|
||||
void SetAudioHandle(void *) { return; };
|
||||
void SetAutoModes(int [VIDEO_STD_MAX]) { return; };
|
||||
int OpenVBI(int) { return 0; };
|
||||
int CloseVBI(void) { return 0; };
|
||||
int StartVBI(unsigned short) { return 0; };
|
||||
int StopVBI(void) { return 0; };
|
||||
void SetDemux(cDemux *dmx);
|
||||
void SetColorFormat(COLOR_FORMAT color_format);
|
||||
bool GetScreenImage(unsigned char *&data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false);
|
||||
|
Reference in New Issue
Block a user