Files
recycled-ni-libstb-hal/azbox/playback.h
Stefan Seyfried e6450f7f08 first preliminary AZzbox ME support
TODO: some code is very similar to SPARK (record and pwrmngr
are just symlinked, dmx is almost identical). Reduce duplication
by factoring out DVBAPI code into an extra directory.
* what works: audio, video, demux
* what probably doesn't work or is untested: record
* what very likely doesn't work: playback
Playback is just copied over from aztrino and made to compile.
If you are lucky, it just segfaults :-)


Origin commit data
------------------
Branch: master
Commit: 0ac7346489
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-06-18 (Mon, 18 Jun 2012)



------------------
This commit was generated by Migit
2012-06-18 14:48:52 +02:00

81 lines
1.7 KiB
C++

#ifndef __PLAYBACK_H
#define __PLAYBACK_H
#include <string>
#include <stdint.h>
#ifndef CS_PLAYBACK_PDATA
typedef struct {
int nothing;
} CS_PLAYBACK_PDATA;
#endif
typedef enum {
PLAYMODE_TS = 0,
PLAYMODE_FILE,
} playmode_t;
class cPlayback
{
private:
int timeout;
pthread_cond_t read_cond;
pthread_mutex_t mutex;
CS_PLAYBACK_PDATA * privateData;
pthread_t rua_thread;
pthread_t event_thread;
bool enabled;
bool paused;
bool playing;
int unit;
int nPlaybackFD;
int video_type;
int nPlaybackSpeed;
int mSpeed;
int mAudioStream;
int mSubStream;
char* mfilename;
int thread_active;
int eof_reached;
int setduration;
int mduration;
playmode_t playMode;
//
public:
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, bool ac3, int duration);
bool Stop(void);
bool SetAPid(unsigned short pid, bool ac3);
bool SetSPid(int pid);
bool SetSpeed(int speed);
bool GetSpeed(int &speed) const;
bool GetPosition(int &position, int &duration);
bool SetPosition(int position, bool absolute = false);
bool IsEOF(void) const;
int GetCurrPlaybackSpeed(void) const;
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
void FindAllSPids(int *spids, uint16_t *numpids, std::string *language);
//
cPlayback(int num = 0);
~cPlayback();
void RuaThread();
void EventThread();
#if 0
/* not used */
bool GetOffset(off64_t &offset);
void PlaybackNotify (int Event, void *pData, void *pTag);
void DMNotify(int Event, void *pTsBuf, void *Tag);
bool IsPlaying(void) const;
bool IsEnabled(void) const;
void * GetHandle(void);
void * GetDmHandle(void);
#endif
};
#endif