From 69b570ff425d833a358de1b0f8cc9cead3365f6d Mon Sep 17 00:00:00 2001 From: Hendi Date: Sun, 9 May 2021 21:04:09 +0200 Subject: [PATCH] record/streamts: lower bsf libavcodec check to 57.48.100 (#10) The bit stream filter change was done in ffmpeg 3.1 already. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/91e3f9e51a736ed61b8ef5ca51278720283475fe Author: Hendi Date: 2021-05-09 (Sun, 09 May 2021) --- src/driver/record.cpp | 8 ++++---- src/driver/streamts.cpp | 6 +++--- src/driver/streamts.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 21e3c52d1..32d4e6248 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -79,7 +79,7 @@ class CStreamRec : public CRecordInstance, OpenThreads::Thread private: AVFormatContext *ifcx; AVFormatContext *ofcx; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 )) AVBitStreamFilterContext *bsfc; #else AVBSFContext *bsfc; @@ -2090,7 +2090,7 @@ void CStreamRec::Close() avformat_free_context(ofcx); } if (bsfc){ -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 )) av_bitstream_filter_close(bsfc); #else av_bsf_free(&bsfc); @@ -2384,7 +2384,7 @@ bool CStreamRec::Open(CZapitChannel * channel) av_dump_format(ofcx, 0, ofcx->url, 1); #endif av_log_set_level(AV_LOG_WARNING); -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 )) bsfc = av_bitstream_filter_init("h264_mp4toannexb"); if (!bsfc) printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); @@ -2427,7 +2427,7 @@ void CStreamRec::run() #endif if (bsfc && codec->codec_id == AV_CODEC_ID_H264) { AVPacket newpkt = pkt; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 )) if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 896c03d62..8fb65782f 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -791,7 +791,7 @@ void CStreamStream::Close() av_free(avio_ctx); if (bsfc){ -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 )) av_bitstream_filter_close(bsfc); #else av_bsf_free(&bsfc); @@ -910,7 +910,7 @@ bool CStreamStream::Open() av_dump_format(ofcx, 0, ofcx->url, 1); #endif av_log_set_level(AV_LOG_WARNING); -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 )) bsfc = av_bitstream_filter_init("h264_mp4toannexb"); if (!bsfc) printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); @@ -974,7 +974,7 @@ void CStreamStream::run() #endif if (bsfc && codec->codec_id == AV_CODEC_ID_H264 ) { AVPacket newpkt = pkt; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 )) if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { av_packet_unref(&pkt); newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); diff --git a/src/driver/streamts.h b/src/driver/streamts.h index 51d755083..d2f59b459 100644 --- a/src/driver/streamts.h +++ b/src/driver/streamts.h @@ -73,7 +73,7 @@ class CStreamStream : public CStreamInstance private: AVFormatContext *ifcx; AVFormatContext *ofcx; -#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 )) +#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 )) AVBitStreamFilterContext *bsfc; #else AVBSFContext *bsfc;