spark: use libeplayer3 for playback

This commit is contained in:
Stefan Seyfried
2012-02-15 00:16:11 +01:00
parent ebf92d82ec
commit 4e3773c568
7 changed files with 33 additions and 26 deletions

View File

@@ -39,7 +39,7 @@ libstb_hal_a_LIBADD += \
libspark/init.o \
libspark/irmp.o \
libspark/lirmp_input.o \
libspark/playback.o \
libspark/playback_libeplayer3.o \
libspark/pwrmngr.o \
libspark/record.o \
libspark/video.o

View File

@@ -2,7 +2,7 @@
#if HAVE_TRIPLEDRAGON
#include "../libtriple/playback_td.h"
#elif HAVE_SPARK_HARDWARE
#include "../libspark/playback_lib.h"
#include "../libspark/playback_libeplayer3.h"
#else
#error neither HAVE_TRIPLEDRAGON nor HAVE_SPARK_HARDWARE defined
#endif

View File

@@ -1,5 +1,6 @@
INCLUDES = \
-I$(top_srcdir)/common
-I$(top_srcdir)/common \
-I$(top_srcdir)/libeplayer3/include
noinst_LIBRARIES = libspark.a
@@ -14,7 +15,7 @@ libspark_a_SOURCES = \
video.cpp \
audio.cpp \
init.cpp \
playback.cpp \
playback_libeplayer3.cpp \
pwrmngr.cpp \
record.cpp

View File

@@ -30,6 +30,7 @@ typedef enum
class cAudio
{
friend class cPlayback;
private:
int fd;
bool Muted;

View File

@@ -2,9 +2,23 @@
#include <stdlib.h>
#include <string.h>
#include "playback_cs.h"
#include <audio_lib.h>
#include <video_lib.h>
static const char * FILENAME = "playback_cs.cpp";
#include <common.h>
extern OutputHandler_t OutputHandler;
extern PlaybackHandler_t PlaybackHandler;
extern ContainerHandler_t ContainerHandler;
extern ManagerHandler_t ManagerHandler;
#include "playback_libeplayer3.h"
static Context_t * player;
extern cAudio *audioDecoder;
extern cVideo *videoDecoder;
static const char * FILENAME = "playback_libeplayer3.cpp";
//
void cPlayback::Attach(void)
@@ -42,6 +56,9 @@ bool cPlayback::Open(playmode_t PlayMode)
"PLAYMODE_FILE"
};
audioDecoder->closeDevice();
videoDecoder->closeDevice();
printf("%s:%s - PlayMode=%s\n", FILENAME, __FUNCTION__, aPLAYMODE[PlayMode]);
player = (Context_t*) malloc(sizeof(Context_t));
@@ -72,11 +89,13 @@ void cPlayback::Close(void)
//Dagobert: movieplayer does not call stop, it calls close ;)
Stop();
audioDecoder->openDevice();
videoDecoder->openDevice();
}
//Used by Fileplay
bool cPlayback::Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, bool ac3)
bool cPlayback::Start(char *filename, unsigned short vpid, int vtype, unsigned short apid, int ac3, unsigned int)
{
bool ret = false;
bool isHTTP = false;

View File

@@ -6,23 +6,11 @@
/* (C) 2008 CoolStream International */
/* */
/*******************************************************************************/
#ifndef __PLAYBACK_CS_H
#define __PLAYBACK_CS_H
#ifndef __HAL_PLAYBACK_H
#define __HAL_PLAYBACK_H
#include <string>
#include <common.h>
extern OutputHandler_t OutputHandler;
extern PlaybackHandler_t PlaybackHandler;
extern ContainerHandler_t ContainerHandler;
extern ManagerHandler_t ManagerHandler;
#ifndef CS_PLAYBACK_PDATA
typedef struct {
int nothing;
} CS_PLAYBACK_PDATA;
#endif
typedef enum {
PLAYMODE_TS = 0,
PLAYMODE_FILE
@@ -34,10 +22,6 @@ class cPlayback
int timeout;
pthread_cond_t read_cond;
pthread_mutex_t mutex;
CS_PLAYBACK_PDATA * privateData;
#ifdef __sh__
Context_t * player;
#endif
bool enabled;
bool paused;
bool playing;
@@ -57,7 +41,8 @@ class cPlayback
void DMNotify(int Event, void *pTsBuf, void *Tag);
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, bool ac3);
bool Start(char *filename, unsigned short vpid, int vtype, unsigned short apid,
int ac3, unsigned int duration);
bool Stop(void);
bool SetAPid(unsigned short pid, bool ac3);
bool SetSpeed(int speed);

View File

@@ -113,6 +113,7 @@ typedef enum
class cVideo
{
friend class cDemux;
friend class cPlayback;
private:
/* video device */
int fd;