#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#if !defined(__FreeBSD__)
#include <sys/stat.h>
#include <sys/statfs.h>
-
+#else
+#include <sys/param.h>
+#include <sys/mount.h>
+#endif
#define DVD_PAL_4x3 0
#define DVD_PAL_16x9 1
void File::get_exe_path(char *result, char *bnp)
{
// Get executable path, basename
+#if !defined(__FreeBSD__)
int len = readlink("/proc/self/exe", result, BCTEXTLEN-1);
+#else
+ char exe_path[BCTEXTLEN];
+ sprintf(exe_path,"/proc/%d/file",getpid());
+ int len = readlink(exe_path, result, BCTEXTLEN-1);
+#endif
+
if( len >= 0 ) {
result[len] = 0;
char *ptr = strrchr(result, '/');
~EXRIStream();
bool read (char c[], int n);
- Imf::Int64 tellg ();
- void seekg (Imf::Int64 pos);
+ uint64_t tellg ();
+ void seekg (uint64_t pos);
void clear ();
private:
~EXROStream();
virtual void write(const char c[], int n);
- virtual Imf::Int64 tellp();
- virtual void seekp(Imf::Int64 pos);
+ virtual uint64_t tellp();
+ virtual void seekp(uint64_t pos);
private:
VFrame *data;
return position >= size;
}
-Imf::Int64 EXRIStream::tellg ()
+uint64_t EXRIStream::tellg ()
{
return position;
}
-void EXRIStream::seekg(Imf::Int64 pos)
+void EXRIStream::seekg(uint64_t pos)
{
position = pos;
}
data->set_compressed_size(MAX(position, data->get_compressed_size()));
}
-Imf::Int64 EXROStream::tellp()
+uint64_t EXROStream::tellp()
{
return position;
}
-void EXROStream::seekp(Imf::Int64 pos)
+void EXROStream::seekp(uint64_t pos)
{
position = pos;
}
#msad ###Input/output error
#setts
#vif ###Input/output error
+#frei0r
+#frei0r_src
+#libvmaf
#include <iconv.h>
#include <sys/ipc.h>
#include <sys/shm.h>
+#if defined(__FreeBSD__)
+#include <sys/sysctl.h>
+#endif
#include <X11/extensions/XShm.h>
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
int BC_Resources::get_machine_cpus()
{
+#if !defined(__FreeBSD__)
int cpus = 1;
FILE *proc = fopen("/proc/cpuinfo", "r");
if( proc ) {
fclose(proc);
}
return cpus;
+#else
+ int mib[2], ncpu;
+ size_t len = sizeof(ncpu);
+ mib[0] = CTL_HW;
+ mib[1] = HW_NCPU;
+ if( sysctl(mib, 2, &ncpu, &len, 0, 0) ) ncpu = 1;
+ return ncpu;
+#endif
}
void BC_Resources::new_vframes(int n, VFrame *vframes[], ...)
BC_WindowBase::resources = this;
synchronous = 0;
vframe_shm = 0;
+#if !defined(__FreeBSD__)
use_shm = -1;
shm_reply = 1;
-
+#else
+ use_shm = 0;
+ shm_reply = 0;
+#endif
if( x_scale <= 0 ) x_scale = 1;
if( y_scale <= 0 ) y_scale = x_scale;
this->x_scale = x_scale;