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,17 +111,17 @@ 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)
{ {
type = 0; type = 0;
layer = 0; /* not used */ layer = 0; /* not used */
freq = 0; freq = 0;
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

@@ -113,9 +113,9 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
__func__, num, DMX_T[pes_type], pes_type, uBufferSize, fd); __func__, num, DMX_T[pes_type], pes_type, uBufferSize, fd);
if (dmx_type == DMX_VIDEO_CHANNEL) if (dmx_type == DMX_VIDEO_CHANNEL)
uBufferSize = 0x100000; /* 1MB */ uBufferSize = 0x100000; /* 1MB */
if (dmx_type == DMX_AUDIO_CHANNEL) if (dmx_type == DMX_AUDIO_CHANNEL)
uBufferSize = 0x10000; /* 64k */ uBufferSize = 0x10000; /* 64k */
#if 0 #if 0
if (!pesfds.empty()) if (!pesfds.empty())
{ {

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

@@ -1,21 +1,21 @@
/* /*
Copyright 2013 Stefan Seyfried <seife@tuxboxcvs.slipkontur.de> Copyright 2013 Stefan Seyfried <seife@tuxboxcvs.slipkontur.de>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
The GLFB namespace is just because it's already established by the The GLFB namespace is just because it's already established by the
generic-pc implementation. generic-pc implementation.
*/ */
#include <vector> #include <vector>
@@ -50,10 +50,10 @@ static VC_IMAGE_TYPE_T type = VC_IMAGE_ARGB8888;
static OpenThreads::Mutex blit_mutex; static OpenThreads::Mutex blit_mutex;
static OpenThreads::Condition blit_cond; static OpenThreads::Condition blit_cond;
static bool goodbye = false; /* if set main loop is left */ static bool goodbye = false; /* if set main loop is left */
static bool ready = false; /* condition predicate */ static bool ready = false; /* condition predicate */
static int width; /* width and height, fixed for a framebuffer instance */ static int width; /* width and height, fixed for a framebuffer instance */
static int height; static int height;
GLFramebuffer::GLFramebuffer(int x, int y) GLFramebuffer::GLFramebuffer(int x, int y)

View File

@@ -1,18 +1,18 @@
/* /*
Copyright 2013 Stefan Seyfried <seife@tuxboxcvs.slipkontur.de> Copyright 2013 Stefan Seyfried <seife@tuxboxcvs.slipkontur.de>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __glthread__ #ifndef __glthread__
@@ -31,10 +31,10 @@ class GLFramebuffer : public OpenThreads::Thread
fb_var_screeninfo getScreenInfo() { return si; } fb_var_screeninfo getScreenInfo() { return si; }
private: private:
void *pdata; /* not yet used */ void *pdata; /* not yet used */
fb_var_screeninfo si; fb_var_screeninfo si;
std::vector<unsigned char> osd_buf; /* silly bounce buffer */ std::vector<unsigned char> osd_buf; /* silly bounce buffer */
void run(); /* for OpenThreads::Thread */ void run(); /* for OpenThreads::Thread */
void setup(); void setup();
void blit_osd(); void blit_osd();

View File

@@ -55,9 +55,9 @@ static void init_keymap(void)
kmap[KEY_E] = KEY_EPG; kmap[KEY_E] = KEY_EPG;
kmap[KEY_I] = KEY_INFO; kmap[KEY_I] = KEY_INFO;
kmap[KEY_M] = KEY_MENU; kmap[KEY_M] = KEY_MENU;
kmap[KEY_F12] = KEY_VOLUMEUP; /* different than glfb, as we */ kmap[KEY_F12] = KEY_VOLUMEUP; /* different than glfb, as we */
kmap[KEY_F11] = KEY_VOLUMEDOWN; /* don't consider the keyboard */ kmap[KEY_F11] = KEY_VOLUMEDOWN; /* don't consider the keyboard */
kmap[KEY_F10] = KEY_MUTE; /* layout... */ kmap[KEY_F10] = KEY_MUTE; /* layout... */
kmap[KEY_H] = KEY_HELP; kmap[KEY_H] = KEY_HELP;
kmap[KEY_P] = KEY_POWER; kmap[KEY_P] = KEY_POWER;
kmap[KEY_F1] = KEY_RED; kmap[KEY_F1] = KEY_RED;

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);
@@ -206,10 +203,10 @@ class cVideo
void SetDBDR(int) { return; }; void SetDBDR(int) { return; };
void SetAudioHandle(void *) { return; }; void SetAudioHandle(void *) { return; };
void SetAutoModes(int [VIDEO_STD_MAX]) { return; }; void SetAutoModes(int [VIDEO_STD_MAX]) { return; };
int OpenVBI(int) { return 0; }; int OpenVBI(int) { return 0; };
int CloseVBI(void) { return 0; }; int CloseVBI(void) { return 0; };
int StartVBI(unsigned short) { return 0; }; int StartVBI(unsigned short) { return 0; };
int StopVBI(void) { return 0; }; int StopVBI(void) { return 0; };
void SetDemux(cDemux *dmx); void SetDemux(cDemux *dmx);
bool GetScreenImage(unsigned char *&data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false); bool GetScreenImage(unsigned char *&data, int &xres, int &yres, bool get_video = true, bool get_osd = false, bool scale_to_video = false);