media/gmp-clearkey/0.1/gmp-clearkey.cpp
author Nicholas Hurley <hurley@todesschaf.org>
Fri, 31 Oct 2014 15:02:02 -0700
changeset 225721 2026699132a1ec3c2b44fd0769f515eaa2044dbb
parent 224839 a6e6e78b033874adee6293f306ff3e4fed713b1e
child 232158 817f770bff547fc9c0109d4476ddca867000fd8a
permissions -rw-r--r--
Bug 1092287 - Update node-http2 to latest master. rs=mcmanus

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <stdio.h>
#include <string.h>

#include "ClearKeyDecryptionManager.h"

#include "gmp-api/gmp-decryption.h"
#include "gmp-api/gmp-platform.h"
#include "mozilla/Attributes.h"
#include "mozilla/NullPtr.h"

static GMPPlatformAPI* sPlatform = nullptr;
GMPPlatformAPI*
GetPlatform()
{
  return sPlatform;
}

extern "C" {

MOZ_EXPORT GMPErr
GMPInit(GMPPlatformAPI* aPlatformAPI)
{
  sPlatform = aPlatformAPI;
  return GMPNoErr;
}

MOZ_EXPORT GMPErr
GMPGetAPI(const char* aApiName, void* aHostAPI, void** aPluginAPI)
{
  if (strcmp(aApiName, "eme-decrypt")) {
    return GMPNotImplementedErr;
  }

  *aPluginAPI = new ClearKeyDecryptionManager();

  return GMPNoErr;
}

MOZ_EXPORT GMPErr
GMPShutdown(void)
{
  return GMPNoErr;
}

}