Skip to content

Commit

Permalink
Remove old RPI4 hw accel
Browse files Browse the repository at this point in the history
This was based around the /dev/rpi_hevcmem interface, which is no longer supported or working on the current versions of raspbian
  • Loading branch information
mpiatka committed Mar 6, 2024
1 parent 0b216f9 commit 30eab46
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 793 deletions.
30 changes: 1 addition & 29 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,6 @@ fi
lavc_hwacc_common=no
lavc_hwacc_vdpau=no
lavc_hwacc_vaapi=no
lavc_hwacc_rpi4=no

define(lavc_hwacc_common_dep, libavcodec libavutil >= 55.22.1)
define(lavc_hwacc_vdpau_dep, lavc_hwacc_common_dep vdpau)
Expand All @@ -1591,13 +1590,6 @@ AC_ARG_ENABLE(lavc-hw-accel-vaapi,
[lavc_hwacc_vaapi_req=$build_default]
)

AC_ARG_ENABLE(lavc-hw-accel-rpi4,
[ --disable-lavc-hw-accel-rpi4 disable lavc-hw-accel-rpi4 (default is auto)]
[ Requires: Raspbian-patched ffmpeg libmmal],
[lavc_hwacc_rpi4_req=$enableval],
[lavc_hwacc_rpi4_req=$build_default]
)

LAVC_HWACC_FLAGS=-DHWACC_COMMON_IMPL
LAVC_HWACC_LIBS=
HW_ACC_OBJ="src/hwaccel_libav_common.o"
Expand All @@ -1622,25 +1614,6 @@ if test $lavc_hwacc_vaapi_req != no; then
lavc_hwacc_common=yes
fi
fi
if test $lavc_hwacc_rpi4_req != no; then
SAVED_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/vc/lib/pkgconfig/"
PKG_CHECK_MODULES([MMAL], [mmal], [ FOUND_HWACC_RPI4_DEP=yes ], [ FOUND_HWACC_RPI4_DEP=no ])
PKG_CHECK_MODULES([BCM_HOST], [bcm_host], [ ], [ FOUND_HWACC_RPI4_DEP=no ])
PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH
AC_CHECK_HEADER([libavcodec/rpi_zc.h], [ ], [FOUND_HWACC_RPI4_DEP=no], [#include <libavcodec/avcodec.h>])
SAVED_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS ${MMAL_CFLAGS}"
AC_CHECK_HEADER([interface/mmal/mmal.h], [], [FOUND_HWACC_RPI4_DEP=no])
CFLAGS=$SAVED_CFLAGS
if test "$FOUND_HWACC_RPI4_DEP" = yes; then
LAVC_HWACC_FLAGS="${LAVC_HWACC_FLAGS} -DHWACC_RPI4 ${MMAL_CFLAGS} ${BCM_HOST_CFLAGS}"
LAVC_HWACC_LIBS="${LAVC_HWACC_LIBS} ${MMAL_LIBS} ${BCM_HOST_LIBS}"
add_module rpi4_hw_accel src/video_display/rpi4_out.o "${MMAL_LIBS} ${BCM_HOST_LIBS}"
lavc_hwacc_rpi4=yes
lavc_hwacc_common=yes
fi
fi
if test $system = MacOSX; then
lavc_hwacc_common=yes
fi
Expand All @@ -1652,7 +1625,6 @@ fi

ENSURE_FEATURE_PRESENT([$lavc_hwacc_vdpau_req], [$lavc_hwacc_vdpau], [Could not find hwacc vdpau dependencies])
ENSURE_FEATURE_PRESENT([$lavc_hwacc_vaapi_req], [$lavc_hwacc_vaapi], [Could not find hwacc vaapi dependencies!])
ENSURE_FEATURE_PRESENT([$lavc_hwacc_rpi4_req], [$lavc_hwacc_rpi4], [Could not find hwacc rpi4 dependencies!])

# -------------------------------------------------------------------------------------------------
# Libswscale
Expand Down Expand Up @@ -3515,7 +3487,7 @@ RESULT=`add_column "$RESULT" "Comprimato J2K" $cmpto_j2k $?`
RESULT=`add_column "$RESULT" "CUDA DXT" $cuda_dxt $?`
RESULT=`add_column "$RESULT" "GPUJPEG" $gpujpeg $?`
RESULT=`add_column "$RESULT" "GPUJPEG transcode to DXT" $gpujpeg_to_dxt $?`
RESULT=`add_column "$RESULT" "Lavc (VDP $lavc_hwacc_vdpau, VA $lavc_hwacc_vaapi, RPI4 $lavc_hwacc_rpi4)" $libavcodec $?`
RESULT=`add_column "$RESULT" "Lavc (VDP $lavc_hwacc_vdpau, VA $lavc_hwacc_vaapi)" $libavcodec $?`
RESULT=`add_column "$RESULT" "Realtime DXT" $rtdxt $?`
RESULT=`add_column "$RESULT" "UYVY dummy compression" $uyvy $?`
RESULT=`end_section "$RESULT"`
Expand Down
1 change: 0 additions & 1 deletion src/hwaccel_libav_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ static const struct {
{ "vdpau-copy", HWACCEL_VDPAU, AV_PIX_FMT_VDPAU, HW_VDPAU},
{ "vaapi", HWACCEL_VAAPI, AV_PIX_FMT_VAAPI, 0 },
{ "videotoolbox", HWACCEL_VIDEOTOOLBOX, AV_PIX_FMT_VIDEOTOOLBOX, 0 },
{ "rpi4", HWACCEL_RPI4, AV_PIX_FMT_RPI4_8, RPI4_8 },
{ "cuda", HWACCEL_CUDA, AV_PIX_FMT_CUDA, 0 },
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 39, 100)
{ "vulkan", HWACCEL_VULKAN, AV_PIX_FMT_VULKAN, 0 },
Expand Down
66 changes: 0 additions & 66 deletions src/hwaccel_rpi4.h

This file was deleted.

15 changes: 0 additions & 15 deletions src/libavcodec/from_lavc_vid_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#include "compat/qsort_s.h"
#include "debug.h"
#include "host.h"
#include "hwaccel_rpi4.h"
#include "hwaccel_vdpau.h"
#include "libavcodec/from_lavc_vid_conv.h"
#include "libavcodec/lavc_common.h"
Expand Down Expand Up @@ -2040,20 +2039,6 @@ static void av_vdpau_to_ug_vdpau(char * __restrict dst_buffer, AVFrame * __restr
}
#endif

#ifdef HWACC_RPI4
static void av_rpi4_8_to_ug(char * __restrict dst_buffer, AVFrame * __restrict in_frame,
int width, int height, int pitch, const int * __restrict rgb_shift)
{
UNUSED(width);
UNUSED(height);
UNUSED(pitch);
UNUSED(rgb_shift);

av_frame_wrapper *out = (av_frame_wrapper *)(void *) dst_buffer;
av_frame_ref(out->av_frame, in_frame);
}
#endif

static void ayuv64_to_uyvy(char * __restrict dst_buffer, AVFrame * __restrict in_frame,
int width, int height, int pitch, const int * __restrict rgb_shift)
{
Expand Down
1 change: 0 additions & 1 deletion src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ enum hw_accel_type {
HWACCEL_VDPAU,
HWACCEL_VAAPI,
HWACCEL_VIDEOTOOLBOX,
HWACCEL_RPI4,
HWACCEL_CUDA,
HWACCEL_VULKAN,
HWACCEL_COUNT
Expand Down
3 changes: 0 additions & 3 deletions src/video_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
#include "debug.h"
#include "host.h"
#include "hwaccel_vdpau.h"
#include "hwaccel_rpi4.h"
#include "utils/macros.h" // to_fourcc, OPTIMEZED_FOR
#include "video_codec.h"

Expand Down Expand Up @@ -165,8 +164,6 @@ static const struct codec_info_t codec_info[] = {
to_fourcc('M','J','2','R'), 1, 1, 0, 8, FALSE, TRUE, FALSE, FALSE, 0, "j2k"},
[HW_VDPAU] = {"HW_VDPAU", "VDPAU hardware surface",
to_fourcc('V', 'D', 'P', 'S'), HW_VDPAU_FRAME_SZ, 1, 0, 8, FALSE, TRUE, FALSE, TRUE, 4440, "vdpau"},
[RPI4_8] = {"RPI4_8", "Raspberry pi 4 hw. decoded (SAND)",
to_fourcc('S', 'A', 'N', 'D'), sizeof(av_frame_wrapper), 1, 0, 8, FALSE, TRUE, FALSE, TRUE, 4200, "sand"},
[HFYU] = {"HFYU", "HuffYUV",
to_fourcc('H','F','Y','U'), 1, 1, 0, 8, FALSE, TRUE, FALSE, FALSE, 0, "hfyu"},
[FFV1] = {"FFV1", "FFV1",
Expand Down
16 changes: 0 additions & 16 deletions src/video_decompress/libavcodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,19 +485,6 @@ static int libavcodec_decompress_reconfigure(void *state, struct video_desc desc
return configure_with(s, desc, NULL, 0);
}

#ifdef HWACC_RPI4
static int rpi4_hwacc_init(struct AVCodecContext *s,
struct hw_accel_state *state,
codec_t out_codec)
{
UNUSED(s), UNUSED(out_codec);
state->type = HWACCEL_RPI4;
state->copy = false;
return 0;
}
#endif


#if defined HWACC_COMMON_IMPL && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 39, 100)
static int vulkan_init(struct AVCodecContext *s,
struct hw_accel_state *state,
Expand Down Expand Up @@ -609,9 +596,6 @@ static enum AVPixelFormat get_format_callback(struct AVCodecContext *s, const en
#endif
#ifdef HAVE_MACOSX
{AV_PIX_FMT_VIDEOTOOLBOX, videotoolbox_init},
#endif
#ifdef HWACC_RPI4
{AV_PIX_FMT_RPI4_8, rpi4_hwacc_init},
#endif
{AV_PIX_FMT_NONE, NULL}
};
Expand Down
Loading

0 comments on commit 30eab46

Please sign in to comment.