After you buy a license, you receive an archive with two sets of licenses: development licenses for your own computers and deployment licenses for the application you ship. Both remove the logo and unlock the components you bought. The components are listed in Types of licenses.
Trial mode
Without licenses, the SDK works in trial mode for 30 days:
- the video gets the Medialooks logo;
- captions, subtitles, Teletext and SCTE messages are removed from frames;
- ASIO devices are not available.
When the trial ends, the logo stays and the SDK shows a purchase window once a day. An application that creates the MFSplitter or MFMuxer objects itself is closed after this window.
Development licenses
Development licenses are .lic files and need no code. Each SDK module reads the .lic files in its own folder and in the folder of the process's .exe. Some SDK objects run in MServer.exe processes, which start from the SDK folders, so a file next to your application is not enough. Copy the .lic files into every SDK folder with modules, by default under C:\Program Files (x86)\Medialooks:
| SDK | Folders |
|---|---|
| MFormats SDK | MFormats SDK\Bin\x86MFormats SDK\Bin\x64 |
| MPlatform SDK | MPlatform SDK\Bin\x86, its DecoderLib and EncoderLibMPlatform SDK\Bin\x64, its DecoderLib, EncoderLib and XMediaEngine |
Then restart the application. A development license ends with your subscription, and the logo comes back after that. Do not ship development licenses with your application.
Deployment licenses
The Deployment folder of the archive has a code file for each license, in each supported language: .cs for C#, .h for C++ and others. The code passes the license to the SDK at run time through MLProxy.dll, a COM library of the SDK in Bin\x86 and Bin\x64. A deployment license does not expire: it works with every SDK version released before the end of your subscription.
- Make sure that
MLProxy.dllis registered. The SDK installer registers it. On other computers, your installer registers it together with the SDK modules, or your manifest lists it (see Redistribution Guidelines). - Add a COM reference to MLProxy Type Library to the project. In the reference properties, set Embed Interop Types to False; otherwise the project does not build.
- Add the
.csfiles of your licenses to the project. - Call
IntializeProtection()of each license class before you create any SDK object. The method name is spelled this way in the files. - If the application runs longer than 24 hours, call it again at least every 24 hours.
public partial class MainForm : Form
{
// The license calls must be repeated at least every 24 hours
private readonly System.Threading.Timer m_licenseTimer;
public MainForm()
{
ActivateLicenses(); // before any SDK object is created
m_licenseTimer = new System.Threading.Timer(_ => ActivateLicenses(), null,
TimeSpan.FromHours(12), TimeSpan.FromHours(12));
InitializeComponent();
}
private static void ActivateLicenses()
{
// One call for each license file of the Deployment folder
MPlatformSDKLic.IntializeProtection();
DecoderlibLic.IntializeProtection();
EncoderlibLic.IntializeProtection();
}
}
If MLProxy.dll is not registered, IntializeProtection() throws a COMException (class not registered).
Protecting the license code
The license text and keys are string and number constants in the code file. Anyone can read them from your .exe with a .NET decompiler. Before you ship the application, process it with an obfuscator that encrypts string constants. Then check that the application still starts without the logo.
Still have questions?
Tell us what didn’t work or what you’d like clarified.