Files
recycled-ni-neutrino/lib/hardware/coolstream/hd2/libcoolstream/playback_cs.h
vanhofen 284138fbc5 audio_select: copy full code from TangoCash
Just compile tested. Maybe some more alignments needed.

Signed-off-by: Thilo Graf <dbt@novatux.de>
Additional changes on cs playback_cs.h, because broken build
Signed-off-by: Thilo Graf <dbt@novatux.de>


Origin commit data
------------------
Commit: 5fd7ec68ac
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-10-12 (Thu, 12 Oct 2017)

Origin message was:
------------------
- audio_select: copy full code from TangoCash

Just compile tested. Maybe some more alignments needed.

Signed-off-by: Thilo Graf <dbt@novatux.de>
Additional changes on cs playback_cs.h, because broken build
Signed-off-by: Thilo Graf <dbt@novatux.de>
2017-10-29 18:32:30 +01:00

88 lines
3.3 KiB
C++

/*******************************************************************************/
/* */
/* libcoolstream/playback_cs.h */
/* Public header file for playback API */
/* */
/* (C) 2008 CoolStream International */
/* */
/* $Id:: $ */
/*******************************************************************************/
#ifndef __PLAYBACK_CS_H_
#define __PLAYBACK_CS_H_
#include <string>
#include <stdint.h>
#include <sys/types.h>
#include <vector>
typedef enum {
PLAYMODE_TS = 0,
PLAYMODE_FILE
} playmode_t;
class cPlaybackData;
typedef struct {
bool enabled;
uint16_t pid;
uint16_t ac3flags;
std::string lang;
std::string codec_name;
} playback_audio_pid_info_t;
#define MAX_PLAYBACK_PIDS 40
class cPlayback {
private:
cPlaybackData * pd;
bool enabled;
bool paused;
bool playing;
int unit;
int nPlaybackFD;
int video_type;
int mSpeed;
playmode_t playMode;
//
void Attach(void);
void Detach(void);
bool SetAVDemuxChannel(bool On, bool Video = true, bool Audio = true);
public:
cPlayback(int num = 0);
~cPlayback();
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag, unsigned int duration = 0);
bool Start(std::string filename, std::string headers = "");
bool Stop(void);
bool SetAPid(unsigned short pid, int audio_flag);
bool SetSubtitlePid(int /*pid*/){return true;}
bool SetSpeed(int speed);
bool GetSpeed(int &speed) const;
bool GetPosition(int &position, int &duration);
bool GetOffset(off64_t &offset);
bool SetPosition(int position, bool absolute = false);
bool IsPlaying(void) const { return playing; }
bool IsEnabled(void) const { return enabled; }
void FindAllPids(playback_audio_pid_info_t *audiopids, uint16_t size, uint16_t *numpida);
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint32_t *numpida, std::string *language){FindAllPids(apids, ac3flags, (uint16_t*) numpida, language);}
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language);
bool SelectSubtitles(int pid, std::string charset = "");
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
void RequestAbort();
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int &current);
void SetTitle(int title);
uint64_t GetReadCount(void);
void FindAllTeletextsubtitlePids(int *, unsigned int *numpids, std::string *, int *, int *){*numpids = 0;}
void FindAllSubtitlePids(int * /*pids*/, unsigned int *numpids, std::string * /*language*/){*numpids = 0;}
int GetSubtitlePid(void){return 0;}
bool SetTeletextPid(int /*pid*/){return true;}
int GetAPid(){return 0;}
void GetMetadata(std::vector<std::string> /*&keys*/, std::vector<std::string> /*&values*/){};
};
#endif // __PLAYBACK_CS_H_