libopenshot: drop openmp workaround.

* requires an up to date gcc.
This commit is contained in:
Jerome Duval
2016-06-03 23:21:33 +02:00
parent 4c4a6cb0b8
commit d0317cc3bd
2 changed files with 1 additions and 271 deletions

View File

@@ -9,7 +9,7 @@ LICENSE="GNU LGPL v3"
SOURCE_URI="https://github.com/OpenShot/libopenshot/archive/v$portVersion.tar.gz"
SOURCE_FILENAME="libopenshot-$portVersion.tar.gz"
CHECKSUM_SHA256="735322c73f6e8ea7bac059970f247c906b4c35f83fad5e5efd9a77adead20d0c"
REVISION="2"
REVISION="3"
PATCHES="libopenshot-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"

View File

@@ -38,276 +38,6 @@ index 545f62a..edcc511 100644
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
diff --git a/include/ChunkReader.h b/include/ChunkReader.h
index dd61257..250d133 100644
--- a/include/ChunkReader.h
+++ b/include/ChunkReader.h
@@ -35,7 +35,9 @@
#include <ctime>
#include <iostream>
#include <fstream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <QtCore/qdir.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/include/ChunkWriter.h b/include/ChunkWriter.h
index 729713c..01e6607 100644
--- a/include/ChunkWriter.h
+++ b/include/ChunkWriter.h
@@ -36,7 +36,9 @@
#include <ctime>
#include <iostream>
#include <fstream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <QtCore/qdir.h>
#include <stdio.h>
#include <sstream>
diff --git a/include/DummyReader.h b/include/DummyReader.h
index 73783cf..1cc5182 100644
--- a/include/DummyReader.h
+++ b/include/DummyReader.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "Cache.h"
diff --git a/include/ImageReader.h b/include/ImageReader.h
index e51b40a..b836aa0 100644
--- a/include/ImageReader.h
+++ b/include/ImageReader.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "Magick++.h"
diff --git a/include/OpenMPUtilities.h b/include/OpenMPUtilities.h
index fc4ff3a..422b90d 100644
--- a/include/OpenMPUtilities.h
+++ b/include/OpenMPUtilities.h
@@ -28,9 +28,14 @@
#ifndef OPENSHOT_OPENMP_UTILITIES_H
#define OPENSHOT_OPENMP_UTILITIES_H
+#ifndef __HAIKU__
#include <omp.h>
// Calculate the # of OpenMP Threads to allow (HACK / WORK-AROUND for an ImageMagick bug: preventing use of all 8 cores)
#define OPEN_MP_NUM_PROCESSORS omp_get_num_procs()
+#else
+ #define OPEN_MP_NUM_PROCESSORS 1
+#endif
+
#endif
diff --git a/include/QtImageReader.h b/include/QtImageReader.h
index 594ef26..c40d38f 100644
--- a/include/QtImageReader.h
+++ b/include/QtImageReader.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include <QtCore/QString>
diff --git a/include/TextReader.h b/include/TextReader.h
index bb8bdd7..2f4e8cf 100644
--- a/include/TextReader.h
+++ b/include/TextReader.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "Magick++.h"
diff --git a/include/effects/Blur.h b/include/effects/Blur.h
index 02799bd..5acc5c9 100644
--- a/include/effects/Blur.h
+++ b/include/effects/Blur.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include <QRect>
diff --git a/include/effects/Brightness.h b/include/effects/Brightness.h
index 801cf40..6b9dd9b 100644
--- a/include/effects/Brightness.h
+++ b/include/effects/Brightness.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "../Color.h"
diff --git a/include/effects/ChromaKey.h b/include/effects/ChromaKey.h
index f2710ad..a216068 100644
--- a/include/effects/ChromaKey.h
+++ b/include/effects/ChromaKey.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "../Color.h"
diff --git a/include/effects/Deinterlace.h b/include/effects/Deinterlace.h
index 8210399..1d7257b 100644
--- a/include/effects/Deinterlace.h
+++ b/include/effects/Deinterlace.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "../Color.h"
diff --git a/include/effects/Mask.h b/include/effects/Mask.h
index 005ab19..a783fbe 100644
--- a/include/effects/Mask.h
+++ b/include/effects/Mask.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "../Color.h"
diff --git a/include/effects/Negate.h b/include/effects/Negate.h
index d8a85f2..6fbaadb 100644
--- a/include/effects/Negate.h
+++ b/include/effects/Negate.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "../Color.h"
diff --git a/include/effects/Saturation.h b/include/effects/Saturation.h
index 35bff03..19bdd6c 100644
--- a/include/effects/Saturation.h
+++ b/include/effects/Saturation.h
@@ -33,7 +33,9 @@
#include <cmath>
#include <ctime>
#include <iostream>
+#ifndef __HAIKU__
#include <omp.h>
+#endif
#include <stdio.h>
#include <tr1/memory>
#include "../Color.h"
diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp
index 7bc06ac..a47aa93 100644
--- a/src/FFmpegReader.cpp
+++ b/src/FFmpegReader.cpp
@@ -506,10 +506,12 @@ tr1::shared_ptr<Frame> FFmpegReader::ReadStream(long int requested_frame)
int packets_processed = 0;
int minimum_packets = OPEN_MP_NUM_PROCESSORS;
+#ifndef __HAIKU__
// Set the number of threads in OpenMP
omp_set_num_threads(OPEN_MP_NUM_PROCESSORS);
// Allow nested OpenMP sections
omp_set_nested(true);
+#endif
// Debug output
AppendDebugMethod("FFmpegReader::ReadStream", "requested_frame", requested_frame, "OPEN_MP_NUM_PROCESSORS", OPEN_MP_NUM_PROCESSORS, "", -1, "", -1, "", -1, "", -1);
diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp
index 33745e6..d40c9e1 100644
--- a/src/FFmpegWriter.cpp
+++ b/src/FFmpegWriter.cpp
@@ -398,10 +398,12 @@ void FFmpegWriter::write_queued_frames() throw (ErrorEncodingVideo)
spooled_video_frames.clear();
spooled_audio_frames.clear();
+#ifndef __HAIKU__
// Set the number of threads in OpenMP
omp_set_num_threads(OPEN_MP_NUM_PROCESSORS);
// Allow nested OpenMP sections
omp_set_nested(true);
+#endif
// Create blank exception
bool has_error_encoding_video = false;
diff --git a/src/FrameMapper.cpp b/src/FrameMapper.cpp
index 5b1ac2a..0d24a1d 100644
--- a/src/FrameMapper.cpp
+++ b/src/FrameMapper.cpp
@@ -376,10 +376,12 @@ tr1::shared_ptr<Frame> FrameMapper::GetFrame(long int requested_frame) throw(Rea
// Minimum number of frames to process (for performance reasons)
int minimum_frames = OPEN_MP_NUM_PROCESSORS;
+#ifndef __HAIKU__
// Set the number of threads in OpenMP
omp_set_num_threads(OPEN_MP_NUM_PROCESSORS);
// Allow nested OpenMP sections
omp_set_nested(true);
+#endif
#pragma omp parallel
{
diff --git a/src/Timeline.cpp b/src/Timeline.cpp
index 891d148..205c339 100644
--- a/src/Timeline.cpp
+++ b/src/Timeline.cpp
@@ -627,9 +627,13 @@ tr1::shared_ptr<Frame> Timeline::GetFrame(long int requested_frame) throw(Reader
// This also opens the readers for intersecting clips, and marks non-intersecting clips as 'needs closing'
vector<Clip*> nearby_clips = find_intersecting_clips(requested_frame, minimum_frames, true);
+#ifndef __HAIKU__
omp_set_num_threads(OPEN_MP_NUM_PROCESSORS);
// Allow nested OpenMP sections
omp_set_nested(true);
+#else
+ #define omp_get_thread_num() 1
+#endif
// Debug output
AppendDebugMethod("Timeline::GetFrame", "requested_frame", requested_frame, "minimum_frames", minimum_frames, "OPEN_MP_NUM_PROCESSORS", OPEN_MP_NUM_PROCESSORS, "", -1, "", -1, "", -1);
--
2.2.2