Remove RASPI support

This commit is contained in:
Dirk Nehring
2022-05-24 00:09:55 +02:00
parent 115f3b1fce
commit 74847c9bed
6 changed files with 90 additions and 159 deletions

38
codec.c
View File

@@ -234,20 +234,6 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) {
break;
}
}
#endif
#ifdef RASPI
switch (codec_id) {
case AV_CODEC_ID_MPEG2VIDEO:
name = "mpeg2_v4l2m2m";
break;
case AV_CODEC_ID_H264:
name = "h264_v4l2m2m";
// name = "h264_mmal";
break;
case AV_CODEC_ID_HEVC:
name = "hevc_v4l2m2m";
break;
}
#endif
if (name && (video_codec = avcodec_find_decoder_by_name(name))) {
Debug(3, "codec: decoder found\n");
@@ -264,16 +250,10 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) {
Fatal(_("codec: can't allocate video codec context\n"));
}
#ifndef RASPI
if (!HwDeviceContext) {
Fatal("codec: no hw device context to be used");
}
decoder->VideoCtx->hw_device_ctx = av_buffer_ref(HwDeviceContext);
#else
decoder->VideoCtx->pix_fmt = AV_PIX_FMT_DRM_PRIME; /* request a DRM frame */
// decoder->VideoCtx->pix_fmt = AV_PIX_FMT_MMAL; /* request a DRM frame
//*/
#endif
// FIXME: for software decoder use all cpus, otherwise 1
decoder->VideoCtx->thread_count = 1;
@@ -288,7 +268,7 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) {
#ifdef YADIF
deint = 2;
#endif
#if defined VAAPI && !defined RASPI
#if defined VAAPI
// decoder->VideoCtx->extra_hw_frames = 8; // VIDEO_SURFACES_MAX +1
if (video_codec->capabilities & (AV_CODEC_CAP_AUTO_THREADS)) {
Debug(3, "codec: auto threads enabled");
@@ -319,20 +299,6 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) {
#endif
#ifdef RASPI
decoder->VideoCtx->codec_id = codec_id;
decoder->VideoCtx->flags |= AV_CODEC_FLAG_BITEXACT;
if (video_codec->capabilities & AV_CODEC_CAP_FRAME_THREADS || AV_CODEC_CAP_SLICE_THREADS) {
Debug(3, "codec: supports frame threads");
decoder->VideoCtx->thread_count = 4;
// decoder->VideoCtx->thread_type |= FF_THREAD_FRAME;
}
if (video_codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) {
Debug(3, "codec: supports slice threads");
decoder->VideoCtx->thread_type |= FF_THREAD_SLICE;
}
#endif
#ifdef CUVID
if (strcmp(decoder->VideoCodec->long_name,
"Nvidia CUVID MPEG2VIDEO decoder") == 0) { // deinterlace for mpeg2 is somehow broken
@@ -401,7 +367,7 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) {
// reset buggy ffmpeg/libav flag
decoder->GetFormatDone = 0;
#if defined(YADIF) || defined(RASPI)
#if defined(YADIF)
decoder->filter = 0;
#endif
}