mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
Compare commits
15 Commits
v0.2.0-gen
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
3ff02b06f2 | ||
|
da0d4290a3 | ||
|
9bd798def2 | ||
|
3869c32e82 | ||
|
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
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
|
2018-01-12 GetAway1 <get-away@t-online.de>
|
||||||
|
|
||||||
|
ShowPicture: return boolean expression
|
||||||
|
|
||||||
2017-11-02 Thilo Graf <dbt@novatux.de>
|
2017-11-02 Thilo Graf <dbt@novatux.de>
|
||||||
|
|
||||||
version 0.2.0-generic-pc
|
version 0.2.0-generic-pc
|
||||||
|
@@ -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];
|
||||||
|
@@ -351,13 +351,14 @@ void cVideo::SetVideoMode(analog_mode_t mode)
|
|||||||
proc_put("/proc/stb/avs/0/colorformat", m, strlen(m));
|
proc_put("/proc/stb/avs/0/colorformat", m, strlen(m));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::ShowPicture(const char * fname)
|
bool cVideo::ShowPicture(const char * fname)
|
||||||
{
|
{
|
||||||
vdec->ShowPicture(fname);
|
return vdec->ShowPicture(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VDec::ShowPicture(const char * fname)
|
bool VDec::ShowPicture(const char * fname)
|
||||||
{
|
{
|
||||||
|
bool ret = false;
|
||||||
lt_debug("%s(%s)\n", __func__, fname);
|
lt_debug("%s(%s)\n", __func__, fname);
|
||||||
char destname[512];
|
char destname[512];
|
||||||
char cmd[512];
|
char cmd[512];
|
||||||
@@ -369,18 +370,18 @@ void VDec::ShowPicture(const char * fname)
|
|||||||
{
|
{
|
||||||
/* does not work and the driver does not seem to like it */
|
/* does not work and the driver does not seem to like it */
|
||||||
lt_info("%s: video_standby == true\n", __func__);
|
lt_info("%s: video_standby == true\n", __func__);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
lt_info("%s: decoder not opened?\n", __func__);
|
lt_info("%s: decoder not opened\n", __func__);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
strcpy(destname, "/var/cache");
|
strcpy(destname, "/var/cache");
|
||||||
if (stat(fname, &st2))
|
if (stat(fname, &st2))
|
||||||
{
|
{
|
||||||
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
mkdir(destname, 0755);
|
mkdir(destname, 0755);
|
||||||
/* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg):
|
/* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg):
|
||||||
@@ -430,10 +431,11 @@ void VDec::ShowPicture(const char * fname)
|
|||||||
read(mfd, iframe, st.st_size);
|
read(mfd, iframe, st.st_size);
|
||||||
show_iframe(fd, iframe, st.st_size);
|
show_iframe(fd, iframe, st.st_size);
|
||||||
free(iframe);
|
free(iframe);
|
||||||
|
ret = true;
|
||||||
out:
|
out:
|
||||||
close(mfd);
|
close(mfd);
|
||||||
pthread_mutex_unlock(&stillp_mutex);
|
pthread_mutex_unlock(&stillp_mutex);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::StopPicture()
|
void cVideo::StopPicture()
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
int setBlank(int blank);
|
int setBlank(int blank);
|
||||||
int SetStreamType(VIDEO_FORMAT type);
|
int SetStreamType(VIDEO_FORMAT type);
|
||||||
void SetSyncMode(AVSYNC_TYPE mode);
|
void SetSyncMode(AVSYNC_TYPE mode);
|
||||||
void ShowPicture(const char * fname);
|
bool ShowPicture(const char * fname);
|
||||||
void Standby(unsigned int bOn);
|
void Standby(unsigned int bOn);
|
||||||
void Pig(int x, int y, int w, int h, int osd_w, int osd_h);
|
void Pig(int x, int y, int w, int h, int osd_w, int osd_h);
|
||||||
|
|
||||||
|
@@ -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
|
||||||
|
51
common/version_hal.cpp
Normal file
51
common/version_hal.cpp
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* (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>
|
||||||
|
|
||||||
|
|
||||||
|
void hal_get_lib_version(hal_libversion_t *ver)
|
||||||
|
{
|
||||||
|
if (!ver)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//init struct
|
||||||
|
*ver = {"",0,0,0,"","",""};
|
||||||
|
|
||||||
|
#ifdef VERSION
|
||||||
|
ver->vVersion = VERSION;
|
||||||
|
#endif
|
||||||
|
#ifdef PACKAGE_VERSION_MAJOR
|
||||||
|
ver->vMajor = PACKAGE_VERSION_MAJOR;
|
||||||
|
#endif
|
||||||
|
#ifdef PACKAGE_VERSION_MAJOR
|
||||||
|
ver->vMinor = PACKAGE_VERSION_MINOR;
|
||||||
|
#endif
|
||||||
|
#ifdef PACKAGE_VERSION_MINOR
|
||||||
|
ver->vPatch = PACKAGE_VERSION_MICRO;
|
||||||
|
#endif
|
||||||
|
#ifdef PACKAGE_NAME
|
||||||
|
ver->vName = PACKAGE_NAME;
|
||||||
|
#endif
|
||||||
|
#ifdef PACKAGE_STRING
|
||||||
|
ver->vStr = PACKAGE_STRING;
|
||||||
|
#endif
|
||||||
|
#ifdef PACKAGE_VERSION_GIT
|
||||||
|
ver->vGitDescribe = PACKAGE_VERSION_GIT;
|
||||||
|
#endif
|
||||||
|
}
|
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([libstb-hal-config.h:config.h.in])
|
||||||
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))
|
||||||
|
@@ -282,16 +282,17 @@ void cVideo::SetVideoMode(analog_mode_t)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::ShowPicture(const char *fname)
|
bool cVideo::ShowPicture(const char *fname)
|
||||||
{
|
{
|
||||||
vdec->ShowPicture(fname);
|
return vdec->ShowPicture(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VDec::ShowPicture(const char *fname)
|
bool VDec::ShowPicture(const char *fname)
|
||||||
{
|
{
|
||||||
|
bool ret = false;
|
||||||
lt_info("%s(%s)\n", __func__, fname);
|
lt_info("%s(%s)\n", __func__, fname);
|
||||||
if (access(fname, R_OK))
|
if (access(fname, R_OK))
|
||||||
return;
|
return ret;
|
||||||
still_m.lock();
|
still_m.lock();
|
||||||
stillpicture = true;
|
stillpicture = true;
|
||||||
buf_num = 0;
|
buf_num = 0;
|
||||||
@@ -312,7 +313,7 @@ void VDec::ShowPicture(const char *fname)
|
|||||||
|
|
||||||
if (avformat_open_input(&avfc, fname, NULL, NULL) < 0) {
|
if (avformat_open_input(&avfc, fname, NULL, NULL) < 0) {
|
||||||
lt_info("%s: Could not open file %s\n", __func__, fname);
|
lt_info("%s: Could not open file %s\n", __func__, fname);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avformat_find_stream_info(avfc, NULL) < 0) {
|
if (avformat_find_stream_info(avfc, NULL) < 0) {
|
||||||
@@ -385,6 +386,7 @@ void VDec::ShowPicture(const char *fname)
|
|||||||
buf_num--;
|
buf_num--;
|
||||||
}
|
}
|
||||||
buf_m.unlock();
|
buf_m.unlock();
|
||||||
|
ret = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
av_packet_unref(&avpkt);
|
av_packet_unref(&avpkt);
|
||||||
@@ -396,6 +398,7 @@ void VDec::ShowPicture(const char *fname)
|
|||||||
out_close:
|
out_close:
|
||||||
avformat_close_input(&avfc);
|
avformat_close_input(&avfc);
|
||||||
lt_debug("%s(%s) end\n", __func__, fname);
|
lt_debug("%s(%s) end\n", __func__, fname);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::StopPicture()
|
void cVideo::StopPicture()
|
||||||
|
@@ -80,7 +80,7 @@ class VDec : public OpenThreads::Thread
|
|||||||
int Stop(bool blank = true);
|
int Stop(bool blank = true);
|
||||||
|
|
||||||
int SetStreamType(VIDEO_FORMAT type);
|
int SetStreamType(VIDEO_FORMAT type);
|
||||||
void ShowPicture(const char * fname);
|
bool ShowPicture(const char * fname);
|
||||||
void Pig(int x, int y, int w, int h);
|
void Pig(int x, int y, int w, int h);
|
||||||
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);
|
||||||
SWFramebuffer *getDecBuf(void);
|
SWFramebuffer *getDecBuf(void);
|
||||||
|
@@ -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();
|
||||||
|
22
include/version_hal.h
Normal file
22
include/version_hal.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef __VERSION_HAL_H__
|
||||||
|
#define __VERSION_HAL_H__
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
// library version functions
|
||||||
|
typedef struct hal_libversion_t
|
||||||
|
{
|
||||||
|
std::string vVersion;
|
||||||
|
int vMajor;
|
||||||
|
int vMinor;
|
||||||
|
int vPatch;;
|
||||||
|
std::string vName;
|
||||||
|
std::string vStr;
|
||||||
|
std::string vGitDescribe;
|
||||||
|
} hal_libversion_struct_t;
|
||||||
|
|
||||||
|
void hal_get_lib_version(hal_libversion_t *ver);
|
||||||
|
|
||||||
|
|
||||||
|
#endif //__VERSION_HAL_H__
|
||||||
|
|
@@ -189,7 +189,7 @@ class cVideo
|
|||||||
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; };
|
||||||
void ShowPicture(const char * fname);
|
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);
|
||||||
|
@@ -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;
|
||||||
|
@@ -394,13 +394,14 @@ void cVideo::SetVideoMode(analog_mode_t mode)
|
|||||||
proc_put("/proc/stb/avs/0/colorformat", m, strlen(m));
|
proc_put("/proc/stb/avs/0/colorformat", m, strlen(m));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::ShowPicture(const char * fname)
|
bool cVideo::ShowPicture(const char * fname)
|
||||||
{
|
{
|
||||||
vdec->ShowPicture(fname);
|
return vdec->ShowPicture(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VDec::ShowPicture(const char * fname)
|
bool VDec::ShowPicture(const char * fname)
|
||||||
{
|
{
|
||||||
|
bool ret = false;
|
||||||
lt_debug("%s(%s)\n", __func__, fname);
|
lt_debug("%s(%s)\n", __func__, fname);
|
||||||
char destname[512];
|
char destname[512];
|
||||||
char cmd[512];
|
char cmd[512];
|
||||||
@@ -411,13 +412,19 @@ void VDec::ShowPicture(const char * fname)
|
|||||||
{
|
{
|
||||||
/* does not work and the driver does not seem to like it */
|
/* does not work and the driver does not seem to like it */
|
||||||
lt_info("%s: video_standby == true\n", __func__);
|
lt_info("%s: video_standby == true\n", __func__);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (fd == -1)
|
||||||
|
{
|
||||||
|
lt_info("%s: decoder not opened\n", __func__);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
strcpy(destname, "/var/cache");
|
strcpy(destname, "/var/cache");
|
||||||
if (stat(fname, &st2))
|
if (stat(fname, &st2))
|
||||||
{
|
{
|
||||||
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
mkdir(destname, 0755);
|
mkdir(destname, 0755);
|
||||||
/* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg):
|
/* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg):
|
||||||
@@ -470,10 +477,11 @@ void VDec::ShowPicture(const char * fname)
|
|||||||
video_still_picture sp = { iframe, st.st_size };
|
video_still_picture sp = { iframe, st.st_size };
|
||||||
fop(ioctl, VIDEO_STILLPICTURE, &sp);
|
fop(ioctl, VIDEO_STILLPICTURE, &sp);
|
||||||
free(iframe);
|
free(iframe);
|
||||||
|
ret = true;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
close(mfd);
|
close(mfd);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::StopPicture()
|
void cVideo::StopPicture()
|
||||||
|
@@ -46,7 +46,7 @@ public:
|
|||||||
int Stop(bool blank = true);
|
int Stop(bool blank = true);
|
||||||
int SetStreamType(VIDEO_FORMAT type);
|
int SetStreamType(VIDEO_FORMAT type);
|
||||||
void SetSyncMode(AVSYNC_TYPE mode);
|
void SetSyncMode(AVSYNC_TYPE mode);
|
||||||
void ShowPicture(const char * fname);
|
bool ShowPicture(const char * fname);
|
||||||
void Standby(unsigned int bOn);
|
void Standby(unsigned int bOn);
|
||||||
|
|
||||||
/* used internally by dmx */
|
/* used internally by dmx */
|
||||||
|
@@ -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"
|
||||||
|
@@ -75,7 +75,7 @@ public:
|
|||||||
|
|
||||||
/* set video_system */
|
/* set video_system */
|
||||||
int SetVideoSystem(int video_system, bool remember = true);
|
int SetVideoSystem(int video_system, bool remember = true);
|
||||||
void ShowPicture(const char * fname);
|
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);
|
void Pig(int x, int y, int w, int h);
|
||||||
|
@@ -469,13 +469,14 @@ void VDec::SetVideoMode(analog_mode_t mode)
|
|||||||
fop(ioctl, MPEG_VID_SET_OUTFMT, outputformat);
|
fop(ioctl, MPEG_VID_SET_OUTFMT, outputformat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::ShowPicture(const char * fname)
|
bool cVideo::ShowPicture(const char * fname)
|
||||||
{
|
{
|
||||||
_vdec->ShowPicture(fname);
|
return _vdec->ShowPicture(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VDec::ShowPicture(const char * fname)
|
bool VDec::ShowPicture(const char * fname)
|
||||||
{
|
{
|
||||||
|
bool ret = false;
|
||||||
lt_debug("%s(%s)\n", __FUNCTION__, fname);
|
lt_debug("%s(%s)\n", __FUNCTION__, fname);
|
||||||
char destname[512];
|
char destname[512];
|
||||||
char cmd[512];
|
char cmd[512];
|
||||||
@@ -487,7 +488,7 @@ void VDec::ShowPicture(const char * fname)
|
|||||||
if (stat(fname, &st2))
|
if (stat(fname, &st2))
|
||||||
{
|
{
|
||||||
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
mkdir(destname, 0755);
|
mkdir(destname, 0755);
|
||||||
/* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg):
|
/* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg):
|
||||||
@@ -542,13 +543,14 @@ void VDec::ShowPicture(const char * fname)
|
|||||||
/* writing twice seems to be more reliable */
|
/* writing twice seems to be more reliable */
|
||||||
fop(ioctl, MPEG_VID_STILLP_WRITE, &buf);
|
fop(ioctl, MPEG_VID_STILLP_WRITE, &buf);
|
||||||
fop(ioctl, MPEG_VID_STILLP_WRITE, &buf);
|
fop(ioctl, MPEG_VID_STILLP_WRITE, &buf);
|
||||||
|
ret = true;
|
||||||
}
|
}
|
||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
close(mfd);
|
close(mfd);
|
||||||
out:
|
out:
|
||||||
pthread_mutex_unlock(&stillp_mutex);
|
pthread_mutex_unlock(&stillp_mutex);
|
||||||
return;
|
return ret;
|
||||||
#if 0
|
#if 0
|
||||||
/* DirectFB based picviewer: works, but is slow and the infobar
|
/* DirectFB based picviewer: works, but is slow and the infobar
|
||||||
draws in the same plane */
|
draws in the same plane */
|
||||||
|
@@ -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))
|
||||||
|
@@ -129,11 +129,11 @@ void cVideo::SetVideoMode(analog_mode_t)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::ShowPicture(const char *fname)
|
bool cVideo::ShowPicture(const char *fname)
|
||||||
{
|
{
|
||||||
lt_info("%s(%s)\n", __func__, fname);
|
lt_info("%s(%s)\n", __func__, fname);
|
||||||
if (access(fname, R_OK))
|
if (access(fname, R_OK))
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVideo::StopPicture()
|
void cVideo::StopPicture()
|
||||||
|
Reference in New Issue
Block a user