com.google.android.exoplayer2.metadata.id3.PrivFrame Java Examples
The following examples show how to use
com.google.android.exoplayer2.metadata.id3.PrivFrame.
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: HlsSampleStreamWrapper.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * Strips the private timestamp frame from metadata, if present. See: * https://github.com/google/ExoPlayer/issues/5063 */ @Nullable private Metadata getAdjustedMetadata(@Nullable Metadata metadata) { if (metadata == null) { return null; } int length = metadata.length(); int transportStreamTimestampMetadataIndex = C.INDEX_UNSET; for (int i = 0; i < length; i++) { Metadata.Entry metadataEntry = metadata.get(i); if (metadataEntry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) metadataEntry; if (HlsMediaChunk.PRIV_TIMESTAMP_FRAME_OWNER.equals(privFrame.owner)) { transportStreamTimestampMetadataIndex = i; break; } } } if (transportStreamTimestampMetadataIndex == C.INDEX_UNSET) { return metadata; } if (length == 1) { return null; } Metadata.Entry[] newMetadataEntries = new Metadata.Entry[length - 1]; for (int i = 0; i < length; i++) { if (i != transportStreamTimestampMetadataIndex) { int newIndex = i < transportStreamTimestampMetadataIndex ? i : i - 1; newMetadataEntries[newIndex] = metadata.get(i); } } return new Metadata(newMetadataEntries); }
Example #2
Source File: EventLogger.java From PowerFileExplorer with GNU General Public License v3.0 | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #3
Source File: EventLogger.java From TubiPlayer with MIT License | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #4
Source File: EventLogger.java From ExoPlayer-Offline with Apache License 2.0 | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #5
Source File: EventLogger.java From LiveVideoBroadcaster with Apache License 2.0 | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #6
Source File: EventLogger.java From mimi-reader with Apache License 2.0 | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #7
Source File: EventLogger.java From GSYVideoPlayer with Apache License 2.0 | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #8
Source File: EventLogger.java From TigerVideo with Apache License 2.0 | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #9
Source File: EventLogger.java From K-Sonic with MIT License | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #10
Source File: EventLogger.java From evercam-android with GNU Affero General Public License v3.0 | 5 votes |
private void printMetadata(Metadata metadata, String prefix) { for (int i = 0; i < metadata.length(); i++) { Metadata.Entry entry = metadata.get(i); if (entry instanceof TextInformationFrame) { TextInformationFrame textInformationFrame = (TextInformationFrame) entry; Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id, textInformationFrame.value)); } else if (entry instanceof UrlLinkFrame) { UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry; Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url)); } else if (entry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) entry; Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner)); } else if (entry instanceof GeobFrame) { GeobFrame geobFrame = (GeobFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description)); } else if (entry instanceof ApicFrame) { ApicFrame apicFrame = (ApicFrame) entry; Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s", apicFrame.id, apicFrame.mimeType, apicFrame.description)); } else if (entry instanceof CommentFrame) { CommentFrame commentFrame = (CommentFrame) entry; Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id, commentFrame.language, commentFrame.description)); } else if (entry instanceof Id3Frame) { Id3Frame id3Frame = (Id3Frame) entry; Log.d(TAG, prefix + String.format("%s", id3Frame.id)); } else if (entry instanceof EventMessage) { EventMessage eventMessage = (EventMessage) entry; Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s", eventMessage.schemeIdUri, eventMessage.id, eventMessage.value)); } } }
Example #11
Source File: HlsSampleStreamWrapper.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
/** * Strips the private timestamp frame from metadata, if present. See: * https://github.com/google/ExoPlayer/issues/5063 */ @Nullable private Metadata getAdjustedMetadata(@Nullable Metadata metadata) { if (metadata == null) { return null; } int length = metadata.length(); int transportStreamTimestampMetadataIndex = C.INDEX_UNSET; for (int i = 0; i < length; i++) { Metadata.Entry metadataEntry = metadata.get(i); if (metadataEntry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) metadataEntry; if (HlsMediaChunk.PRIV_TIMESTAMP_FRAME_OWNER.equals(privFrame.owner)) { transportStreamTimestampMetadataIndex = i; break; } } } if (transportStreamTimestampMetadataIndex == C.INDEX_UNSET) { return metadata; } if (length == 1) { return null; } Metadata.Entry[] newMetadataEntries = new Metadata.Entry[length - 1]; for (int i = 0; i < length; i++) { if (i != transportStreamTimestampMetadataIndex) { int newIndex = i < transportStreamTimestampMetadataIndex ? i : i - 1; newMetadataEntries[newIndex] = metadata.get(i); } } return new Metadata(newMetadataEntries); }
Example #12
Source File: HlsSampleStreamWrapper.java From Telegram with GNU General Public License v2.0 | 5 votes |
/** * Strips the private timestamp frame from metadata, if present. See: * https://github.com/google/ExoPlayer/issues/5063 */ @Nullable private Metadata getAdjustedMetadata(@Nullable Metadata metadata) { if (metadata == null) { return null; } int length = metadata.length(); int transportStreamTimestampMetadataIndex = C.INDEX_UNSET; for (int i = 0; i < length; i++) { Metadata.Entry metadataEntry = metadata.get(i); if (metadataEntry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) metadataEntry; if (HlsMediaChunk.PRIV_TIMESTAMP_FRAME_OWNER.equals(privFrame.owner)) { transportStreamTimestampMetadataIndex = i; break; } } } if (transportStreamTimestampMetadataIndex == C.INDEX_UNSET) { return metadata; } if (length == 1) { return null; } Metadata.Entry[] newMetadataEntries = new Metadata.Entry[length - 1]; for (int i = 0; i < length; i++) { if (i != transportStreamTimestampMetadataIndex) { int newIndex = i < transportStreamTimestampMetadataIndex ? i : i - 1; newMetadataEntries[newIndex] = metadata.get(i); } } return new Metadata(newMetadataEntries); }