Example usage for android.media MediaCryptoException toString

List of usage examples for android.media MediaCryptoException toString

Introduction

In this page you can find the example usage for android.media MediaCryptoException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:org.chromium.media.MediaDrmBridge.java

/**
 * Create a MediaCrypto object.//from  w ww.  j a va2  s .  com
 *
 * @return if a MediaCrypto object is successfully created.
 */
private boolean createMediaCrypto() {
    assert (mSessionId != null);
    assert (mMediaCrypto == null);
    try {
        final byte[] session = mSessionId.getBytes("UTF-8");
        if (MediaCrypto.isCryptoSchemeSupported(mSchemeUUID)) {
            mMediaCrypto = new MediaCrypto(mSchemeUUID, session);
        }
    } catch (android.media.MediaCryptoException e) {
        Log.e(TAG, "Cannot create MediaCrypto " + e.toString());
        return false;
    } catch (java.io.UnsupportedEncodingException e) {
        Log.e(TAG, "Cannot create MediaCrypto " + e.toString());
        return false;
    }

    assert (mMediaCrypto != null);
    nativeOnMediaCryptoReady(mNativeMediaDrmBridge);
    return true;
}