mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add @ContentType IntDef to Util.getAdaptiveMimeTypeForContentType
Also add a case for RTSP, otherwise lint complains. PiperOrigin-RevId: 438805903
This commit is contained in:
parent
0370e05395
commit
80ff26b6fa
2 changed files with 9 additions and 8 deletions
|
|
@ -718,17 +718,17 @@ public final class C {
|
||||||
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
|
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
|
||||||
@IntDef({TYPE_DASH, TYPE_SS, TYPE_HLS, TYPE_RTSP, TYPE_OTHER})
|
@IntDef({TYPE_DASH, TYPE_SS, TYPE_HLS, TYPE_RTSP, TYPE_OTHER})
|
||||||
public @interface ContentType {}
|
public @interface ContentType {}
|
||||||
/** Value returned by {@link Util#inferContentType(String)} for DASH manifests. */
|
/** Value returned by {@link Util#inferContentType} for DASH manifests. */
|
||||||
public static final int TYPE_DASH = 0;
|
public static final int TYPE_DASH = 0;
|
||||||
/** Value returned by {@link Util#inferContentType(String)} for Smooth Streaming manifests. */
|
/** Value returned by {@link Util#inferContentType} for Smooth Streaming manifests. */
|
||||||
public static final int TYPE_SS = 1;
|
public static final int TYPE_SS = 1;
|
||||||
/** Value returned by {@link Util#inferContentType(String)} for HLS manifests. */
|
/** Value returned by {@link Util#inferContentType} for HLS manifests. */
|
||||||
public static final int TYPE_HLS = 2;
|
public static final int TYPE_HLS = 2;
|
||||||
/** Value returned by {@link Util#inferContentType(String)} for RTSP. */
|
/** Value returned by {@link Util#inferContentType} for RTSP. */
|
||||||
public static final int TYPE_RTSP = 3;
|
public static final int TYPE_RTSP = 3;
|
||||||
/**
|
/**
|
||||||
* Value returned by {@link Util#inferContentType(String)} for files other than DASH, HLS or
|
* Value returned by {@link Util#inferContentType} for files other than DASH, HLS or Smooth
|
||||||
* Smooth Streaming manifests, or RTSP URIs.
|
* Streaming manifests, or RTSP URIs.
|
||||||
*/
|
*/
|
||||||
public static final int TYPE_OTHER = 4;
|
public static final int TYPE_OTHER = 4;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1902,10 +1902,10 @@ public final class Util {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the MIME type corresponding to the given adaptive {@link ContentType}, or {@code null}
|
* Returns the MIME type corresponding to the given adaptive {@link ContentType}, or {@code null}
|
||||||
* if the content type is {@link C#TYPE_OTHER}.
|
* if the content type is not adaptive.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public static String getAdaptiveMimeTypeForContentType(int contentType) {
|
public static String getAdaptiveMimeTypeForContentType(@ContentType int contentType) {
|
||||||
switch (contentType) {
|
switch (contentType) {
|
||||||
case C.TYPE_DASH:
|
case C.TYPE_DASH:
|
||||||
return MimeTypes.APPLICATION_MPD;
|
return MimeTypes.APPLICATION_MPD;
|
||||||
|
|
@ -1913,6 +1913,7 @@ public final class Util {
|
||||||
return MimeTypes.APPLICATION_M3U8;
|
return MimeTypes.APPLICATION_M3U8;
|
||||||
case C.TYPE_SS:
|
case C.TYPE_SS:
|
||||||
return MimeTypes.APPLICATION_SS;
|
return MimeTypes.APPLICATION_SS;
|
||||||
|
case C.TYPE_RTSP:
|
||||||
case C.TYPE_OTHER:
|
case C.TYPE_OTHER:
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue