Add support for the AOM scheme_id for ID3-in-EMSG
https://developer.apple.com/documentation/http_live_streaming/about_the_common_media_application_format_with_http_live_streaming PiperOrigin-RevId: 264126140
This commit is contained in:
parent
20fd4e16d2
commit
17d8e3728f
@ -27,13 +27,20 @@ import com.google.android.exoplayer2.util.MimeTypes;
|
|||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/** An Event Message (emsg) as defined in ISO 23009-1. */
|
||||||
* An Event Message (emsg) as defined in ISO 23009-1.
|
|
||||||
*/
|
|
||||||
public final class EventMessage implements Metadata.Entry {
|
public final class EventMessage implements Metadata.Entry {
|
||||||
|
|
||||||
@VisibleForTesting
|
/**
|
||||||
public static final String ID3_SCHEME_ID = "https://developer.apple.com/streaming/emsg-id3";
|
* emsg scheme_id_uri from the <a href="https://aomediacodec.github.io/av1-id3/#semantics">CMAF
|
||||||
|
* spec</a>.
|
||||||
|
*/
|
||||||
|
@VisibleForTesting public static final String ID3_SCHEME_ID_AOM = "https://aomedia.org/emsg/ID3";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Apple-hosted scheme_id equivalent to {@code ID3_SCHEME_ID_AOM} - used before AOM adoption.
|
||||||
|
*/
|
||||||
|
private static final String ID3_SCHEME_ID_APPLE =
|
||||||
|
"https://developer.apple.com/streaming/emsg-id3";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* scheme_id_uri from section 7.3.2 of <a
|
* scheme_id_uri from section 7.3.2 of <a
|
||||||
@ -103,7 +110,8 @@ public final class EventMessage implements Metadata.Entry {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public Format getWrappedMetadataFormat() {
|
public Format getWrappedMetadataFormat() {
|
||||||
switch (schemeIdUri) {
|
switch (schemeIdUri) {
|
||||||
case ID3_SCHEME_ID:
|
case ID3_SCHEME_ID_AOM:
|
||||||
|
case ID3_SCHEME_ID_APPLE:
|
||||||
return ID3_FORMAT;
|
return ID3_FORMAT;
|
||||||
case SCTE35_SCHEME_ID:
|
case SCTE35_SCHEME_ID:
|
||||||
return SCTE35_FORMAT;
|
return SCTE35_FORMAT;
|
||||||
|
@ -96,7 +96,7 @@ public class MetadataRendererTest {
|
|||||||
public void decodeMetadata_handlesId3WrappedInEmsg() throws Exception {
|
public void decodeMetadata_handlesId3WrappedInEmsg() throws Exception {
|
||||||
EventMessage emsg =
|
EventMessage emsg =
|
||||||
new EventMessage(
|
new EventMessage(
|
||||||
EventMessage.ID3_SCHEME_ID,
|
EventMessage.ID3_SCHEME_ID_AOM,
|
||||||
/* value= */ "",
|
/* value= */ "",
|
||||||
/* durationMs= */ 1,
|
/* durationMs= */ 1,
|
||||||
/* id= */ 0,
|
/* id= */ 0,
|
||||||
@ -133,7 +133,7 @@ public class MetadataRendererTest {
|
|||||||
public void decodeMetadata_skipsMalformedWrappedMetadata() throws Exception {
|
public void decodeMetadata_skipsMalformedWrappedMetadata() throws Exception {
|
||||||
EventMessage emsg =
|
EventMessage emsg =
|
||||||
new EventMessage(
|
new EventMessage(
|
||||||
EventMessage.ID3_SCHEME_ID,
|
EventMessage.ID3_SCHEME_ID_AOM,
|
||||||
/* value= */ "",
|
/* value= */ "",
|
||||||
/* durationMs= */ 1,
|
/* durationMs= */ 1,
|
||||||
/* id= */ 0,
|
/* id= */ 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user