tried to make more real patches:

$ git format-patch -o randrik/ e04ca4a9e14
randrik/0001-constify-fileffmpeg.C.patch
randrik/0002-ifdef-for-DV.patch
randrik/0003-TERMUX-ifdefs-in-guicast.patch
randrik/0004-libzmpeg-TERMUX-ifdefs.patch
randrik/0005-Add-libzmpeg-ifdef-in-fileac3-move-fireware-objects-.patch
randrik/0006-more-ifdefs-for-file.C-ac3-demand-libzmpeg.patch

note patch0001 re-enables leaking ff->video_probe(), so do not apply
as-is....
0002 should be safe for apply
0003/0004  a bit more involved and adds header for termux compilation
0005/0006 should be safe to apply together

On Friday, May 7, 2021, Andrew Randrianasulu <[email protected]>
wrote:

> Update:
>
> Found few more problems, most dangerously-looking in guicast/
>
> Fixed compilation of guicast/cinelerra object files by adding this patch
>
> New_cin_termux-3.diff
>
> And placing bthread.h in guicast
> bthread.h from
>
> https://github.com/tux-mind/libbthread/blob/master/bthread.h
>
>
> Config:
>
> $ ./configure --without-lv2 --without-vaapi --without-vdpau
> --without-shuttle_usb --with-clang --enable-static-build --with-single-user
> --without-shuttle --without-libzmpeg --without-fireware --without-dv
> --without-dvb --without-openexr
>
> Without-fireware somewhat does not work, need to fix global-config by hand
>
> After fixing sh to bash in configure I still was forced to fix
> global-config by adding there
>
> +CFLAGS += -DNO_BTRACE
>  +CFLAGS += -DNO_GDB
>  +CFLAGS += -DNO_CTX
>
> Probably must be default on non-x86?
>
> I still can't build cin more fully due to space constrains.
>
>
>
> On Thursday, May 6, 2021, Andrew Randrianasulu <[email protected]>
> wrote:
>
>> Hello all!
>> So,  because I only have this tablet:
>>
>> $ termux-info Packages CPU architecture: arm
>>  Subscribed repositories: # sources.list deb
>> https://ipfs.io/ipns/k51qzi5uqu5dg9vawh923wejqffxiu9bhqlze5f
>> 508msk0h7ylpac27fdgaskx stable main
>>  # science-repo (sources.list.d/science.list) deb
>> https://grimler.se/science-packages-24 science stable
>>  # game-repo (sources.list.d/game.list) deb
>> https://grimler.se/game-packages-24 games stable
>>  # x11-repo (sources.list.d/x11.list) deb https://termux.com/x11-package
>> s-bin x11 main
>>  Updatable packages: All packages up to date
>>  Android version: 10
>>  Kernel build information: Linux localhost 4.14.141+ #1 SMP PREEMPT Mon
>> Mar 29 18:09:45 CST 2021 armv8l
>> Android Device manufacturer: HUAWEI
>>  Device model: KOB2-L09
>>
>> I tried to do my best and compile Cingg on *that*
>> Of course my attempt failed So far, but at least buildsystem  unpack
>> sources correctly and start to build them.
>>
>> I installed termux from so-called AppGallery (but termux actually exist
>> for F-droid, libre/oss repo independent from Google play), and updated it,
>> after installing few utilites and editing source list (it uses apt, like
>> debian, while you can call it as 'pkg search blah, pkg install meh')
>> because since mid-2020 they changed their way Of hosting binaries
>>
>> More about termux :
>>
>> https://github.com/termux/termux-app
>> Works on Android 7+, provides  X via Xsdl or vnc
>> Does not require root priviledges on device
>>
>> In theory you can try to install more compatible arm distro but this Will
>> eat more space So I tried Hard way!
>>
>> Packages with development files have '-static' added to their name.
>> So, I tried to call configure in Cingg source tree with suitable
>> argument.
>>
>> generated by GNU Autoconf 2.71. Invocation command line was
>>
>>  $ ./configure --with-single-user --with-thirdparty --enable-static-build
>> --without-vaapi --without-vdpau --without-shuttle_usb --without-libzmpeg
>> --without-lv2 --with-clang
>>
>> device uses clang-12 currently (!)
>>
>> I tried to update configure.ac based on result of 'autoscan' invokation,
>> it makes configure phase longer but more verbose.
>>
>> But main show breaker was difference between /bin/sh and bin/bash (with
>> long termux path)
>> Default was sh and it was barking at += statements in configure.ac like
>> those
>>
>> CFG_CFLAGS+=" -pthread -Wall"
>> # misguided pedantic warnings
>> # this is extra work, not a gain...
>> CFG_CFLAGS+=" -Wno-unknown-warning-option"
>> CFG_CFLAGS+=" -Wno-attributes"
>> CFG_CFLAGS+=" -Wno-unused-result"
>> CFG_CFLAGS+=" -Wno-stringop-overflow"
>> CFG_CFLAGS+=" -Wno-format-truncation"
>> CFG_CFLAGS+=" -Wno-format-overflow"
>> CFG_CFLAGS+=" -Wno-parentheses"
>> CFG_CFLAGS+=" -Wno-stringop-truncation"
>> CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
>> CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
>>
>> And as result configure was half-broken, failed to make thirdparty.. :/
>>
>> But by changing configure's first line manually to
>>
>> #! /data/data/com.termux/files/usr/bin/bash
>>
>> I overcome this error!
>>
>> Of course with less than 700 mb free out of 16 gb flash 'disk' (I have
>> few huge navigator apps and Android was weighting 9 gb from very start!)
>> build in thirdparty failed, and guicast/cinelerra dirs had their own
>> problems related to missing shared mem support (!) and other problems  but
>> at least it started
>>
>> See my hacks attached
>>
>> Be aware about limited number of write cycles when it comes to flash
>> memory! Big compiles can degrade internal storage prety quickly, I am afraid
>>
>>
>>
From 9dbb2ac0d94e8a13f6c4c01f42045db3035b05e4 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sat, 15 May 2021 18:00:21 +0300
Subject: [PATCH 2/6] ifdef for DV

---
 cinelerra-5.1/cinelerra/ffmpeg.C | 2 ++
 cinelerra-5.1/cinelerra/record.C | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index df39763c..55fa668e 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -29,7 +29,9 @@
 #include "ffmpeg.h"
 #include "indexfile.h"
 #include "interlacemodes.h"
+#ifdef HAVE_DV
 #include "libdv.h"
+#endif
 #include "libmjpeg.h"
 #include "mainerror.h"
 #include "mwindow.h"
diff --git a/cinelerra-5.1/cinelerra/record.C b/cinelerra-5.1/cinelerra/record.C
index ad293f7b..f42fe9e1 100644
--- a/cinelerra-5.1/cinelerra/record.C
+++ b/cinelerra-5.1/cinelerra/record.C
@@ -46,7 +46,9 @@
 #include "keys.h"
 #include "language.h"
 #include "localsession.h"
+#ifdef HAVE_DV
 #include "libdv.h"
+#endif
 #include "libmjpeg.h"
 #include "libzmpeg3.h"
 #include "mainmenu.h"
@@ -215,10 +217,12 @@ int Record::load_defaults()
 	case VIDEO4LINUX2JPEG:
 		vcodec = CODEC_TAG_MJPEG;
 		break;
+#ifdef HAVE_DV
 	case CAPTURE_FIREWIRE:
 	case CAPTURE_IEC61883:
 		vcodec = CODEC_TAG_DVSD;
 		break;
+#endif
 	}
 	if( vcodec )
 		strcpy(default_asset->vcodec, vcodec);
-- 
2.31.1

From c7721ddf60656abd40e1128c762296aeaf7f976f Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sat, 15 May 2021 17:10:22 +0300
Subject: [PATCH 1/6] constify fileffmpeg.C

---
 cinelerra-5.1/cinelerra/fileffmpeg.C | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C
index a71d692a..853e5839 100644
--- a/cinelerra-5.1/cinelerra/fileffmpeg.C
+++ b/cinelerra-5.1/cinelerra/fileffmpeg.C
@@ -159,7 +159,7 @@ void FFMpegPixelFormat::update_formats()
 	pixfmts.remove_all_objects();
 	char video_codec[BCSTRLEN]; video_codec[0] = 0;
 	const char *vcodec = vid_config->asset->vcodec;
-	AVCodec *av_codec = !FFMPEG::get_codec(video_codec, "video", vcodec) ?
+	const AVCodec *av_codec = !FFMPEG::get_codec(video_codec, "video", vcodec) ?
 		avcodec_find_encoder_by_name(video_codec) : 0;
 	const AVPixelFormat *pix_fmts = av_codec ? av_codec->pix_fmts : 0;
 	if( pix_fmts ) {
@@ -190,7 +190,7 @@ void FFMpegSampleFormat::update_formats()
 	samplefmts.remove_all_objects();
 	char audio_codec[BCSTRLEN]; audio_codec[0] = 0;
 	const char *acodec = aud_config->asset->acodec;
-	AVCodec *av_codec = !FFMPEG::get_codec(audio_codec, "audio", acodec) ?
+	const AVCodec *av_codec = !FFMPEG::get_codec(audio_codec, "audio", acodec) ?
 		avcodec_find_encoder_by_name(audio_codec) : 0;
 	const AVSampleFormat *sample_fmts = av_codec ? av_codec->sample_fmts : 0;
 	if( sample_fmts ) {
@@ -345,7 +345,7 @@ int FileFFMPEG::open_file(int rd, int wr)
 				asset->aspect_ratio = ff->ff_aspect_ratio(0);
 				if (!asset->interlace_mode) asset->interlace_mode = ff->ff_interlace(0);
 				if ( ff->ff_video_frames(0) > 1 ) {
-//				ff->video_probe(1);
+				ff->video_probe(1);
 				 if (!asset->interlace_mode && (ff->interlace_from_codec) ) asset->interlace_mode = ff->video_probe(1); 
 				}
 				if( !asset->layers ) asset->layers = video_layers;
@@ -1844,7 +1844,7 @@ int FFOptionsViewAudio::handle_event()
 	const char *name = asset->acodec;
 	char audio_format[BCSTRLEN];  audio_format[0] = 0;
 	char audio_codec[BCSTRLEN];   audio_codec[0] = 0;
-	AVCodec *codec = !ret &&
+	const AVCodec *codec = !ret &&
 	    !FFMPEG::get_format(audio_format, "audio", name) &&
 	    !FFMPEG::get_codec(audio_codec, "audio", name) ?
 		avcodec_find_encoder_by_name(audio_codec) : 0;
@@ -1882,7 +1882,7 @@ int FFOptionsViewVideo::handle_event()
 	const char *name = asset->vcodec;
 	char video_format[BCSTRLEN];  video_format[0] = 0;
 	char video_codec[BCSTRLEN];   video_codec[0] = 0;
-	AVCodec *codec = !ret &&
+	const AVCodec *codec = !ret &&
 	    !FFMPEG::get_format(video_format, "video", name) &&
 	    !FFMPEG::get_codec(video_codec, "video", name) ?
 		avcodec_find_encoder_by_name(video_codec) : 0;
-- 
2.31.1

From 4131ef4f95f4dceb1684d67335f4eda35b77f99c Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sat, 15 May 2021 21:05:21 +0300
Subject: [PATCH 5/6] Add libzmpeg ifdef in fileac3, move fireware objects into
 their own group in Makefile in cinelerra/

---
 cinelerra-5.1/cinelerra/Makefile  | 22 ++++++++++++++--------
 cinelerra-5.1/cinelerra/fileac3.C |  3 ++-
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
index 81d1acee..d5145d7d 100644
--- a/cinelerra-5.1/cinelerra/Makefile
+++ b/cinelerra-5.1/cinelerra/Makefile
@@ -56,7 +56,6 @@ OBJS := $(OVERLAYS) \
 	$(OBJDIR)/assets.o \
 	$(OBJDIR)/atrack.o \
 	$(OBJDIR)/attachmentpoint.o \
-	$(OBJDIR)/audio1394.o \
 	$(OBJDIR)/audioalsa.o \
 	$(OBJDIR)/audiodevice.o \
 	$(OBJDIR)/audiodvb.o \
@@ -70,8 +69,6 @@ OBJS := $(OVERLAYS) \
 	$(OBJDIR)/automation.o \
 	$(OBJDIR)/auto.o \
 	$(OBJDIR)/autos.o \
-	$(OBJDIR)/avc1394control.o \
-	$(OBJDIR)/avc1394transport.o \
 	$(OBJDIR)/awindowgui.o \
 	$(OBJDIR)/awindow.o \
 	$(OBJDIR)/batch.o \
@@ -112,8 +109,6 @@ OBJS := $(OVERLAYS) \
 	$(OBJDIR)/cwindowtool.o \
 	$(OBJDIR)/dcoffset.o \
 	$(OBJDIR)/deleteallindexes.o \
-	$(OBJDIR)/device1394input.o \
-	$(OBJDIR)/device1394output.o \
 	$(OBJDIR)/devicedvbinput.o \
 	$(OBJDIR)/devicev4l2base.o \
 	$(OBJDIR)/devicev4l2input.o \
@@ -170,8 +165,6 @@ OBJS := $(OVERLAYS) \
 	$(OBJDIR)/garbage.o \
 	$(OBJDIR)/gwindowgui.o \
 	$(OBJDIR)/gwindow.o \
-	$(OBJDIR)/iec61883input.o \
-	$(OBJDIR)/iec61883output.o \
 	$(OBJDIR)/indexable.o \
 	$(OBJDIR)/indexfile.o \
 	$(OBJDIR)/indexstate.o \
@@ -339,7 +332,6 @@ OBJS := $(OVERLAYS) \
 	$(OBJDIR)/undostack.o \
 	$(OBJDIR)/vattachmentpoint.o \
 	$(OBJDIR)/vautomation.o \
-	$(OBJDIR)/vdevice1394.o \
 	$(OBJDIR)/vdevicebase.o \
 	$(OBJDIR)/vdevicedvb.o \
 	$(OBJDIR)/vdeviceprefs.o \
@@ -378,6 +370,19 @@ OBJS := $(OVERLAYS) \
 	$(OBJDIR)/zwindow.o \
 	$(OBJDIR)/zwindowgui.o \
 
+ifneq ($(WANT_FIREWARE),no)
+OBJ += \
+	$(OBJDIR)/audio1394.o \
+	$(OBJDIR)/avc1394control.o \
+	$(OBJDIR)/avc1394transport.o \
+	$(OBJDIR)/vdevice1394.o \
+	$(OBJDIR)/device1394input.o \
+	$(OBJDIR)/device1394output.o \
+	$(OBJDIR)/iec61883input.o \
+	$(OBJDIR)/iec61883output.o \
+
+endif
+
 ifneq ($(WANT_LIBZMPEG),no)
 OBJS += \
 	$(OBJDIR)/audiompeg.o \
@@ -426,6 +431,7 @@ LIBRARIES += \
 
 endif
 
+
 LIBS := $(LIBRARIES)
 
 ifeq ($(WANT_CIN_3RDPARTY),no)
diff --git a/cinelerra-5.1/cinelerra/fileac3.C b/cinelerra-5.1/cinelerra/fileac3.C
index c6a94161..be62f2b7 100644
--- a/cinelerra-5.1/cinelerra/fileac3.C
+++ b/cinelerra-5.1/cinelerra/fileac3.C
@@ -18,7 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
-
+#if HAVE_LIBZMPEG
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -421,3 +421,4 @@ int AC3ConfigAudioBitrate::handle_event()
 }
 
 #endif
+#endif //libzmpeg
\ No newline at end of file
-- 
2.31.1

From 794d3a552090aca0aab92834635afc6cb4329568 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sat, 15 May 2021 20:14:27 +0300
Subject: [PATCH 3/6] TERMUX ifdefs in guicast

---
 cinelerra-5.1/guicast/Makefile     |  7 +++++++
 cinelerra-5.1/guicast/bthread.h    | 31 ++++++++++++++++++++++++++++++
 cinelerra-5.1/guicast/filesystem.C |  3 ++-
 cinelerra-5.1/guicast/thread.C     |  5 +++++
 cinelerra-5.1/guicast/thread.h     |  4 +++-
 cinelerra-5.1/guicast/vframe.C     | 10 +++++-----
 cinelerra-5.1/guicast/vframe.h     |  3 ++-
 7 files changed, 55 insertions(+), 8 deletions(-)
 create mode 100644 cinelerra-5.1/guicast/bthread.h

diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile
index cf189dea..fc086f92 100644
--- a/cinelerra-5.1/guicast/Makefile
+++ b/cinelerra-5.1/guicast/Makefile
@@ -12,6 +12,11 @@ ifeq ($(OBJDIR), amd64)
 BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B i386 -I binary -O elf64-x86-64\""
 endif
 
+ifeq ($(OBJDIR), armv8l)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B arm -I binary -O elf32-littlearm\""
+endif
+
+
 $(shell mkdir -p $(OBJDIR) )
 
 OBJS = \
@@ -83,6 +88,7 @@ OBJS = \
 	$(OBJDIR)/vicon.o \
 	$(OBJDIR)/workarounds.o
 
+
 OUTPUT = $(OBJDIR)/libguicast.a
 
 UTILS = $(OBJDIR)/bootstrap $(OBJDIR)/pngtoh $(OBJDIR)/pngtoraw
@@ -90,6 +96,7 @@ BCXFER = xfer/$(OBJDIR)/xfer.stamp
 
 CFLAGS += $(static_incs)
 
+
 $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags)
 $(shell echo $(OBJS) > $(OBJDIR)/objs)
 
diff --git a/cinelerra-5.1/guicast/bthread.h b/cinelerra-5.1/guicast/bthread.h
new file mode 100644
index 00000000..57a0c492
--- /dev/null
+++ b/cinelerra-5.1/guicast/bthread.h
@@ -0,0 +1,31 @@
+/* BThread main header
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+# define PTHREAD_CANCEL_ENABLE    	 0x00000010
+# define PTHREAD_CANCEL_DISABLE   	 0x00000000
+
+# define PTHREAD_CANCEL_ASYNCHRONOUS 0x00000020
+# define PTHREAD_CANCEL_DEFERRED     0x00000000
+
+#define PTHREAD_CANCELED ((void *) -1)
+
+int pthread_setcancelstate (int , int *);
+int pthread_setcanceltype (int , int *);
+void pthread_testcancel (void);
+int pthread_cancel (pthread_t t);
diff --git a/cinelerra-5.1/guicast/filesystem.C b/cinelerra-5.1/guicast/filesystem.C
index 6017f6ea..b1ace6fd 100644
--- a/cinelerra-5.1/guicast/filesystem.C
+++ b/cinelerra-5.1/guicast/filesystem.C
@@ -536,7 +536,7 @@ int FileSystem::parse_tildas(char *new_dir)
 				new_user[j] = new_dir[i];
 			}
 			new_user[j] = 0;
-
+#if !defined(__TERMUX__)
 			setpwent();
 			while( (pw = getpwent()) != 0 )
 			{
@@ -550,6 +550,7 @@ int FileSystem::parse_tildas(char *new_dir)
       			}
 			}
 			endpwent();
+#endif
 			return 0;
 		}
 	}
diff --git a/cinelerra-5.1/guicast/thread.C b/cinelerra-5.1/guicast/thread.C
index 50b52a47..9908a628 100644
--- a/cinelerra-5.1/guicast/thread.C
+++ b/cinelerra-5.1/guicast/thread.C
@@ -28,6 +28,9 @@
 #include <string.h>
 #include <typeinfo>
 #include "thread.h"
+#if defined(__TERMUX__)
+#include "bthread.h"
+#endif
 
 
 Thread::Thread(int synchronous, int realtime, int autodelete)
@@ -102,8 +105,10 @@ void Thread::start()
 			perror("Thread::start pthread_attr_setschedparam");
 	}
 	else {
+#if !defined(__TERMUX__)
 		if(pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED) < 0)
 			perror("Thread::start pthread_attr_setinheritsched");
+#endif
 	}
 
 // autodelete may delete this immediately after create
diff --git a/cinelerra-5.1/guicast/thread.h b/cinelerra-5.1/guicast/thread.h
index 79f3e713..e701a8f4 100644
--- a/cinelerra-5.1/guicast/thread.h
+++ b/cinelerra-5.1/guicast/thread.h
@@ -29,13 +29,15 @@
 #ifndef NO_TID
 #include <sys/syscall.h>
 
+#if !defined(__TERMUX__)
 // glibc >= 2.30 provides gettid() in unistd
 #if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 30)
 static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
-#endif
 #else
 static inline long gettid() { return (long)pthread_self(); }
 #endif
+#endif // TERMUX
+#endif //no_tid
 
 // The thread does not autodelete by default.
 // If autodelete is 1 the thread autodeletes.
diff --git a/cinelerra-5.1/guicast/vframe.C b/cinelerra-5.1/guicast/vframe.C
index af0e52a8..44d7f97e 100644
--- a/cinelerra-5.1/guicast/vframe.C
+++ b/cinelerra-5.1/guicast/vframe.C
@@ -334,7 +334,7 @@ if( memory_type != VFrame::SHARED )
 			shmid = -1;
 			break;
 
-		case VFrame::SHMGET:
+		case VFrame::SHM_GET:
 			if(data)
 				shmdt(data);
 			data = 0;
@@ -510,7 +510,7 @@ int VFrame::allocate_data(unsigned char *data, int shmid,
 		this->v_offset = v_offset;
 	}
 	else if( shmid >= 0 ) {
-		memory_type = VFrame::SHMGET;
+		memory_type = VFrame::SHM_GET;
 		this->data = (unsigned char*)shmat(shmid, NULL, 0);
 		if( this->data == (unsigned char*)-1 ) {
 			printf("VFrame::allocate_data %d could not attach"
@@ -593,7 +593,7 @@ void VFrame::set_memory(unsigned char *data,
 	else
 	if(shmid >= 0)
 	{
-		memory_type = VFrame::SHMGET;
+		memory_type = VFrame::SHM_GET;
 		this->data = (unsigned char*)shmat(shmid, NULL, 0);
 		this->shmid = shmid;
 	}
@@ -635,7 +635,7 @@ void VFrame::set_compressed_memory(unsigned char *data,
 	else
 	if(shmid >= 0)
 	{
-		memory_type = VFrame::SHMGET;
+		memory_type = VFrame::SHM_GET;
 		this->data = (unsigned char*)shmat(shmid, NULL, 0);
 		this->shmid = shmid;
 	}
@@ -713,7 +713,7 @@ UNBUFFER(data);
 			else
 				free(data);
 		}
-		else if( memory_type == VFrame::SHMGET ) {
+		else if( memory_type == VFrame::SHM_GET ) {
 			if( data ) shmdt(data);
 		}
 
diff --git a/cinelerra-5.1/guicast/vframe.h b/cinelerra-5.1/guicast/vframe.h
index 589fce1c..55590bda 100644
--- a/cinelerra-5.1/guicast/vframe.h
+++ b/cinelerra-5.1/guicast/vframe.h
@@ -31,6 +31,7 @@
 #include "bccmodels.h"
 #include "vframe.inc"
 
+
 // Maximum number of prev or next effects to be pushed onto the stacks.
 #define MAX_STACK_ELEMENTS 255
 #define SHM_MIN_SIZE 2048
@@ -417,7 +418,7 @@ private:
 	{
 		PRIVATE,
 		SHARED,
-		SHMGET
+		SHM_GET
 	};
 
 // Data pointer is pointing to someone else's buffer.
-- 
2.31.1

From 4ead9a1bd5b84aadc0805975b3daa5fe2fd83495 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sat, 15 May 2021 20:27:37 +0300
Subject: [PATCH 4/6] libzmpeg TERMUX ifdefs

---
 cinelerra-5.1/libzmpeg3/bthread.h   | 31 +++++++++++++++++++++++++++++
 cinelerra-5.1/libzmpeg3/libzmpeg3.h |  2 ++
 cinelerra-5.1/libzmpeg3/zio.C       |  3 +++
 3 files changed, 36 insertions(+)
 create mode 100644 cinelerra-5.1/libzmpeg3/bthread.h

diff --git a/cinelerra-5.1/libzmpeg3/bthread.h b/cinelerra-5.1/libzmpeg3/bthread.h
new file mode 100644
index 00000000..57a0c492
--- /dev/null
+++ b/cinelerra-5.1/libzmpeg3/bthread.h
@@ -0,0 +1,31 @@
+/* BThread main header
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+# define PTHREAD_CANCEL_ENABLE    	 0x00000010
+# define PTHREAD_CANCEL_DISABLE   	 0x00000000
+
+# define PTHREAD_CANCEL_ASYNCHRONOUS 0x00000020
+# define PTHREAD_CANCEL_DEFERRED     0x00000000
+
+#define PTHREAD_CANCELED ((void *) -1)
+
+int pthread_setcancelstate (int , int *);
+int pthread_setcanceltype (int , int *);
+void pthread_testcancel (void);
+int pthread_cancel (pthread_t t);
diff --git a/cinelerra-5.1/libzmpeg3/libzmpeg3.h b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
index 430ebb4d..8993aed4 100644
--- a/cinelerra-5.1/libzmpeg3/libzmpeg3.h
+++ b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
@@ -5,7 +5,9 @@
 /* for quicktime build */
 #define MAXFRAMESAMPLES 65536
 #define ZDVB
+#if defined(__i386__) || defined(__x86-64__)
 #define USE_FUTEX
+#endif
 
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS
diff --git a/cinelerra-5.1/libzmpeg3/zio.C b/cinelerra-5.1/libzmpeg3/zio.C
index cb6ce15d..2f6f6c58 100644
--- a/cinelerra-5.1/libzmpeg3/zio.C
+++ b/cinelerra-5.1/libzmpeg3/zio.C
@@ -1,4 +1,7 @@
 #include "libzmpeg3.h"
+#if defined(__TERMUX__)
+#include "bthread.h"
+#endif
 
 #ifdef USE_FUTEX
 typedef zmpeg3_t::zloc_t zzloc_t;
-- 
2.31.1

From 3b6a576bc6a02d064b2746659808777938909fe2 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sat, 15 May 2021 21:14:35 +0300
Subject: [PATCH 6/6] more ifdefs for file.C (ac3 demand libzmpeg)

---
 cinelerra-5.1/cinelerra/file.C | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C
index 9828d6ec..b8a5ed3d 100644
--- a/cinelerra-5.1/cinelerra/file.C
+++ b/cinelerra-5.1/cinelerra/file.C
@@ -173,10 +173,12 @@ int File::get_options(FormatTools *format,
 	format_completion->lock("File::get_options");
 	switch( asset->format ) {
 #ifdef HAVE_CIN_3RDPARTY
+#ifdef HAVE_LIBZMPEG
 	case FILE_AC3: FileAC3::get_parameters(parent_window, asset, format_window,
 			audio_options, video_options, edl);
 		break;
 #endif
+#endif
 #ifdef HAVE_DV
 	case FILE_RAWDV:
 		FileDV::get_parameters(parent_window, asset, format_window,
@@ -542,9 +544,11 @@ int File::open_file(Preferences *preferences,
 		break; }
 // format already determined
 #ifdef HAVE_CIN_3RDPARTY
+#ifdef HAVE_LIBZMPEG
 	case FILE_AC3:
 		file = new FileAC3(this->asset, this);
 		break;
+#endif
 #endif
 	case FILE_SCENE:
 		file = new FileScene(this->asset, this);
-- 
2.31.1

-- 
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to