Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve native libraries at runtime rather than at compile time #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alextnull
Copy link

Not tested on Linux and Unity.

Changes
Resolve native libraries at runtime rather than at compile time.
Single file for calling native library.
Fix encoder and decoder dispose.

Breaking changes
Defines.CiscoDllName64bit deprecated. Library name must be passed to the decoder or encoder constructor.

// Example
string ciscoDll = "";
switch (RuntimeScanApi.OperatingSystem)
{
    case H264Sharp.OperatingSystem.Windows:
        ciscoDll = RuntimeScanApi.Is64BitProcess
            ? "openh264-2.4.0-win64.dll"
            : "openh264-2.4.0-win32.dll";
        break;
    case H264Sharp.OperatingSystem.Linux:
        ciscoDll = RuntimeScanApi.Is64BitProcess
            ? "libopenh264-2.4.1-linux64.7.so"
            : "libopenh264-2.4.1-linux32.7.so";
        break;
    default:
        throw new NotSupportedException($"{RuntimeScanApi.OperatingSystem} OS is not supported");
}
H264Encoder encoder = new H264Encoder(ciscoDll);
H264Decoder decoder = new H264Decoder(ciscoDll);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant