Java Code Examples for com.google.android.exoplayer2.util.MimeTypes#APPLICATION_CEA708
The following examples show how to use
com.google.android.exoplayer2.util.MimeTypes#APPLICATION_CEA708 .
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: DashManifestParser.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
/** * Derives a sample mimeType from a container mimeType and codecs attribute. * * @param containerMimeType The mimeType of the container. * @param codecs The codecs attribute. * @return The derived sample mimeType, or null if it could not be derived. */ private static String getSampleMimeType(String containerMimeType, String codecs) { if (MimeTypes.isAudio(containerMimeType)) { return MimeTypes.getAudioMediaMimeType(codecs); } else if (MimeTypes.isVideo(containerMimeType)) { return MimeTypes.getVideoMediaMimeType(codecs); } else if (mimeTypeIsRawText(containerMimeType)) { return containerMimeType; } else if (MimeTypes.APPLICATION_MP4.equals(containerMimeType)) { if ("stpp".equals(codecs)) { return MimeTypes.APPLICATION_TTML; } else if ("wvtt".equals(codecs)) { return MimeTypes.APPLICATION_MP4VTT; } } else if (MimeTypes.APPLICATION_RAWCC.equals(containerMimeType)) { if (codecs != null) { if (codecs.contains("cea708")) { return MimeTypes.APPLICATION_CEA708; } else if (codecs.contains("eia608") || codecs.contains("cea608")) { return MimeTypes.APPLICATION_CEA608; } } return null; } return null; }
Example 2
Source File: DashManifestParser.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
/** * Derives a sample mimeType from a container mimeType and codecs attribute. * * @param containerMimeType The mimeType of the container. * @param codecs The codecs attribute. * @return The derived sample mimeType, or null if it could not be derived. */ private static String getSampleMimeType(String containerMimeType, String codecs) { if (MimeTypes.isAudio(containerMimeType)) { return MimeTypes.getAudioMediaMimeType(codecs); } else if (MimeTypes.isVideo(containerMimeType)) { return MimeTypes.getVideoMediaMimeType(codecs); } else if (mimeTypeIsRawText(containerMimeType)) { return containerMimeType; } else if (MimeTypes.APPLICATION_MP4.equals(containerMimeType)) { if ("stpp".equals(codecs)) { return MimeTypes.APPLICATION_TTML; } else if ("wvtt".equals(codecs)) { return MimeTypes.APPLICATION_MP4VTT; } } else if (MimeTypes.APPLICATION_RAWCC.equals(containerMimeType)) { if (codecs != null) { if (codecs.contains("cea708")) { return MimeTypes.APPLICATION_CEA708; } else if (codecs.contains("eia608") || codecs.contains("cea608")) { return MimeTypes.APPLICATION_CEA608; } } return null; } return null; }
Example 3
Source File: DashManifestParser.java From K-Sonic with MIT License | 6 votes |
/** * Derives a sample mimeType from a container mimeType and codecs attribute. * * @param containerMimeType The mimeType of the container. * @param codecs The codecs attribute. * @return The derived sample mimeType, or null if it could not be derived. */ private static String getSampleMimeType(String containerMimeType, String codecs) { if (MimeTypes.isAudio(containerMimeType)) { return MimeTypes.getAudioMediaMimeType(codecs); } else if (MimeTypes.isVideo(containerMimeType)) { return MimeTypes.getVideoMediaMimeType(codecs); } else if (mimeTypeIsRawText(containerMimeType)) { return containerMimeType; } else if (MimeTypes.APPLICATION_MP4.equals(containerMimeType)) { if ("stpp".equals(codecs)) { return MimeTypes.APPLICATION_TTML; } else if ("wvtt".equals(codecs)) { return MimeTypes.APPLICATION_MP4VTT; } } else if (MimeTypes.APPLICATION_RAWCC.equals(containerMimeType)) { if (codecs != null) { if (codecs.contains("cea708")) { return MimeTypes.APPLICATION_CEA708; } else if (codecs.contains("eia608") || codecs.contains("cea608")) { return MimeTypes.APPLICATION_CEA608; } } return null; } return null; }
Example 4
Source File: SubtitleDecoderFactory.java From MediaSDK with Apache License 2.0 | 5 votes |
@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 5
Source File: DashManifestParser.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * Derives a sample mimeType from a container mimeType and codecs attribute. * * @param containerMimeType The mimeType of the container. * @param codecs The codecs attribute. * @return The derived sample mimeType, or null if it could not be derived. */ @Nullable private static String getSampleMimeType( @Nullable String containerMimeType, @Nullable String codecs) { if (MimeTypes.isAudio(containerMimeType)) { return MimeTypes.getAudioMediaMimeType(codecs); } else if (MimeTypes.isVideo(containerMimeType)) { return MimeTypes.getVideoMediaMimeType(codecs); } else if (mimeTypeIsRawText(containerMimeType)) { return containerMimeType; } else if (MimeTypes.APPLICATION_MP4.equals(containerMimeType)) { if (codecs != null) { if (codecs.startsWith("stpp")) { return MimeTypes.APPLICATION_TTML; } else if (codecs.startsWith("wvtt")) { return MimeTypes.APPLICATION_MP4VTT; } } } else if (MimeTypes.APPLICATION_RAWCC.equals(containerMimeType)) { if (codecs != null) { if (codecs.contains("cea708")) { return MimeTypes.APPLICATION_CEA708; } else if (codecs.contains("eia608") || codecs.contains("cea608")) { return MimeTypes.APPLICATION_CEA608; } } return null; } return null; }
Example 6
Source File: SubtitleDecoderFactory.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
@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 7
Source File: SubtitleDecoderFactory.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
@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 8
Source File: NoPlayerSubtitleDecoderFactory.java From no-player with Apache License 2.0 | 5 votes |
@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 9
Source File: SubtitleDecoderFactory.java From K-Sonic with MIT License | 5 votes |
private Class<?> getDecoderClass(String mimeType) { if (mimeType == null) { return null; } try { switch (mimeType) { case MimeTypes.TEXT_VTT: return Class.forName("com.google.android.exoplayer2.text.webvtt.WebvttDecoder"); case MimeTypes.APPLICATION_TTML: return Class.forName("com.google.android.exoplayer2.text.ttml.TtmlDecoder"); case MimeTypes.APPLICATION_MP4VTT: return Class.forName("com.google.android.exoplayer2.text.webvtt.Mp4WebvttDecoder"); case MimeTypes.APPLICATION_SUBRIP: return Class.forName("com.google.android.exoplayer2.text.subrip.SubripDecoder"); case MimeTypes.APPLICATION_TX3G: return Class.forName("com.google.android.exoplayer2.text.tx3g.Tx3gDecoder"); case MimeTypes.APPLICATION_CEA608: case MimeTypes.APPLICATION_MP4CEA608: return Class.forName("com.google.android.exoplayer2.text.cea.Cea608Decoder"); case MimeTypes.APPLICATION_CEA708: return Class.forName("com.google.android.exoplayer2.text.cea.Cea708Decoder"); default: return null; } } catch (ClassNotFoundException e) { return null; } }
Example 10
Source File: SubtitleDecoderFactory.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
@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 11
Source File: DashManifestParser.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** * Derives a sample mimeType from a container mimeType and codecs attribute. * * @param containerMimeType The mimeType of the container. * @param codecs The codecs attribute. * @return The derived sample mimeType, or null if it could not be derived. */ private static String getSampleMimeType(String containerMimeType, String codecs) { if (MimeTypes.isAudio(containerMimeType)) { return MimeTypes.getAudioMediaMimeType(codecs); } else if (MimeTypes.isVideo(containerMimeType)) { return MimeTypes.getVideoMediaMimeType(codecs); } else if (mimeTypeIsRawText(containerMimeType)) { return containerMimeType; } else if (MimeTypes.APPLICATION_MP4.equals(containerMimeType)) { if (codecs != null) { if (codecs.startsWith("stpp")) { return MimeTypes.APPLICATION_TTML; } else if (codecs.startsWith("wvtt")) { return MimeTypes.APPLICATION_MP4VTT; } } } else if (MimeTypes.APPLICATION_RAWCC.equals(containerMimeType)) { if (codecs != null) { if (codecs.contains("cea708")) { return MimeTypes.APPLICATION_CEA708; } else if (codecs.contains("eia608") || codecs.contains("cea608")) { return MimeTypes.APPLICATION_CEA608; } } return null; } return null; }
Example 12
Source File: SubtitleDecoderFactory.java From Telegram with GNU General Public License v2.0 | 5 votes |
@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 13
Source File: DashManifestParser.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** * Derives a sample mimeType from a container mimeType and codecs attribute. * * @param containerMimeType The mimeType of the container. * @param codecs The codecs attribute. * @return The derived sample mimeType, or null if it could not be derived. */ private static String getSampleMimeType(String containerMimeType, String codecs) { if (MimeTypes.isAudio(containerMimeType)) { return MimeTypes.getAudioMediaMimeType(codecs); } else if (MimeTypes.isVideo(containerMimeType)) { return MimeTypes.getVideoMediaMimeType(codecs); } else if (mimeTypeIsRawText(containerMimeType)) { return containerMimeType; } else if (MimeTypes.APPLICATION_MP4.equals(containerMimeType)) { if (codecs != null) { if (codecs.startsWith("stpp")) { return MimeTypes.APPLICATION_TTML; } else if (codecs.startsWith("wvtt")) { return MimeTypes.APPLICATION_MP4VTT; } } } else if (MimeTypes.APPLICATION_RAWCC.equals(containerMimeType)) { if (codecs != null) { if (codecs.contains("cea708")) { return MimeTypes.APPLICATION_CEA708; } else if (codecs.contains("eia608") || codecs.contains("cea608")) { return MimeTypes.APPLICATION_CEA608; } } return null; } return null; }