From 987ac894037845fa406aaf7b9f502302993be295 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Mon, 28 Feb 2011 20:06:56 -0500 Subject: [PATCH] examples: use function to get iface pointers MSVC can't pass the address of global variables in a DLL correctly across DLL boundaries. This patch allows linking the examples to a libvpx dll build. Fixes issue #268. Change-Id: I1c52d076cfc68efb3efdfba019f12d53c5019f58 --- examples/decoder_tmpl.c | 2 +- examples/decoder_tmpl.txt | 2 +- examples/encoder_tmpl.c | 2 +- examples/encoder_tmpl.txt | 2 +- examples/simple_decoder.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/decoder_tmpl.c b/examples/decoder_tmpl.c index 26b745d34..c70681b1a 100644 --- a/examples/decoder_tmpl.c +++ b/examples/decoder_tmpl.c @@ -19,7 +19,7 @@ #define VPX_CODEC_DISABLE_COMPAT 1 #include "vpx/vpx_decoder.h" #include "vpx/vp8dx.h" -#define interface (&vpx_codec_vp8_dx_algo) +#define interface (vpx_codec_vp8_dx()) @EXTRA_INCLUDES diff --git a/examples/decoder_tmpl.txt b/examples/decoder_tmpl.txt index 310c66d54..7dd05d1ff 100644 --- a/examples/decoder_tmpl.txt +++ b/examples/decoder_tmpl.txt @@ -2,7 +2,7 @@ #define VPX_CODEC_DISABLE_COMPAT 1 #include "vpx/vpx_decoder.h" #include "vpx/vp8dx.h" -#define interface (&vpx_codec_vp8_dx_algo) +#define interface (vpx_codec_vp8_dx()) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INCLUDES diff --git a/examples/encoder_tmpl.c b/examples/encoder_tmpl.c index d9e4d0317..f109e6216 100644 --- a/examples/encoder_tmpl.c +++ b/examples/encoder_tmpl.c @@ -19,7 +19,7 @@ #define VPX_CODEC_DISABLE_COMPAT 1 #include "vpx/vpx_encoder.h" #include "vpx/vp8cx.h" -#define interface (&vpx_codec_vp8_cx_algo) +#define interface (vpx_codec_vp8_cx()) #define fourcc 0x30385056 @EXTRA_INCLUDES diff --git a/examples/encoder_tmpl.txt b/examples/encoder_tmpl.txt index 3273164da..00420713a 100644 --- a/examples/encoder_tmpl.txt +++ b/examples/encoder_tmpl.txt @@ -2,7 +2,7 @@ #define VPX_CODEC_DISABLE_COMPAT 1 #include "vpx/vpx_encoder.h" #include "vpx/vp8cx.h" -#define interface (&vpx_codec_vp8_cx_algo) +#define interface (vpx_codec_vp8_cx()) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INCLUDES diff --git a/examples/simple_decoder.txt b/examples/simple_decoder.txt index be8ca734a..90d9a6870 100644 --- a/examples/simple_decoder.txt +++ b/examples/simple_decoder.txt @@ -33,7 +33,7 @@ Initializing The Codec ---------------------- The decoder is initialized by the following code. This is an example for the VP8 decoder, but the code is analogous for all algorithms. Replace -`&vpx_codec_vp8_dx_algo` with a pointer to the interface exposed by the +`vpx_codec_vp8_dx()` with a pointer to the interface exposed by the algorithm you want to use. The `cfg` argument is left as NULL in this example, because we want the algorithm to determine the stream configuration (width/height) and allocate memory automatically. This