diff options
author | hkuang <hkuang@google.com> | 2013-11-07 15:50:31 -0800 |
---|---|---|
committer | hkuang <hkuang@google.com> | 2013-11-08 11:40:06 -0800 |
commit | 5ae7ac49f08a179e4f054d99fcfc9dce78d26e58 (patch) | |
tree | 0d891d2cbbac4c3da6fd15a25bf8797b29b31994 /libvpx/vpxdec.c | |
parent | e6eeaaa14ccef4c0938fcce21c54979204041a30 (diff) | |
download | libvpx-5ae7ac49f08a179e4f054d99fcfc9dce78d26e58.tar.gz |
Roll latest libvpx into Android.
The lastest libvpx just added multithread tile decoding support.
Checkout is from master: abdefeaa89a0908327518e5ca75c935c66b2e1aa
Bug:11576718
Change-Id: Icbe5430633e179b8dc6d419e280ad7ebd3cad4a0
Diffstat (limited to 'libvpx/vpxdec.c')
-rw-r--r-- | libvpx/vpxdec.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/libvpx/vpxdec.c b/libvpx/vpxdec.c index 513d7bd57..8e575e16f 100644 --- a/libvpx/vpxdec.c +++ b/libvpx/vpxdec.c @@ -50,8 +50,6 @@ static const char *exec_name; -#define VP8_FOURCC (0x00385056) -#define VP9_FOURCC (0x00395056) static const struct { char const *name; const vpx_codec_iface_t *(*iface)(void); @@ -59,10 +57,10 @@ static const struct { unsigned int fourcc_mask; } ifaces[] = { #if CONFIG_VP8_DECODER - {"vp8", vpx_codec_vp8_dx, VP8_FOURCC, 0x00FFFFFF}, + {"vp8", vpx_codec_vp8_dx, VP8_FOURCC_MASK, 0x00FFFFFF}, #endif #if CONFIG_VP9_DECODER - {"vp9", vpx_codec_vp9_dx, VP9_FOURCC, 0x00FFFFFF}, + {"vp9", vpx_codec_vp9_dx, VP9_FOURCC_MASK, 0x00FFFFFF}, #endif }; @@ -143,7 +141,7 @@ static const arg_def_t *vp8_pp_args[] = { }; #endif -static void usage_exit() { +void usage_exit() { int i; fprintf(stderr, "Usage: %s <options> filename\n\n" @@ -178,14 +176,6 @@ static void usage_exit() { exit(EXIT_FAILURE); } -void die(const char *fmt, ...) { - va_list ap; - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); - usage_exit(); -} - static unsigned int mem_get_le16(const void *vmem) { unsigned int val; const unsigned char *mem = (const unsigned char *)vmem; @@ -501,6 +491,15 @@ webm_guess_framerate(struct input_ctx *input, unsigned int i; uint64_t tstamp = 0; + /* Check to see if we can seek before we parse any data. */ + if (nestegg_track_seek(input->nestegg_ctx, input->video_track, 0)) { + fprintf(stderr, + "WARNING: Failed to guess framerate (no Cues), set to 30fps.\n"); + *fps_num = 30; + *fps_den = 1; + return 0; + } + /* Guess the framerate. Read up to 1 second, or 50 video packets, * whichever comes first. */ @@ -566,9 +565,9 @@ file_is_webm(struct input_ctx *input, codec_id = nestegg_track_codec_id(input->nestegg_ctx, i); if (codec_id == NESTEGG_CODEC_VP8) { - *fourcc = VP8_FOURCC; + *fourcc = VP8_FOURCC_MASK; } else if (codec_id == NESTEGG_CODEC_VP9) { - *fourcc = VP9_FOURCC; + *fourcc = VP9_FOURCC_MASK; } else { fprintf(stderr, "Not VPx video, quitting.\n"); exit(1); |