Java Code Examples for com.google.android.exoplayer2.C#SERIF_NAME
The following examples show how to use
com.google.android.exoplayer2.C#SERIF_NAME .
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: Tx3gDecoder.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * Sets up a new {@link Tx3gDecoder} with default values. * * @param initializationData Sample description atom ('stsd') data with default subtitle styles. */ public Tx3gDecoder(List<byte[]> initializationData) { super("Tx3gDecoder"); parsableByteArray = new ParsableByteArray(); if (initializationData != null && initializationData.size() == 1 && (initializationData.get(0).length == 48 || initializationData.get(0).length == 53)) { byte[] initializationBytes = initializationData.get(0); defaultFontFace = initializationBytes[24]; defaultColorRgba = ((initializationBytes[26] & 0xFF) << 24) | ((initializationBytes[27] & 0xFF) << 16) | ((initializationBytes[28] & 0xFF) << 8) | (initializationBytes[29] & 0xFF); String fontFamily = Util.fromUtf8Bytes(initializationBytes, 43, initializationBytes.length - 43); defaultFontFamily = TX3G_SERIF.equals(fontFamily) ? C.SERIF_NAME : C.SANS_SERIF_NAME; //font size (initializationBytes[25]) is 5% of video height calculatedVideoTrackHeight = 20 * initializationBytes[25]; customVerticalPlacement = (initializationBytes[0] & 0x20) != 0; if (customVerticalPlacement) { int requestedVerticalPlacement = ((initializationBytes[10] & 0xFF) << 8) | (initializationBytes[11] & 0xFF); defaultVerticalPlacement = (float) requestedVerticalPlacement / calculatedVideoTrackHeight; defaultVerticalPlacement = Util.constrainValue(defaultVerticalPlacement, 0.0f, 0.95f); } else { defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } } else { defaultFontFace = DEFAULT_FONT_FACE; defaultColorRgba = DEFAULT_COLOR; defaultFontFamily = DEFAULT_FONT_FAMILY; customVerticalPlacement = false; defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } }
Example 2
Source File: Tx3gDecoder.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private void decodeInitializationData(List<byte[]> initializationData) { if (initializationData != null && initializationData.size() == 1 && (initializationData.get(0).length == 48 || initializationData.get(0).length == 53)) { byte[] initializationBytes = initializationData.get(0); defaultFontFace = initializationBytes[24]; defaultColorRgba = ((initializationBytes[26] & 0xFF) << 24) | ((initializationBytes[27] & 0xFF) << 16) | ((initializationBytes[28] & 0xFF) << 8) | (initializationBytes[29] & 0xFF); String fontFamily = Util.fromUtf8Bytes(initializationBytes, 43, initializationBytes.length - 43); defaultFontFamily = TX3G_SERIF.equals(fontFamily) ? C.SERIF_NAME : C.SANS_SERIF_NAME; //font size (initializationBytes[25]) is 5% of video height calculatedVideoTrackHeight = 20 * initializationBytes[25]; customVerticalPlacement = (initializationBytes[0] & 0x20) != 0; if (customVerticalPlacement) { int requestedVerticalPlacement = ((initializationBytes[10] & 0xFF) << 8) | (initializationBytes[11] & 0xFF); defaultVerticalPlacement = (float) requestedVerticalPlacement / calculatedVideoTrackHeight; defaultVerticalPlacement = Util.constrainValue(defaultVerticalPlacement, 0.0f, 0.95f); } else { defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } } else { defaultFontFace = DEFAULT_FONT_FACE; defaultColorRgba = DEFAULT_COLOR; defaultFontFamily = DEFAULT_FONT_FAMILY; customVerticalPlacement = false; defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } }
Example 3
Source File: Tx3gDecoder.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private void decodeInitializationData(List<byte[]> initializationData) { if (initializationData != null && initializationData.size() == 1 && (initializationData.get(0).length == 48 || initializationData.get(0).length == 53)) { byte[] initializationBytes = initializationData.get(0); defaultFontFace = initializationBytes[24]; defaultColorRgba = ((initializationBytes[26] & 0xFF) << 24) | ((initializationBytes[27] & 0xFF) << 16) | ((initializationBytes[28] & 0xFF) << 8) | (initializationBytes[29] & 0xFF); String fontFamily = Util.fromUtf8Bytes(initializationBytes, 43, initializationBytes.length - 43); defaultFontFamily = TX3G_SERIF.equals(fontFamily) ? C.SERIF_NAME : C.SANS_SERIF_NAME; //font size (initializationBytes[25]) is 5% of video height calculatedVideoTrackHeight = 20 * initializationBytes[25]; customVerticalPlacement = (initializationBytes[0] & 0x20) != 0; if (customVerticalPlacement) { int requestedVerticalPlacement = ((initializationBytes[10] & 0xFF) << 8) | (initializationBytes[11] & 0xFF); defaultVerticalPlacement = (float) requestedVerticalPlacement / calculatedVideoTrackHeight; defaultVerticalPlacement = Util.constrainValue(defaultVerticalPlacement, 0.0f, 0.95f); } else { defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } } else { defaultFontFace = DEFAULT_FONT_FACE; defaultColorRgba = DEFAULT_COLOR; defaultFontFamily = DEFAULT_FONT_FAMILY; customVerticalPlacement = false; defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } }
Example 4
Source File: Tx3gDecoder.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** * Sets up a new {@link Tx3gDecoder} with default values. * * @param initializationData Sample description atom ('stsd') data with default subtitle styles. */ public Tx3gDecoder(List<byte[]> initializationData) { super("Tx3gDecoder"); parsableByteArray = new ParsableByteArray(); if (initializationData != null && initializationData.size() == 1 && (initializationData.get(0).length == 48 || initializationData.get(0).length == 53)) { byte[] initializationBytes = initializationData.get(0); defaultFontFace = initializationBytes[24]; defaultColorRgba = ((initializationBytes[26] & 0xFF) << 24) | ((initializationBytes[27] & 0xFF) << 16) | ((initializationBytes[28] & 0xFF) << 8) | (initializationBytes[29] & 0xFF); String fontFamily = Util.fromUtf8Bytes(initializationBytes, 43, initializationBytes.length - 43); defaultFontFamily = TX3G_SERIF.equals(fontFamily) ? C.SERIF_NAME : C.SANS_SERIF_NAME; //font size (initializationBytes[25]) is 5% of video height calculatedVideoTrackHeight = 20 * initializationBytes[25]; customVerticalPlacement = (initializationBytes[0] & 0x20) != 0; if (customVerticalPlacement) { int requestedVerticalPlacement = ((initializationBytes[10] & 0xFF) << 8) | (initializationBytes[11] & 0xFF); defaultVerticalPlacement = (float) requestedVerticalPlacement / calculatedVideoTrackHeight; defaultVerticalPlacement = Util.constrainValue(defaultVerticalPlacement, 0.0f, 0.95f); } else { defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } } else { defaultFontFace = DEFAULT_FONT_FACE; defaultColorRgba = DEFAULT_COLOR; defaultFontFamily = DEFAULT_FONT_FAMILY; customVerticalPlacement = false; defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } }
Example 5
Source File: Tx3gDecoder.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** * Sets up a new {@link Tx3gDecoder} with default values. * * @param initializationData Sample description atom ('stsd') data with default subtitle styles. */ public Tx3gDecoder(List<byte[]> initializationData) { super("Tx3gDecoder"); parsableByteArray = new ParsableByteArray(); if (initializationData != null && initializationData.size() == 1 && (initializationData.get(0).length == 48 || initializationData.get(0).length == 53)) { byte[] initializationBytes = initializationData.get(0); defaultFontFace = initializationBytes[24]; defaultColorRgba = ((initializationBytes[26] & 0xFF) << 24) | ((initializationBytes[27] & 0xFF) << 16) | ((initializationBytes[28] & 0xFF) << 8) | (initializationBytes[29] & 0xFF); String fontFamily = Util.fromUtf8Bytes(initializationBytes, 43, initializationBytes.length - 43); defaultFontFamily = TX3G_SERIF.equals(fontFamily) ? C.SERIF_NAME : C.SANS_SERIF_NAME; //font size (initializationBytes[25]) is 5% of video height calculatedVideoTrackHeight = 20 * initializationBytes[25]; customVerticalPlacement = (initializationBytes[0] & 0x20) != 0; if (customVerticalPlacement) { int requestedVerticalPlacement = ((initializationBytes[10] & 0xFF) << 8) | (initializationBytes[11] & 0xFF); defaultVerticalPlacement = (float) requestedVerticalPlacement / calculatedVideoTrackHeight; defaultVerticalPlacement = Util.constrainValue(defaultVerticalPlacement, 0.0f, 0.95f); } else { defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } } else { defaultFontFace = DEFAULT_FONT_FACE; defaultColorRgba = DEFAULT_COLOR; defaultFontFamily = DEFAULT_FONT_FAMILY; customVerticalPlacement = false; defaultVerticalPlacement = DEFAULT_VERTICAL_PLACEMENT; } }