Merge branch 'CR_745_FFMPEG_Arvin.zhu' into 'jh7110-mm-devel'

ffmpeg: enable omx

See merge request sdk/buildroot!9
This commit is contained in:
andy.hu
2022-06-09 09:45:58 +00:00
committed by Andy Hu
2 changed files with 27 additions and 16 deletions
@@ -68,22 +68,22 @@ index 86e32a8..023db9c 100644
break;
- } else {
+ } else if (avctx->codec->id == AV_CODEC_ID_HEVC) {
++ // For H.265, the extradata can be returned in two separate buffers
++ // (the videocore encoder on raspberry pi does this);
++ // therefore check that we have got both SPS and PPS before continuing.
++ int nals[128] = { 0 };
++ int i;
++ for (i = 0; i + 4 < avctx->extradata_size; i++) {
++ if (!avctx->extradata[i + 0] &&
++ !avctx->extradata[i + 1] &&
++ !avctx->extradata[i + 2] &&
++ avctx->extradata[i + 3] == 1) {
++ nals[(avctx->extradata[i + 4] & 0x7E) >> 1]++;
++ }
++ }
++ if (nals[HEVC_NAL_SPS] && nals[HEVC_NAL_PPS] && nals[HEVC_NAL_VPS])
++ break;
++ } else {
+ // For H.265, the extradata can be returned in two separate buffers
+ // (the videocore encoder on raspberry pi does this);
+ // therefore check that we have got both SPS and PPS before continuing.
+ int nals[128] = { 0 };
+ int i;
+ for (i = 0; i + 4 < avctx->extradata_size; i++) {
+ if (!avctx->extradata[i + 0] &&
+ !avctx->extradata[i + 1] &&
+ !avctx->extradata[i + 2] &&
+ avctx->extradata[i + 3] == 1) {
+ nals[(avctx->extradata[i + 4] & 0x7E) >> 1]++;
+ }
+ }
+ if (nals[HEVC_NAL_SPS] && nals[HEVC_NAL_PPS] && nals[HEVC_NAL_VPS])
+ break;
+ } else {
if (avctx->extradata_size > 0)
break;
}
+11
View File
@@ -189,6 +189,13 @@ else
FFMPEG_CONF_OPTS += --disable-outdevs
endif
ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
FFMPEG_CONF_OPTS += --enable-libpulse
FFMPEG_DEPENDENCIES += pulseaudio
else
FFMPEG_CONF_OPTS += --disable-libpulse
endif
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
FFMPEG_CONF_OPTS += --enable-pthreads
else
@@ -285,6 +292,10 @@ ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
FFMPEG_CONF_OPTS += --enable-mmal --enable-omx --enable-omx-rpi \
--extra-cflags=-I$(STAGING_DIR)/usr/include/IL
FFMPEG_DEPENDENCIES += rpi-userland
else ifeq ($(BR2_PACKAGE_SF_OMX_IL),y)
FFMPEG_CONF_OPTS += --disable-mmal --enable-omx --disable-omx-rpi \
--extra-cflags=-I$(STAGING_DIR)/usr/include/omx-il
FFMPEG_DEPENDENCIES += sf-omx-il
else
FFMPEG_CONF_OPTS += --disable-mmal --disable-omx --disable-omx-rpi
endif