0theora compilation fixes

This commit is contained in:
Juan Linietsky 2015-11-25 00:28:03 -03:00
parent 082e3fbb29
commit b987d2113b
12 changed files with 59 additions and 26 deletions

View file

@ -84,6 +84,9 @@ env_base.__class__.disable_module = methods.disable_module
env_base.__class__.add_source_files = methods.add_source_files env_base.__class__.add_source_files = methods.add_source_files
env_base["x86_opt_gcc"]=False
env_base["x86_opt_vc"]=False
customs = ['custom.py'] customs = ['custom.py']
profile = ARGUMENTS.get("profile", False) profile = ARGUMENTS.get("profile", False)
@ -304,6 +307,7 @@ if selected_platform in platform_list:
if (env['opus']=='yes'): if (env['opus']=='yes'):
env.Append(CPPFLAGS=['-DOPUS_ENABLED']); env.Append(CPPFLAGS=['-DOPUS_ENABLED']);
if (env['theora']=='yes'): if (env['theora']=='yes'):
env['theoralib']='yes' env['theoralib']='yes'
env.Append(CPPFLAGS=['-DTHEORA_ENABLED']); env.Append(CPPFLAGS=['-DTHEORA_ENABLED']);

View file

@ -6,5 +6,4 @@ ogg_sources = [
"ogg/framing.c", "ogg/framing.c",
] ]
if env['theora'] != "yes" or env['use_theoraplayer_binary'] != "yes": env.drivers_sources+=ogg_sources
env.drivers_sources+=ogg_sources

View file

@ -104,10 +104,6 @@ static ResourceFormatLoaderAudioStreamSpeex *speex_stream_loader=NULL;
static ResourceFormatLoaderVideoStreamTheora* theora_stream_loader = NULL; static ResourceFormatLoaderVideoStreamTheora* theora_stream_loader = NULL;
#endif #endif
#ifdef THEORAPLAYER_ENABLED
static ResourceFormatLoaderVideoStreamTheoraplayer* theoraplayer_stream_loader = NULL;
#endif
#ifdef MUSEPACK_ENABLED #ifdef MUSEPACK_ENABLED
static ResourceFormatLoaderAudioStreamMPC * mpc_stream_loader=NULL; static ResourceFormatLoaderAudioStreamMPC * mpc_stream_loader=NULL;
#endif #endif
@ -229,12 +225,6 @@ void register_driver_types() {
ObjectTypeDB::register_type<VideoStreamTheora>(); ObjectTypeDB::register_type<VideoStreamTheora>();
#endif #endif
#ifdef THEORAPLAYER_ENABLED
theoraplayer_stream_loader = memnew( ResourceFormatLoaderVideoStreamTheoraplayer );
ResourceLoader::add_resource_format_loader(theoraplayer_stream_loader);
ObjectTypeDB::register_type<VideoStreamTheoraplayer>();
#endif
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
#ifdef SQUISH_ENABLED #ifdef SQUISH_ENABLED
@ -273,9 +263,6 @@ void unregister_driver_types() {
memdelete (theora_stream_loader); memdelete (theora_stream_loader);
#endif #endif
#ifdef THEORAPLAYER_ENABLED
memdelete (theoraplayer_stream_loader);
#endif
#ifdef MUSEPACK_ENABLED #ifdef MUSEPACK_ENABLED

View file

@ -31,4 +31,37 @@ sources = [
"theora/video_stream_theora.cpp", "theora/video_stream_theora.cpp",
] ]
sources_x86 = [
"theora/x86/mmxencfrag.c",
"theora/x86/mmxfdct.c",
"theora/x86/mmxfrag.c",
"theora/x86/mmxidct.c",
"theora/x86/mmxstate.c",
"theora/x86/sse2fdct.c",
"theora/x86/x86enc.c",
"theora/x86/x86state.c",
]
sources_x86_vc = [
"theora/x86_vc/mmxencfrag.c",
"theora/x86_vc/mmxfdct.c",
"theora/x86_vc/mmxfrag.c",
"theora/x86_vc/mmxidct.c",
"theora/x86_vc/mmxstate.c",
"theora/x86_vc/x86enc.c",
"theora/x86_vc/x86state.c",
]
env.drivers_sources += sources env.drivers_sources += sources
if (env["x86_opt_gcc"]):
env.Append(CCFLAGS=["-DOC_X86_ASM"])
env.drivers_sources += sources_x86
if (env["x86_opt_vc"]):
env.Append(CCFLAGS=["-DOC_X86_ASM"])
env.drivers_sources += sources_x86_vc

View file

@ -14,6 +14,7 @@
last mod: $Id: encint.h 16503 2009-08-22 18:14:02Z giles $ last mod: $Id: encint.h 16503 2009-08-22 18:14:02Z giles $
********************************************************************/ ********************************************************************/
#if !defined(_encint_H) #if !defined(_encint_H)
# define _encint_H (1) # define _encint_H (1)
# if defined(HAVE_CONFIG_H) # if defined(HAVE_CONFIG_H)

View file

@ -441,8 +441,10 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
//print_line("play "+rtos(p_delta)); //print_line("play "+rtos(p_delta));
time+=p_delta; time+=p_delta;
if (videobuf_time>get_time()) if (videobuf_time>get_time()) {
return; //no new frames need to be produced return; //no new frames need to be produced
}
bool frame_done=false; bool frame_done=false;
bool audio_done=false; bool audio_done=false;
@ -541,7 +543,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
if(ogg_stream_packetout(&to,&op)>0){ if(ogg_stream_packetout(&to,&op)>0){
if(pp_inc){ if(false && pp_inc){
pp_level+=pp_inc; pp_level+=pp_inc;
th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level, th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,
sizeof(pp_level)); sizeof(pp_level));
@ -569,16 +571,20 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
keyframing. Soon enough libtheora will be able to deal keyframing. Soon enough libtheora will be able to deal
with non-keyframe seeks. */ with non-keyframe seeks. */
if(videobuf_time>=get_time()) if(videobuf_time>=get_time()) {
frame_done=true; frame_done=true;
else{ print_line("frame!");
} else{
/*If we are too slow, reduce the pp level.*/ /*If we are too slow, reduce the pp level.*/
pp_inc=pp_level>0?-1:0; pp_inc=pp_level>0?-1:0;
print_line("skip!");
} }
} }
} else } else {
print_line("no packet..");
break; break;
}
} }
if (file && /*!videobuf_ready && */ file->eof_reached()) { if (file && /*!videobuf_ready && */ file->eof_reached()) {

View file

@ -33,6 +33,4 @@ sources_lib = [
] ]
env.drivers_sources += sources env.drivers_sources += sources
env.drivers_sources += sources_lib
if env['theora'] != "yes" or env['use_theoraplayer_binary'] != "yes":
env.drivers_sources += sources_lib

View file

@ -98,6 +98,7 @@ def configure(env):
if env['android_arch']=='x86': if env['android_arch']=='x86':
env['NDK_TARGET']=env['NDK_TARGET_X86'] env['NDK_TARGET']=env['NDK_TARGET_X86']
env["x86_opt_gcc"]=True
if env['PLATFORM'] == 'win32': if env['PLATFORM'] == 'win32':
import methods import methods

View file

@ -116,4 +116,4 @@ def configure(env):
env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
#env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } )
env["x86_opt_gcc"]=True

View file

@ -263,6 +263,7 @@ def configure(env):
env.Append(CCFLAGS=["/I"+DIRECTX_PATH+"/Include"]) env.Append(CCFLAGS=["/I"+DIRECTX_PATH+"/Include"])
env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x86"]) env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x86"])
env['ENV'] = os.environ; env['ENV'] = os.environ;
env["x86_opt_vc"]=True
else: else:
# Workaround for MinGW. See: # Workaround for MinGW. See:
@ -361,6 +362,7 @@ def configure(env):
env['AR'] = mingw_prefix+"ar" env['AR'] = mingw_prefix+"ar"
env['RANLIB'] = mingw_prefix+"ranlib" env['RANLIB'] = mingw_prefix+"ranlib"
env['LD'] = mingw_prefix+"g++" env['LD'] = mingw_prefix+"g++"
env["x86_opt_gcc"]=True
#env['CC'] = "winegcc" #env['CC'] = "winegcc"
#env['CXX'] = "wineg++" #env['CXX'] = "wineg++"

View file

@ -180,3 +180,5 @@ def configure(env):
env.Append(CPPFLAGS=['-DNEW_WM_API']) env.Append(CPPFLAGS=['-DNEW_WM_API'])
env.ParseConfig('pkg-config xinerama --cflags --libs') env.ParseConfig('pkg-config xinerama --cflags --libs')
env["x86_opt_gcc"]=True

View file

@ -27,7 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/ /*************************************************************************/
#include "video_player.h" #include "video_player.h"
#include "os/os.h"
int VideoPlayer::InternalStream::get_channel_count() const { int VideoPlayer::InternalStream::get_channel_count() const {
@ -130,7 +130,7 @@ void VideoPlayer::_notification(int p_notification) {
if (!playback->is_playing()) if (!playback->is_playing())
return; return;
double audio_time = AudioServer::get_singleton()->get_mix_time(); double audio_time = OS::get_singleton()->get_ticks_usec()/1000000.0; //AudioServer::get_singleton()->get_mix_time();
double delta = last_audio_time==0?0:audio_time-last_audio_time; double delta = last_audio_time==0?0:audio_time-last_audio_time;
last_audio_time=audio_time; last_audio_time=audio_time;