2014-05-17 20:05:46 -07: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"
|
2014-06-29 16:02:39 -07:00
|
|
|
#include "nsIPrincipal.idl"
|
2014-10-12 15:53:44 -07:00
|
|
|
#include "nsIFile.idl"
|
2014-05-17 20:05:46 -07:00
|
|
|
|
|
|
|
%{C++
|
2014-06-29 16:02:39 -07:00
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsStringGlue.h"
|
2014-08-02 14:29:26 -07:00
|
|
|
class GMPAudioDecoderProxy;
|
2014-07-27 16:20:34 -07:00
|
|
|
class GMPDecryptorProxy;
|
2014-07-10 20:35:56 -07:00
|
|
|
class GMPVideoDecoderProxy;
|
|
|
|
class GMPVideoEncoderProxy;
|
2014-05-17 20:05:46 -07:00
|
|
|
class GMPVideoHost;
|
|
|
|
%}
|
|
|
|
|
2014-07-10 20:35:56 -07:00
|
|
|
[ptr] native GMPVideoDecoderProxy(GMPVideoDecoderProxy);
|
|
|
|
[ptr] native GMPVideoEncoderProxy(GMPVideoEncoderProxy);
|
2014-05-17 20:05:46 -07:00
|
|
|
[ptr] native GMPVideoHost(GMPVideoHost);
|
|
|
|
[ptr] native MessageLoop(MessageLoop);
|
2014-06-29 16:02:39 -07:00
|
|
|
[ptr] native TagArray(nsTArray<nsCString>);
|
2014-07-27 16:20:34 -07:00
|
|
|
[ptr] native GMPDecryptorProxy(GMPDecryptorProxy);
|
2014-08-02 14:29:26 -07:00
|
|
|
[ptr] native GMPAudioDecoderProxy(GMPAudioDecoderProxy);
|
2014-05-17 20:05:46 -07:00
|
|
|
|
2014-10-12 15:53:44 -07:00
|
|
|
[scriptable, uuid(e5cde76d-f926-4b3f-84ff-62864c7a750a)]
|
2014-05-17 20:05:46 -07:00
|
|
|
interface mozIGeckoMediaPluginService : nsISupports
|
|
|
|
{
|
2014-10-12 15:53:43 -07:00
|
|
|
|
2014-07-10 11:48:11 -07:00
|
|
|
/**
|
|
|
|
* The GMP thread. Callable from any thread.
|
|
|
|
*/
|
2014-05-17 20:05:46 -07:00
|
|
|
readonly attribute nsIThread thread;
|
|
|
|
|
2014-07-16 19:59:17 -07:00
|
|
|
/**
|
|
|
|
* Get a plugin that supports the specified tags.
|
|
|
|
* Callable on any thread
|
|
|
|
*/
|
|
|
|
[noscript]
|
2014-10-12 15:53:43 -07:00
|
|
|
boolean hasPluginForAPI([optional] in ACString nodeId,
|
2014-07-16 19:59:17 -07:00
|
|
|
in ACString api,
|
|
|
|
in TagArray tags);
|
|
|
|
|
2014-07-10 11:48:11 -07: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.
|
|
|
|
*/
|
|
|
|
[noscript]
|
2014-07-10 20:35:56 -07:00
|
|
|
GMPVideoDecoderProxy getGMPVideoDecoder(in TagArray tags,
|
2014-10-12 15:53:43 -07:00
|
|
|
[optional] in ACString nodeId,
|
2014-07-10 20:35:56 -07:00
|
|
|
out GMPVideoHost outVideoHost);
|
2014-05-17 20:05:46 -07:00
|
|
|
|
2014-07-10 11:48:11 -07: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.
|
|
|
|
*/
|
|
|
|
[noscript]
|
2014-07-10 20:35:56 -07:00
|
|
|
GMPVideoEncoderProxy getGMPVideoEncoder(in TagArray tags,
|
2014-10-12 15:53:43 -07:00
|
|
|
[optional] in ACString nodeId,
|
2014-07-10 20:35:56 -07:00
|
|
|
out GMPVideoHost outVideoHost);
|
2014-07-10 11:48:11 -07:00
|
|
|
|
2014-08-02 14:29:26 -07: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.
|
|
|
|
GMPAudioDecoderProxy getGMPAudioDecoder(in TagArray tags,
|
2014-10-12 15:53:43 -07:00
|
|
|
[optional] in ACString nodeId);
|
2014-08-02 14:29:26 -07:00
|
|
|
|
2014-07-27 16:20:34 -07: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.
|
2014-10-12 15:53:43 -07:00
|
|
|
GMPDecryptorProxy getGMPDecryptor(in TagArray tags, in ACString nodeId);
|
2014-07-27 16:20:34 -07:00
|
|
|
|
2014-07-10 11:48:11 -07:00
|
|
|
/**
|
|
|
|
* Add a directory to scan for gecko media plugins.
|
|
|
|
* @note Main-thread API.
|
|
|
|
*/
|
|
|
|
void addPluginDirectory(in AString directory);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a directory for gecko media plugins.
|
|
|
|
* @note Main-thread API.
|
|
|
|
*/
|
|
|
|
void removePluginDirectory(in AString directory);
|
2014-10-12 15:53:43 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the NodeId for a (origin, urlbarOrigin, isInprivateBrowsing) tuple.
|
|
|
|
*/
|
|
|
|
ACString getNodeId(in AString origin,
|
|
|
|
in AString topLevelOrigin,
|
|
|
|
in bool inPrivateBrowsingMode);
|
2014-10-12 15:53:44 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the directory to use as the base for storing data about GMPs.
|
|
|
|
*/
|
|
|
|
nsIFile getStorageDir();
|
|
|
|
|
2014-05-17 20:05:46 -07:00
|
|
|
};
|