diff options
Diffstat (limited to 'drivers/theora/video_stream_theora.h')
| -rw-r--r-- | drivers/theora/video_stream_theora.h | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/drivers/theora/video_stream_theora.h b/drivers/theora/video_stream_theora.h index 12aac731f..77a9ae866 100644 --- a/drivers/theora/video_stream_theora.h +++ b/drivers/theora/video_stream_theora.h @@ -10,9 +10,9 @@ #include "io/resource_loader.h" #include "scene/resources/video_stream.h" -class VideoStreamTheora : public VideoStream { +class VideoStreamPlaybackTheora : public VideoStreamPlayback { - OBJ_TYPE(VideoStreamTheora, VideoStream); + OBJ_TYPE(VideoStreamPlaybackTheora, VideoStreamPlayback); enum { MAX_FRAMES = 4, @@ -58,16 +58,17 @@ class VideoStreamTheora : public VideoStream { double last_update_time; double time; + double delay_compensation; -protected: + Ref<ImageTexture> texture; - virtual UpdateMode get_update_mode() const; - virtual void update(); + AudioMixCallback mix_callback; + void* mix_udata; - void clear(); - - virtual bool _can_mix() const; +protected: + void clear(); + public: virtual void play(); @@ -92,12 +93,36 @@ public: void set_file(const String& p_file); - int get_pending_frame_count() const; - Image pop_frame(); - Image peek_frame() const; + virtual Ref<Texture> get_texture(); + virtual void update(float p_delta); + + virtual void set_mix_callback(AudioMixCallback p_callback,void *p_userdata); + virtual int get_channels() const; + virtual int get_mix_rate() const; + + virtual void set_audio_track(int p_idx); + + VideoStreamPlaybackTheora(); + ~VideoStreamPlaybackTheora(); +}; + + + +class VideoStreamTheora : public VideoStream { + + OBJ_TYPE(VideoStreamTheora,VideoStream); + + String file; +public: + + Ref<VideoStreamPlayback> instance_playback() { + Ref<VideoStreamPlaybackTheora> pb = memnew( VideoStreamPlaybackTheora ); + pb->set_file(file); + return pb; + } + + void set_file(const String& p_file) { file=p_file; } - VideoStreamTheora(); - ~VideoStreamTheora(); }; class ResourceFormatLoaderVideoStreamTheora : public ResourceFormatLoader { |
