forked from xbmc/xbmc
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ffmpeg] Add MVC support from Koying
- Loading branch information
1 parent
c3a5830
commit c04ccf6
Showing
2 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
From 437127b0d709b7ce660816807e31cf5bbad55c0b Mon Sep 17 00:00:00 2001 | ||
From: "Chris \"koying\" Browet" <cbro@semperpax.com> | ||
Date: Mon, 11 May 2015 15:02:11 +0200 | ||
Subject: [PATCH] add h264 MVC support | ||
|
||
--- | ||
libavcodec/avcodec.h | 4 ++++ | ||
libavcodec/h264.c | 6 ++++++ | ||
libavcodec/h264.h | 3 +++ | ||
libavformat/mov.c | 29 +++++++++++++++++++++++++++++ | ||
libavformat/mpegts.c | 4 +++- | ||
5 files changed, 45 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h | ||
index 4ea6e5a..c7e9492 100644 | ||
--- a/libavcodec/avcodec.h | ||
+++ b/libavcodec/avcodec.h | ||
@@ -292,6 +292,10 @@ enum AVCodecID { | ||
AV_CODEC_ID_MVC2_DEPRECATED, | ||
AV_CODEC_ID_HQX, | ||
|
||
+ /* H264 MVC type */ | ||
+ AV_CODEC_ID_H264MVC = MKBETAG('M','V','C','C'), | ||
+ | ||
+ | ||
AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'), | ||
AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), | ||
AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), | ||
diff --git a/libavcodec/h264.c b/libavcodec/h264.c | ||
index 6529d98..8bcf0e1 100644 | ||
--- a/libavcodec/h264.c | ||
+++ b/libavcodec/h264.c | ||
@@ -1668,6 +1668,12 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size, | ||
case NAL_SPS_EXT: | ||
case NAL_AUXILIARY_SLICE: | ||
break; | ||
+ case NAL_14: | ||
+ case NAL_15: | ||
+ case NAL_20: | ||
+ av_log(avctx, AV_LOG_ERROR, "NAL type: %d for MVC\n", hx->nal_unit_type); | ||
+ avctx->codec_tag = AV_CODEC_ID_H264MVC; | ||
+ break; | ||
case NAL_FF_IGNORE: | ||
break; | ||
default: | ||
diff --git a/libavcodec/h264.h b/libavcodec/h264.h | ||
index 5cb7851..22b09a9 100644 | ||
--- a/libavcodec/h264.h | ||
+++ b/libavcodec/h264.h | ||
@@ -122,7 +122,10 @@ enum { | ||
NAL_END_STREAM = 11, | ||
NAL_FILLER_DATA = 12, | ||
NAL_SPS_EXT = 13, | ||
+ NAL_14 = 14, | ||
+ NAL_15 = 15, | ||
NAL_AUXILIARY_SLICE = 19, | ||
+ NAL_20 = 20, | ||
NAL_FF_IGNORE = 0xff0f001, | ||
}; | ||
|
||
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c | ||
index 336d869..067deee 100644 | ||
--- a/libavformat/mpegts.c | ||
+++ b/libavformat/mpegts.c | ||
@@ -679,7 +679,7 @@ static const StreamType ISO_types[] = { | ||
{ 0x11, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AAC_LATM }, /* LATM syntax */ | ||
#endif | ||
{ 0x1b, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264 }, | ||
- { 0x20, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264 }, | ||
+ { 0x20, AVMEDIA_TYPE_DATA, AV_CODEC_ID_H264 }, | ||
{ 0x24, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_HEVC }, | ||
{ 0x42, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_CAVS }, | ||
{ 0xd1, AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_DIRAC }, | ||
@@ -813,6 +813,8 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, | ||
sub_pes->sub_st = pes->sub_st = sub_st; | ||
} | ||
} | ||
+ if (pes->stream_type == 0x20) // MVC | ||
+ st->codec->codec_tag = AV_CODEC_ID_H264MVC; | ||
if (st->codec->codec_id == AV_CODEC_ID_NONE) | ||
mpegts_find_stream_type(st, pes->stream_type, MISC_types); | ||
if (st->codec->codec_id == AV_CODEC_ID_NONE) { |