mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 07:23:11 +02:00
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 :-)
81 lines
1.7 KiB
C++
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
|