Skip to content

Commit

Permalink
#4216 minimal patch for re-enabling decoder and swscale with ffmpeg v7
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Aug 23, 2024
1 parent 0e00991 commit db493b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions packaging/MSWindows/MINGW_BUILD.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PYTHON=python3
KEY_FILE="E:\\xpra.pfx"
DIST="./dist"

BUILD_OPTIONS="${BUILD_OPTIONS} --without-enc_ffmpeg"
if [ "${DO_FULL}" == "0" ]; then
BUILD_OPTIONS="${BUILD_OPTIONS} --without-server --without-shadow --without-proxy --without-rfb"
BUILD_OPTIONS="${BUILD_OPTIONS} --without-dbus"
Expand Down
11 changes: 2 additions & 9 deletions xpra/codecs/ffmpeg/decoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ cdef extern from "libavutil/pixfmt.h":
AVPixelFormat AV_PIX_FMT_BAYER_GBRG16BE
AVPixelFormat AV_PIX_FMT_BAYER_GRBG16LE
AVPixelFormat AV_PIX_FMT_BAYER_GRBG16BE
AVPixelFormat AV_PIX_FMT_XVMC
AVPixelFormat AV_PIX_FMT_YUV440P10LE
AVPixelFormat AV_PIX_FMT_YUV440P10BE
AVPixelFormat AV_PIX_FMT_YUV440P12LE
Expand Down Expand Up @@ -291,10 +290,10 @@ cdef extern from "libavcodec/avcodec.h":
#init and free:
const AVCodec *avcodec_find_decoder(AVCodecID id)
AVCodecContext *avcodec_alloc_context3(const AVCodec *codec)
void avcodec_free_context(AVCodecContext **context)
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
AVFrame* av_frame_alloc()
void av_frame_free(AVFrame **frame)
int avcodec_close(AVCodecContext *avctx)

#actual decoding:
AVPacket *av_packet_alloc() nogil
Expand Down Expand Up @@ -462,7 +461,6 @@ FORMAT_TO_STR = {
AV_PIX_FMT_BAYER_GBRG16BE : "BAYER_GBRG16BE",
AV_PIX_FMT_BAYER_GRBG16LE : "BAYER_GRBG16LE",
AV_PIX_FMT_BAYER_GRBG16BE : "BAYER_GRBG16BE",
AV_PIX_FMT_XVMC : "XVMC",
AV_PIX_FMT_YUV440P10LE : "YUV440P10LE",
AV_PIX_FMT_YUV440P10BE : "YUV440P10BE",
AV_PIX_FMT_YUV440P12LE : "YUV440P12LE",
Expand Down Expand Up @@ -818,12 +816,7 @@ cdef class Decoder:
img.clone_pixel_data()
log("clean_decoder() freeing AVCodecContext: %#x", <uintptr_t> self.codec_ctx)
if self.codec_ctx!=NULL:
r = avcodec_close(self.codec_ctx)
if r!=0:
log.error("Error: failed to close decoder context %#x:", <uintptr_t> self.codec_ctx)
log.error(" %s", av_error_str(r))
av_free(self.codec_ctx)
self.codec_ctx = NULL
avcodec_free_context(&self.codec_ctx)
f = self.file
if f:
self.file = None
Expand Down

0 comments on commit db493b8

Please sign in to comment.