com.google.android.exoplayer2.metadata.MetadataInputBuffer Java Examples

The following examples show how to use com.google.android.exoplayer2.metadata.MetadataInputBuffer. 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: PlayerEmsgHandler.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
private void parseAndDiscardSamples() {
  while (sampleQueue.hasNextSample()) {
    MetadataInputBuffer inputBuffer = dequeueSample();
    if (inputBuffer == null) {
      continue;
    }
    long eventTimeUs = inputBuffer.timeUs;
    Metadata metadata = decoder.decode(inputBuffer);
    if (metadata == null) {
      continue;
    }
    EventMessage eventMessage = (EventMessage) metadata.get(0);
    if (isPlayerEmsgEvent(eventMessage.schemeIdUri, eventMessage.value)) {
      parsePlayerEmsgEvent(eventTimeUs, eventMessage);
    }
  }
  sampleQueue.discardToRead();
}
 
Example #2
Source File: PlayerEmsgHandler.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
@Nullable
private MetadataInputBuffer dequeueSample() {
  buffer.clear();
  int result =
      sampleQueue.read(
          formatHolder,
          buffer,
          /* formatRequired= */ false,
          /* loadingFinished= */ false,
          /* decodeOnlyUntilUs= */ 0);
  if (result == C.RESULT_BUFFER_READ) {
    buffer.flip();
    return buffer;
  }
  return null;
}
 
Example #3
Source File: PlayerEmsgHandler.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
private void parseAndDiscardSamples() {
  while (sampleQueue.hasNextSample()) {
    MetadataInputBuffer inputBuffer = dequeueSample();
    if (inputBuffer == null) {
      continue;
    }
    long eventTimeUs = inputBuffer.timeUs;
    Metadata metadata = decoder.decode(inputBuffer);
    if (metadata == null) {
      continue;
    }
    EventMessage eventMessage = (EventMessage) metadata.get(0);
    if (isPlayerEmsgEvent(eventMessage.schemeIdUri, eventMessage.value)) {
      parsePlayerEmsgEvent(eventTimeUs, eventMessage);
    }
  }
  sampleQueue.discardToRead();
}
 
Example #4
Source File: PlayerEmsgHandler.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private void parseAndDiscardSamples() {
  while (sampleQueue.hasNextSample()) {
    MetadataInputBuffer inputBuffer = dequeueSample();
    if (inputBuffer == null) {
      continue;
    }
    long eventTimeUs = inputBuffer.timeUs;
    Metadata metadata = decoder.decode(inputBuffer);
    EventMessage eventMessage = (EventMessage) metadata.get(0);
    if (isPlayerEmsgEvent(eventMessage.schemeIdUri, eventMessage.value)) {
      parsePlayerEmsgEvent(eventTimeUs, eventMessage);
    }
  }
  sampleQueue.discardToRead();
}
 
Example #5
Source File: PlayerEmsgHandler.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
private MetadataInputBuffer dequeueSample() {
  buffer.clear();
  int result = sampleQueue.read(formatHolder, buffer, false, false, 0);
  if (result == C.RESULT_BUFFER_READ) {
    buffer.flip();
    return buffer;
  }
  return null;
}
 
Example #6
Source File: PlayerEmsgHandler.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
private MetadataInputBuffer dequeueSample() {
  buffer.clear();
  int result = sampleQueue.read(formatHolder, buffer, false, false, 0);
  if (result == C.RESULT_BUFFER_READ) {
    buffer.flip();
    return buffer;
  }
  return null;
}
 
Example #7
Source File: PlayerEmsgHandler.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
private MetadataInputBuffer dequeueSample() {
  buffer.clear();
  int result = sampleQueue.read(formatHolder, buffer, false, false, 0);
  if (result == C.RESULT_BUFFER_READ) {
    buffer.flip();
    return buffer;
  }
  return null;
}
 
Example #8
Source File: Id3Decoder.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("ByteBufferBackingArray")
@Override
@Nullable
public Metadata decode(MetadataInputBuffer inputBuffer) {
  ByteBuffer buffer = Assertions.checkNotNull(inputBuffer.data);
  return decode(buffer.array(), buffer.limit());
}
 
Example #9
Source File: PlayerEmsgHandler.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
private MetadataInputBuffer dequeueSample() {
  buffer.clear();
  int result = sampleQueue.read(formatHolder, buffer, false, false, 0);
  if (result == C.RESULT_BUFFER_READ) {
    buffer.flip();
    return buffer;
  }
  return null;
}
 
Example #10
Source File: PlayerEmsgHandler.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private void parseAndDiscardSamples() {
  while (sampleQueue.hasNextSample()) {
    MetadataInputBuffer inputBuffer = dequeueSample();
    if (inputBuffer == null) {
      continue;
    }
    long eventTimeUs = inputBuffer.timeUs;
    Metadata metadata = decoder.decode(inputBuffer);
    EventMessage eventMessage = (EventMessage) metadata.get(0);
    if (isPlayerEmsgEvent(eventMessage.schemeIdUri, eventMessage.value)) {
      parsePlayerEmsgEvent(eventTimeUs, eventMessage);
    }
  }
  sampleQueue.discardToRead();
}
 
Example #11
Source File: PlayerEmsgHandler.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
private void parseAndDiscardSamples() {
  while (sampleQueue.isReady(/* loadingFinished= */ false)) {
    MetadataInputBuffer inputBuffer = dequeueSample();
    if (inputBuffer == null) {
      continue;
    }
    long eventTimeUs = inputBuffer.timeUs;
    Metadata metadata = decoder.decode(inputBuffer);
    EventMessage eventMessage = (EventMessage) metadata.get(0);
    if (isPlayerEmsgEvent(eventMessage.schemeIdUri, eventMessage.value)) {
      parsePlayerEmsgEvent(eventTimeUs, eventMessage);
    }
  }
  sampleQueue.discardToRead();
}
 
Example #12
Source File: Id3Decoder.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public @Nullable Metadata decode(MetadataInputBuffer inputBuffer) {
  ByteBuffer buffer = inputBuffer.data;
  return decode(buffer.array(), buffer.limit());
}
 
Example #13
Source File: PlayerEmsgHandler.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
PlayerTrackEmsgHandler(SampleQueue sampleQueue) {
  this.sampleQueue = sampleQueue;

  formatHolder = new FormatHolder();
  buffer = new MetadataInputBuffer();
}
 
Example #14
Source File: Id3Decoder.java    From K-Sonic with MIT License 4 votes vote down vote up
@Override
public Metadata decode(MetadataInputBuffer inputBuffer) {
  ByteBuffer buffer = inputBuffer.data;
  return decode(buffer.array(), buffer.limit());
}
 
Example #15
Source File: Id3Decoder.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("ByteBufferBackingArray")
@Override
public @Nullable Metadata decode(MetadataInputBuffer inputBuffer) {
  ByteBuffer buffer = inputBuffer.data;
  return decode(buffer.array(), buffer.limit());
}
 
Example #16
Source File: PlayerEmsgHandler.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
PlayerTrackEmsgHandler(SampleQueue sampleQueue) {
  this.sampleQueue = sampleQueue;

  formatHolder = new FormatHolder();
  buffer = new MetadataInputBuffer();
}
 
Example #17
Source File: PlayerEmsgHandler.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
PlayerTrackEmsgHandler(SampleQueue sampleQueue) {
  this.sampleQueue = sampleQueue;

  formatHolder = new FormatHolder();
  buffer = new MetadataInputBuffer();
}
 
Example #18
Source File: Id3Decoder.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public @Nullable Metadata decode(MetadataInputBuffer inputBuffer) {
  ByteBuffer buffer = inputBuffer.data;
  return decode(buffer.array(), buffer.limit());
}
 
Example #19
Source File: Id3Decoder.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("ByteBufferBackingArray")
@Override
public @Nullable Metadata decode(MetadataInputBuffer inputBuffer) {
  ByteBuffer buffer = inputBuffer.data;
  return decode(buffer.array(), buffer.limit());
}
 
Example #20
Source File: PlayerEmsgHandler.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
PlayerTrackEmsgHandler(SampleQueue sampleQueue) {
  this.sampleQueue = sampleQueue;

  formatHolder = new FormatHolder();
  buffer = new MetadataInputBuffer();
}
 
Example #21
Source File: PlayerEmsgHandler.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
PlayerTrackEmsgHandler(SampleQueue sampleQueue) {
  this.sampleQueue = sampleQueue;

  formatHolder = new FormatHolder();
  buffer = new MetadataInputBuffer();
}