mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
Compare commits
4 Commits
v0.2.1-gen
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
3ff02b06f2 | ||
|
da0d4290a3 | ||
|
9bd798def2 | ||
|
3869c32e82 |
@@ -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>
|
||||
|
||||
version 0.2.0-generic-pc
|
||||
|
@@ -351,13 +351,14 @@ void cVideo::SetVideoMode(analog_mode_t mode)
|
||||
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);
|
||||
char destname[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 */
|
||||
lt_info("%s: video_standby == true\n", __func__);
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
if (fd < 0)
|
||||
{
|
||||
lt_info("%s: decoder not opened?\n", __func__);
|
||||
return;
|
||||
lt_info("%s: decoder not opened\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
strcpy(destname, "/var/cache");
|
||||
if (stat(fname, &st2))
|
||||
{
|
||||
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
mkdir(destname, 0755);
|
||||
/* 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);
|
||||
show_iframe(fd, iframe, st.st_size);
|
||||
free(iframe);
|
||||
ret = true;
|
||||
out:
|
||||
close(mfd);
|
||||
pthread_mutex_unlock(&stillp_mutex);
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void cVideo::StopPicture()
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
int setBlank(int blank);
|
||||
int SetStreamType(VIDEO_FORMAT type);
|
||||
void SetSyncMode(AVSYNC_TYPE mode);
|
||||
void ShowPicture(const char * fname);
|
||||
bool ShowPicture(const char * fname);
|
||||
void Standby(unsigned int bOn);
|
||||
void Pig(int x, int y, int w, int h, int osd_w, int osd_h);
|
||||
|
||||
|
@@ -19,37 +19,33 @@
|
||||
#include <version_hal.h>
|
||||
|
||||
|
||||
std::string getPackageVersion()
|
||||
void hal_get_lib_version(hal_libversion_t *ver)
|
||||
{
|
||||
return PACKAGE_VERSION;
|
||||
}
|
||||
if (!ver)
|
||||
return;
|
||||
|
||||
int getPackageVersionMajor()
|
||||
{
|
||||
return PACKAGE_VERSION_MAJOR;
|
||||
}
|
||||
//init struct
|
||||
*ver = {"",0,0,0,"","",""};
|
||||
|
||||
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;
|
||||
#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
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ define(ver_git, m4_esyscmd([
|
||||
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])
|
||||
AC_CONFIG_HEADERS([libstb-hal-config.h:config.h.in])
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_GNU_SOURCE
|
||||
|
@@ -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);
|
||||
if (access(fname, R_OK))
|
||||
return;
|
||||
return ret;
|
||||
still_m.lock();
|
||||
stillpicture = true;
|
||||
buf_num = 0;
|
||||
@@ -312,7 +313,7 @@ void VDec::ShowPicture(const char *fname)
|
||||
|
||||
if (avformat_open_input(&avfc, fname, NULL, NULL) < 0) {
|
||||
lt_info("%s: Could not open file %s\n", __func__, fname);
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (avformat_find_stream_info(avfc, NULL) < 0) {
|
||||
@@ -385,6 +386,7 @@ void VDec::ShowPicture(const char *fname)
|
||||
buf_num--;
|
||||
}
|
||||
buf_m.unlock();
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
av_packet_unref(&avpkt);
|
||||
@@ -396,6 +398,7 @@ void VDec::ShowPicture(const char *fname)
|
||||
out_close:
|
||||
avformat_close_input(&avfc);
|
||||
lt_debug("%s(%s) end\n", __func__, fname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void cVideo::StopPicture()
|
||||
|
@@ -80,7 +80,7 @@ class VDec : public OpenThreads::Thread
|
||||
int Stop(bool blank = true);
|
||||
|
||||
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);
|
||||
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);
|
||||
|
@@ -3,13 +3,19 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string getPackageVersion();
|
||||
int getPackageVersionMajor();
|
||||
int getPackageVersionMinor();
|
||||
int getPackageVersionMicro();
|
||||
std::string getPackagenName();
|
||||
std::string getPackageString();
|
||||
std::string getPackageVersionGit();
|
||||
// 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; };
|
||||
void SetCECAutoView(bool) { return; };
|
||||
void SetCECAutoStandby(bool) { return; };
|
||||
void ShowPicture(const char * fname);
|
||||
bool ShowPicture(const char * fname);
|
||||
void StopPicture();
|
||||
void Standby(unsigned int bOn);
|
||||
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);
|
||||
|
@@ -394,13 +394,14 @@ void cVideo::SetVideoMode(analog_mode_t mode)
|
||||
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);
|
||||
char destname[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 */
|
||||
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");
|
||||
if (stat(fname, &st2))
|
||||
{
|
||||
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
mkdir(destname, 0755);
|
||||
/* 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 };
|
||||
fop(ioctl, VIDEO_STILLPICTURE, &sp);
|
||||
free(iframe);
|
||||
ret = true;
|
||||
}
|
||||
out:
|
||||
close(mfd);
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void cVideo::StopPicture()
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
int Stop(bool blank = true);
|
||||
int SetStreamType(VIDEO_FORMAT type);
|
||||
void SetSyncMode(AVSYNC_TYPE mode);
|
||||
void ShowPicture(const char * fname);
|
||||
bool ShowPicture(const char * fname);
|
||||
void Standby(unsigned int bOn);
|
||||
|
||||
/* used internally by dmx */
|
||||
|
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
/* set video_system */
|
||||
int SetVideoSystem(int video_system, bool remember = true);
|
||||
void ShowPicture(const char * fname);
|
||||
bool ShowPicture(const char * fname);
|
||||
void StopPicture();
|
||||
void Standby(unsigned int bOn);
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
char destname[512];
|
||||
char cmd[512];
|
||||
@@ -487,7 +488,7 @@ void VDec::ShowPicture(const char * fname)
|
||||
if (stat(fname, &st2))
|
||||
{
|
||||
lt_info("%s: could not stat %s (%m)\n", __func__, fname);
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
mkdir(destname, 0755);
|
||||
/* 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 */
|
||||
fop(ioctl, MPEG_VID_STILLP_WRITE, &buf);
|
||||
fop(ioctl, MPEG_VID_STILLP_WRITE, &buf);
|
||||
ret = true;
|
||||
}
|
||||
free(data);
|
||||
}
|
||||
close(mfd);
|
||||
out:
|
||||
pthread_mutex_unlock(&stillp_mutex);
|
||||
return;
|
||||
return ret;
|
||||
#if 0
|
||||
/* DirectFB based picviewer: works, but is slow and the infobar
|
||||
draws in the same plane */
|
||||
|
@@ -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);
|
||||
if (access(fname, R_OK))
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
void cVideo::StopPicture()
|
||||
|
Reference in New Issue
Block a user