From 77745289c49216d0daa10096e9159bc070e7ef32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 6 Jan 2014 14:54:38 +0100 Subject: [PATCH] matroskademux: Add HEVC / h265 support --- gst/matroska/matroska-demux.c | 20 ++++++++++++++++++++ gst/matroska/matroska-ids.h | 1 + 2 files changed, 21 insertions(+) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 9b15a3de00..7e398130e4 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -5125,6 +5125,26 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext * NULL); } *codec_name = g_strdup ("H264"); + } else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_MPEGH_HEVC)) { + caps = gst_caps_new_empty_simple ("video/x-h265"); + if (data) { + GstBuffer *priv; + + gst_codec_utils_h265_caps_set_level_tier_and_profile (caps, data + 1, + size - 1); + + priv = gst_buffer_new_wrapped (g_memdup (data, size), size); + gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, priv, NULL); + gst_buffer_unref (priv); + + gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "hvc1", + "alignment", G_TYPE_STRING, "au", NULL); + } else { + GST_WARNING ("No codec data found, assuming output is byte-stream"); + gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "byte-stream", + NULL); + } + *codec_name = g_strdup ("HEVC"); } else if ((!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_REALVIDEO1)) || (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_REALVIDEO2)) || (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_VIDEO_REALVIDEO3)) || diff --git a/gst/matroska/matroska-ids.h b/gst/matroska/matroska-ids.h index f19a6d2f58..8d8862312d 100644 --- a/gst/matroska/matroska-ids.h +++ b/gst/matroska/matroska-ids.h @@ -346,6 +346,7 @@ #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_VIDEO_MPEGH_HEVC "V_MPEGH/ISO/HEVC" #define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L1 "A_MPEG/L1" #define GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L2 "A_MPEG/L2" -- 2.34.1