Java 类com.google.android.exoplayer2.text.tx3g.Tx3gDecoder 实例源码

项目:Exoplayer2Radio    文件:SubtitleDecoderFactory.java   
@Override
public SubtitleDecoder createDecoder(Format format) {
  switch (format.sampleMimeType) {
    case MimeTypes.TEXT_VTT:
      return new WebvttDecoder();
    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);
    case MimeTypes.APPLICATION_DVBSUBS:
      return new DvbDecoder(format.initializationData);
    default:
      throw new IllegalArgumentException("Attempted to create decoder for unsupported format");
  }
}
项目:transistor    文件:SubtitleDecoderFactory.java   
@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);
    case MimeTypes.APPLICATION_DVBSUBS:
      return new DvbDecoder(format.initializationData);
    default:
      throw new IllegalArgumentException("Attempted to create decoder for unsupported format");
  }
}