Commit 2656284e by sheenachhabra Committed by Rohit Singh

Align muxer code with media3 coding conventions.

This CL includes following changes:
1. Remove GCA related terms/links from java docs and comments.
2. Make class final where ever possible.
3. Append /* package */ for default classes.
4. Change java docs to recommended format.
5. Replace term "packet" with "sample" to avoid confusion.
6. Correct TODO format.
7. Delete MediaFormatUtil.java from muxer module and add its methods into MediaFormatUtil.java in common module.

Note: The java doc on various boxes has the limited description which was already present. In future I am planning to add proper small description for each box (from MP4 spec).

Not included in this CL:
1. Order of element correction as it will show lot of changes and might create confusion with other minor changes.
2. Correction in test cases (Only some renaming).

PiperOrigin-RevId: 502414139
parent a4f9f948
...@@ -239,6 +239,28 @@ public final class MediaFormatUtil { ...@@ -239,6 +239,28 @@ public final class MediaFormatUtil {
return array; return array;
} }
/** Returns whether a {@link MediaFormat} is a video format. */
public static boolean isVideoFormat(MediaFormat mediaFormat) {
return MimeTypes.isVideo(mediaFormat.getString(MediaFormat.KEY_MIME));
}
/** Returns whether a {@link MediaFormat} is an audio format. */
public static boolean isAudioFormat(MediaFormat mediaFormat) {
return MimeTypes.isAudio(mediaFormat.getString(MediaFormat.KEY_MIME));
}
/** Returns the time lapse capture FPS from the given {@link MediaFormat} if it was set. */
@Nullable
public static Integer getTimeLapseFrameRate(MediaFormat format) {
if (format.containsKey("time-lapse-enable")
&& format.getInteger("time-lapse-enable") > 0
&& format.containsKey("time-lapse-fps")) {
return format.getInteger("time-lapse-fps");
} else {
return null;
}
}
// Internal methods. // Internal methods.
private static void setBooleanAsInt(MediaFormat format, String key, int value) { private static void setBooleanAsInt(MediaFormat format, String key, int value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment