mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2025-12-22 03:30:17 +00:00
revbump(x11/glslviewer): revbump for ffmpeg-8.0
- Addresses upstream issue: https://github.com/patriciogonzalezvivo/vera/issues/19 Co-authored-by: Ted Stein <me@tedstein.net>
This commit is contained in:
@@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Console-based GLSL Sandbox for 2D/3D shaders"
|
||||
TERMUX_PKG_LICENSE="BSD 3-Clause"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION="3.2.4"
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_REVISION=3
|
||||
TERMUX_PKG_SRCURL=git+https://github.com/patriciogonzalezvivo/glslViewer
|
||||
TERMUX_PKG_GIT_BRANCH=$TERMUX_PKG_VERSION
|
||||
TERMUX_PKG_DEPENDS="ffmpeg, glfw, glu, libdrm, liblo, libxcb, mesa-dev, ncurses"
|
||||
|
||||
81
x11-packages/glslviewer/vera-ffmpeg8-support.patch
Normal file
81
x11-packages/glslviewer/vera-ffmpeg8-support.patch
Normal file
@@ -0,0 +1,81 @@
|
||||
Submodule deps/vera contains modified content
|
||||
diff --git a/deps/vera/src/gl/textureStreamAV.cpp b/deps/vera/src/gl/textureStreamAV.cpp
|
||||
index 0b0d726..f378d75 100644
|
||||
--- a/deps/vera/src/gl/textureStreamAV.cpp
|
||||
+++ b/deps/vera/src/gl/textureStreamAV.cpp
|
||||
@@ -475,9 +475,6 @@ void TextureStreamAV::clear() {
|
||||
if (av_packet)
|
||||
av_free(av_packet);
|
||||
|
||||
- if (av_codec_ctx)
|
||||
- avcodec_close(av_codec_ctx);
|
||||
-
|
||||
if (av_format_ctx)
|
||||
avformat_free_context(av_format_ctx);
|
||||
// avformat_close_input(&av_format_ctx);
|
||||
diff --git a/deps/vera/src/gl/textureStreamAudio.cpp b/deps/vera/src/gl/textureStreamAudio.cpp
|
||||
index 11ce427..b13baac 100644
|
||||
--- a/deps/vera/src/gl/textureStreamAudio.cpp
|
||||
+++ b/deps/vera/src/gl/textureStreamAudio.cpp
|
||||
@@ -15,14 +15,17 @@
|
||||
#define MINIAUDIO_IMPLEMENTATION
|
||||
|
||||
extern "C" {
|
||||
-#include <libavcodec/avfft.h>
|
||||
+// adapted from https://github.com/alexkay/spek/pull/338/files
|
||||
+#include <libavutil/tx.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include "miniaudio.h"
|
||||
}
|
||||
|
||||
ma_device_config a_deviceConfig;
|
||||
ma_device a_device;
|
||||
-static RDFTContext *ctx;
|
||||
+static AVTXContext *ctx;
|
||||
+av_tx_fn tx;
|
||||
+float* tmp;
|
||||
ma_context context;
|
||||
ma_device_info* pPlaybackDeviceInfos;
|
||||
ma_device_info* pCaptureDeviceInfos;
|
||||
@@ -138,7 +141,9 @@ bool TextureStreamAudio::load(const std::string &_device_id_str, bool _vFlip, ve
|
||||
}
|
||||
|
||||
// init dft calculator
|
||||
- ctx = av_rdft_init((int) log2(m_buf_len), DFT_R2C);
|
||||
+ const float scale = 1.0;
|
||||
+ av_tx_init(&ctx, &tx, AV_TX_FLOAT_RDFT, 0, m_buf_len, &scale, 0);
|
||||
+ tmp = (float*) av_malloc((m_buf_len + 2) * sizeof(float));
|
||||
if (!ctx) {
|
||||
ma_device_uninit(&a_device);
|
||||
ma_context_uninit(&context);
|
||||
@@ -192,14 +197,14 @@ bool TextureStreamAudio::update() {
|
||||
m_dft_buffer[i] = value;
|
||||
}
|
||||
|
||||
- av_rdft_calc(ctx, m_dft_buffer);
|
||||
+ tx(ctx, tmp, m_dft_buffer, sizeof(AVComplexFloat));
|
||||
|
||||
// copy frequency values to RED pixels
|
||||
for (int i = 0; i < m_width; i++) {
|
||||
|
||||
// magnitude
|
||||
- float im = m_dft_buffer[i*2];
|
||||
- float re = m_dft_buffer[i*2 + 1];
|
||||
+ float im = tmp[i*2];
|
||||
+ float re = tmp[i*2 + 1];
|
||||
float mag = sqrt(im * im + re * re);
|
||||
|
||||
// experimental scale factor
|
||||
@@ -232,8 +237,10 @@ void TextureStreamAudio::clear() {
|
||||
ma_device_uninit(&a_device);
|
||||
ma_context_uninit(&context);
|
||||
|
||||
- if (ctx)
|
||||
- av_rdft_end(ctx);
|
||||
+ if (ctx) {
|
||||
+ av_tx_uninit(&ctx);
|
||||
+ av_freep(&tmp);
|
||||
+ }
|
||||
|
||||
av_free(m_dft_buffer);
|
||||
|
||||
Reference in New Issue
Block a user