This is a library for setting up broadcasts and streaming on Caffeine.tv.
Libcaffeine is licensed under the GNU GPL version 2. See LICENSE.txt for details.
For information on contributing to this project, see CONTRIBUTING.md.
TODO: More Documentation
Minimal Example:
// Callbacks
void started(void *myContext) {
// Start capturing audio & video
}
void failed(void *myContext, caff_Result result) {
// Handle error
// Stop capturing if necessary
}
// Once on startup
caff_initialize("example", "1.0", caff_SeverityDebug, NULL);
// Starting a broadcast
caff_InstanceHandle instance = caff_createInstance();
caff_Result result = caff_signIn(instance, "Myuser", "|\\/|Yp455WYrd", NULL);
if (result != caff_ResultSuccess) return -1;
result = caff_startBroadcast(instance, &myContext, "My title!", caff_RatingNone, NULL, started, failed);
// On your video/audio capture thread(s)
caff_sendVideo(
instance, caff_VideoFormatNv12, pixels, pixelBytes, width, height, caff_TimestampGenerate);
caff_sendAudio(instance, samples, 2);
// When it's over:
caff_endBroadcast(instance);
caff_freeInstance(&instance);Prereqs:
- Visual Studio 2017 (and LLVM Compiler Toolchain Extension)
- LLVM toolchain
Steps:
- Download the latest version of webrtc-prebuilt-windows.7z from https://github.com/caffeinetv/webrtc/releases
- Extract the file somewhere convenient
- Set
WEBRTC_ROOT_DIRenvironment variable to the directory you extracted the files to - In the libcaffeine root directory:
mkdir buildcd buildcmake .. -G "Visual Studio 15 2017 Win64" -T LLVMstart libcaffeine.sln
- Build the solution in Visual Studio
Prereqs:
- Xcode
- CMAKE
Steps:
- Download the latest version of webrtc-prebuilt-macos.7z from https://github.com/caffeinetv/webrtc/releases
- Extract the archive somewhere convenient
- Set
WEBRTC_ROOT_DIRenvironment variable to the directory you extracted the files to - In the libcaffeine root directory:
mkdir buildcd buildcmake .. -G Xcode- Build the project in Xcode
TODO: Linux