summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2013-06-21 13:11:32 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-06-21 18:22:13 +0200
commit3c9aba91dcf413495b97675106d3049b7d01fb4e (patch)
treea468ade02d27ad8b2dcb7a7afe4090f4f2acfb07
parentf67af2936fe84765b87ce2f8e0ce629908788b92 (diff)
matroska: Add initial VP9 support
-rw-r--r--gst/matroska/matroska-demux.c6
-rw-r--r--gst/matroska/matroska-ids.h1
-rw-r--r--gst/matroska/matroska-mux.c10
-rw-r--r--gst/matroska/webm-mux.c5
4 files changed, 16 insertions, 6 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index 2a717f6eb..c586f55c5 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -3423,7 +3423,8 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
if ((is_simpleblock && !(flags & 0x80)) || referenceblock) {
delta_unit = TRUE;
invisible_frame = ((flags & 0x08)) &&
- (strcmp (stream->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP8) == 0);
+ (!strcmp (stream->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP8) ||
+ !strcmp (stream->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP9));
}
}
@@ -5065,6 +5066,9 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP8)) {
caps = gst_caps_new_empty_simple ("video/x-vp8");
*codec_name = g_strdup_printf ("On2 VP8");
+ } else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP9)) {
+ caps = gst_caps_new_empty_simple ("video/x-vp9");
+ *codec_name = g_strdup_printf ("On2 VP9");
} else {
GST_WARNING ("Unknown codec '%s', cannot build Caps", codec_id);
return NULL;
diff --git a/gst/matroska/matroska-ids.h b/gst/matroska/matroska-ids.h
index c1b29362b..f19a6d2f5 100644
--- a/gst/matroska/matroska-ids.h
+++ b/gst/matroska/matroska-ids.h
@@ -345,6 +345,7 @@
#define GST_MATROSKA_CODEC_ID_VIDEO_SNOW "V_SNOW"
#define GST_MATROSKA_CODEC_ID_VIDEO_DIRAC "V_DIRAC"
#define GST_MATROSKA_CODEC_ID_VIDEO_VP8 "V_VP8"
+#define GST_MATROSKA_CODEC_ID_VIDEO_VP9 "V_VP9"
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L1 "A_MPEG/L1"
#define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L2 "A_MPEG/L2"
diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c
index cad509de1..d31b1ab4d 100644
--- a/gst/matroska/matroska-mux.c
+++ b/gst/matroska/matroska-mux.c
@@ -961,7 +961,8 @@ gst_matroska_mux_video_pad_setcaps (GstPad * pad, GstCaps * caps)
/* set vp8 defaults or let user override it */
if (GST_MATROSKAMUX_PAD_CAST (pad)->frame_duration_user == FALSE
- && (!strcmp (mimetype, "video/x-vp8")))
+ && (!strcmp (mimetype, "video/x-vp8")
+ || !strcmp (mimetype, "video/x-vp9")))
GST_MATROSKAMUX_PAD_CAST (pad)->frame_duration =
DEFAULT_PAD_FRAME_DURATION_VP8;
@@ -1136,6 +1137,8 @@ skip_details:
gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_VIDEO_DIRAC);
} else if (!strcmp (mimetype, "video/x-vp8")) {
gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_VIDEO_VP8);
+ } else if (!strcmp (mimetype, "video/x-vp9")) {
+ gst_matroska_mux_set_codec_id (context, GST_MATROSKA_CODEC_ID_VIDEO_VP9);
} else if (!strcmp (mimetype, "video/mpeg")) {
gint mpegversion;
@@ -3262,8 +3265,9 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
is_video_keyframe = TRUE;
} else if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DECODE_ONLY) &&
- !strcmp (collect_pad->track->codec_id,
- GST_MATROSKA_CODEC_ID_VIDEO_VP8)) {
+ (!strcmp (collect_pad->track->codec_id, GST_MATROSKA_CODEC_ID_VIDEO_VP8)
+ || !strcmp (collect_pad->track->codec_id,
+ GST_MATROSKA_CODEC_ID_VIDEO_VP9))) {
GST_LOG_OBJECT (mux,
"have VP8 video invisible frame, " "ts=%" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
diff --git a/gst/matroska/webm-mux.c b/gst/matroska/webm-mux.c
index 9f04b3336..19aa24577 100644
--- a/gst/matroska/webm-mux.c
+++ b/gst/matroska/webm-mux.c
@@ -62,10 +62,11 @@ static GstStaticPadTemplate webm_src_templ = GST_STATIC_PAD_TEMPLATE ("src",
);
static GstStaticPadTemplate webm_videosink_templ =
-GST_STATIC_PAD_TEMPLATE ("video_%u",
+ GST_STATIC_PAD_TEMPLATE ("video_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
- GST_STATIC_CAPS ("video/x-vp8, " COMMON_VIDEO_CAPS)
+ GST_STATIC_CAPS ("video/x-vp8, " COMMON_VIDEO_CAPS ";"
+ "video/x-vp9, " COMMON_VIDEO_CAPS)
);
static GstStaticPadTemplate webm_audiosink_templ =