Adding API to get vpx encoder/decoder interface.

Change-Id: I137e5e6585356792913e1e84da6c0a439c5153a5
This commit is contained in:
Dmitry Kovalev
2014-02-11 21:12:23 -08:00
parent 9453c64726
commit 70d9664fb2
12 changed files with 210 additions and 183 deletions

View File

@@ -76,7 +76,7 @@ int main(int argc, char **argv) {
int frame_cnt = 0;
FILE *outfile = NULL;
vpx_codec_ctx_t codec;
vpx_codec_iface_t *iface = NULL;
const VpxInterface *decoder = NULL;
VpxVideoReader *reader = NULL;
const VpxVideoInfo *info = NULL;
int n = 0;
@@ -104,13 +104,13 @@ int main(int argc, char **argv) {
info = vpx_video_reader_get_info(reader);
iface = get_codec_interface(info->codec_fourcc);
if (!iface)
decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
if (!decoder)
die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(iface));
printf("Using %s\n", vpx_codec_iface_name(decoder->interface()));
if (vpx_codec_dec_init(&codec, iface, NULL, 0))
if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0))
die_codec(&codec, "Failed to initialize decoder.");
while (vpx_video_reader_read_frame(reader)) {