2017-01-25 15:00:56 +00:00
|
|
|
#ifdef _RPI_
|
|
|
|
#ifndef _VIDEOPLAYERCOMPONENT_H_
|
|
|
|
#define _VIDEOPLAYERCOMPONENT_H_
|
|
|
|
|
|
|
|
#include "platform.h"
|
|
|
|
#include GLHEADER
|
|
|
|
|
|
|
|
#include "components/VideoComponent.h"
|
|
|
|
|
2017-03-25 17:02:28 +00:00
|
|
|
void catch_child(int sig_num);
|
|
|
|
|
2017-01-25 15:00:56 +00:00
|
|
|
class VideoPlayerComponent : public VideoComponent
|
|
|
|
{
|
|
|
|
public:
|
2017-06-01 20:08:44 +00:00
|
|
|
VideoPlayerComponent(Window* window, std::string path);
|
2017-01-25 15:00:56 +00:00
|
|
|
virtual ~VideoPlayerComponent();
|
|
|
|
|
2017-10-28 20:24:35 +00:00
|
|
|
void render(const Transform4x4f& parentTrans) override;
|
2017-01-25 15:00:56 +00:00
|
|
|
|
2017-03-25 17:02:28 +00:00
|
|
|
// Resize the video to fit this size. If one axis is zero, scale that axis to maintain aspect ratio.
|
|
|
|
// If both are non-zero, potentially break the aspect ratio. If both are zero, no resizing.
|
|
|
|
// Can be set before or after a video is loaded.
|
|
|
|
// setMaxSize() and setResize() are mutually exclusive.
|
|
|
|
void setResize(float width, float height);
|
|
|
|
|
|
|
|
// Resize the video to be as large as possible but fit within a box of this size.
|
|
|
|
// Can be set before or after a video is loaded.
|
|
|
|
// Never breaks the aspect ratio. setMaxSize() and setResize() are mutually exclusive.
|
|
|
|
void setMaxSize(float width, float height);
|
|
|
|
|
2017-01-25 15:00:56 +00:00
|
|
|
private:
|
|
|
|
// Start the video Immediately
|
|
|
|
virtual void startVideo();
|
|
|
|
// Stop the video
|
|
|
|
virtual void stopVideo();
|
|
|
|
|
|
|
|
private:
|
|
|
|
pid_t mPlayerPid;
|
2017-06-01 20:08:44 +00:00
|
|
|
std::string subtitlePath;
|
2017-01-25 15:00:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|