use of com.google.android.exoplayer2.metadata.emsg.EventMessageEncoder in project ExoPlayer by google.
the class EventMessageEncoderTest method encodeDecodeEventStream.
@Test
public void encodeDecodeEventStream() throws IOException {
byte[] encodedByteArray = new EventMessageEncoder().encode(DECODED_MESSAGE);
MetadataInputBuffer buffer = createMetadataInputBuffer(encodedByteArray);
EventMessageDecoder decoder = new EventMessageDecoder();
Metadata metadata = decoder.decode(buffer);
assertThat(metadata.length()).isEqualTo(1);
assertThat(metadata.get(0)).isEqualTo(DECODED_MESSAGE);
}
use of com.google.android.exoplayer2.metadata.emsg.EventMessageEncoder in project ExoPlayer by google.
the class EventSampleStreamTest method setUp.
@Before
public void setUp() {
formatHolder = new FormatHolder();
inputBuffer = new MetadataInputBuffer();
eventMessageEncoder = new EventMessageEncoder();
}
use of com.google.android.exoplayer2.metadata.emsg.EventMessageEncoder in project ExoPlayer by google.
the class EventMessageEncoderTest method encodeDecodeEventMessage_durationNotSet.
// https://github.com/google/ExoPlayer/issues/9123
@Test
public void encodeDecodeEventMessage_durationNotSet() {
EventMessage originalMessage = new EventMessage("urn:test", "456", C.TIME_UNSET, 99, new byte[] { 7, 8, 9 });
byte[] encodedMessage = new EventMessageEncoder().encode(originalMessage);
EventMessage decodedMessage = new EventMessageDecoder().decode(new ParsableByteArray(encodedMessage));
assertThat(decodedMessage).isEqualTo(originalMessage);
}
Aggregations