com.google.android.exoplayer2.metadata.emsg.EventMessageEncoder Java Examples

The following examples show how to use com.google.android.exoplayer2.metadata.emsg.EventMessageEncoder. 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: FragmentedMp4Extractor.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * @param flags Flags that control the extractor's behavior.
 * @param timestampAdjuster Adjusts sample timestamps. May be null if no adjustment is needed.
 * @param sideloadedTrack Sideloaded track information, in the case that the extractor will not
 *     receive a moov box in the input data. Null if a moov box is expected.
 * @param sideloadedDrmInitData The {@link DrmInitData} to use for encrypted tracks. If null, the
 *     pssh boxes (if present) will be used.
 * @param closedCaptionFormats For tracks that contain SEI messages, the formats of the closed
 *     caption channels to expose.
 * @param additionalEmsgTrackOutput An extra track output that will receive all emsg messages
 *     targeting the player, even if {@link #FLAG_ENABLE_EMSG_TRACK} is not set. Null if special
 *     handling of emsg messages for players is not required.
 */
public FragmentedMp4Extractor(
    @Flags int flags,
    @Nullable TimestampAdjuster timestampAdjuster,
    @Nullable Track sideloadedTrack,
    @Nullable DrmInitData sideloadedDrmInitData,
    List<Format> closedCaptionFormats,
    @Nullable TrackOutput additionalEmsgTrackOutput) {
  this.flags = flags | (sideloadedTrack != null ? FLAG_SIDELOADED : 0);
  this.timestampAdjuster = timestampAdjuster;
  this.sideloadedTrack = sideloadedTrack;
  this.sideloadedDrmInitData = sideloadedDrmInitData;
  this.closedCaptionFormats = Collections.unmodifiableList(closedCaptionFormats);
  this.additionalEmsgTrackOutput = additionalEmsgTrackOutput;
  eventMessageEncoder = new EventMessageEncoder();
  atomHeader = new ParsableByteArray(Atom.LONG_HEADER_SIZE);
  nalStartCode = new ParsableByteArray(NalUnitUtil.NAL_START_CODE);
  nalPrefix = new ParsableByteArray(5);
  nalBuffer = new ParsableByteArray();
  scratchBytes = new byte[16];
  scratch = new ParsableByteArray(scratchBytes);
  containerAtoms = new ArrayDeque<>();
  pendingMetadataSampleInfos = new ArrayDeque<>();
  trackBundles = new SparseArray<>();
  durationUs = C.TIME_UNSET;
  pendingSeekTimeUs = C.TIME_UNSET;
  segmentIndexEarliestPresentationTimeUs = C.TIME_UNSET;
  enterReadingAtomHeaderState();
}
 
Example #2
Source File: EventSampleStream.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
public EventSampleStream(
    EventStream eventStream, Format upstreamFormat, boolean eventStreamAppendable) {
  this.upstreamFormat = upstreamFormat;
  this.eventStream = eventStream;
  eventMessageEncoder = new EventMessageEncoder();
  pendingSeekPositionUs = C.TIME_UNSET;
  eventTimesUs = eventStream.presentationTimesUs;
  updateEventStream(eventStream, eventStreamAppendable);
}
 
Example #3
Source File: EventSampleStream.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
EventSampleStream(EventStream eventStream, Format upstreamFormat, boolean eventStreamUpdatable) {
  this.upstreamFormat = upstreamFormat;
  this.eventStream = eventStream;
  eventMessageEncoder = new EventMessageEncoder();
  pendingSeekPositionUs = C.TIME_UNSET;
  eventTimesUs = eventStream.presentationTimesUs;
  updateEventStream(eventStream, eventStreamUpdatable);
}
 
Example #4
Source File: EventSampleStream.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
EventSampleStream(EventStream eventStream, Format upstreamFormat, boolean eventStreamUpdatable) {
  this.upstreamFormat = upstreamFormat;
  this.eventStream = eventStream;
  eventMessageEncoder = new EventMessageEncoder();
  pendingSeekPositionUs = C.TIME_UNSET;
  eventTimesUs = eventStream.presentationTimesUs;
  updateEventStream(eventStream, eventStreamUpdatable);
}
 
Example #5
Source File: FragmentedMp4Extractor.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param flags Flags that control the extractor's behavior.
 * @param timestampAdjuster Adjusts sample timestamps. May be null if no adjustment is needed.
 * @param sideloadedTrack Sideloaded track information, in the case that the extractor will not
 *     receive a moov box in the input data. Null if a moov box is expected.
 * @param sideloadedDrmInitData The {@link DrmInitData} to use for encrypted tracks. If null, the
 *     pssh boxes (if present) will be used.
 * @param closedCaptionFormats For tracks that contain SEI messages, the formats of the closed
 *     caption channels to expose.
 * @param additionalEmsgTrackOutput An extra track output that will receive all emsg messages
 *     targeting the player, even if {@link #FLAG_ENABLE_EMSG_TRACK} is not set. Null if special
 *     handling of emsg messages for players is not required.
 */
public FragmentedMp4Extractor(
    @Flags int flags,
    @Nullable TimestampAdjuster timestampAdjuster,
    @Nullable Track sideloadedTrack,
    @Nullable DrmInitData sideloadedDrmInitData,
    List<Format> closedCaptionFormats,
    @Nullable TrackOutput additionalEmsgTrackOutput) {
  this.flags = flags | (sideloadedTrack != null ? FLAG_SIDELOADED : 0);
  this.timestampAdjuster = timestampAdjuster;
  this.sideloadedTrack = sideloadedTrack;
  this.sideloadedDrmInitData = sideloadedDrmInitData;
  this.closedCaptionFormats = Collections.unmodifiableList(closedCaptionFormats);
  this.additionalEmsgTrackOutput = additionalEmsgTrackOutput;
  eventMessageEncoder = new EventMessageEncoder();
  atomHeader = new ParsableByteArray(Atom.LONG_HEADER_SIZE);
  nalStartCode = new ParsableByteArray(NalUnitUtil.NAL_START_CODE);
  nalPrefix = new ParsableByteArray(5);
  nalBuffer = new ParsableByteArray();
  scratchBytes = new byte[16];
  scratch = new ParsableByteArray(scratchBytes);
  containerAtoms = new ArrayDeque<>();
  pendingMetadataSampleInfos = new ArrayDeque<>();
  trackBundles = new SparseArray<>();
  durationUs = C.TIME_UNSET;
  pendingSeekTimeUs = C.TIME_UNSET;
  segmentIndexEarliestPresentationTimeUs = C.TIME_UNSET;
  enterReadingAtomHeaderState();
}
 
Example #6
Source File: EventSampleStream.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public EventSampleStream(
    EventStream eventStream, Format upstreamFormat, boolean eventStreamAppendable) {
  this.upstreamFormat = upstreamFormat;
  this.eventStream = eventStream;
  eventMessageEncoder = new EventMessageEncoder();
  pendingSeekPositionUs = C.TIME_UNSET;
  eventTimesUs = eventStream.presentationTimesUs;
  updateEventStream(eventStream, eventStreamAppendable);
}
 
Example #7
Source File: FragmentedMp4Extractor.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param flags Flags that control the extractor's behavior.
 * @param timestampAdjuster Adjusts sample timestamps. May be null if no adjustment is needed.
 * @param sideloadedTrack Sideloaded track information, in the case that the extractor will not
 *     receive a moov box in the input data. Null if a moov box is expected.
 * @param sideloadedDrmInitData The {@link DrmInitData} to use for encrypted tracks. If null, the
 *     pssh boxes (if present) will be used.
 * @param closedCaptionFormats For tracks that contain SEI messages, the formats of the closed
 *     caption channels to expose.
 * @param additionalEmsgTrackOutput An extra track output that will receive all emsg messages
 *     targeting the player, even if {@link #FLAG_ENABLE_EMSG_TRACK} is not set. Null if special
 *     handling of emsg messages for players is not required.
 */
public FragmentedMp4Extractor(
    @Flags int flags,
    @Nullable TimestampAdjuster timestampAdjuster,
    @Nullable Track sideloadedTrack,
    @Nullable DrmInitData sideloadedDrmInitData,
    List<Format> closedCaptionFormats,
    @Nullable TrackOutput additionalEmsgTrackOutput) {
  this.flags = flags | (sideloadedTrack != null ? FLAG_SIDELOADED : 0);
  this.timestampAdjuster = timestampAdjuster;
  this.sideloadedTrack = sideloadedTrack;
  this.sideloadedDrmInitData = sideloadedDrmInitData;
  this.closedCaptionFormats = Collections.unmodifiableList(closedCaptionFormats);
  this.additionalEmsgTrackOutput = additionalEmsgTrackOutput;
  eventMessageEncoder = new EventMessageEncoder();
  atomHeader = new ParsableByteArray(Atom.LONG_HEADER_SIZE);
  nalStartCode = new ParsableByteArray(NalUnitUtil.NAL_START_CODE);
  nalPrefix = new ParsableByteArray(5);
  nalBuffer = new ParsableByteArray();
  scratchBytes = new byte[16];
  scratch = new ParsableByteArray(scratchBytes);
  containerAtoms = new ArrayDeque<>();
  pendingMetadataSampleInfos = new ArrayDeque<>();
  trackBundles = new SparseArray<>();
  durationUs = C.TIME_UNSET;
  pendingSeekTimeUs = C.TIME_UNSET;
  segmentIndexEarliestPresentationTimeUs = C.TIME_UNSET;
  enterReadingAtomHeaderState();
}
 
Example #8
Source File: EventSampleStream.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public EventSampleStream(
    EventStream eventStream, Format upstreamFormat, boolean eventStreamAppendable) {
  this.upstreamFormat = upstreamFormat;
  this.eventStream = eventStream;
  eventMessageEncoder = new EventMessageEncoder();
  pendingSeekPositionUs = C.TIME_UNSET;
  eventTimesUs = eventStream.presentationTimesUs;
  updateEventStream(eventStream, eventStreamAppendable);
}