11 Commits

Author SHA1 Message Date
Thilo Graf
ed8e3743d5 version_hal.cpp/h: add methodes to get package data 2019-01-01 16:03:12 +01:00
Thilo Graf
bc9eca8588 configure: add additional config header
config.h was not usable with neutrino.
2018-12-31 11:21:41 +01:00
Thilo Graf
1e47a62926 .gitignore: ignore some unneeded config and local stuff
picked from mpx branch
2018-12-31 11:20:31 +01:00
Jacek Jendrzej
4fecdd558a fix generic compil 2018-12-01 12:35:02 +01:00
Jacek Jendrzej
2e8aa93895 add getFD 2018-02-17 13:28:03 +01:00
Jacek Jendrzej
8d6b3f71c0 add dumb functions for streaminfo2 compil 2017-12-13 17:26:57 +01:00
Jacek Jendrzej
2673ba0940 fix possible segfault 2017-12-07 11:39:27 +01:00
Jacek Jendrzej
78b3403303 fix generic compil 2017-12-07 11:13:28 +01:00
Jacek Jendrzej
dd01a95ddb Revert "remove unused"
This reverts commit 3f9525e42e.
2017-11-03 19:57:28 +01:00
Jacek Jendrzej
3f9525e42e remove unused 2017-11-03 19:01:09 +01:00
Jacek Jendrzej
a47c399a19 fix generic build 2017-11-03 18:27:35 +01:00
16 changed files with 145 additions and 13 deletions

3
.gitignore vendored
View File

@@ -4,8 +4,11 @@ Makefile.in
/config.guess
/config.h.in
/config.sub
*/*-config.h
*/*-config.h.in
/configure
/compile
*.directory
/depcomp
/install-sh
/ltmain.sh

View File

@@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libstb-hal.la
libstb_hal_la_SOURCES =
SUBDIRS = common tools
bin_PROGRAMS = libstb-hal-test
#bin_PROGRAMS = libstb-hal-test
libstb_hal_la_LIBADD = \
common/libcommon.la
@@ -59,5 +59,5 @@ pkginclude_HEADERS = \
include/playback_hal.h \
include/pwrmngr.h \
include/record_hal.h \
include/video_cs.h \
include/video_hal.h
include/version_hal.h \
include/video_cs.h

View File

@@ -30,7 +30,9 @@ hw_caps_t *get_hwcaps(void)
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.has_HDMI = 1;
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");
const char *tmp;
char buf[64];

View File

@@ -9,4 +9,5 @@ libcommon_la_SOURCES = \
ca.cpp \
lt_debug.c \
proc_tools.c \
pwrmngr.cpp
pwrmngr.cpp \
version_hal.cpp

55
common/version_hal.cpp Normal file
View 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;
}

View File

@@ -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
AC_CONFIG_HEADERS([include/libstb-hal-config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_CONFIG_MACRO_DIR([m4])
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_DIRECTORY
TUXBOX_BOXTYPE

View File

@@ -438,7 +438,8 @@ void ADec::run()
adevice = ao_open_live(driver, &sformat, NULL);
ai = ao_driver_info(driver);
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);
if(ai)
lt_info("libao driver: %d name '%s' short '%s' author '%s'\n",
driver, ai->name, ai->short_name, ai->author);
}

View File

@@ -28,7 +28,10 @@ hw_caps_t *get_hwcaps(void)
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.has_HDMI = 1;
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.boxname, "PC");
if (! uname(&u))

View File

@@ -7,6 +7,10 @@
#include <stdint.h>
#include "cs_types.h"
#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>::iterator CaIdVectorIterator;
typedef std::vector<u16>::const_iterator CaIdVectorConstIterator;
@@ -92,6 +96,8 @@ public:
static cCA *GetInstance(void);
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, 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);
void SetInitMask(enum CA_INIT_MASK InitMask);
int GetCAIDS(CaIdVector & /*Caids*/) { return 0; };

View File

@@ -81,6 +81,7 @@ public:
static int GetSource(int unit);
cDemux(int num = 0);
~cDemux();
int getFD(void) { return fd; }; /* needed by cPlayback class */
private:
void removePid(unsigned short Pid); /* needed by cRecord class */
int num;

View File

@@ -36,7 +36,10 @@ typedef struct hw_caps
display_type_t display_type;
int display_xres; /* x resolution or chars per line */
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 boxname[64];
char boxarch[64];

View File

@@ -22,6 +22,10 @@
#include <stdint.h>
#include <vector>
extern "C" {
#include <libavformat/avformat.h>
}
/*
* This is actually the max number that could be returned by
* FindAllPids() / FindAllSubs().
@@ -49,6 +53,7 @@ public:
bool GetPosition(int &position, int &duration);
bool SetPosition(int position, bool absolute = false);
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);
bool SelectSubtitles(int pid, std::string charset = "");
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 &current);
void SetTitle(int title);
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();

16
include/version_hal.h Normal file
View 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__

View File

@@ -37,7 +37,9 @@ hw_caps_t *get_hwcaps(void)
caps.has_HDMI = 1;
caps.has_SCART = 1;
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 */
strcpy(caps.boxvendor, "SPARK");
const char *tmp;

View File

@@ -23,7 +23,9 @@ static hw_caps_t caps = {
.display_type = HW_DISPLAY_GFX,
.display_xres = 128,
.display_yres = 64,
.can_set_display_brightness = 0,
.display_has_statusline = 0,
.display_can_deepstandby = 0;
.display_can_set_brightness = 0;
.boxvendor = "Armas",
.boxname = "TripleDragon",
.boxarch = "ppc405"

View File

@@ -29,7 +29,9 @@ hw_caps_t *get_hwcaps(void)
caps.display_type = HW_DISPLAY_LINE_TEXT;
caps.has_HDMI = 1;
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.boxname, "Pi");
if (! uname(&u))