Java Code Examples for com.google.android.exoplayer2.C#CENC_TYPE_cenc

The following examples show how to use com.google.android.exoplayer2.C#CENC_TYPE_cenc . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TrackEncryptionBox.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
@C.CryptoMode
private static int schemeToCryptoMode(@Nullable String schemeType) {
  if (schemeType == null) {
    // If unknown, assume cenc.
    return C.CRYPTO_MODE_AES_CTR;
  }
  switch (schemeType) {
    case C.CENC_TYPE_cenc:
    case C.CENC_TYPE_cens:
      return C.CRYPTO_MODE_AES_CTR;
    case C.CENC_TYPE_cbc1:
    case C.CENC_TYPE_cbcs:
      return C.CRYPTO_MODE_AES_CBC;
    default:
      Log.w(TAG, "Unsupported protection scheme type '" + schemeType + "'. Assuming AES-CTR "
          + "crypto mode.");
      return C.CRYPTO_MODE_AES_CTR;
  }
}
 
Example 2
Source File: TrackEncryptionBox.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@C.CryptoMode
private static int schemeToCryptoMode(@Nullable String schemeType) {
  if (schemeType == null) {
    // If unknown, assume cenc.
    return C.CRYPTO_MODE_AES_CTR;
  }
  switch (schemeType) {
    case C.CENC_TYPE_cenc:
    case C.CENC_TYPE_cens:
      return C.CRYPTO_MODE_AES_CTR;
    case C.CENC_TYPE_cbc1:
    case C.CENC_TYPE_cbcs:
      return C.CRYPTO_MODE_AES_CBC;
    default:
      Log.w(TAG, "Unsupported protection scheme type '" + schemeType + "'. Assuming AES-CTR "
          + "crypto mode.");
      return C.CRYPTO_MODE_AES_CTR;
  }
}
 
Example 3
Source File: TrackEncryptionBox.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@C.CryptoMode
private static int schemeToCryptoMode(@Nullable String schemeType) {
  if (schemeType == null) {
    // If unknown, assume cenc.
    return C.CRYPTO_MODE_AES_CTR;
  }
  switch (schemeType) {
    case C.CENC_TYPE_cenc:
    case C.CENC_TYPE_cens:
      return C.CRYPTO_MODE_AES_CTR;
    case C.CENC_TYPE_cbc1:
    case C.CENC_TYPE_cbcs:
      return C.CRYPTO_MODE_AES_CBC;
    default:
      Log.w(TAG, "Unsupported protection scheme type '" + schemeType + "'. Assuming AES-CTR "
          + "crypto mode.");
      return C.CRYPTO_MODE_AES_CTR;
  }
}
 
Example 4
Source File: TrackEncryptionBox.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@C.CryptoMode
private static int schemeToCryptoMode(@Nullable String schemeType) {
  if (schemeType == null) {
    // If unknown, assume cenc.
    return C.CRYPTO_MODE_AES_CTR;
  }
  switch (schemeType) {
    case C.CENC_TYPE_cenc:
    case C.CENC_TYPE_cens:
      return C.CRYPTO_MODE_AES_CTR;
    case C.CENC_TYPE_cbc1:
    case C.CENC_TYPE_cbcs:
      return C.CRYPTO_MODE_AES_CBC;
    default:
      Log.w(TAG, "Unsupported protection scheme type '" + schemeType + "'. Assuming AES-CTR "
          + "crypto mode.");
      return C.CRYPTO_MODE_AES_CTR;
  }
}
 
Example 5
Source File: TrackEncryptionBox.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@C.CryptoMode
private static int schemeToCryptoMode(@Nullable String schemeType) {
  if (schemeType == null) {
    // If unknown, assume cenc.
    return C.CRYPTO_MODE_AES_CTR;
  }
  switch (schemeType) {
    case C.CENC_TYPE_cenc:
    case C.CENC_TYPE_cens:
      return C.CRYPTO_MODE_AES_CTR;
    case C.CENC_TYPE_cbc1:
    case C.CENC_TYPE_cbcs:
      return C.CRYPTO_MODE_AES_CBC;
    default:
      Log.w(TAG, "Unsupported protection scheme type '" + schemeType + "'. Assuming AES-CTR "
          + "crypto mode.");
      return C.CRYPTO_MODE_AES_CTR;
  }
}
 
Example 6
Source File: HlsPlaylistParser.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
private static String parseEncryptionScheme(String method) {
  return METHOD_SAMPLE_AES_CENC.equals(method) || METHOD_SAMPLE_AES_CTR.equals(method)
      ? C.CENC_TYPE_cenc
      : C.CENC_TYPE_cbcs;
}
 
Example 7
Source File: HlsPlaylistParser.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
private static String parseEncryptionScheme(String method) {
  return METHOD_SAMPLE_AES_CENC.equals(method) || METHOD_SAMPLE_AES_CTR.equals(method)
      ? C.CENC_TYPE_cenc
      : C.CENC_TYPE_cbcs;
}
 
Example 8
Source File: HlsPlaylistParser.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
private static String parseEncryptionScheme(String method) {
  return METHOD_SAMPLE_AES_CENC.equals(method) || METHOD_SAMPLE_AES_CTR.equals(method)
      ? C.CENC_TYPE_cenc
      : C.CENC_TYPE_cbcs;
}