From: Simon McVittie Date: Fri, 20 Jan 2012 09:14:26 +0000 (+0000) Subject: add LINK_TO_THEORA X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9aba9e9a1a4003eb69a8e79055b187d9c7fb8287;p=xonotic%2Fdarkplaces.git add LINK_TO_THEORA In Debian we want library dependencies to work in the conventional way, since many tools expect that and use it to generate package dependencies. Origin: vendor, Debian --- diff --git a/cap_ogg.c b/cap_ogg.c index a4913aeb..e5b13255 100644 --- a/cap_ogg.c +++ b/cap_ogg.c @@ -19,6 +19,55 @@ static cvar_t cl_capturevideo_ogg_theora_noise_sensitivity = {CVAR_SAVE, "cl_cap static cvar_t cl_capturevideo_ogg_theora_sharpness = {CVAR_SAVE, "cl_capturevideo_ogg_theora_sharpness", "0", "sharpness (0 to 2); lower is sharper"}; static cvar_t cl_capturevideo_ogg_vorbis_quality = {CVAR_SAVE, "cl_capturevideo_ogg_vorbis_quality", "3", "audio quality (-1 to 10); higher is better"}; +#ifdef LINK_TO_THEORA + +#include +#include +#include +#include + +#define qogg_stream_packetin ogg_stream_packetin +#define qogg_stream_pageout ogg_stream_pageout +#define qogg_stream_flush ogg_stream_flush +#define qogg_stream_init ogg_stream_init +#define qogg_stream_clear ogg_stream_clear +#define qogg_page_granulepos ogg_page_granulepos + +#define qvorbis_info_init vorbis_info_init +#define qvorbis_info_clear vorbis_info_clear +#define qvorbis_comment_init vorbis_comment_init +#define qvorbis_comment_clear vorbis_comment_clear +#define qvorbis_block_init vorbis_block_init +#define qvorbis_block_clear vorbis_block_clear +#define qvorbis_dsp_clear vorbis_dsp_clear +#define qvorbis_granule_time vorbis_granule_time +#define qvorbis_analysis_init vorbis_analysis_init +#define qvorbis_commentheader_out vorbis_commentheader_out +#define qvorbis_analysis_headerout vorbis_analysis_headerout +#define qvorbis_analysis_buffer vorbis_analysis_buffer +#define qvorbis_analysis_wrote vorbis_analysis_wrote +#define qvorbis_analysis_blockout vorbis_analysis_blockout +#define qvorbis_analysis vorbis_analysis +#define qvorbis_bitrate_addblock vorbis_bitrate_addblock +#define qvorbis_bitrate_flushpacket vorbis_bitrate_flushpacket +#define qvorbis_encode_init_vbr vorbis_encode_init_vbr + +#define qtheora_encode_init theora_encode_init +#define qtheora_encode_YUVin theora_encode_YUVin +#define qtheora_encode_packetout theora_encode_packetout +#define qtheora_encode_header theora_encode_header +#define qtheora_encode_comment theora_encode_comment +#define qtheora_encode_tables theora_encode_tables +#define qtheora_info_init theora_info_init +#define qtheora_info_clear theora_info_clear +#define qtheora_clear theora_clear +#define qtheora_comment_init theora_comment_init +#define qtheora_comment_clear theora_comment_clear +#define qtheora_granule_time theora_granule_time +#define qtheora_control theora_control + +#else + // ogg.h stuff #ifdef _MSC_VER typedef __int16 ogg_int16_t; @@ -591,10 +640,13 @@ static qboolean SCR_CaptureVideo_Ogg_OpenLibrary(void) && Sys_LoadLibrary (dllnames_ve, &ve_dll, vorbisencfuncs); } +#endif void SCR_CaptureVideo_Ogg_Init(void) { +#ifndef LINK_TO_THEORA SCR_CaptureVideo_Ogg_OpenLibrary(); +#endif Cvar_RegisterVariable(&cl_capturevideo_ogg_theora_vp3compat); Cvar_RegisterVariable(&cl_capturevideo_ogg_theora_quality); @@ -609,15 +661,21 @@ void SCR_CaptureVideo_Ogg_Init(void) qboolean SCR_CaptureVideo_Ogg_Available(void) { +#ifdef LINK_TO_THEORA + return TRUE; +#else return og_dll && th_dll && vo_dll && ve_dll; +#endif } void SCR_CaptureVideo_Ogg_CloseDLL(void) { +#ifndef LINK_TO_THEORA Sys_UnloadLibrary (&ve_dll); Sys_UnloadLibrary (&vo_dll); Sys_UnloadLibrary (&th_dll); Sys_UnloadLibrary (&og_dll); +#endif } // this struct should not be needed diff --git a/makefile b/makefile index e7c7cf50..6deb727d 100644 --- a/makefile +++ b/makefile @@ -322,6 +322,11 @@ CFLAGS_ODE=-DLINK_TO_ODE `pkg-config --cflags ode` LIB_ODE=`pkg-config --libs ode` endif +ifdef LINK_TO_THEORA +CFLAGS_THEORA=-DLINK_TO_THEORA `pkg-config --cflags theora vorbisfile vorbisenc vorbis ogg` +LIB_THEORA=`pkg-config --libs theora vorbisfile vorbisenc vorbis ogg` +endif + ifdef LINK_TO_ZLIB CFLAGS_ZLIB=-DLINK_TO_ZLIB LIB_ZLIB=-lz diff --git a/makefile.inc b/makefile.inc index 84ff115c..0f881c43 100644 --- a/makefile.inc +++ b/makefile.inc @@ -194,6 +194,7 @@ CFLAGS_COMMON=\ $(CFLAGS_WARNINGS) \ $(CFLAGS_LIBJPEG) \ $(CFLAGS_LIBVORBIS) \ + $(CFLAGS_THEORA) \ $(CFLAGS_ZLIB) \ $(CFLAGS_D3D) \ -D_FILE_OFFSET_BITS=64 \ @@ -232,6 +233,7 @@ LDFLAGS_UNIXCOMMON=\ -lm \ $(LIB_ODE) \ $(LIB_JPEG) \ + $(LIB_THEORA) \ $(LIB_ZLIB) \ $(LIB_CRYPTO) \ $(LIB_GMP) \