libraspi: sync with max_10

Origin commit data
------------------
Branch: master
Commit: 50202b34ec
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-03-09 (Thu, 09 Mar 2023)

Origin message was:
------------------
- libraspi: sync with max_10

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2023-03-09 20:33:26 +01:00
parent 23e90f01d4
commit 890b8ca05c
8 changed files with 59 additions and 129 deletions

View File

@@ -76,30 +76,30 @@ int cAudio::Stop(void)
bool cAudio::Pause(bool /*Pcm*/) bool cAudio::Pause(bool /*Pcm*/)
{ {
return true; return true;
}; }
void cAudio::SetSyncMode(AVSYNC_TYPE Mode) void cAudio::SetSyncMode(AVSYNC_TYPE Mode)
{ {
hal_debug("%s %d\n", __func__, Mode); hal_debug("%s %d\n", __func__, Mode);
}; }
void cAudio::SetStreamType(int bypass) void cAudio::SetStreamType(int bypass)
{ {
StreamType = bypass; StreamType = bypass;
hal_debug("%s %d (0x%x)\n", __FUNCTION__, bypass, bypass); hal_debug("%s %d (0x%x)\n", __FUNCTION__, bypass, bypass);
}; }
int cAudio::setChannel(int /*channel*/) int cAudio::setChannel(int /*channel*/)
{ {
return 0; return 0;
}; }
int cAudio::PrepareClipPlay(int ch, int srate, int bits, int le) int cAudio::PrepareClipPlay(int ch, int srate, int bits, int le)
{ {
hal_debug("%s ch %d srate %d bits %d le %d\n", __func__, ch, srate, bits, le);; hal_debug("%s ch %d srate %d bits %d le %d\n", __func__, ch, srate, bits, le);;
return 0; return 0;
}; }
int cAudio::WriteClip(unsigned char *buffer, int size) int cAudio::WriteClip(unsigned char *buffer, int size)
{ {
@@ -111,7 +111,7 @@ int cAudio::StopClip()
{ {
hal_debug("%s\n", __func__); hal_debug("%s\n", __func__);
return 0; return 0;
}; }
void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &mode) void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &mode)
{ {
@@ -121,7 +121,7 @@ void cAudio::getAudioInfo(int &type, int &layer, int &freq, int &bitrate, int &m
bitrate = 0; /* not used, but easy to get :-) */ bitrate = 0; /* not used, but easy to get :-) */
mode = 0; /* default: stereo */ mode = 0; /* default: stereo */
hal_debug("%s t: %d l: %d f: %d b: %d m: %d\n", __func__, type, layer, freq, bitrate, mode); hal_debug("%s t: %d l: %d f: %d b: %d m: %d\n", __func__, type, layer, freq, bitrate, mode);
}; }
void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int /*iq_level*/) void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int /*iq_level*/)
{ {
@@ -131,22 +131,22 @@ void cAudio::SetSRS(int /*iq_enable*/, int /*nmgr_enable*/, int /*iq_mode*/, int
void cAudio::SetHdmiDD(bool enable) void cAudio::SetHdmiDD(bool enable)
{ {
hal_debug("%s %d\n", __func__, enable); hal_debug("%s %d\n", __func__, enable);
}; }
void cAudio::SetSpdifDD(bool enable) void cAudio::SetSpdifDD(bool enable)
{ {
hal_debug("%s %d\n", __func__, enable); hal_debug("%s %d\n", __func__, enable);
}; }
void cAudio::ScheduleMute(bool On) void cAudio::ScheduleMute(bool On)
{ {
hal_debug("%s %d\n", __func__, On); hal_debug("%s %d\n", __func__, On);
}; }
void cAudio::EnableAnalogOut(bool enable) void cAudio::EnableAnalogOut(bool enable)
{ {
hal_debug("%s %d\n", __func__, enable); hal_debug("%s %d\n", __func__, enable);
}; }
void cAudio::setBypassMode(bool disable) void cAudio::setBypassMode(bool disable)
{ {

View File

@@ -1,69 +0,0 @@
#ifndef __DMX_H__
#define __DMX_H__
#include <cstdlib>
#include <vector>
#include <inttypes.h>
#include <linux/dvb/dmx.h>
#include "../common/cs_types.h"
#define MAX_DMX_UNITS 4
typedef enum
{
DMX_INVALID = 0,
DMX_VIDEO_CHANNEL = 1,
DMX_AUDIO_CHANNEL,
DMX_PES_CHANNEL,
DMX_PSI_CHANNEL,
DMX_TP_CHANNEL,
DMX_PCR_ONLY_CHANNEL
} DMX_CHANNEL_TYPE;
typedef struct
{
int fd;
unsigned short pid;
} pes_pids;
class cRecord;
class cPlayback;
class cDemux
{
friend class cRecord;
friend class cPlayback;
public:
bool Open(DMX_CHANNEL_TYPE pes_type, void *x = NULL, int y = 0);
void Close(void);
bool Start(bool record = false);
bool Stop(void);
int Read(unsigned char *buff, int len, int Timeout = 0);
bool sectionFilter(unsigned short pid, const unsigned char *const filter, const unsigned char *const mask, int len, int Timeout = 0, const unsigned char *const negmask = NULL);
bool pesFilter(const unsigned short pid);
void SetSyncMode(AVSYNC_TYPE mode);
void *getBuffer();
void *getChannel();
DMX_CHANNEL_TYPE getChannelType(void) { return dmx_type; };
bool addPid(unsigned short pid);
void getSTC(int64_t *STC);
int getUnit(void);
static bool SetSource(int unit, int source);
static int GetSource(int unit);
int getFD(void) { return fd; }; /* needed by cPlayback class */
cDemux(int num = 0);
~cDemux();
private:
void removePid(unsigned short Pid); /* needed by cRecord class */
int num;
int fd;
int buffersize;
uint16_t pid;
uint8_t flt;
std::vector<pes_pids> pesfds;
DMX_CHANNEL_TYPE dmx_type;
void *pdata;
};
#endif // __DMX_H__

View File

@@ -19,12 +19,14 @@
*/ */
#include <unistd.h> #include <unistd.h>
#include <cstring> #include <cstring>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include "video_lib.h" #include "video_lib.h"
#include "hal_debug.h" #include "hal_debug.h"
#define hal_debug(args...) _hal_debug(HAL_DEBUG_VIDEO, this, args) #define hal_debug(args...) _hal_debug(HAL_DEBUG_VIDEO, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_VIDEO, this, args) #define hal_info(args...) _hal_info(HAL_DEBUG_VIDEO, this, args)
#define hal_info_c(args...) _hal_info(HAL_DEBUG_VIDEO, NULL, args) #define hal_info_c(args...) _hal_info(HAL_DEBUG_VIDEO, NULL, args)
@@ -174,7 +176,7 @@ void cVideo::getPictureInfo(int &width, int &height, int &rate)
void cVideo::SetSyncMode(AVSYNC_TYPE) void cVideo::SetSyncMode(AVSYNC_TYPE)
{ {
}; }
int cVideo::SetStreamType(VIDEO_FORMAT v) int cVideo::SetStreamType(VIDEO_FORMAT v)
{ {

View File

@@ -23,7 +23,6 @@ typedef enum
ANALOG_SCART_MASK = 0x10 ANALOG_SCART_MASK = 0x10
} analog_mode_t; } analog_mode_t;
typedef enum typedef enum
{ {
VIDEO_FORMAT_MPEG2 = 0, VIDEO_FORMAT_MPEG2 = 0,
@@ -105,7 +104,7 @@ typedef enum
VIDEO_STD_1080P24, VIDEO_STD_1080P24,
VIDEO_STD_1080P25, VIDEO_STD_1080P25,
VIDEO_STD_AUTO, VIDEO_STD_AUTO,
VIDEO_STD_1080P50, /* SPARK only */ VIDEO_STD_1080P50,
VIDEO_STD_MAX VIDEO_STD_MAX
} VIDEO_STD; } VIDEO_STD;
@@ -127,7 +126,6 @@ typedef enum
VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS VIDEO_CONTROL_MAX = VIDEO_CONTROL_SHARPNESS
} VIDEO_CONTROL; } VIDEO_CONTROL;
#define VDEC_MAXBUFS 0x30 #define VDEC_MAXBUFS 0x30
class cVideo class cVideo
{ {
@@ -167,8 +165,8 @@ class cVideo
/* aspect ratio */ /* aspect ratio */
int getAspectRatio(void); int getAspectRatio(void);
void getPictureInfo(int &width, int &height, int &rate);
int setAspectRatio(int aspect, int mode); int setAspectRatio(int aspect, int mode);
void getPictureInfo(int &width, int &height, int &rate);
/* cropping mode */ /* cropping mode */
int setCroppingMode(int x = 0 /*vidDispMode_t x = VID_DISPMODE_NORM*/); int setCroppingMode(int x = 0 /*vidDispMode_t x = VID_DISPMODE_NORM*/);
@@ -189,14 +187,13 @@ class cVideo
int Stop(bool blank = true); int Stop(bool blank = true);
bool Pause(void); bool Pause(void);
/* set video_system */
int SetVideoSystem(int video_system, bool remember = true);
int SetStreamType(VIDEO_FORMAT type); int SetStreamType(VIDEO_FORMAT type);
bool ShowPicture(const char *fname);
void SetSyncMode(AVSYNC_TYPE mode); void SetSyncMode(AVSYNC_TYPE mode);
bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; }; bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };
void SetCECAutoView(bool) { return; }; void SetCECAutoView(bool) { return; };
void SetCECAutoStandby(bool) { return; }; void SetCECAutoStandby(bool) { return; };
bool ShowPicture(const char *fname);
void StopPicture(); void StopPicture();
void Standby(unsigned int bOn); void Standby(unsigned int bOn);
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600); void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);