diff options
Diffstat (limited to 'modules/theora/video_stream_theora.h')
-rw-r--r-- | modules/theora/video_stream_theora.h | 56 |
1 files changed, 23 insertions, 33 deletions
diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index 0e1f5fa864..ea568906da 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -31,8 +31,8 @@ #include "io/resource_loader.h" #include "os/file_access.h" -#include "os/thread.h" #include "os/semaphore.h" +#include "os/thread.h" #include "ring_buffer.h" #include "scene/resources/video_stream.h" @@ -53,7 +53,7 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { Image::Format format; PoolVector<uint8_t> frame_data; int frames_pending; - FileAccess* file; + FileAccess *file; String file_name; int audio_frames_wrote; Point2i size; @@ -66,18 +66,18 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { bool theora_eos; bool vorbis_eos; - ogg_sync_state oy; - ogg_page og; + ogg_sync_state oy; + ogg_page og; ogg_stream_state vo; ogg_stream_state to; - th_info ti; - th_comment tc; - th_dec_ctx *td; - vorbis_info vi; + th_info ti; + th_comment tc; + th_dec_ctx *td; + vorbis_info vi; vorbis_dsp_state vd; - vorbis_block vb; - vorbis_comment vc; - th_pixel_fmt px_fmt; + vorbis_block vb; + vorbis_comment vc; + th_pixel_fmt px_fmt; double videobuf_time; int pp_inc; @@ -97,13 +97,13 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { Ref<ImageTexture> texture; AudioMixCallback mix_callback; - void* mix_udata; + void *mix_udata; bool paused; #ifdef THEORA_USE_THREAD_STREAMING enum { - RB_SIZE_KB=1024 + RB_SIZE_KB = 1024 }; RingBuffer<uint8_t> ring_buffer; @@ -117,15 +117,12 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { #endif - int audio_track; protected: - void clear(); - -public: +public: virtual void play(); virtual void stop(); virtual bool is_playing() const; @@ -145,13 +142,12 @@ public: virtual float get_pos() const; virtual void seek_pos(float p_time); - - void set_file(const String& p_file); + void set_file(const String &p_file); virtual Ref<Texture> get_texture(); virtual void update(float p_delta); - virtual void set_mix_callback(AudioMixCallback p_callback,void *p_userdata); + virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata); virtual int get_channels() const; virtual int get_mix_rate() const; @@ -161,39 +157,33 @@ public: ~VideoStreamPlaybackTheora(); }; - - class VideoStreamTheora : public VideoStream { - GDCLASS(VideoStreamTheora,VideoStream); + GDCLASS(VideoStreamTheora, VideoStream); String file; int audio_track; - public: - Ref<VideoStreamPlayback> instance_playback() { - Ref<VideoStreamPlaybackTheora> pb = memnew( VideoStreamPlaybackTheora ); + Ref<VideoStreamPlaybackTheora> pb = memnew(VideoStreamPlaybackTheora); pb->set_audio_track(audio_track); pb->set_file(file); return pb; } - void set_file(const String& p_file) { file=p_file; } - void set_audio_track(int p_track) { audio_track=p_track; } - - VideoStreamTheora() { audio_track=0; } + void set_file(const String &p_file) { file = p_file; } + void set_audio_track(int p_track) { audio_track = p_track; } + VideoStreamTheora() { audio_track = 0; } }; class ResourceFormatLoaderVideoStreamTheora : public ResourceFormatLoader { public: - virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL); virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String& p_type) const; + virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; - }; #endif |