#include <stdio.h>
#include "./vpx_config.h"
+#include "vpx/vpx_codec.h"
#include "vpx/vpx_image.h"
#include "vpx/vpx_integer.h"
#define RAW_FRAME_HDR_SZ sizeof(uint32_t)
-#define VP8_FOURCC (0x30385056)
-#define VP9_FOURCC (0x30395056)
-#define VP8_FOURCC_MASK (0x00385056)
-#define VP9_FOURCC_MASK (0x00395056)
+#define VP8_FOURCC 0x30385056
+#define VP9_FOURCC 0x30395056
enum VideoFileType {
FILE_TYPE_RAW,
void fatal(const char *fmt, ...);
void warn(const char *fmt, ...);
+void die_codec(vpx_codec_ctx_t *ctx, const char *s);
+
/* The tool including this file must define usage_exit() */
void usage_exit();
int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame);
+typedef struct VpxInterface {
+ const char *const name;
+ const uint32_t fourcc;
+ vpx_codec_iface_t *(*const interface)();
+} VpxInterface;
+
+int get_vpx_encoder_count();
+const VpxInterface *get_vpx_encoder_by_index(int i);
+const VpxInterface *get_vpx_encoder_by_name(const char *name);
+
+int get_vpx_decoder_count();
+const VpxInterface *get_vpx_decoder_by_index(int i);
+const VpxInterface *get_vpx_decoder_by_name(const char *name);
+const VpxInterface *get_vpx_decoder_by_fourcc(uint32_t fourcc);
+
+// TODO(dkovalev): move this function to vpx_image.{c, h}, so it will be part
+// of vpx_image_t support
+int vpx_img_plane_width(const vpx_image_t *img, int plane);
+int vpx_img_plane_height(const vpx_image_t *img, int plane);
+void vpx_img_write(const vpx_image_t *img, FILE *file);
+int vpx_img_read(vpx_image_t *img, FILE *file);
+
#ifdef __cplusplus
} /* extern "C" */
#endif