#ifndef __PLAYER_H__ #define __PLAYER_H__ #include #include #include extern "C" { #include #include #include #include #include } #include #include #include #include #include #include "input.h" #include "output.h" #include "manager.h" struct Chapter { std::string title; double start; double end; }; class Player { friend class Input; friend class Output; friend class Manager; friend class cPlayback; friend int interrupt_cb(void *arg); private: Input input; Output output; Manager manager; OpenThreads::Mutex chapterMutex; std::vector chapters; bool abortPlayback; bool abortRequested; bool isHttp; bool isPaused; bool isCreationPhase; bool isSlowMotion; int Speed; int AVSync; bool isVideo; bool isAudio; std::string url; bool noprobe; /* hack: only minimal probing in av_find_stream_info */ int hasThreadStarted; static void* SupervisorThread(void*); public: bool isForwarding; bool isBackWard; bool isPlaying; uint64_t readCount; bool SwitchAudio(int pid); bool SwitchVideo(int pid); bool SwitchTeletext(int pid); bool SwitchSubtitle(int pid); bool GetPts(int64_t &pts); bool GetFrameCount(int64_t &framecount); bool GetDuration(double &duration); bool GetMetadata(std::vector &keys, std::vector &values); bool SlowMotion(int repeats); bool FastBackward(int speed); bool FastForward(int speed); bool Open(const char *Url); bool Close(); bool Play(); bool Pause(); bool Continue(); bool Stop(); bool Seek(float pos, bool absolute); bool Terminate(); bool GetChapters(std::vector &positions, std::vector &titles); void SetChapters(std::vector &Chapters); Player(); }; #endif