Bug 1360396 - Update nestegg from upstream. r?kinetik
Pull recent changes from the upstream nestegg webm parser
repo. This include a definition of NESTEGG_CODEC_AV1 for
supporting the Alliance for Open Media's AV1 video codec,
and a fix for an unitialized variable warning.
MozReview-Commit-ID: EC1WsaFYlqo
--- a/media/libnestegg/README_MOZILLA
+++ b/media/libnestegg/README_MOZILLA
@@ -1,8 +1,8 @@
The source from this directory was copied from the nestegg
git repository using the update.sh script. The only changes
made were those applied by update.sh and the addition of
Makefile.in build files for the Mozilla build system.
-The nestegg git repository is: git://github.com/kinetiknz/nestegg.git
+The nestegg git repository is: https://github.com/kinetiknz/nestegg
-The git commit ID used was 5e2fb721d5808785475d68f63fc97d45b8a4ef03.
+The git commit ID used was af26fc354ec9eadf5fcd34fb01223be3f6f8a773.
--- a/media/libnestegg/include/nestegg.h
+++ b/media/libnestegg/include/nestegg.h
@@ -22,17 +22,17 @@ extern "C" {
<tt>libnestegg</tt> is a demultiplexing library for <a
href="http://www.webmproject.org/code/specs/container/">WebM</a>
media files.
@section example Example code
@code
nestegg * demux_ctx;
- nestegg_init(&demux_ctx, io, NULL);
+ nestegg_init(&demux_ctx, io, NULL, -1);
nestegg_packet * pkt;
while ((r = nestegg_read_packet(demux_ctx, &pkt)) > 0) {
unsigned int track;
nestegg_packet_track(pkt, &track);
// This example decodes the first track only.
@@ -66,16 +66,17 @@ extern "C" {
#define NESTEGG_TRACK_VIDEO 0 /**< Track is of type video. */
#define NESTEGG_TRACK_AUDIO 1 /**< Track is of type audio. */
#define NESTEGG_TRACK_UNKNOWN INT_MAX /**< Track is of type unknown. */
#define NESTEGG_CODEC_VP8 0 /**< Track uses Google On2 VP8 codec. */
#define NESTEGG_CODEC_VORBIS 1 /**< Track uses Xiph Vorbis codec. */
#define NESTEGG_CODEC_VP9 2 /**< Track uses Google On2 VP9 codec. */
#define NESTEGG_CODEC_OPUS 3 /**< Track uses Xiph Opus codec. */
+#define NESTEGG_CODEC_AV1 4 /**< Track uses AOMedia AV1 codec. */
#define NESTEGG_CODEC_UNKNOWN INT_MAX /**< Track uses unknown codec. */
#define NESTEGG_VIDEO_MONO 0 /**< Track is mono video. */
#define NESTEGG_VIDEO_STEREO_LEFT_RIGHT 1 /**< Track is side-by-side stereo video. Left first. */
#define NESTEGG_VIDEO_STEREO_BOTTOM_TOP 2 /**< Track is top-bottom stereo video. Right first. */
#define NESTEGG_VIDEO_STEREO_TOP_BOTTOM 3 /**< Track is top-bottom stereo video. Left first. */
#define NESTEGG_VIDEO_STEREO_RIGHT_LEFT 11 /**< Track is side-by-side stereo video. Right first. */
--- a/media/libnestegg/src/nestegg.c
+++ b/media/libnestegg/src/nestegg.c
@@ -149,16 +149,17 @@ enum ebml_type_enum {
/* Track Types */
#define TRACK_TYPE_VIDEO 1
#define TRACK_TYPE_AUDIO 2
/* Track IDs */
#define TRACK_ID_VP8 "V_VP8"
#define TRACK_ID_VP9 "V_VP9"
+#define TRACK_ID_AV1 "V_AV1"
#define TRACK_ID_VORBIS "A_VORBIS"
#define TRACK_ID_OPUS "A_OPUS"
/* Track Encryption */
#define CONTENT_ENC_ALGO_AES 5
#define AES_SETTINGS_CIPHER_CTR 1
/* Packet Encryption */
@@ -1041,17 +1042,17 @@ ne_read_single_master(nestegg * ctx, str
return ne_ctx_push(ctx, desc->children, ctx->ancestor->data + desc->offset);
}
static int
ne_read_simple(nestegg * ctx, struct ebml_element_desc * desc, size_t length)
{
struct ebml_type * storage;
- int r;
+ int r = -1;
storage = (struct ebml_type *) (ctx->ancestor->data + desc->offset);
if (storage->read) {
ctx->log(ctx, NESTEGG_LOG_DEBUG, "element %llx (%s) already read, skipping",
desc->id, desc->name);
return 0;
}
@@ -2365,16 +2366,19 @@ nestegg_track_codec_id(nestegg * ctx, un
return -1;
if (strcmp(codec_id, TRACK_ID_VP8) == 0)
return NESTEGG_CODEC_VP8;
if (strcmp(codec_id, TRACK_ID_VP9) == 0)
return NESTEGG_CODEC_VP9;
+ if (strcmp(codec_id, TRACK_ID_AV1) == 0)
+ return NESTEGG_CODEC_AV1;
+
if (strcmp(codec_id, TRACK_ID_VORBIS) == 0)
return NESTEGG_CODEC_VORBIS;
if (strcmp(codec_id, TRACK_ID_OPUS) == 0)
return NESTEGG_CODEC_OPUS;
return NESTEGG_CODEC_UNKNOWN;
}