diff options
Diffstat (limited to 'modules/theora')
-rw-r--r-- | modules/theora/SCsub | 60 | ||||
-rw-r--r-- | modules/theora/config.py | 3 | ||||
-rw-r--r-- | modules/theora/register_types.h | 5 | ||||
-rw-r--r-- | modules/theora/video_stream_theora.cpp | 16 | ||||
-rw-r--r-- | modules/theora/video_stream_theora.h | 2 |
5 files changed, 47 insertions, 39 deletions
diff --git a/modules/theora/SCsub b/modules/theora/SCsub index ff65d2f8ec..a01e65b4b0 100644 --- a/modules/theora/SCsub +++ b/modules/theora/SCsub @@ -1,71 +1,71 @@ #!/usr/bin/env python -Import('env') -Import('env_modules') +Import("env") +Import("env_modules") env_theora = env_modules.Clone() # Thirdparty source files -if env['builtin_libtheora']: +if env["builtin_libtheora"]: thirdparty_dir = "#thirdparty/libtheora/" thirdparty_sources = [ - #"analyze.c", - #"apiwrapper.c", + # "analyze.c", + # "apiwrapper.c", "bitpack.c", "cpu.c", - #"decapiwrapper.c", + # "decapiwrapper.c", "decinfo.c", "decode.c", "dequant.c", - #"encapiwrapper.c", - #"encfrag.c", - #"encinfo.c", - #"encode.c", - #"encoder_disabled.c", - #"enquant.c", - #"fdct.c", + # "encapiwrapper.c", + # "encfrag.c", + # "encinfo.c", + # "encode.c", + # "encoder_disabled.c", + # "enquant.c", + # "fdct.c", "fragment.c", "huffdec.c", - #"huffenc.c", + # "huffenc.c", "idct.c", "info.c", "internal.c", - #"mathops.c", - #"mcenc.c", + # "mathops.c", + # "mcenc.c", "quant.c", - #"rate.c", + # "rate.c", "state.c", - #"tokenize.c", + # "tokenize.c", ] thirdparty_sources_x86 = [ - #"x86/mmxencfrag.c", - #"x86/mmxfdct.c", + # "x86/mmxencfrag.c", + # "x86/mmxfdct.c", "x86/mmxfrag.c", "x86/mmxidct.c", "x86/mmxstate.c", - #"x86/sse2fdct.c", - #"x86/x86enc.c", + # "x86/sse2fdct.c", + # "x86/x86enc.c", "x86/x86state.c", ] thirdparty_sources_x86_vc = [ - #"x86_vc/mmxencfrag.c", - #"x86_vc/mmxfdct.c", + # "x86_vc/mmxencfrag.c", + # "x86_vc/mmxfdct.c", "x86_vc/mmxfrag.c", "x86_vc/mmxidct.c", "x86_vc/mmxstate.c", - #"x86_vc/x86enc.c", + # "x86_vc/x86enc.c", "x86_vc/x86state.c", ] - if (env["x86_libtheora_opt_gcc"]): + if env["x86_libtheora_opt_gcc"]: thirdparty_sources += thirdparty_sources_x86 - if (env["x86_libtheora_opt_vc"]): + if env["x86_libtheora_opt_vc"]: thirdparty_sources += thirdparty_sources_x86_vc - if (env["x86_libtheora_opt_gcc"] or env["x86_libtheora_opt_vc"]): + if env["x86_libtheora_opt_gcc"] or env["x86_libtheora_opt_vc"]: env_theora.Append(CPPDEFINES=["OC_X86_ASM"]) thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] @@ -73,9 +73,9 @@ if env['builtin_libtheora']: env_theora.Prepend(CPPPATH=[thirdparty_dir]) # also requires libogg and libvorbis - if env['builtin_libogg']: + if env["builtin_libogg"]: env_theora.Prepend(CPPPATH=["#thirdparty/libogg"]) - if env['builtin_libvorbis']: + if env["builtin_libvorbis"]: env_theora.Prepend(CPPPATH=["#thirdparty/libvorbis"]) env_thirdparty = env_theora.Clone() diff --git a/modules/theora/config.py b/modules/theora/config.py index c7713d7607..413acce2df 100644 --- a/modules/theora/config.py +++ b/modules/theora/config.py @@ -1,13 +1,16 @@ def can_build(env, platform): return True + def configure(env): pass + def get_doc_classes(): return [ "VideoStreamTheora", ] + def get_doc_path(): return "doc_classes" diff --git a/modules/theora/register_types.h b/modules/theora/register_types.h index 66eb49aed1..4f0670b2c7 100644 --- a/modules/theora/register_types.h +++ b/modules/theora/register_types.h @@ -28,5 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#ifndef THEORA_REGISTER_TYPES_H +#define THEORA_REGISTER_TYPES_H + void register_theora_types(); void unregister_theora_types(); + +#endif // THEORA_REGISTER_TYPES_H diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index ee44c6bf05..b9f276fb12 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -144,7 +144,7 @@ void VideoStreamPlaybackTheora::clear() { thread_sem->post(); //just in case Thread::wait_to_finish(thread); memdelete(thread); - thread = NULL; + thread = nullptr; ring_buffer.clear(); #endif @@ -159,7 +159,7 @@ void VideoStreamPlaybackTheora::clear() { if (file) { memdelete(file); } - file = NULL; + file = nullptr; playing = false; }; @@ -167,7 +167,7 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) { ERR_FAIL_COND(playing); ogg_packet op; - th_setup_info *ts = NULL; + th_setup_info *ts = nullptr; file_name = p_file; if (file) { @@ -674,7 +674,7 @@ void VideoStreamPlaybackTheora::_streaming_thread(void *ud) { VideoStreamPlaybackTheora::VideoStreamPlaybackTheora() { - file = NULL; + file = nullptr; theora_p = 0; vorbis_p = 0; videobuf_ready = 0; @@ -685,8 +685,8 @@ VideoStreamPlaybackTheora::VideoStreamPlaybackTheora() { buffering = false; texture = Ref<ImageTexture>(memnew(ImageTexture)); - mix_callback = NULL; - mix_udata = NULL; + mix_callback = nullptr; + mix_udata = nullptr; audio_track = 0; delay_compensation = 0; audio_frames_wrote = 0; @@ -696,7 +696,7 @@ VideoStreamPlaybackTheora::VideoStreamPlaybackTheora() { ring_buffer.resize(rb_power); read_buffer.resize(RB_SIZE_KB * 1024); thread_sem = Semaphore::create(); - thread = NULL; + thread = nullptr; thread_exit = false; thread_eof = false; @@ -725,7 +725,7 @@ void VideoStreamTheora::_bind_methods() { //////////// -RES ResourceFormatLoaderTheora::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderTheora::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { FileAccess *f = FileAccess::open(p_path, FileAccess::READ); if (!f) { diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index da3558ce34..f98368ed8b 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -187,7 +187,7 @@ public: class ResourceFormatLoaderTheora : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); 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; |