mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
matroska: Add initial VP9 support
This commit is contained in:
parent
f67af2936f
commit
3c9aba91dc
4 changed files with 16 additions and 6 deletions
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue