caffeinetv / libcaffeine

A library for broadcasting to Caffeine.tv
https://www.caffeine.tv
GNU General Public License v2.0
16 stars 5 forks source link

libcaffeine

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

Using the library

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);

Build instructions

Windows

Prereqs:

Steps:

Mac

Prereqs:

Steps:

Note: if the cmake command above fails, it may be due to the XCode commandline tools being selected. To resolve this, reset your XCode selection and retry: sudo xcode-select -r

TODO: Linux

Packaging Instructions

Prerequisites

To run the build

Windows

Mac

Change directory to be the libcaffeine directory.

Windows:

The packaged output will be in build directory in Mac and dist directory in Windows.

Manual steps:

Windows:

Mac:

Metadata