2014-05-18 07:05:46 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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 "nsISupports.idl"
|
|
|
|
#include "nsIThread.idl"
|
|
|
|
|
|
|
|
%{C++
|
2015-02-10 13:48:29 +03:00
|
|
|
#include "mozilla/UniquePtr.h"
|
2014-06-30 03:02:39 +04:00
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsStringGlue.h"
|
2014-08-03 01:29:26 +04:00
|
|
|
class GMPAudioDecoderProxy;
|
2014-07-28 03:20:34 +04:00
|
|
|
class GMPDecryptorProxy;
|
2014-07-11 07:35:56 +04:00
|
|
|
class GMPVideoDecoderProxy;
|
|
|
|
class GMPVideoEncoderProxy;
|
2014-05-18 07:05:46 +04:00
|
|
|
class GMPVideoHost;
|
2015-02-10 13:48:29 +03:00
|
|
|
|
|
|
|
template<class T>
|
|
|
|
class GMPGetterCallback
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GMPGetterCallback() { MOZ_COUNT_CTOR(GMPGetterCallback<T>); }
|
|
|
|
virtual ~GMPGetterCallback() { MOZ_COUNT_DTOR(GMPGetterCallback<T>); }
|
|
|
|
virtual void Done(T*) = 0;
|
|
|
|
};
|
|
|
|
template<class T>
|
|
|
|
class GMPVideoGetterCallback
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GMPVideoGetterCallback() { MOZ_COUNT_CTOR(GMPVideoGetterCallback<T>); }
|
|
|
|
virtual ~GMPVideoGetterCallback() { MOZ_COUNT_DTOR(GMPVideoGetterCallback<T>); }
|
|
|
|
virtual void Done(T*, GMPVideoHost*) = 0;
|
|
|
|
};
|
|
|
|
typedef GMPGetterCallback<GMPDecryptorProxy> GetGMPDecryptorCallback;
|
|
|
|
typedef GMPGetterCallback<GMPAudioDecoderProxy> GetGMPAudioDecoderCallback;
|
|
|
|
typedef GMPVideoGetterCallback<GMPVideoDecoderProxy> GetGMPVideoDecoderCallback;
|
|
|
|
typedef GMPVideoGetterCallback<GMPVideoEncoderProxy> GetGMPVideoEncoderCallback;
|
2015-02-10 13:48:52 +03:00
|
|
|
class GetNodeIdCallback
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GetNodeIdCallback() { MOZ_COUNT_CTOR(GetNodeIdCallback); }
|
|
|
|
virtual ~GetNodeIdCallback() { MOZ_COUNT_DTOR(GetNodeIdCallback); }
|
|
|
|
virtual void Done(nsresult aResult, const nsACString& aNodeId) = 0;
|
|
|
|
};
|
2014-05-18 07:05:46 +04:00
|
|
|
%}
|
|
|
|
|
2014-06-30 03:02:39 +04:00
|
|
|
[ptr] native TagArray(nsTArray<nsCString>);
|
2015-02-10 13:48:29 +03:00
|
|
|
native GetGMPDecryptorCallback(mozilla::UniquePtr<GetGMPDecryptorCallback>&&);
|
|
|
|
native GetGMPAudioDecoderCallback(mozilla::UniquePtr<GetGMPAudioDecoderCallback>&&);
|
|
|
|
native GetGMPVideoDecoderCallback(mozilla::UniquePtr<GetGMPVideoDecoderCallback>&&);
|
|
|
|
native GetGMPVideoEncoderCallback(mozilla::UniquePtr<GetGMPVideoEncoderCallback>&&);
|
2015-02-10 13:48:52 +03:00
|
|
|
native GetNodeIdCallback(mozilla::UniquePtr<GetNodeIdCallback>&&);
|
2014-05-18 07:05:46 +04:00
|
|
|
|
2015-12-15 05:17:22 +03:00
|
|
|
[scriptable, uuid(44d362ae-937a-4803-bee6-f2512a0149d1)]
|
2014-05-18 07:05:46 +04:00
|
|
|
interface mozIGeckoMediaPluginService : nsISupports
|
|
|
|
{
|
2014-10-13 02:53:43 +04:00
|
|
|
|
2014-07-10 22:48:11 +04:00
|
|
|
/**
|
|
|
|
* The GMP thread. Callable from any thread.
|
|
|
|
*/
|
2014-05-18 07:05:46 +04:00
|
|
|
readonly attribute nsIThread thread;
|
|
|
|
|
2014-07-17 06:59:17 +04:00
|
|
|
/**
|
|
|
|
* Get a plugin that supports the specified tags.
|
|
|
|
* Callable on any thread
|
|
|
|
*/
|
|
|
|
[noscript]
|
2014-10-14 04:52:56 +04:00
|
|
|
boolean hasPluginForAPI(in ACString api, in TagArray tags);
|
2014-07-17 06:59:17 +04:00
|
|
|
|
2015-02-20 04:37:49 +03:00
|
|
|
/**
|
|
|
|
* Get the version of the plugin that supports the specified tags.
|
|
|
|
* Callable on any thread
|
|
|
|
*/
|
|
|
|
[noscript]
|
2015-02-24 17:03:56 +03:00
|
|
|
void getPluginVersionForAPI(in ACString api, in TagArray tags,
|
|
|
|
out boolean hasPlugin, out ACString version);
|
2015-02-20 04:37:49 +03:00
|
|
|
|
2014-07-10 22:48:11 +04:00
|
|
|
/**
|
|
|
|
* Get a video decoder that supports the specified tags.
|
|
|
|
* The array of tags should at least contain a codec tag, and optionally
|
|
|
|
* other tags such as for EME keysystem.
|
|
|
|
* Callable only on GMP thread.
|
2015-02-10 13:48:29 +03:00
|
|
|
* This is an asynchronous operation, the Done method of the callback object
|
|
|
|
* will be called on the GMP thread with the result (which might be null in
|
|
|
|
* the case of failure). This method always takes ownership of the callback
|
|
|
|
* object, but if this method returns an error then the Done method of the
|
|
|
|
* callback object will not be called at all.
|
2014-07-10 22:48:11 +04:00
|
|
|
*/
|
|
|
|
[noscript]
|
2015-02-10 13:48:29 +03:00
|
|
|
void getGMPVideoDecoder(in TagArray tags,
|
|
|
|
[optional] in ACString nodeId,
|
|
|
|
in GetGMPVideoDecoderCallback callback);
|
2014-05-18 07:05:46 +04:00
|
|
|
|
2014-07-10 22:48:11 +04:00
|
|
|
/**
|
|
|
|
* Get a video encoder that supports the specified tags.
|
|
|
|
* The array of tags should at least contain a codec tag, and optionally
|
|
|
|
* other tags.
|
|
|
|
* Callable only on GMP thread.
|
2015-02-10 13:48:29 +03:00
|
|
|
* This is an asynchronous operation, the Done method of the callback object
|
|
|
|
* will be called on the GMP thread with the result (which might be null in
|
|
|
|
* the case of failure). This method always takes ownership of the callback
|
|
|
|
* object, but if this method returns an error then the Done method of the
|
|
|
|
* callback object will not be called at all.
|
2014-07-10 22:48:11 +04:00
|
|
|
*/
|
|
|
|
[noscript]
|
2015-02-10 13:48:29 +03:00
|
|
|
void getGMPVideoEncoder(in TagArray tags,
|
|
|
|
[optional] in ACString nodeId,
|
|
|
|
in GetGMPVideoEncoderCallback callback);
|
2014-07-10 22:48:11 +04:00
|
|
|
|
2015-02-10 13:48:29 +03:00
|
|
|
/**
|
|
|
|
* Returns an audio decoder that supports the specified tags.
|
|
|
|
* The array of tags should at least contain a codec tag, and optionally
|
|
|
|
* other tags such as for EME keysystem.
|
|
|
|
* Callable only on GMP thread.
|
|
|
|
* This is an asynchronous operation, the Done method of the callback object
|
|
|
|
* will be called on the GMP thread with the result (which might be null in
|
|
|
|
* the case of failure). This method always takes ownership of the callback
|
|
|
|
* object, but if this method returns an error then the Done method of the
|
|
|
|
* callback object will not be called at all.
|
|
|
|
*/
|
|
|
|
[noscript]
|
|
|
|
void getGMPAudioDecoder(in TagArray tags,
|
|
|
|
[optional] in ACString nodeId,
|
|
|
|
in GetGMPAudioDecoderCallback callback);
|
2014-08-03 01:29:26 +04:00
|
|
|
|
2015-02-10 13:48:29 +03:00
|
|
|
/**
|
|
|
|
* Returns a decryption session manager that supports the specified tags.
|
|
|
|
* The array of tags should at least contain a key system tag, and optionally
|
|
|
|
* other tags.
|
|
|
|
* Callable only on GMP thread.
|
|
|
|
* This is an asynchronous operation, the Done method of the callback object
|
|
|
|
* will be called on the GMP thread with the result (which might be null in
|
|
|
|
* the case of failure). This method always takes ownership of the callback
|
|
|
|
* object, but if this method returns an error then the Done method of the
|
|
|
|
* callback object will not be called at all.
|
|
|
|
*/
|
|
|
|
[noscript]
|
|
|
|
void getGMPDecryptor(in TagArray tags, in ACString nodeId,
|
|
|
|
in GetGMPDecryptorCallback callback);
|
2014-07-28 03:20:34 +04:00
|
|
|
|
2014-10-13 02:53:43 +04:00
|
|
|
/**
|
|
|
|
* Gets the NodeId for a (origin, urlbarOrigin, isInprivateBrowsing) tuple.
|
|
|
|
*/
|
2015-02-10 13:48:52 +03:00
|
|
|
[noscript]
|
|
|
|
void getNodeId(in AString origin,
|
|
|
|
in AString topLevelOrigin,
|
2015-11-27 00:53:31 +03:00
|
|
|
in AString gmpName,
|
2015-02-10 13:48:52 +03:00
|
|
|
in bool inPrivateBrowsingMode,
|
|
|
|
in GetNodeIdCallback callback);
|
2014-05-18 07:05:46 +04:00
|
|
|
};
|