--help Print this message
--exe Generate a project for building an Application
--lib Generate a project for creating a static library
+ --dll Generate a project for creating a dll
--static-crt Use the static C runtime (/MT)
--target=isa-os-cc Target specifier (required)
--out=filename Write output to a file [stdout]
;;
--exe) proj_kind="exe"
;;
+ --dll) proj_kind="dll"
+ ;;
--lib) proj_kind="lib"
;;
--src-path-bare=*) src_path_bare="$optval"
case "$proj_kind" in
exe) vs_ConfigurationType=1
;;
+ dll) vs_ConfigurationType=2
+ ;;
*) vs_ConfigurationType=4
;;
esac
# Can only build shared libs on a subset of platforms. Doing this check
# here rather than at option parse time because the target auto-detect
# magic happens after the command line has been parsed.
- enabled linux || die "--enable-shared only supported on ELF for now"
+ enabled linux || enabled win32 || enabled win64 || die "--enable-shared only supported on ELF for now"
fi
if [ -z "$CC" ]; then
echo "Bypassing toolchain for environment detection."
# Set up additional MSVS environment
ifeq ($(CONFIG_MSVS),yes)
-CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
+CODEC_LIB=$(if $(CONFIG_SHARED),vpx,$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd))
# This variable uses deferred expansion intentionally, since the results of
# $(wildcard) may change during the course of the Make.
VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
vpx.vcproj: $(CODEC_SRCS) vpx.def
@echo " [CREATE] $@"
$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
- --lib \
- --target=$(TOOLCHAIN) \
+ $(if $(CONFIG_SHARED),--dll,--lib) \
+ --target=$(TOOLCHAIN) \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--name=vpx \
--proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \
data vpx_codec_vp8_cx_algo
text vpx_codec_vp8_cx
+data vpx_codec_vp8x_cx_algo
+text vpx_codec_vp8x_cx
+
#if CONFIG_EXPERIMENTAL
-vpx_codec_iface_t vpx_codec_vp8x_cx_algo = {
+
+CODEC_INTERFACE(vpx_codec_vp8x_cx) = {
"VP8 Experimental Encoder" VERSION_STRING,
VPX_CODEC_INTERNAL_ABI_VERSION,
VPX_CODEC_CAP_ENCODER | VPX_CODEC_CAP_PSNR,
* VP8 variant, which is bitstream incompatible with the default VP8 encoder.
*/
extern vpx_codec_iface_t vpx_codec_vp8x_cx_algo;
+extern vpx_codec_iface_t *vpx_codec_vp8x_cx(void);
#endif
static const char *exec_name;
#define VP8_FOURCC (0x00385056)
+
static const struct {
- char const *name;
- const vpx_codec_iface_t *iface;
- unsigned int fourcc;
- unsigned int fourcc_mask;
+ char const *name;
+ const vpx_codec_iface_t *(*iface)(void);
+ unsigned int fourcc;
+ unsigned int fourcc_mask;
} ifaces[] = {
#if CONFIG_VP8_DECODER
- {"vp8", &vpx_codec_vp8_dx_algo, VP8_FOURCC, 0x00FFFFFF},
+ {"vp8", vpx_codec_vp8_dx, VP8_FOURCC, 0x00FFFFFF},
#endif
};
+
#include "args.h"
static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1,
"Codec to use");
for (i = 0; i < sizeof(ifaces) / sizeof(ifaces[0]); i++)
fprintf(stderr, " %-6s - %s\n",
ifaces[i].name,
- vpx_codec_iface_name(ifaces[i].iface));
+ vpx_codec_iface_name(ifaces[i].iface()));
exit(EXIT_FAILURE);
}
if (mem_get_le32(buf) < 256 * 1024 * 1024)
for (i = 0; i < sizeof(ifaces) / sizeof(ifaces[0]); i++)
- if (!vpx_codec_peek_stream_info(ifaces[i].iface,
+ if (!vpx_codec_peek_stream_info(ifaces[i].iface(),
buf + 4, 32 - 4, &si)) {
is_raw = 1;
*fourcc = ifaces[i].fourcc;
k = j;
if (k >= 0)
- iface = ifaces[k].iface;
+ iface = ifaces[k].iface();
else
die("Error: Unrecognized argument (%s) to --codec\n",
arg.val);
/* Try to determine the codec from the fourcc. */
for (i = 0; i < sizeof(ifaces) / sizeof(ifaces[0]); i++)
if ((fourcc & ifaces[i].fourcc_mask) == ifaces[i].fourcc) {
- vpx_codec_iface_t *ivf_iface = ifaces[i].iface;
+ vpx_codec_iface_t *ivf_iface = ifaces[i].iface();
if (iface && iface != ivf_iface)
fprintf(stderr, "Notice -- IVF header indicates codec: %s\n",
}
dec_flags = (postproc ? VPX_CODEC_USE_POSTPROC : 0);
- if (vpx_codec_dec_init(&decoder, iface ? iface : ifaces[0].iface, &cfg,
+ if (vpx_codec_dec_init(&decoder, iface ? iface : ifaces[0].iface(), &cfg,
dec_flags)) {
fprintf(stderr, "Failed to initialize decoder: %s\n", vpx_codec_error(&decoder));
return EXIT_FAILURE;
static const char *exec_name;
-static const struct codec_item {
- char const *name;
- const vpx_codec_iface_t *iface;
- unsigned int fourcc;
-} codecs[] = {
-#if CONFIG_EXPERIMENTAL && CONFIG_VP8_ENCODER
- {"vp8x", &vpx_codec_vp8x_cx_algo, 0x78385056},
-#endif
-#if CONFIG_VP8_ENCODER
- {"vp8", &vpx_codec_vp8_cx_algo, 0x30385056},
-#endif
-};
-#define VP8_FOURCC (0x00385056)
+
+#define VP8_FOURCC (0x78385056)
static const struct {
char const *name;
- const vpx_codec_iface_t *iface;
+ const vpx_codec_iface_t *(*iface)(void);
unsigned int fourcc;
unsigned int fourcc_mask;
} ifaces[] = {
#if CONFIG_VP8_DECODER
- {"vp8", &vpx_codec_vp8_dx_algo, VP8_FOURCC, 0x00FFFFFF},
+ {"vp8", &vpx_codec_vp8_dx, VP8_FOURCC, 0x00FFFFFF},
+#endif
+};
+
+static const struct codec_item {
+ char const *name;
+ const vpx_codec_iface_t *(*iface)(void);
+ unsigned int fourcc;
+ unsigned int fourcc_mask;
+} codecs[] = {
+#if CONFIG_VP8_ENCODER
+ {"vp8", vpx_codec_vp8x_cx, VP8_FOURCC, 0x00FFFFFF},
#endif
};
for (i = 0; i < sizeof(codecs) / sizeof(codecs[0]); i++)
fprintf(stderr, " %-6s - %s\n",
codecs[i].name,
- vpx_codec_iface_name(codecs[i].iface));
+ vpx_codec_iface_name(codecs[i].iface()));
exit(EXIT_FAILURE);
}
int pass, one_pass_only = 0;
stats_io_t stats;
vpx_image_t raw;
- const struct codec_item *codec = codecs;
+ struct codec_item *codec = codecs;
int frame_avail, got_data;
struct arg arg;
}
/* Populate encoder configuration */
- res = vpx_codec_enc_config_default(codec->iface, &cfg, arg_usage);
+ res = vpx_codec_enc_config_default(codec->iface(), &cfg, arg_usage);
if (res) {
fprintf(stderr, "Failed to get config: %s\n",
/* Handle codec specific options */
#if CONFIG_VP8_ENCODER
- if (codec->iface == &vpx_codec_vp8_cx_algo
-#if CONFIG_EXPERIMENTAL
- || codec->iface == &vpx_codec_vp8x_cx_algo
-#endif
- ) {
+ if (codec->fourcc == VP8_FOURCC) {
ctrl_args = vp8_args;
ctrl_args_map = vp8_arg_ctrl_map;
}
#define SHOW(field) fprintf(stderr, " %-28s = %d\n", #field, cfg.field)
if (verbose && pass == 0) {
- fprintf(stderr, "Codec: %s\n", vpx_codec_iface_name(codec->iface));
+ fprintf(stderr, "Codec: %s\n", vpx_codec_iface_name(codec->iface()));
fprintf(stderr, "Source file: %s Format: %s\n", in_fn,
arg_use_i420 ? "I420" : "YV12");
fprintf(stderr, "Destination file: %s\n", out_fn);
/* Construct Encoder Context */
- vpx_codec_enc_init(&encoder, codec->iface, &cfg,
+ vpx_codec_enc_init(&encoder, codec->iface(), &cfg,
show_psnr ? VPX_CODEC_USE_PSNR : 0);
ctx_exit_on_error(&encoder, "Failed to initialize encoder");
if (test_decode &&
- vpx_codec_dec_init(&decoder, ifaces[0].iface, &dec_cfg, 0)) {
+ vpx_codec_dec_init(&decoder, ifaces[0].iface(), &dec_cfg, 0)) {
fprintf(stderr,
"Failed to initialize decoder: %s\n",
vpx_codec_error(&decoder));