Files
recycled-ni-libstb-hal/libarmbox/playback_libeplayer3.h
GetAway be03534b69 This commit refactors the extraction of HTTP headers in the
cPlayback::Start method to include the 'Referer' header using
the extractParam helper function. It ensures that the 'Referer'
value from URL parameters is properly extracted and appended to
the headers when present.
Using:
<webtv title=ATV url=https://stream.hdtvizlecanli.com/atv.m3u8#Referer=https://www.livestreamde.com />


Origin commit data
------------------
Branch: master
Commit: 34400d702f
Author: GetAway <get-away@t-online.de>
Date: 2024-04-11 (Thu, 11 Apr 2024)



------------------
This commit was generated by Migit
2024-04-11 21:15:40 +02:00

93 lines
2.9 KiB
C++

#ifndef __PLAYBACK_LIBEPLAYER3_H__
#define __PLAYBACK_LIBEPLAYER3_H__
#include <string>
#include <vector>
#include <OpenThreads/Mutex>
typedef enum
{
PLAYMODE_TS = 0,
PLAYMODE_FILE
} playmode_t;
struct AVFormatContext;
class cPlayback
{
friend class CStreamInfo2;
private:
static OpenThreads::Mutex mutex;
bool enabled;
bool playing, first;
bool no_probe;
bool got_vpts_ts;
int nPlaybackSpeed;
int mAudioStream;
int mSubtitleStream;
int mTeletextStream;
int64_t vpts_ts;
bool Stop(void);
bool decoders_closed;
playmode_t pm;
std::string fn_ts;
std::string fn_xml;
off64_t last_size;
int init_jump;
AVFormatContext *avft;
std::string extractParam(const std::string &hdrs, const std::string &paramName);
public:
cPlayback(int num = 0);
~cPlayback();
bool Open(playmode_t PlayMode);
void Close(void);
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration, std::string headers = "", std::string filename2 = "");
bool Start(std::string filename, std::string headers = "", std::string filename2 = "");
bool SetAPid(int pid, bool ac3 = false);
bool SetVPid(int /*pid*/);
bool SetSubtitlePid(int pid);
bool SetTeletextPid(int pid);
int GetAPid(void) { return mAudioStream; }
int GetVPid(void) { return 0; }
int GetSubtitlePid(void) { return mSubtitleStream; }
int GetTeletextPid(void);
bool SetSpeed(int speed);
bool GetSpeed(int &speed) const;
bool GetPosition(int &position, int &duration, bool isWebChannel = false);
void GetPts(uint64_t &pts);
bool SetPosition(int position, bool absolute = false);
void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language);
void FindAllSubs(short unsigned int *pids, short unsigned int *supported, short unsigned int *numpida, std::string *language);
bool SelectSubtitles(int pid, std::string charset = "");
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
void FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpidt, std::string */*tlanguage*/, int */*mags*/, int */*pages*/);
void RequestAbort(void);
bool IsPlaying(void);
uint64_t GetReadCount(void);
void GetChapters(std::vector<int> &positions, std::vector<std::string> &titles);
void GetMetadata(std::vector<std::string> &keys, std::vector<std::string> &values);
AVFormatContext *GetAVFormatContext();
void ReleaseAVFormatContext();
void GetTitles(std::vector<int> &playlists, std::vector<std::string> &titles, int &current);
void SetTitle(int title);
#if 0
// Functions that are not used by movieplayer.cpp:
bool GetOffset(off64_t &offset);
bool IsPlaying(void) const;
bool IsEnabled(void) const;
void *GetHandle(void);
void *GetDmHandle(void);
int GetCurrPlaybackSpeed(void) const;
void PlaybackNotify(int Event, void *pData, void *pTag);
void DMNotify(int Event, void *pTsBuf, void *Tag);
#endif
};
#endif // __PLAYBACK_LIBEPLAYER3_H__