com.google.android.exoplayer2.text.dvb.DvbDecoder Java Examples

The following examples show how to use com.google.android.exoplayer2.text.dvb.DvbDecoder. 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: SubtitleDecoderFactory.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
@Override
public SubtitleDecoder createDecoder(Format format) {
  @Nullable String mimeType = format.sampleMimeType;
  if (mimeType != null) {
    switch (mimeType) {
      case MimeTypes.TEXT_VTT:
        return new WebvttDecoder();
      case MimeTypes.TEXT_SSA:
        return new SsaDecoder(format.initializationData);
      case MimeTypes.APPLICATION_MP4VTT:
        return new Mp4WebvttDecoder();
      case MimeTypes.APPLICATION_TTML:
        return new TtmlDecoder();
      case MimeTypes.APPLICATION_SUBRIP:
        return new SubripDecoder();
      case MimeTypes.APPLICATION_TX3G:
        return new Tx3gDecoder(format.initializationData);
      case MimeTypes.APPLICATION_CEA608:
      case MimeTypes.APPLICATION_MP4CEA608:
        return new Cea608Decoder(mimeType, format.accessibilityChannel);
      case MimeTypes.APPLICATION_CEA708:
        return new Cea708Decoder(format.accessibilityChannel, format.initializationData);
      case MimeTypes.APPLICATION_DVBSUBS:
        return new DvbDecoder(format.initializationData);
      case MimeTypes.APPLICATION_PGS:
        return new PgsDecoder();
      default:
        break;
    }
  }
  throw new IllegalArgumentException(
      "Attempted to create decoder for unsupported MIME type: " + mimeType);
}
 
Example #2
Source File: SubtitleDecoderFactory.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SubtitleDecoder createDecoder(Format format) {
  switch (format.sampleMimeType) {
    case MimeTypes.TEXT_VTT:
      return new WebvttDecoder();
    case MimeTypes.TEXT_SSA:
      return new SsaDecoder(format.initializationData);
    case MimeTypes.APPLICATION_MP4VTT:
      return new Mp4WebvttDecoder();
    case MimeTypes.APPLICATION_TTML:
      return new TtmlDecoder();
    case MimeTypes.APPLICATION_SUBRIP:
      return new SubripDecoder();
    case MimeTypes.APPLICATION_TX3G:
      return new Tx3gDecoder(format.initializationData);
    case MimeTypes.APPLICATION_CEA608:
    case MimeTypes.APPLICATION_MP4CEA608:
      return new Cea608Decoder(format.sampleMimeType, format.accessibilityChannel);
    case MimeTypes.APPLICATION_CEA708:
      return new Cea708Decoder(format.accessibilityChannel, format.initializationData);
    case MimeTypes.APPLICATION_DVBSUBS:
      return new DvbDecoder(format.initializationData);
    case MimeTypes.APPLICATION_PGS:
      return new PgsDecoder();
    default:
      throw new IllegalArgumentException(
          "Attempted to create decoder for unsupported format");
  }
}
 
Example #3
Source File: SubtitleDecoderFactory.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SubtitleDecoder createDecoder(Format format) {
  switch (format.sampleMimeType) {
    case MimeTypes.TEXT_VTT:
      return new WebvttDecoder();
    case MimeTypes.TEXT_SSA:
      return new SsaDecoder(format.initializationData);
    case MimeTypes.APPLICATION_MP4VTT:
      return new Mp4WebvttDecoder();
    case MimeTypes.APPLICATION_TTML:
      return new TtmlDecoder();
    case MimeTypes.APPLICATION_SUBRIP:
      return new SubripDecoder();
    case MimeTypes.APPLICATION_TX3G:
      return new Tx3gDecoder(format.initializationData);
    case MimeTypes.APPLICATION_CEA608:
    case MimeTypes.APPLICATION_MP4CEA608:
      return new Cea608Decoder(format.sampleMimeType, format.accessibilityChannel);
    case MimeTypes.APPLICATION_CEA708:
      return new Cea708Decoder(format.accessibilityChannel, format.initializationData);
    case MimeTypes.APPLICATION_DVBSUBS:
      return new DvbDecoder(format.initializationData);
    case MimeTypes.APPLICATION_PGS:
      return new PgsDecoder();
    default:
      throw new IllegalArgumentException(
          "Attempted to create decoder for unsupported format");
  }
}
 
Example #4
Source File: NoPlayerSubtitleDecoderFactory.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public SubtitleDecoder createDecoder(Format format) {
    switch (format.sampleMimeType) {
        case MimeTypes.TEXT_VTT:
            return new WebvttDecoder();
        case MimeTypes.TEXT_SSA:
            return new SsaDecoder(format.initializationData);
        case MimeTypes.APPLICATION_MP4VTT:
            return new Mp4WebvttDecoder();
        case MimeTypes.APPLICATION_TTML:
            return new TtmlDecoder();
        case MimeTypes.APPLICATION_SUBRIP:
            return new SubripDecoder();
        case MimeTypes.APPLICATION_TX3G:
            return new Tx3gDecoder(format.initializationData);
        case MimeTypes.APPLICATION_CEA608:
        case MimeTypes.APPLICATION_MP4CEA608:
            return new Cea608Decoder(format.sampleMimeType, format.accessibilityChannel);
        case MimeTypes.APPLICATION_CEA708:
            return new Cea708Decoder(format.accessibilityChannel, format.initializationData);
        case MimeTypes.APPLICATION_DVBSUBS:
            return new DvbDecoder(format.initializationData);
        case MimeTypes.APPLICATION_PGS:
            return new PgsDecoder();
        default:
            throw new IllegalArgumentException("Attempted to create decoder for unsupported format");
    }
}
 
Example #5
Source File: SubtitleDecoderFactory.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SubtitleDecoder createDecoder(Format format) {
  switch (format.sampleMimeType) {
    case MimeTypes.TEXT_VTT:
      return new WebvttDecoder();
    case MimeTypes.TEXT_SSA:
      return new SsaDecoder(format.initializationData);
    case MimeTypes.APPLICATION_MP4VTT:
      return new Mp4WebvttDecoder();
    case MimeTypes.APPLICATION_TTML:
      return new TtmlDecoder();
    case MimeTypes.APPLICATION_SUBRIP:
      return new SubripDecoder();
    case MimeTypes.APPLICATION_TX3G:
      return new Tx3gDecoder(format.initializationData);
    case MimeTypes.APPLICATION_CEA608:
    case MimeTypes.APPLICATION_MP4CEA608:
      return new Cea608Decoder(format.sampleMimeType, format.accessibilityChannel);
    case MimeTypes.APPLICATION_CEA708:
      return new Cea708Decoder(format.accessibilityChannel, format.initializationData);
    case MimeTypes.APPLICATION_DVBSUBS:
      return new DvbDecoder(format.initializationData);
    case MimeTypes.APPLICATION_PGS:
      return new PgsDecoder();
    default:
      throw new IllegalArgumentException(
          "Attempted to create decoder for unsupported format");
  }
}
 
Example #6
Source File: SubtitleDecoderFactory.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SubtitleDecoder createDecoder(Format format) {
  switch (format.sampleMimeType) {
    case MimeTypes.TEXT_VTT:
      return new WebvttDecoder();
    case MimeTypes.TEXT_SSA:
      return new SsaDecoder(format.initializationData);
    case MimeTypes.APPLICATION_MP4VTT:
      return new Mp4WebvttDecoder();
    case MimeTypes.APPLICATION_TTML:
      return new TtmlDecoder();
    case MimeTypes.APPLICATION_SUBRIP:
      return new SubripDecoder();
    case MimeTypes.APPLICATION_TX3G:
      return new Tx3gDecoder(format.initializationData);
    case MimeTypes.APPLICATION_CEA608:
    case MimeTypes.APPLICATION_MP4CEA608:
      return new Cea608Decoder(format.sampleMimeType, format.accessibilityChannel);
    case MimeTypes.APPLICATION_CEA708:
      return new Cea708Decoder(format.accessibilityChannel, format.initializationData);
    case MimeTypes.APPLICATION_DVBSUBS:
      return new DvbDecoder(format.initializationData);
    case MimeTypes.APPLICATION_PGS:
      return new PgsDecoder();
    default:
      throw new IllegalArgumentException(
          "Attempted to create decoder for unsupported format");
  }
}