Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add AV1 media types
  • Loading branch information
Nevcairiel committed Sep 12, 2018
1 parent 9215ea7 commit a06f776
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/includes/moreuuids.h
Expand Up @@ -98,6 +98,9 @@ DEFINE_GUID(MEDIASUBTYPE_VP80 ,
DEFINE_GUID(MEDIASUBTYPE_VP90 ,
0x30395056, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);

DEFINE_GUID(MEDIASUBTYPE_AV01,
0x31305641, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);

DEFINE_GUID(MEDIASUBTYPE_IMA4,
0x34616D69, 0x000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
// {34616D69-0000-0010-8000-00AA00389B71}
Expand Down
6 changes: 6 additions & 0 deletions decoder/LAVVideo/Media.cpp
Expand Up @@ -84,6 +84,9 @@ static const FFMPEG_SUBTYPE_MAP lavc_video_codecs[] = {
{ &MEDIASUBTYPE_VP80, AV_CODEC_ID_VP8 },
{ &MEDIASUBTYPE_VP90, AV_CODEC_ID_VP9 },

// AV1
{ &MEDIASUBTYPE_AV01, AV_CODEC_ID_AV1 },

// MPEG4 ASP
{ &MEDIASUBTYPE_XVID, AV_CODEC_ID_MPEG4 },
{ &MEDIASUBTYPE_xvid, AV_CODEC_ID_MPEG4 },
Expand Down Expand Up @@ -347,6 +350,9 @@ const AMOVIESETUP_MEDIATYPE CLAVVideo::sudPinTypesIn[] = {
{ &MEDIATYPE_Video, &MEDIASUBTYPE_VP80 },
{ &MEDIATYPE_Video, &MEDIASUBTYPE_VP90 },

// AV1
{ &MEDIATYPE_Video, &MEDIASUBTYPE_AV01 },

// MPEG4 ASP
{ &MEDIATYPE_Video, &MEDIASUBTYPE_XVID },
{ &MEDIATYPE_Video, &MEDIASUBTYPE_xvid },
Expand Down
8 changes: 8 additions & 0 deletions demuxer/Demuxers/LAVFStreamInfo.cpp
Expand Up @@ -317,6 +317,14 @@ STDMETHODIMP CLAVFStreamInfo::CreateVideoMediaType(AVFormatContext *avctx, AVStr
AV_WB8 (extra + 13, avstream->codecpar->color_space);
AV_WB16(extra + 14, 0); // no codec init data
}
else if (mtype.subtype == MEDIASUBTYPE_AV01) {

// TODO: properly decide on an extradata format for AV1
// Empty it for now, just in case
mtype.ReallocFormatBuffer(sizeof(VIDEOINFOHEADER2));
VIDEOINFOHEADER2 *vih2 = (VIDEOINFOHEADER2 *)mtype.pbFormat;
vih2->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
}
} else if (mtype.formattype == FORMAT_MPEGVideo) {
mtype.pbFormat = (BYTE *)g_VideoHelper.CreateMPEG1VI(avstream, &mtype.cbFormat, m_containerFormat);
} else if (mtype.formattype == FORMAT_MPEG2Video) {
Expand Down
1 change: 1 addition & 0 deletions demuxer/Demuxers/LAVFVideoHelper.cpp
Expand Up @@ -55,6 +55,7 @@ static FormatMapping video_map[] = {
{ AV_CODEC_ID_TARGA, &MEDIASUBTYPE_TGA, MKTAG('T','G','A',' '), nullptr },
{ AV_CODEC_ID_VP8, &MEDIASUBTYPE_VP80, MKTAG('V','P','8','0'), &FORMAT_VideoInfo2 },
{ AV_CODEC_ID_VP9, &MEDIASUBTYPE_VP90, MKTAG('V','P','9','0'), &FORMAT_VideoInfo2 },
{ AV_CODEC_ID_AV1, &MEDIASUBTYPE_AV01, MKTAG('A','V','0','1'), &FORMAT_VideoInfo2 },
{ AV_CODEC_ID_CFHD, &MEDIASUBTYPE_CFHD, MKTAG('C','F','H','D'), &FORMAT_VideoInfo2 },
};

Expand Down

0 comments on commit a06f776

Please sign in to comment.