зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1495053 - p2: add setServerCertificate() to Java/JNI proxy classes. r=cpearce
Differential Revision: https://phabricator.services.mozilla.com/D7791 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b691f2d917
Коммит
356abac240
|
@ -261,4 +261,11 @@ void MediaDrmProxySupport::Shutdown() {
|
|||
mDestroyed = true;
|
||||
}
|
||||
|
||||
bool MediaDrmProxySupport::SetServerCertificate(
|
||||
const nsTArray<uint8_t>& aCert) {
|
||||
jni::ByteArray::LocalRef cert = jni::ByteArray::New(
|
||||
reinterpret_cast<const int8_t*>(aCert.Elements()), aCert.Length());
|
||||
return mBridgeProxy->SetServerCertificate(cert);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -51,6 +51,8 @@ class MediaDrmProxySupport final {
|
|||
|
||||
const nsString& GetMediaDrmStubId() const { return mMediaDrmStubId; }
|
||||
|
||||
bool SetServerCertificate(const nsTArray<uint8_t>& aCert);
|
||||
|
||||
private:
|
||||
const nsString mKeySystem;
|
||||
java::MediaDrmProxy::GlobalRef mBridgeProxy;
|
||||
|
|
|
@ -282,6 +282,16 @@ public final class MediaDrmProxy {
|
|||
return mDrmStubId;
|
||||
}
|
||||
|
||||
@WrapForJNI
|
||||
public boolean setServerCertificate(final byte[] cert) {
|
||||
try {
|
||||
mImpl.setServerCertificate(cert);
|
||||
return true;
|
||||
} catch (RuntimeException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Get corresponding MediaCrypto object by a generated UUID for MediaCodec.
|
||||
// Will be called on MediaFormatReader's TaskQueue.
|
||||
@WrapForJNI
|
||||
|
|
Загрузка…
Ссылка в новой задаче