2014-09-15 16:33:30 +02:00
|
|
|
#ifndef VIDEO_STREAM_THEORAPLAYER_H
|
|
|
|
#define VIDEO_STREAM_THEORAPLAYER_H
|
|
|
|
|
|
|
|
#include "scene/resources/video_stream.h"
|
|
|
|
#include "io/resource_loader.h"
|
2014-11-02 15:31:01 +01:00
|
|
|
#include "scene/resources/texture.h"
|
2014-09-15 16:33:30 +02:00
|
|
|
|
|
|
|
class TheoraVideoManager;
|
|
|
|
class TheoraVideoClip;
|
|
|
|
|
|
|
|
class VideoStreamTheoraplayer : public VideoStream {
|
|
|
|
|
|
|
|
OBJ_TYPE(VideoStreamTheoraplayer,VideoStream);
|
|
|
|
|
2014-11-02 15:31:01 +01:00
|
|
|
mutable DVector<uint8_t> data;
|
2014-09-15 16:33:30 +02:00
|
|
|
TheoraVideoClip* clip;
|
|
|
|
bool started;
|
|
|
|
bool playing;
|
|
|
|
bool loop;
|
2014-11-19 15:33:15 +01:00
|
|
|
bool paused;
|
2014-09-15 16:33:30 +02:00
|
|
|
|
2014-11-12 15:23:23 +01:00
|
|
|
int audio_track;
|
|
|
|
|
2014-09-15 16:33:30 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void stop();
|
|
|
|
virtual void play();
|
|
|
|
|
|
|
|
virtual bool is_playing() const;
|
|
|
|
|
|
|
|
virtual void set_paused(bool p_paused);
|
|
|
|
virtual bool is_paused(bool p_paused) const;
|
|
|
|
|
|
|
|
virtual void set_loop(bool p_enable);
|
|
|
|
virtual bool has_loop() const;
|
|
|
|
|
|
|
|
virtual float get_pos() const;
|
|
|
|
virtual void seek_pos(float p_time);
|
|
|
|
|
|
|
|
virtual float get_length() const;
|
|
|
|
|
|
|
|
virtual int get_pending_frame_count() const;
|
2014-11-02 15:31:01 +01:00
|
|
|
virtual void pop_frame(Ref<ImageTexture> p_tex);
|
2014-09-15 16:33:30 +02:00
|
|
|
virtual Image peek_frame() const;
|
|
|
|
|
|
|
|
void update(float p_time);
|
|
|
|
|
|
|
|
void set_file(const String& p_file);
|
2014-11-12 15:23:23 +01:00
|
|
|
void set_audio_track(int p_idx);
|
2014-09-15 16:33:30 +02:00
|
|
|
|
|
|
|
~VideoStreamTheoraplayer();
|
|
|
|
VideoStreamTheoraplayer();
|
|
|
|
};
|
|
|
|
|
|
|
|
class ResourceFormatLoaderVideoStreamTheoraplayer : public ResourceFormatLoader {
|
|
|
|
public:
|
2015-08-24 01:15:56 +02:00
|
|
|
virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL);
|
2014-09-15 16:33:30 +02:00
|
|
|
virtual void get_recognized_extensions(List<String> *p_extensions) const;
|
|
|
|
virtual bool handles_type(const String& p_type) const;
|
|
|
|
virtual String get_resource_type(const String &p_path) const;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|