qtdemux: add Dolby Vision fourcc

This identifiers are registered in the MPEG-RA and defined
to be used by the Dolby Vision AVC/HEVC streams.

This is a first step to present the stream to the decoder.
Additional box parsing of DOVIConfigurationBox is necessary
to complete the media presentation with proper Dolby Vision
enhancements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/658>
This commit is contained in:
Stéphane Cerveau 2020-07-01 15:17:47 +02:00
parent 1e39fe66ad
commit c943be8b25
3 changed files with 18 additions and 0 deletions

View file

@ -130,6 +130,11 @@ G_BEGIN_DECLS
#define FOURCC_dvc_ GST_MAKE_FOURCC('d','v','c',' ')
#define FOURCC_dv5p GST_MAKE_FOURCC('d','v','5','p')
#define FOURCC_dv5n GST_MAKE_FOURCC('d','v','5','n')
#define FOURCC_dva1 GST_MAKE_FOURCC('d','v','a','1')
#define FOURCC_dvav GST_MAKE_FOURCC('d','v','a','v')
#define FOURCC_dvh1 GST_MAKE_FOURCC('d','v','h','1')
#define FOURCC_dvhe GST_MAKE_FOURCC('d','v','h','e')
#define FOURCC_dvcC GST_MAKE_FOURCC('d','v','c','C')
#define FOURCC_edts GST_MAKE_FOURCC('e','d','t','s')
#define FOURCC_elst GST_MAKE_FOURCC('e','l','s','t')
#define FOURCC_enda GST_MAKE_FOURCC('e','n','d','a')

View file

@ -7918,6 +7918,8 @@ qtdemux_parse_node (GstQTDemux * qtdemux, GNode * node, const guint8 * buffer,
case FOURCC_H265:
case FOURCC_hvc1:
case FOURCC_hev1:
case FOURCC_dvh1:
case FOURCC_dvhe:
case FOURCC_mjp2:
case FOURCC_encv:
{
@ -11064,6 +11066,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
case FOURCC_H265:
case FOURCC_hvc1:
case FOURCC_hev1:
case FOURCC_dvh1:
case FOURCC_dvhe:
{
gint len = QT_UINT32 (stsd_entry_data) - 0x56;
const guint8 *hevc_data = stsd_entry_data + 0x56;
@ -14166,12 +14170,14 @@ qtdemux_video_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
break;
case FOURCC_H264:
case FOURCC_avc1:
case FOURCC_dva1:
_codec ("H.264 / AVC");
caps = gst_caps_new_simple ("video/x-h264",
"stream-format", G_TYPE_STRING, "avc",
"alignment", G_TYPE_STRING, "au", NULL);
break;
case FOURCC_avc3:
case FOURCC_dvav:
_codec ("H.264 / AVC");
caps = gst_caps_new_simple ("video/x-h264",
"stream-format", G_TYPE_STRING, "avc3",
@ -14179,12 +14185,14 @@ qtdemux_video_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
break;
case FOURCC_H265:
case FOURCC_hvc1:
case FOURCC_dvh1:
_codec ("H.265 / HEVC");
caps = gst_caps_new_simple ("video/x-h265",
"stream-format", G_TYPE_STRING, "hvc1",
"alignment", G_TYPE_STRING, "au", NULL);
break;
case FOURCC_hev1:
case FOURCC_dvhe:
_codec ("H.265 / HEVC");
caps = gst_caps_new_simple ("video/x-h265",
"stream-format", G_TYPE_STRING, "hev1",

View file

@ -186,10 +186,15 @@ static const QtNodeType qt_node_types[] = {
{FOURCC_avcC, "AV codec configuration container", 0},
{FOURCC_avc1, "AV codec configuration v1", 0},
{FOURCC_avc3, "AV codec configuration v3", 0},
{FOURCC_dva1, "AVC-based Dolby Vision derived from avc1", 0},
{FOURCC_dvav, "AVC-based Dolby Vision derived from avc3", 0},
{FOURCC_mp4s, "VOBSUB codec configuration", 0},
{FOURCC_hvc1, "HEVC codec configuration", 0},
{FOURCC_hev1, "HEVC codec configuration", 0},
{FOURCC_hvcC, "HEVC codec configuration container", 0},
{FOURCC_dvhe, "HEVC-based Dolby Vision codec derived from hev1 ", 0},
{FOURCC_dvh1, "HEVC-based Dolby Vision codec derived from hvc1 ", 0},
{FOURCC_dvcC, "HEVC-based Dolby Vision codec configuration container", 0},
{FOURCC_tfdt, "Track fragment decode time", 0, qtdemux_dump_tfdt},
{FOURCC_chap, "Chapter Reference"},
{FOURCC_btrt, "Bitrate information", 0},