Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #29 from WatchBeam/obs_merge
Browse files Browse the repository at this point in the history
Obs merge
  • Loading branch information
sslivins authored Nov 4, 2016
2 parents 3e4eada + 4c88f4d commit fa7c975
Show file tree
Hide file tree
Showing 249 changed files with 9,676 additions and 659 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

[submodule "plugins/enc-amf"]
path = plugins/enc-amf
url = https://github.com/Xaymar/OBS-AMD-Advanced-Media-Framework.git
url = https://github.com/Xaymar/obs-studio_amf-encoder-plugin.git

[submodule "plugins/obs-browser"]
path = plugins/obs-browser
url = https://github.com/kc5nra/obs-browser.git
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
os: osx
osx_image: xcode7.1
env:
matrix:
- CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake
global:
# AWS S3 creds
# access key
- secure: "MfhOg+84yb4ZHB2tM8PIPFQX2Y+WLN0I0iiAgyLC4KaHPUoNOyloe9yk6OjV7Lj7SZWqTlQUsqHa8S9mOUswGIody1Ydglo4RvyGOKCd8I6b2ri/jE8qHVuD9sO+sNlIxq4YqqG/qReTsbSs2YEgLneZUCYLCk/fihl8L6eVuSc="
# secret
- secure: "JRQVU2zgC3hY6CEY+Crmh/upp93En0BzKaLcsuBT538johNlK7m5hn3m2UOw63seLvBvVaKKWUDj9N986a3DwcXxWPMyF/9ctXgNWy39WzaVWxrbVR5nQB1fdiRp5YEgkoVN+gEm3OVF7sV5AGzh5/8CvEdRCoTLIGgMGHxW9mc="

language: cpp

before_install: "./CI/install-dependencies-osx.sh"
before_script: "./CI/before-script-osx.sh"
script: cd ./build && make -j4 && cd -
before_deploy: "./CI/before-deploy-osx.sh"

deploy:
provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
skip_cleanup: true
local_dir: nightly
bucket: obs-nightly
region: us-west-2
acl: public_read
on:
repo: jp9000/obs-studio

# The channel name "azubu.il.us.quakenet.org#obs-dev" is encrypted against jp9000/obs-studio to prevent IRC spam of forks
notifications:
irc:
skip_join: true
template:
- "%{message} %{build_url}"
channels:
- secure: k9j7+ogVODMlveZdd5pP73AVLCFl1VbzVaVon0ECn3EQcxnLSpiZbc6l+PnIUKgee5pRKtUB4breufgmr4puq3s69YeQiOVKk5gx2yJGZ5jGacbSne0xTspzPxapiEbVUkcJ2L7gKntDG4+SUiW67dtt4G26O7zsErDF/lY/woQ=
8 changes: 8 additions & 0 deletions CI/before-deploy-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export GIT_HASH=$(git rev-parse --short HEAD)
export FILE_DATE=$(date +%Y-%m-%d.%H:%M:%S)
export FILENAME=$FILE_DATE-$GIT_HASH-osx.zip
mkdir nightly
cd ./build
sudo python ../CI/install/osx/build_app.py
zip -r -X $FILENAME OBS.app
mv ./$FILENAME ../nightly
3 changes: 3 additions & 0 deletions CI/before-script-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mkdir build
cd build
cmake -DBUILD_BROWSER=ON -DCEF_ROOT_DIR=$PWD/../../cef_binary_3.2704.1434.gec3e9ed_macosx64 ..
17 changes: 17 additions & 0 deletions CI/install-dependencies-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
brew update

#Base OBS Deps
brew install ffmpeg x264 qt5 python cmake

# CEF Stuff
cd ../
curl -kLO http://opensource.spotify.com/cefbuilds/cef_binary_3.2704.1434.gec3e9ed_macosx64.tar.bz2
tar -xf ./cef_binary_3.2704.1434.gec3e9ed_macosx64.tar.bz2
cd ./cef_binary_3.2704.1434.gec3e9ed_macosx64
mkdir build
cd ./build
cmake -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_EXE_LINKER_FLAGS="-std=c++11 -stdlib=libc++" ..
make -j4
mkdir libcef_dll
mv ./libcef_dll_wrapper/libcef_dll_wrapper.a ./libcef_dll/libcef_dll_wrapper.a
cd ../../
211 changes: 211 additions & 0 deletions CI/install/osx/build_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
#!/usr/bin/env python

candidate_paths = "bin obs-plugins data".split()

plist_path = "../cmake/osxbundle/Info.plist"
icon_path = "../cmake/osxbundle/obs.icns"
run_path = "../cmake/osxbundle/obslaunch.sh"

#not copied
blacklist = """/usr /System""".split()

#copied
whitelist = """/usr/local""".split()

#
#
#


from sys import argv
from glob import glob
from subprocess import check_output, call
from collections import namedtuple
from shutil import copy, copytree, rmtree
from os import makedirs, rename, walk, path as ospath
import plistlib

import argparse
parser = argparse.ArgumentParser(description='obs-studio package util')
parser.add_argument('-d', '--base-dir', dest='dir', default='rundir/RelWithDebInfo')
parser.add_argument('-n', '--build-number', dest='build_number', default='0')
parser.add_argument('-k', '--public-key', dest='public_key', default='OBSPublicDSAKey.pem')
parser.add_argument('-f', '--sparkle-framework', dest='sparkle', default=None)
parser.add_argument('-b', '--base-url', dest='base_url', default='https://builds.catchexception.org/obs-studio')
parser.add_argument('-u', '--user', dest='user', default='jp9000')
parser.add_argument('-c', '--channel', dest='channel', default='master')
parser.add_argument('-s', '--stable', dest='stable', required=False, action='store_true', default=False)
parser.add_argument('-p', '--prefix', dest='prefix', default='')
args = parser.parse_args()

def cmd(cmd):
import subprocess
import shlex
return subprocess.check_output(shlex.split(cmd)).rstrip('\r\n')

LibTarget = namedtuple("LibTarget", ("path", "external", "copy_as"))

inspect = list()

inspected = set()

build_path = args.dir
build_path = build_path.replace("\\ ", " ")

def add(name, external=False, copy_as=None):
if external and copy_as is None:
copy_as = name.split("/")[-1]
if name[0] != "/":
name = build_path+"/"+name
t = LibTarget(name, external, copy_as)
if t in inspected:
return
inspect.append(t)
inspected.add(t)


for i in candidate_paths:
print("Checking " + i)
for root, dirs, files in walk(build_path+"/"+i):
for file_ in files:
path = root + "/" + file_
try:
out = check_output("{0}otool -L '{1}'".format(args.prefix, path), shell=True,
universal_newlines=True)
if "is not an object file" in out:
continue
except:
continue
rel_path = path[len(build_path)+1:]
print(repr(path), repr(rel_path))
add(rel_path)

def add_plugins(path, replace):
for img in glob(path.replace(
"lib/QtCore.framework/Versions/5/QtCore",
"plugins/%s/*"%replace).replace(
"Library/Frameworks/QtCore.framework/Versions/5/QtCore",
"share/qt5/plugins/%s/*"%replace)):
if "_debug" in img:
continue
add(img, True, img.split("plugins/")[-1])

actual_sparkle_path = '@loader_path/Frameworks/Sparkle.framework/Versions/A/Sparkle'

while inspect:
target = inspect.pop()
print("inspecting", repr(target))
path = target.path
if path[0] == "@":
continue
out = check_output("{0}otool -L '{1}'".format(args.prefix, path), shell=True,
universal_newlines=True)

if "QtCore" in path:
add_plugins(path, "platforms")
add_plugins(path, "imageformats")
add_plugins(path, "accessible")


for line in out.split("\n")[1:]:
new = line.strip().split(" (")[0]
if '@' in new and "sparkle.framework" in new.lower():
actual_sparkle_path = new
print "Using sparkle path:", repr(actual_sparkle_path)
if not new or new[0] == "@" or new.endswith(path.split("/")[-1]):
continue
whitelisted = False
for i in whitelist:
if new.startswith(i):
whitelisted = True
if not whitelisted:
blacklisted = False
for i in blacklist:
if new.startswith(i):
blacklisted = True
break
if blacklisted:
continue
add(new, True)

changes = list()
for path, external, copy_as in inspected:
if not external:
continue #built with install_rpath hopefully
changes.append("-change '%s' '@rpath/%s'"%(path, copy_as))
changes = " ".join(changes)

info = plistlib.readPlist(plist_path)

latest_tag = cmd('git describe --tags --abbrev=0')
log = cmd('git log --pretty=oneline {0}...HEAD'.format(latest_tag))

from os import path
# set version
if args.stable:
info["CFBundleVersion"] = latest_tag
info["CFBundleShortVersionString"] = latest_tag
info["SUFeedURL"] = '{0}/stable/updates.xml'.format(args.base_url)
else:
info["CFBundleVersion"] = args.build_number
info["CFBundleShortVersionString"] = '{0}.{1}'.format(latest_tag, args.build_number)
info["SUFeedURL"] = '{0}/{1}/{2}/updates.xml'.format(args.base_url, args.user, args.channel)

info["SUPublicDSAKeyFile"] = path.basename(args.public_key)
info["OBSFeedsURL"] = '{0}/feeds.xml'.format(args.base_url)

app_name = info["CFBundleName"]+".app"
icon_file = "tmp/Contents/Resources/%s"%info["CFBundleIconFile"]

copytree(build_path, "tmp/Contents/Resources/", symlinks=True)
copy(icon_path, icon_file)
plistlib.writePlist(info, "tmp/Contents/Info.plist")
makedirs("tmp/Contents/MacOS")
copy(run_path, "tmp/Contents/MacOS/%s"%info["CFBundleExecutable"])
try:
copy(args.public_key, "tmp/Contents/Resources")
except:
pass

if args.sparkle is not None:
copytree(args.sparkle, "tmp/Contents/Frameworks/Sparkle.framework", symlinks=True)

prefix = "tmp/Contents/Resources/"
sparkle_path = '@loader_path/{0}/Frameworks/Sparkle.framework/Versions/A/Sparkle'

cmd('{0}install_name_tool -change {1} {2} {3}/bin/obs'.format(
args.prefix, actual_sparkle_path, sparkle_path.format('../..'), prefix))



for path, external, copy_as in inspected:
id_ = ""
filename = path
rpath = ""
if external:
id_ = "-id '@rpath/%s'"%copy_as
filename = prefix + "bin/" +copy_as
rpath = "-add_rpath @loader_path/ -add_rpath @executable_path/"
if "/" in copy_as:
try:
dirs = copy_as.rsplit("/", 1)[0]
makedirs(prefix + "bin/" + dirs)
except:
pass
copy(path, filename)
else:
filename = path[len(build_path)+1:]
id_ = "-id '@rpath/../%s'"%filename
if not filename.startswith("bin"):
print(filename)
rpath = "-add_rpath '@loader_path/{}/'".format(ospath.relpath("bin/", ospath.dirname(filename)))
filename = prefix + filename

cmd = "{0}install_name_tool {1} {2} {3} '{4}'".format(args.prefix, changes, id_, rpath, filename)
call(cmd, shell=True)

try:
rename("tmp", app_name)
except:
print("App already exists")
rmtree("tmp")
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ cmake_minimum_required(VERSION 2.8.12)

project(obs-studio)

if(WIN32)
if (QTDIR OR DEFINED ENV{QTDIR} OR DEFINED ENV{QTDIR32} OR DEFINED ENV{QTDIR64})
# Qt path set by user or env var
else()
set(QTDIR "" CACHE PATH "Path to Qt (e.g. C:/Qt/5.7/msvc2015_64)")
message(WARNING "QTDIR variable is missing. Please set this variable to specify path to Qt (e.g. C:/Qt/5.7/msvc2015_64)")
endif()
if (DepsPath OR DEFINED ENV{DepsPath} OR DEFINED ENV{DepsPath32} OR DEFINED ENV{DepsPath64})
# Dependencies path set by user or env var
else()
set(DepsPath "" CACHE PATH "Path to compiled dependencies (e.g. D:/dependencies/win64)")
message(WARNING "DepsPath variable is missing. Please set this variable to specify path to compiled dependencies (e.g. D:/dependencies/win64)")
endif()
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

include(ObsHelpers)
Expand Down
14 changes: 1 addition & 13 deletions UI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,7 @@ elseif(UNIX)
set(obs_PLATFORM_SOURCES
platform-x11.cpp)

find_package(XCB COMPONENTS XCB REQUIRED RANDR REQUIRED XINERAMA REQUIRED)

include_directories(
${XCB_INCLUDE_DIRS}
${X11_XCB_INCLUDE_DIRS})

add_definitions(
${XCB_DEFINITIONS}
${X11_XCB_DEFINITIONS})

set(obs_PLATFORM_LIBRARIES
${XCB_LIBRARIES}
${X11_XCB_LIBRARIES}
set(obs_PLATFORM_LIBRARIES
Qt5::X11Extras)
endif()

Expand Down
2 changes: 1 addition & 1 deletion UI/api-interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ struct OBSStudioAPI : obs_frontend_callbacks {

bool obs_frontend_recording_active(void) override
{
return main->outputHandler->StreamingActive();
return main->outputHandler->RecordingActive();
}

void *obs_frontend_add_tools_menu_qaction(const char *name) override
Expand Down
4 changes: 4 additions & 0 deletions UI/data/locale/ca-ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Right="Dreta"
Top="Part superior"
Bottom="Part inferior"
Reset="Restableix"
Hours="Hores"
Minutes="Minuts"
Seconds="Segons"

QuickTransitions.SwapScenes="Canvia la vista prèvia i sortida d'escenes després de la transició"
QuickTransitions.SwapScenesTT="Canvia la vista prèvia i sortida d'escenes després de la transició (si encara existeix l'escena original de la sortida). \nAixò no desfarà qualsevol canvi que pugui haver fet a l'escena original de la sortida."
Expand Down Expand Up @@ -369,6 +372,7 @@ Basic.Settings.Output.Simple.Warn.Lossless.Title="Advertiment de qualitat sense
Basic.Settings.Output.Simple.Warn.MultipleQSV="Advertència: No es poden utilitzar diversos descodificadors QSV separats en transmetre i enregistrar al mateix temps. Per transmetre i engrestriar al mateix temps, si us plau modifiqueu-los, ja sigui el codificador de gravació o el codificador de transmissió."
Basic.Settings.Output.Simple.Encoder.Software="Programari (x264)"
Basic.Settings.Output.Simple.Encoder.Hardware.QSV="Maquinari (QSV)"
Basic.Settings.Output.Simple.Encoder.Hardware.AMD="Maquinari (AMD)"
Basic.Settings.Output.Simple.Encoder.Hardware.NVENC="Maquinari (NVENC)"
Basic.Settings.Output.Simple.Encoder.SoftwareLowCPU="Programari (preconfiguració de x264 amb baix ús de CPU, augmenta la mida del fitxer)"
Basic.Settings.Output.VideoBitrate="Bitrate de vídeo"
Expand Down
4 changes: 4 additions & 0 deletions UI/data/locale/cs-CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Right="Vpravo"
Top="Nahoře"
Bottom="Dole"
Reset="Resetovat"
Hours="Hodiny"
Minutes="Minuty"
Seconds="Vteřiny"

QuickTransitions.SwapScenes="Prohodit scény náhledu a výstupu po přechodu"
QuickTransitions.SwapScenesTT="Prohodí scény náhledu a výstupu po přechodu (pokud originální výstupní scéna stále existuje).\nTato funkce nevrátí provedené změny, které byly provedeny v originální scéně výstupu."
Expand Down Expand Up @@ -369,6 +372,7 @@ Basic.Settings.Output.Simple.Warn.Lossless.Title="Varování nastavené kvality!
Basic.Settings.Output.Simple.Warn.MultipleQSV="Varování: Není možné použit více oddělených QSV enkodérů pro streamování a nahrávání ve stejnou dobu. Pokud chcete tuto limitaci obejít, tak změňte použitý enkodér pro streamování či nahrávání."
Basic.Settings.Output.Simple.Encoder.Software="Softwarový (x264)"
Basic.Settings.Output.Simple.Encoder.Hardware.QSV="Hardwarový (QSV)"
Basic.Settings.Output.Simple.Encoder.Hardware.AMD="Hardwarový (AMD)"
Basic.Settings.Output.Simple.Encoder.Hardware.NVENC="Hardwarový (NVENC)"
Basic.Settings.Output.Simple.Encoder.SoftwareLowCPU="Softwarový (x264 předvolba nízkého zatížení CPU, větší soubory)"
Basic.Settings.Output.VideoBitrate="Bitrate videa"
Expand Down
Loading

0 comments on commit fa7c975

Please sign in to comment.