[packages/simplescreenrecorder] - fix building with ffmpeg 4.0 - add missing c++ header - rel 3
baggins
baggins at pld-linux.org
Sun Apr 29 20:06:28 CEST 2018
commit 68d77f5bc43f0c98885948dd7a0c4a3b8570a68d
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sun Apr 29 20:06:05 2018 +0200
- fix building with ffmpeg 4.0
- add missing c++ header
- rel 3
build.patch | 10 +++++++
ffmpeg4.patch | 69 +++++++++++++++++++++++++++++++++++++++++++++++
simplescreenrecorder.spec | 6 ++++-
3 files changed, 84 insertions(+), 1 deletion(-)
---
diff --git a/simplescreenrecorder.spec b/simplescreenrecorder.spec
index 8c4a0eb..1459043 100644
--- a/simplescreenrecorder.spec
+++ b/simplescreenrecorder.spec
@@ -2,11 +2,13 @@ Summary: Screen recorder for Linux
Summary(pl.UTF-8): Nagrywarka ekranu dla Linuksa
Name: simplescreenrecorder
Version: 0.3.6
-Release: 2
+Release: 3
License: GPL v3
Group: Applications
Source0: https://github.com/MaartenBaert/ssr/archive/%{version}/ssr-%{version}.tar.gz
# Source0-md5: 3c0dcf288c0cc1b21f4cd2010c73d5ae
+Patch0: build.patch
+Patch1: ffmpeg4.patch
URL: http://www.maartenbaert.be/simplescreenrecorder/
BuildRequires: Mesa-libGL-devel
BuildRequires: Mesa-libGLU-devel
@@ -46,6 +48,8 @@ OpenGL applications, for use with the SimpleScreenRecorder.
%prep
%setup -q -n ssr-%{version}
+%patch0 -p1
+%patch1 -p1
%build
%{__libtoolize}
diff --git a/build.patch b/build.patch
new file mode 100644
index 0000000..a427035
--- /dev/null
+++ b/build.patch
@@ -0,0 +1,10 @@
+--- ssr-0.3.6/src/Benchmark.cpp.orig 2015-11-02 22:13:49.000000000 +0100
++++ ssr-0.3.6/src/Benchmark.cpp 2018-04-29 20:00:46.863057424 +0200
+@@ -25,6 +25,7 @@
+ #include "FastScaler_Scale.h"
+ #include "Logger.h"
+ #include "TempBuffer.h"
++#include <random>
+
+ struct ImageGeneric {
+
diff --git a/ffmpeg4.patch b/ffmpeg4.patch
new file mode 100644
index 0000000..ed2e886
--- /dev/null
+++ b/ffmpeg4.patch
@@ -0,0 +1,69 @@
+--- ssr-0.3.6/src/Global.h~ 2015-11-02 22:13:49.000000000 +0100
++++ ssr-0.3.6/src/Global.h 2018-04-29 19:51:10.866406546 +0200
+@@ -326,9 +326,6 @@
+ inline double ToDouble(const AVRational& r) {
+ return (double) r.num / (double) r.den;
+ }
+-inline double ToDouble(const AVFrac& f) {
+- return (double) f.val + (double) f.num / (double) f.den;
+-}
+
+ inline void GroupEnabled(std::initializer_list<QAction*> actions, bool enabled) {
+ for(QAction *a : actions) {
+--- ssr-0.3.6/src/AV/Output/AudioEncoder.cpp~ 2015-11-02 22:13:49.000000000 +0100
++++ ssr-0.3.6/src/AV/Output/AudioEncoder.cpp 2018-04-29 19:52:26.060460580 +0200
+@@ -59,7 +59,7 @@
+
+ unsigned int AudioEncoder::GetFrameSize() {
+ #if SSR_USE_AVCODEC_ENCODE_AUDIO2
+- return (GetStream()->codec->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)? DEFAULT_FRAME_SAMPLES : GetStream()->codec->frame_size;
++ return (GetStream()->codec->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)? DEFAULT_FRAME_SAMPLES : GetStream()->codec->frame_size;
+ #else
+ return (GetStream()->codec->frame_size <= 1)? DEFAULT_FRAME_SAMPLES : GetStream()->codec->frame_size;
+ #endif
+@@ -121,7 +121,7 @@
+ if(key == "threads") {
+ stream->codec->thread_count = ParseCodecOptionInt(key, value, 1, 100);
+ } else if(key == "qscale") {
+- stream->codec->flags |= CODEC_FLAG_QSCALE;
++ stream->codec->flags |= AV_CODEC_FLAG_QSCALE;
+ stream->codec->global_quality = lrint(ParseCodecOptionDouble(key, value, -1.0e6, 1.0e6, FF_QP2LAMBDA));
+ } else if(key == "sampleformat") {
+ sample_format_name = value;
+--- ssr-0.3.6/src/AV/Output/BaseEncoder.cpp~ 2015-11-02 22:13:49.000000000 +0100
++++ ssr-0.3.6/src/AV/Output/BaseEncoder.cpp 2018-04-29 19:52:56.784084323 +0200
+@@ -207,7 +207,7 @@
+ }
+
+ // flush the encoder
+- if(!m_should_stop && (m_stream->codec->codec->capabilities & CODEC_CAP_DELAY)) {
++ if(!m_should_stop && (m_stream->codec->codec->capabilities & AV_CODEC_CAP_DELAY)) {
+ Logger::LogInfo("[BaseEncoder::EncoderThread] " + Logger::tr("Flushing encoder ..."));
+ while(!m_should_stop) {
+ if(EncodeFrame(NULL)) {
+--- ssr-0.3.6/src/AV/Output/Muxer.cpp~ 2015-11-02 22:13:49.000000000 +0100
++++ ssr-0.3.6/src/AV/Output/Muxer.cpp 2018-04-29 19:54:03.428041137 +0200
+@@ -289,10 +289,10 @@
+
+ // not sure why this is needed, but it's in the example code and it doesn't work without this
+ if(m_format_context->oformat->flags & AVFMT_GLOBALHEADER)
+- stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ // if the codec is experimental, allow it
+- if(codec->capabilities & CODEC_CAP_EXPERIMENTAL) {
++ if(codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) {
+ Logger::LogWarning("[Muxer::AddStream] " + Logger::tr("Warning: This codec is considered experimental by libav/ffmpeg."));
+ stream->codec->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
+ }
+--- ssr-0.3.6/src/AV/Output/VideoEncoder.cpp~ 2015-11-02 22:13:49.000000000 +0100
++++ ssr-0.3.6/src/AV/Output/VideoEncoder.cpp 2018-04-29 19:54:53.401837201 +0200
+@@ -147,7 +147,7 @@
+ if(key == "threads") {
+ stream->codec->thread_count = ParseCodecOptionInt(key, value, 1, 100);
+ } else if(key == "qscale") {
+- stream->codec->flags |= CODEC_FLAG_QSCALE;
++ stream->codec->flags |= AV_CODEC_FLAG_QSCALE;
+ stream->codec->global_quality = lrint(ParseCodecOptionDouble(key, value, -1.0e6, 1.0e6, FF_QP2LAMBDA));
+ } else if(key == "minrate") {
+ stream->codec->rc_min_rate = ParseCodecOptionInt(key, value, 1, 1000000, 1024); // kbps
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/simplescreenrecorder.git/commitdiff/68d77f5bc43f0c98885948dd7a0c4a3b8570a68d
More information about the pld-cvs-commit
mailing list