mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
Compare commits
11 Commits
v0.2.0-gen
...
v0.2.1-gen
Author | SHA1 | Date | |
---|---|---|---|
|
ed8e3743d5 | ||
|
bc9eca8588 | ||
|
1e47a62926 | ||
|
4fecdd558a | ||
|
2e8aa93895 | ||
|
8d6b3f71c0 | ||
|
2673ba0940 | ||
|
78b3403303 | ||
|
dd01a95ddb | ||
|
3f9525e42e | ||
|
a47c399a19 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,8 +4,11 @@ Makefile.in
|
|||||||
/config.guess
|
/config.guess
|
||||||
/config.h.in
|
/config.h.in
|
||||||
/config.sub
|
/config.sub
|
||||||
|
*/*-config.h
|
||||||
|
*/*-config.h.in
|
||||||
/configure
|
/configure
|
||||||
/compile
|
/compile
|
||||||
|
*.directory
|
||||||
/depcomp
|
/depcomp
|
||||||
/install-sh
|
/install-sh
|
||||||
/ltmain.sh
|
/ltmain.sh
|
||||||
|
@@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4
|
|||||||
lib_LTLIBRARIES = libstb-hal.la
|
lib_LTLIBRARIES = libstb-hal.la
|
||||||
libstb_hal_la_SOURCES =
|
libstb_hal_la_SOURCES =
|
||||||
SUBDIRS = common tools
|
SUBDIRS = common tools
|
||||||
bin_PROGRAMS = libstb-hal-test
|
#bin_PROGRAMS = libstb-hal-test
|
||||||
|
|
||||||
libstb_hal_la_LIBADD = \
|
libstb_hal_la_LIBADD = \
|
||||||
common/libcommon.la
|
common/libcommon.la
|
||||||
@@ -59,5 +59,5 @@ pkginclude_HEADERS = \
|
|||||||
include/playback_hal.h \
|
include/playback_hal.h \
|
||||||
include/pwrmngr.h \
|
include/pwrmngr.h \
|
||||||
include/record_hal.h \
|
include/record_hal.h \
|
||||||
include/video_cs.h \
|
include/version_hal.h \
|
||||||
include/video_hal.h
|
include/video_cs.h
|
||||||
|
@@ -30,7 +30,9 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
||||||
caps.has_HDMI = 1;
|
caps.has_HDMI = 1;
|
||||||
caps.display_xres = 8;
|
caps.display_xres = 8;
|
||||||
caps.can_set_display_brightness = 0;
|
caps.display_has_statusline = 0;
|
||||||
|
caps.display_can_deepstandby = 0;
|
||||||
|
caps.display_can_set_brightness = 0;
|
||||||
strcpy(caps.boxvendor, "AZBox");
|
strcpy(caps.boxvendor, "AZBox");
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
@@ -9,4 +9,5 @@ libcommon_la_SOURCES = \
|
|||||||
ca.cpp \
|
ca.cpp \
|
||||||
lt_debug.c \
|
lt_debug.c \
|
||||||
proc_tools.c \
|
proc_tools.c \
|
||||||
pwrmngr.cpp
|
pwrmngr.cpp \
|
||||||
|
version_hal.cpp
|
||||||
|
55
common/version_hal.cpp
Normal file
55
common/version_hal.cpp
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* (C) 2018 Thilo Graf
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <libstb-hal-config.h>
|
||||||
|
|
||||||
|
#include <version_hal.h>
|
||||||
|
|
||||||
|
|
||||||
|
std::string getPackageVersion()
|
||||||
|
{
|
||||||
|
return PACKAGE_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getPackageVersionMajor()
|
||||||
|
{
|
||||||
|
return PACKAGE_VERSION_MAJOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getPackageVersionMinor()
|
||||||
|
{
|
||||||
|
return PACKAGE_VERSION_MINOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getPackageVersionMicro()
|
||||||
|
{
|
||||||
|
return PACKAGE_VERSION_MICRO;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getPackagenName()
|
||||||
|
{
|
||||||
|
return PACKAGE_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getPackageString()
|
||||||
|
{
|
||||||
|
return PACKAGE_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getPackageVersionGit()
|
||||||
|
{
|
||||||
|
return PACKAGE_VERSION_GIT;
|
||||||
|
}
|
21
configure.ac
21
configure.ac
@@ -1,9 +1,28 @@
|
|||||||
AC_INIT([libstb-hal], [0.2.0])
|
# explicit defines for separate revision handling
|
||||||
|
define(ver_major, 0)
|
||||||
|
define(ver_minor, 2)
|
||||||
|
define(ver_micro, 1)
|
||||||
|
|
||||||
|
# sync with current git
|
||||||
|
define(ver_git, m4_esyscmd([
|
||||||
|
GITBRANCH=$(git rev-parse --abbrev-ref HEAD);
|
||||||
|
GITDESCRIBE=$(git describe --always --tags --dirty);
|
||||||
|
printf "$GITDESCRIBE $GITBRANCH"
|
||||||
|
]))
|
||||||
|
|
||||||
|
AC_PACKAGE_NAME, PACKAGE_NAME_LIBSTB_HAL
|
||||||
|
AC_INIT([Tuxbox-libstb-hal], [ver_major.ver_minor.ver_micro])
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
|
AC_CONFIG_HEADERS([include/libstb-hal-config.h])
|
||||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
AC_GNU_SOURCE
|
AC_GNU_SOURCE
|
||||||
|
|
||||||
|
AC_DEFINE(PACKAGE_VERSION_MAJOR, ver_major, [Major version number])
|
||||||
|
AC_DEFINE(PACKAGE_VERSION_MINOR, ver_minor, [Minor version number])
|
||||||
|
AC_DEFINE(PACKAGE_VERSION_MICRO, ver_micro, [Micro version number])
|
||||||
|
AC_DEFINE(PACKAGE_VERSION_GIT, "ver_git", [internal vcs version info])
|
||||||
|
|
||||||
TUXBOX_APPS
|
TUXBOX_APPS
|
||||||
TUXBOX_APPS_DIRECTORY
|
TUXBOX_APPS_DIRECTORY
|
||||||
TUXBOX_BOXTYPE
|
TUXBOX_BOXTYPE
|
||||||
|
@@ -438,8 +438,9 @@ void ADec::run()
|
|||||||
adevice = ao_open_live(driver, &sformat, NULL);
|
adevice = ao_open_live(driver, &sformat, NULL);
|
||||||
ai = ao_driver_info(driver);
|
ai = ao_driver_info(driver);
|
||||||
lt_info("%s: changed params ch %d srate %d bits %d adevice %p\n",
|
lt_info("%s: changed params ch %d srate %d bits %d adevice %p\n",
|
||||||
__func__, o_ch, o_sr, 16, adevice);;
|
__func__, o_ch, o_sr, 16, adevice);
|
||||||
lt_info("libao driver: %d name '%s' short '%s' author '%s'\n",
|
if(ai)
|
||||||
|
lt_info("libao driver: %d name '%s' short '%s' author '%s'\n",
|
||||||
driver, ai->name, ai->short_name, ai->author);
|
driver, ai->name, ai->short_name, ai->author);
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
|
@@ -28,7 +28,10 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
||||||
caps.has_HDMI = 1;
|
caps.has_HDMI = 1;
|
||||||
caps.display_xres = 8;
|
caps.display_xres = 8;
|
||||||
caps.can_set_display_brightness = 0;
|
caps.display_can_deepstandby = 0;
|
||||||
|
caps.display_can_set_brightness = 0;
|
||||||
|
caps.display_has_statusline = 0;
|
||||||
|
caps.has_button_vformat = 0;
|
||||||
strcpy(caps.boxvendor, "Generic");
|
strcpy(caps.boxvendor, "Generic");
|
||||||
strcpy(caps.boxname, "PC");
|
strcpy(caps.boxname, "PC");
|
||||||
if (! uname(&u))
|
if (! uname(&u))
|
||||||
|
@@ -7,6 +7,10 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "cs_types.h"
|
#include "cs_types.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <set>
|
||||||
|
typedef std::set<int> ca_map_t;
|
||||||
|
typedef ca_map_t::iterator ca_map_iterator_t;
|
||||||
|
|
||||||
typedef std::vector<u16> CaIdVector;
|
typedef std::vector<u16> CaIdVector;
|
||||||
typedef std::vector<u16>::iterator CaIdVectorIterator;
|
typedef std::vector<u16>::iterator CaIdVectorIterator;
|
||||||
typedef std::vector<u16>::const_iterator CaIdVectorConstIterator;
|
typedef std::vector<u16>::const_iterator CaIdVectorConstIterator;
|
||||||
@@ -92,6 +96,8 @@ public:
|
|||||||
static cCA *GetInstance(void);
|
static cCA *GetInstance(void);
|
||||||
bool SendPMT(int Unit, unsigned char *Data, int Len, CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL);
|
bool SendPMT(int Unit, unsigned char *Data, int Len, CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL);
|
||||||
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/, enum CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL) { (void)SlotType; return true; };
|
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/, enum CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL) { (void)SlotType; return true; };
|
||||||
|
bool SendCAPMT(u64 /*Source*/, u8 /*DemuxSource*/, u8 /*DemuxMask*/, const unsigned char * /*CAPMT*/, u32 /*CAPMTLen*/, const unsigned char * /*RawPMT*/, u32 /*RawPMTLen*/, enum CA_SLOT_TYPE SlotType = CA_SLOT_TYPE_ALL, unsigned char scrambled = 0, ca_map_t camap ={0}, int mode = 0, bool enable = false) { (void)SlotType;(void)scrambled;(void)camap;(void)mode;(void)enable; return true; };
|
||||||
|
|
||||||
bool SendMessage(const CA_MESSAGE *Msg);
|
bool SendMessage(const CA_MESSAGE *Msg);
|
||||||
void SetInitMask(enum CA_INIT_MASK InitMask);
|
void SetInitMask(enum CA_INIT_MASK InitMask);
|
||||||
int GetCAIDS(CaIdVector & /*Caids*/) { return 0; };
|
int GetCAIDS(CaIdVector & /*Caids*/) { return 0; };
|
||||||
|
@@ -81,6 +81,7 @@ public:
|
|||||||
static int GetSource(int unit);
|
static int GetSource(int unit);
|
||||||
cDemux(int num = 0);
|
cDemux(int num = 0);
|
||||||
~cDemux();
|
~cDemux();
|
||||||
|
int getFD(void) { return fd; }; /* needed by cPlayback class */
|
||||||
private:
|
private:
|
||||||
void removePid(unsigned short Pid); /* needed by cRecord class */
|
void removePid(unsigned short Pid); /* needed by cRecord class */
|
||||||
int num;
|
int num;
|
||||||
|
@@ -36,7 +36,10 @@ typedef struct hw_caps
|
|||||||
display_type_t display_type;
|
display_type_t display_type;
|
||||||
int display_xres; /* x resolution or chars per line */
|
int display_xres; /* x resolution or chars per line */
|
||||||
int display_yres;
|
int display_yres;
|
||||||
int can_set_display_brightness;
|
int display_can_deepstandby;
|
||||||
|
int display_can_set_brightness;
|
||||||
|
int display_has_statusline;
|
||||||
|
int has_button_vformat;
|
||||||
char boxvendor[64];
|
char boxvendor[64];
|
||||||
char boxname[64];
|
char boxname[64];
|
||||||
char boxarch[64];
|
char boxarch[64];
|
||||||
|
@@ -22,6 +22,10 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include <libavformat/avformat.h>
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is actually the max number that could be returned by
|
* This is actually the max number that could be returned by
|
||||||
* FindAllPids() / FindAllSubs().
|
* FindAllPids() / FindAllSubs().
|
||||||
@@ -49,6 +53,7 @@ public:
|
|||||||
bool GetPosition(int &position, int &duration);
|
bool GetPosition(int &position, int &duration);
|
||||||
bool SetPosition(int position, bool absolute = false);
|
bool SetPosition(int position, bool absolute = false);
|
||||||
void FindAllPids(uint16_t *pids, unsigned short *aud_flags, uint16_t *num, std::string *language);
|
void FindAllPids(uint16_t *pids, unsigned short *aud_flags, uint16_t *num, std::string *language);
|
||||||
|
void FindAllPids(int *apids, unsigned int *ac3flags, uint32_t *numpida, std::string *language){FindAllPids((uint16_t*)apids, (unsigned short*)ac3flags, (uint16_t*) numpida, language);}
|
||||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *num, std::string *language);
|
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *num, std::string *language);
|
||||||
bool SelectSubtitles(int pid, std::string charset = "");
|
bool SelectSubtitles(int pid, std::string charset = "");
|
||||||
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
|
||||||
@@ -56,6 +61,17 @@ public:
|
|||||||
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int ¤t);
|
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int ¤t);
|
||||||
void SetTitle(int title);
|
void SetTitle(int title);
|
||||||
uint64_t GetReadCount(void);
|
uint64_t GetReadCount(void);
|
||||||
|
void FindAllTeletextsubtitlePids(int *, unsigned int *numpids, std::string *, int *, int *){*numpids = 0;}
|
||||||
|
void FindAllSubtitlePids(int * /*pids*/, unsigned int *numpids, std::string * /*language*/){*numpids = 0;}
|
||||||
|
int GetSubtitlePid(void){return 0;}
|
||||||
|
bool SetTeletextPid(int /*pid*/){return true;}
|
||||||
|
int GetAPid(){return 0;}
|
||||||
|
void GetMetadata(std::vector<std::string> /*&keys*/, std::vector<std::string> /*&values*/){}
|
||||||
|
void GetPts(uint64_t &/*pts*/){}
|
||||||
|
bool SetSubtitlePid(int /*pid*/){return false;}
|
||||||
|
AVFormatContext *GetAVFormatContext(){return NULL;}
|
||||||
|
void ReleaseAVFormatContext(){}
|
||||||
|
|
||||||
//
|
//
|
||||||
cPlayback(int num = 0);
|
cPlayback(int num = 0);
|
||||||
~cPlayback();
|
~cPlayback();
|
||||||
|
16
include/version_hal.h
Normal file
16
include/version_hal.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef __VERSION_HAL_H__
|
||||||
|
#define __VERSION_HAL_H__
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
std::string getPackageVersion();
|
||||||
|
int getPackageVersionMajor();
|
||||||
|
int getPackageVersionMinor();
|
||||||
|
int getPackageVersionMicro();
|
||||||
|
std::string getPackagenName();
|
||||||
|
std::string getPackageString();
|
||||||
|
std::string getPackageVersionGit();
|
||||||
|
|
||||||
|
|
||||||
|
#endif //__VERSION_HAL_H__
|
||||||
|
|
@@ -37,7 +37,9 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
caps.has_HDMI = 1;
|
caps.has_HDMI = 1;
|
||||||
caps.has_SCART = 1;
|
caps.has_SCART = 1;
|
||||||
caps.display_xres = 4;
|
caps.display_xres = 4;
|
||||||
caps.can_set_display_brightness = 0;
|
caps.display_has_statusline = 0;
|
||||||
|
caps.display_can_deepstandby = 0;
|
||||||
|
caps.display_can_set_brightness = 0;
|
||||||
caps.force_tuner_2G = 1; /* I have patched the drivers to fix this, but not everyone has */
|
caps.force_tuner_2G = 1; /* I have patched the drivers to fix this, but not everyone has */
|
||||||
strcpy(caps.boxvendor, "SPARK");
|
strcpy(caps.boxvendor, "SPARK");
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
|
@@ -23,7 +23,9 @@ static hw_caps_t caps = {
|
|||||||
.display_type = HW_DISPLAY_GFX,
|
.display_type = HW_DISPLAY_GFX,
|
||||||
.display_xres = 128,
|
.display_xres = 128,
|
||||||
.display_yres = 64,
|
.display_yres = 64,
|
||||||
.can_set_display_brightness = 0,
|
.display_has_statusline = 0,
|
||||||
|
.display_can_deepstandby = 0;
|
||||||
|
.display_can_set_brightness = 0;
|
||||||
.boxvendor = "Armas",
|
.boxvendor = "Armas",
|
||||||
.boxname = "TripleDragon",
|
.boxname = "TripleDragon",
|
||||||
.boxarch = "ppc405"
|
.boxarch = "ppc405"
|
||||||
|
@@ -29,7 +29,9 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
||||||
caps.has_HDMI = 1;
|
caps.has_HDMI = 1;
|
||||||
caps.display_xres = 8;
|
caps.display_xres = 8;
|
||||||
caps.can_set_display_brightness = 0;
|
caps.display_has_statusline = 0;
|
||||||
|
caps.display_can_deepstandby = 0;
|
||||||
|
caps.display_can_set_brightness = 0;
|
||||||
strcpy(caps.boxvendor, "Raspberry");
|
strcpy(caps.boxvendor, "Raspberry");
|
||||||
strcpy(caps.boxname, "Pi");
|
strcpy(caps.boxname, "Pi");
|
||||||
if (! uname(&u))
|
if (! uname(&u))
|
||||||
|
Reference in New Issue
Block a user