sync with seife

This commit is contained in:
martii
2013-06-19 12:41:13 +02:00
20 changed files with 129 additions and 34 deletions

View File

@@ -1,8 +1,8 @@
INCLUDES = \
-I$(top_srcdir)/common
noinst_LTLIBRARIES = libazbox.la
AM_CPPFLAGS = \
-I$(top_srcdir)/common
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_LDFLAGS = -lpthread

View File

@@ -43,10 +43,10 @@ extern cVideo *videoDecoder;
#define dmx_err(_errfmt, _errstr, _revents) do { \
uint16_t _pid = (uint16_t)-1; uint16_t _f = 0;\
if (dmx_type == DMX_PES_CHANNEL) { \
_pid = p_flt.pid; \
} else if (dmx_type == DMX_PSI_CHANNEL) { \
if (dmx_type == DMX_PSI_CHANNEL) { \
_pid = s_flt.pid; _f = s_flt.filter.filter[0]; \
} else { \
_pid = p_flt.pid; \
}; \
lt_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
__func__, _errstr, fd, _revents, DMX_T[dmx_type], _pid, _f); \

View File

@@ -336,7 +336,7 @@ bool cPlayback::SetAPid(unsigned short pid, int /*ac3*/)
return true;
}
bool cPlayback::SetSPid(int pid)
bool cPlayback::SelectSubtitles(int pid)
{
lt_info("%s: pid %i\n", __func__, pid);
if (pid != subpid)
@@ -464,7 +464,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
}
}
void cPlayback::FindAllSPids(int *spids, uint16_t *numpids, std::string *language)
void cPlayback::FindAllSubs(uint16_t *spids, unsigned short *supported, uint16_t *numpids, std::string *language)
{
lt_info("%s\n", __func__);
char buf[32];
@@ -487,6 +487,7 @@ void cPlayback::FindAllSPids(int *spids, uint16_t *numpids, std::string *languag
spu_lang[20] = '\0';
spids[sid] = atoi(streamidstring);
language[sid] = spu_lang;
supported[sid] = 1;
lt_info("%s: #%d apid:%d lang: %s\n", __func__, sid, spids[sid], spu_lang);
}
}
@@ -496,6 +497,13 @@ void cPlayback::FindAllSPids(int *spids, uint16_t *numpids, std::string *languag
language[spu_count] = "Disable";
}
/* DVD support is not yet ready... */
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
{
positions.clear();
titles.clear();
}
cPlayback::cPlayback(int /*num*/)
{
lt_info("%s: constructor\n", __func__);

View File

@@ -3,6 +3,7 @@
#include <string>
#include <stdint.h>
#include <vector>
typedef enum {
PLAYMODE_TS = 0,
@@ -42,9 +43,9 @@ class cPlayback
bool GetPosition(int &position, int &duration); /* pos: current time in ms, dur: file length in ms */
bool SetPosition(int position, bool absolute = false); /* position: jump in ms */
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
// AZbox specific
void FindAllSPids(int *spids, uint16_t *numpids, std::string *language);
bool SetSPid(int pid);
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
bool SelectSubtitles(int pid);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
#if 0
// Functions that are not used by movieplayer.cpp:
bool Stop(void);

View File

@@ -1,5 +1,5 @@
AC_INIT(libstb-hal,0.1.1)
AM_INIT_AUTOMAKE(libstb-hal,0.1.1)
AC_INIT([libstb-hal], [0.1.1])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_CONFIG_MACRO_DIR([m4])
AC_GNU_SOURCE

View File

@@ -1,9 +1,9 @@
INCLUDES = \
-I$(top_srcdir)/common
noinst_LTLIBRARIES = libgeneric.la
AM_CPPFLAGS = -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
AM_CPPFLAGS += \
-I$(top_srcdir)/common
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_LDFLAGS = \

View File

@@ -35,16 +35,20 @@
#include "dmx_lib.h"
#include "lt_debug.h"
/* needed for getSTC :-( */
#include "video_lib.h"
extern cVideo *videoDecoder;
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_DEMUX, this, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_DEMUX, this, args)
#define lt_info_c(args...) _lt_info(TRIPLE_DEBUG_DEMUX, NULL, args)
#define dmx_err(_errfmt, _errstr, _revents) do { \
uint16_t _pid = (uint16_t)-1; uint16_t _f = 0;\
if (dmx_type == DMX_PES_CHANNEL) { \
_pid = p_flt.pid; \
} else if (dmx_type == DMX_PSI_CHANNEL) { \
if (dmx_type == DMX_PSI_CHANNEL) { \
_pid = s_flt.pid; _f = s_flt.filter.filter[0]; \
} else { \
_pid = p_flt.pid; \
}; \
lt_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
__func__, _errstr, fd, _revents, DMX_T[dmx_type], _pid, _f); \
@@ -120,7 +124,9 @@ bool cDemux::Open(DMX_CHANNEL_TYPE pes_type, void * /*hVideoBuffer*/, int uBuffe
num, DMX_T[pes_type], pes_type, uBufferSize, fd);
if (dmx_type == DMX_VIDEO_CHANNEL)
uBufferSize = 0x40000;
uBufferSize = 0x100000; /* 1MB */
if (dmx_type == DMX_AUDIO_CHANNEL)
uBufferSize = 0x10000; /* 64k */
#if 0
if (!pesfds.empty())
{
@@ -472,6 +478,8 @@ void cDemux::removePid(unsigned short Pid)
void cDemux::getSTC(int64_t * STC)
{
int64_t pts = 0;
if (videoDecoder)
pts = videoDecoder->GetPTS();
*STC = pts;
}

View File

@@ -26,6 +26,12 @@ bool cPlayback::SetAPid(unsigned short pid, bool /*ac3*/)
return true;
}
bool cPlayback::SelectSubtitles(int pid)
{
printf("%s:%s pid %i\n", FILENAME, __func__, pid);
return true;
}
bool cPlayback::SetSpeed(int speed)
{
printf("%s:%s playing %d speed %d\n", FILENAME, __func__, playing, speed);
@@ -99,6 +105,18 @@ unsigned short cPlayback::GetTeletextPid(void)
{
}
void cPlayback::FindAllSubs(uint16_t *, unsigned short *, uint16_t *numpida, std::string *)
{
printf("%s:%s\n", FILENAME, __func__);
*numpida = 0;
}
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
{
positions.clear();
titles.clear();
}
cPlayback::cPlayback(int /*num*/)
{
printf("%s:%s\n", FILENAME, __func__);

View File

@@ -3,6 +3,7 @@
#include <string>
#include <stdint.h>
#include <vector>
typedef enum {
PLAYMODE_TS = 0,
@@ -43,6 +44,9 @@ class cPlayback
void FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpidt, std::string *tlanguage);
void RequestAbort(void);
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
bool SelectSubtitles(int pid);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
//
cPlayback(int num = 0);
~cPlayback();

View File

@@ -650,3 +650,13 @@ bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool ge
return true;
}
int64_t cVideo::GetPTS(void)
{
int64_t pts = 0;
buf_m.lock();
if (buf_num != 0)
pts = buffers[buf_out].pts();
buf_m.unlock();
return pts;
}

View File

@@ -122,6 +122,7 @@ typedef enum
class cVideo : public OpenThreads::Thread
{
friend class GLFramebuffer;
friend class cDemux;
private:
/* called from GL thread */
class SWFramebuffer : public std::vector<unsigned char>
@@ -143,6 +144,7 @@ class cVideo : public OpenThreads::Thread
AVRational mAR;
};
int buf_in, buf_out, buf_num;
int64_t GetPTS(void);
public:
/* constructor & destructor */
cVideo(int mode, void *, void *);

View File

@@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libeplayer3.la
CXXFLAGS = -Wall
INCLUDES = \
AM_CPPFLAGS = \
-I$(srcdir)/include
libeplayer3_la_SOURCES = \

View File

@@ -1,9 +1,9 @@
INCLUDES = \
noinst_LTLIBRARIES = libspark.la
AM_CPPFLAGS = \
-I$(top_srcdir)/common \
-I$(top_srcdir)/libeplayer3/include
noinst_LTLIBRARIES = libspark.la
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_LDFLAGS = -lpthread -lasound -lass \
@AVFORMAT_LIBS@ \

View File

@@ -78,10 +78,10 @@ extern cVideo *videoDecoder;
#define dmx_err(_errfmt, _errstr, _revents) do { \
uint16_t _pid = (uint16_t)-1; uint16_t _f = 0;\
if (dmx_type == DMX_PES_CHANNEL) { \
_pid = p_flt.pid; \
} else if (dmx_type == DMX_PSI_CHANNEL) { \
if (dmx_type == DMX_PSI_CHANNEL) { \
_pid = s_flt.pid; _f = s_flt.filter.filter[0]; \
} else { \
_pid = p_flt.pid; \
}; \
lt_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
__func__, _errstr, fd, _revents, DMX_T[dmx_type], _pid, _f); \

View File

@@ -667,6 +667,26 @@ unsigned short cPlayback::GetTeletextPid(void)
return (unsigned short)pid;
}
/* dummy functions for subtitles */
void cPlayback::FindAllSubs(uint16_t * /*pids*/, unsigned short * /*supp*/, uint16_t *num, std::string * /*lang*/)
{
*num = 0;
}
bool cPlayback::SelectSubtitles(int pid)
{
printf("%s:%s pid %d\n", FILENAME, __func__, pid);
return false;
}
/* another dummy function for DVD playback(?) */
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
{
positions.clear();
titles.clear();
}
//
cPlayback::cPlayback(int num __attribute__((unused)), void (*fbcb)(unsigned char **, unsigned int *, unsigned int *, unsigned int *, int *))
{
printf("%s:%s\n", FILENAME, __FUNCTION__);

View File

@@ -2,6 +2,7 @@
#define __HAL_PLAYBACK_H
#include <string>
#include <vector>
typedef enum {
PLAYMODE_TS = 0,
@@ -45,8 +46,10 @@ class cPlayback
void FindAllSubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language);
void FindAllDvbsubtitlePids(uint16_t *pids, uint16_t *numpids, std::string *language);
void FindAllTeletextsubtitlePids(uint16_t *pids, uint16_t *numpidt, std::string *tlanguage);
void RequestAbort(void);
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
bool SelectSubtitles(int pid);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
#if 0
// Functions that are not used by movieplayer.cpp:
bool GetOffset(off64_t &offset);

View File

@@ -1,9 +1,9 @@
INCLUDES = \
noinst_LTLIBRARIES = libtriple.la
AM_CPPFLAGS = \
-I$(top_srcdir)/common \
@DIRECTFB_CFLAGS@
noinst_LTLIBRARIES = libtriple.la
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
AM_LDFLAGS = \
@DIRECTFB_LIBS@

View File

@@ -40,10 +40,10 @@ extern cVideo *videoDecoder;
#define dmx_err(_errfmt, _errstr, _revents) do { \
uint16_t _pid = (uint16_t)-1; uint16_t _f = 0;\
if (dmx_type == DMX_PES_CHANNEL) { \
_pid = p_flt.pid; \
} else if (dmx_type == DMX_PSI_CHANNEL) { \
if (dmx_type == DMX_PSI_CHANNEL) { \
_pid = s_flt.pid; _f = s_flt.filter[0]; \
} else { \
_pid = p_flt.pid; \
}; \
lt_info("%s " _errfmt " fd:%d, ev:0x%x %s pid:0x%04hx flt:0x%02hx\n", \
__func__, _errstr, fd, _revents, DMX_T[dmx_type], _pid, _f); \

View File

@@ -576,6 +576,24 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
*numpida = i;
}
/* it is unlikely that subtitle support will be implemented soon */
void cPlayback::FindAllSubs(uint16_t *, unsigned short *, uint16_t *num, std::string *)
{
*num = 0;
}
bool cPlayback::SelectSubtitles(int)
{
return false;
}
/* DVD support is also unlikely... */
void cPlayback::GetChapters(std::vector<int> &positions, std::vector<std::string> &titles)
{
positions.clear();
titles.clear();
}
off_t cPlayback::seek_to_pts(int64_t pts)
{
off_t newpos = curr_pos;

View File

@@ -109,6 +109,9 @@ class cPlayback
bool GetPosition(int &position, int &duration); /* pos: current time in ms, dur: file length in ms */
bool SetPosition(int position, bool absolute = false); /* position: jump in ms */
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
bool SelectSubtitles(int pid);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
#if 0
// Functions that are not used by movieplayer.cpp:
bool Stop(void);