Skip to content

Commit

Permalink
Added incomplete FreeBSD support.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenBaert committed Jun 15, 2014
1 parent 8382466 commit 9a1b23b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
20 changes: 13 additions & 7 deletions glinject/elfhacks.h
Expand Up @@ -45,16 +45,22 @@ extern "C" {
# define __elf32
#endif

#ifdef __elf64
#if defined(__elf64)
# define ELFW_R_SYM ELF64_R_SYM
# define ElfW_Sword Elf64_Sxword
#else
# ifdef __elf32
# define ELFW_R_SYM ELF32_R_SYM
# define ElfW_Sword Elf32_Sword
# else
# error neither __elf32 nor __elf64 is defined
# ifdef BSD
# define ElfW(v) Elf64_##v
# define __ELF_NATIVE_CLASS 64
# endif
#elif defined(__elf32)
# define ELFW_R_SYM ELF32_R_SYM
# define ElfW_Sword Elf32_Sword
# ifdef BSD
# define ElfW(v) Elf32_##v
# define __ELF_NATIVE_CLASS 32
# endif
#else
# error neither __elf32 nor __elf64 is defined
#endif

/**
Expand Down
6 changes: 6 additions & 0 deletions src/AV/Input/SSRVideoStreamWatcher.cpp
Expand Up @@ -23,7 +23,9 @@ along with SimpleScreenRecorder. If not, see <http://www.gnu.org/licenses/>.

#include <dirent.h>
#include <signal.h>
#ifdef __linux__
#include <sys/inotify.h>
#endif
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
Expand Down Expand Up @@ -112,6 +114,7 @@ void SSRVideoStreamWatcher::Init() {

}

#ifdef __linux__
// initialize inotify
m_fd_notify = inotify_init1(IN_CLOEXEC | IN_NONBLOCK);
if(m_fd_notify == -1) {
Expand All @@ -124,6 +127,7 @@ void SSRVideoStreamWatcher::Init() {
Logger::LogError("[SSRVideoStreamWatcher::Init] " + Logger::tr("Error: Can't watch shared memory directory!"));
throw SSRStreamException();
}
#endif

// get all the files that existed already
DIR *dir = NULL;
Expand Down Expand Up @@ -180,6 +184,7 @@ void SSRVideoStreamWatcher::Free() {
}

void SSRVideoStreamWatcher::HandleChanges(AddCallback add_callback, RemoveCallback remove_callback, void* userdata) {
#ifdef __linux__

// find out how much we can read
int len;
Expand Down Expand Up @@ -271,4 +276,5 @@ void SSRVideoStreamWatcher::HandleChanges(AddCallback add_callback, RemoveCallba

}

#endif
}
2 changes: 2 additions & 0 deletions src/AV/SimpleSynth.cpp
Expand Up @@ -28,6 +28,7 @@ along with SimpleScreenRecorder. If not, see <http://www.gnu.org/licenses/>.
#include <sys/resource.h>

static void MakeThreadHighPriority() {
#ifdef __linux__
rlimit limit;

// try to get real-time priority
Expand All @@ -52,6 +53,7 @@ static void MakeThreadHighPriority() {
}

Logger::LogWarning("[MakeThreadHighPriority] " + Logger::tr("Warning: Can't increase the thread priority."));
#endif
}

static void ALSARecoverAfterUnderrun(snd_pcm_t* pcm) {
Expand Down
19 changes: 10 additions & 9 deletions src/GUI/PageOutput.cpp
Expand Up @@ -76,20 +76,21 @@ PageOutput::PageOutput(MainWindow* main_window)
m_old_container_av = 0;

// main codecs
// (initializer lists should use explicit types for Clang)
m_containers = {
{"Matroska (MKV)", "matroska", QStringList({"mkv"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("Matroska") + " (*.mkv)",
ContainerData({"Matroska (MKV)", "matroska", QStringList({"mkv"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("Matroska") + " (*.mkv)",
{VIDEO_CODEC_H264, VIDEO_CODEC_VP8, VIDEO_CODEC_THEORA},
{AUDIO_CODEC_VORBIS, AUDIO_CODEC_MP3, AUDIO_CODEC_AAC, AUDIO_CODEC_UNCOMPRESSED}},
{"MP4", "mp4", QStringList({"mp4"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("MP4") + " (*.mp4)",
{AUDIO_CODEC_VORBIS, AUDIO_CODEC_MP3, AUDIO_CODEC_AAC, AUDIO_CODEC_UNCOMPRESSED}}),
ContainerData({"MP4", "mp4", QStringList({"mp4"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("MP4") + " (*.mp4)",
{VIDEO_CODEC_H264},
{AUDIO_CODEC_VORBIS, AUDIO_CODEC_MP3, AUDIO_CODEC_AAC}},
{"WebM", "webm", QStringList({"webm"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("WebM") + " (*.webm)",
{AUDIO_CODEC_VORBIS, AUDIO_CODEC_MP3, AUDIO_CODEC_AAC}}),
ContainerData({"WebM", "webm", QStringList({"webm"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("WebM") + " (*.webm)",
{VIDEO_CODEC_VP8},
{AUDIO_CODEC_VORBIS}},
{"OGG", "ogg", QStringList({"ogg"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("OGG") + " (*.ogg)",
{AUDIO_CODEC_VORBIS}}),
ContainerData({"OGG", "ogg", QStringList({"ogg"}), tr("%1 files", "This appears in the file dialog, e.g. 'MP4 files'").arg("OGG") + " (*.ogg)",
{VIDEO_CODEC_THEORA},
{AUDIO_CODEC_VORBIS}},
{tr("Other..."), "other", QStringList(), "", {}, {}},
{AUDIO_CODEC_VORBIS}}),
ContainerData({tr("Other..."), "other", QStringList(), "", std::set<enum_video_codec>({}), std::set<enum_audio_codec>({})}),
};
m_video_codecs = {
{"H.264" , "libx264" },
Expand Down

0 comments on commit 9a1b23b

Please sign in to comment.