To find the state of this project's repository at the time of any of these versions, check out the tags.
example_xma.c 5.48 KiB
/*
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */
/* This is a simple program showing how to initialize the decoder in XMA mode */
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx_config.h"
#include "vpx/vpx_decoder.h"
#include "vpx/vpx_integer.h"
#if CONFIG_VP9_DECODER
#include "vpx/vp8dx.h"
#endif
static char *exec_name;
static int   verbose = 0;
static const struct {
  const char *name;
  const vpx_codec_iface_t *iface;
} ifaces[] = {
#if CONFIG_VP9_DECODER
  {"vp9",  &vpx_codec_vp8_dx_algo},
#endif
static void usage_exit(void) {
  int i;
  printf("Usage: %s <options>\n\n"
         "Options:\n"
         "\t--codec <name>\tCodec to use (default=%s)\n"
         "\t-h <height>\tHeight of the simulated video frame, in pixels\n"
         "\t-w <width> \tWidth of the simulated video frame, in pixels\n"
         "\t-v         \tVerbose mode (show individual segment sizes)\n"
         "\t--help     \tShow this message\n"
         "\n"
         "Included decoders:\n"
         "\n",
         exec_name,
         ifaces[0].name);
  for (i = 0; i < sizeof(ifaces) / sizeof(ifaces[0]); i++)
    printf("    %-6s - %s\n",
           ifaces[i].name,
           vpx_codec_iface_name(ifaces[i].iface));
  exit(EXIT_FAILURE);
static void usage_error(const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  vprintf(fmt, ap);
  printf("\n");
  usage_exit();
void my_mem_dtor(vpx_codec_mmap_t *mmap) {
  if (verbose)