summaryrefslogtreecommitdiff
path: root/drivers/theoraplayer/video_stream_theoraplayer.h
blob: 063bf389532a0e177746c2595dc4b5cf968a274f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef VIDEO_STREAM_THEORAPLAYER_H
#define VIDEO_STREAM_THEORAPLAYER_H

#include "scene/resources/video_stream.h"
#include "io/resource_loader.h"

class TheoraVideoManager;
class TheoraVideoClip;

class VideoStreamTheoraplayer : public VideoStream {

	OBJ_TYPE(VideoStreamTheoraplayer,VideoStream);

	mutable Image frame;
	TheoraVideoManager* mgr;
	TheoraVideoClip* clip;
	bool started;
	bool playing;
	bool loop;

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;
	virtual Image pop_frame();
	virtual Image peek_frame() const;

	void update(float p_time);

	void set_file(const String& p_file);

	~VideoStreamTheoraplayer();
	VideoStreamTheoraplayer();
};

class ResourceFormatLoaderVideoStreamTheoraplayer : public ResourceFormatLoader {
public:
	virtual RES load(const String &p_path,const String& p_original_path="");
	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