#ifndef PROJECT_PLAYER_H #define PROJECT_PLAYER_H #include "ffcpp/MediaFile.h" #include #include namespace ffcpp { struct IVideoSink { virtual AVPixelFormat getPixelFormat() const noexcept = 0; virtual int getWidth() const noexcept = 0; virtual int getHeight() const noexcept = 0; virtual void drawFrame(void* pixelsData, int pitch) = 0; virtual void drawPlanarYUVFrame(const void *yPlane, const void *uPlane, const void *vPlane, int yPitch, int uPitch, int vPitch) = 0; }; enum class PlayerState { Stopped, Playing, Paused }; class Player { private: std::shared_ptr _vSink; std::unique_ptr _curMedia; StreamPtr _aStream; StreamPtr _vStream; std::thread _decodeThread; PlayerState _state; public: Player(std::shared_ptr vSink); ~Player(); void setMedia(std::string path); void play(); private: void decode(); }; } #endif //PROJECT_PLAYER_H