Transformer: deprecate setOutputMimeType

PiperOrigin-RevId: 411010270
This commit is contained in:
kimvde 2021-11-19 10:20:49 +00:00 committed by Ian Baker
parent b82bcdd07b
commit 74fb54a60f
3 changed files with 18 additions and 70 deletions

View file

@ -252,17 +252,8 @@ public final class TranscodingTransformer {
}
/**
* Sets the MIME type of the output. The default value is {@link MimeTypes#VIDEO_MP4}. Supported
* values are:
*
* <ul>
* <li>{@link MimeTypes#VIDEO_MP4}
* <li>{@link MimeTypes#VIDEO_WEBM} from API level 21
* </ul>
*
* @param outputMimeType The MIME type of the container.
* @return This builder.
* @deprecated Use {@link #setContainerMimeType} instead.
* @deprecated This feature will be removed in a following release and the MIME type of the
* output will always be MP4.
*/
@Deprecated
public Builder setOutputMimeType(String outputMimeType) {
@ -270,23 +261,6 @@ public final class TranscodingTransformer {
return this;
}
/**
* Sets the MIME type of the output container. The default value is {@link MimeTypes#VIDEO_MP4}.
* Supported values are:
*
* <ul>
* <li>{@link MimeTypes#VIDEO_MP4}
* <li>{@link MimeTypes#VIDEO_WEBM} from API level 21
* </ul>
*
* @param containerMimeType The MIME type of the container.
* @return This builder.
*/
public Builder setContainerMimeType(String containerMimeType) {
this.containerMimeType = containerMimeType;
return this;
}
/**
* Sets the video MIME type of the output. The default value is to use the same MIME type as the
* input. Supported values are:
@ -547,9 +521,9 @@ public final class TranscodingTransformer {
*
* <p>Concurrent transformations on the same TranscodingTransformer object are not allowed.
*
* <p>The output can contain at most one video track and one audio track. Other track types are
* ignored. For adaptive bitrate {@link MediaSource media sources}, the highest bitrate video and
* audio streams are selected.
* <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest
* bitrate video and audio streams are selected.
*
* @param mediaItem The {@link MediaItem} to transform. The supported sample formats depend on the
* {@link Muxer} and on the output container format. For the {@link FrameworkMuxer}, they are
@ -572,9 +546,9 @@ public final class TranscodingTransformer {
*
* <p>Concurrent transformations on the same TranscodingTransformer object are not allowed.
*
* <p>The output can contain at most one video track and one audio track. Other track types are
* ignored. For adaptive bitrate {@link MediaSource media sources}, the highest bitrate video and
* audio streams are selected.
* <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest
* bitrate video and audio streams are selected.
*
* @param mediaItem The {@link MediaItem} to transform. The supported sample formats depend on the
* {@link Muxer} and on the output container format. For the {@link FrameworkMuxer}, they are

View file

@ -210,17 +210,8 @@ public final class Transformer {
}
/**
* Sets the MIME type of the output. The default value is {@link MimeTypes#VIDEO_MP4}. Supported
* values are:
*
* <ul>
* <li>{@link MimeTypes#VIDEO_MP4}
* <li>{@link MimeTypes#VIDEO_WEBM} from API level 21
* </ul>
*
* @param outputMimeType The MIME type of the container.
* @return This builder.
* @deprecated Use {@link #setContainerMimeType} instead.
* @deprecated This feature will be removed in a following release and the MIME type of the
* output will always be MP4.
*/
@Deprecated
public Builder setOutputMimeType(String outputMimeType) {
@ -228,23 +219,6 @@ public final class Transformer {
return this;
}
/**
* Sets the MIME type of the output container. The default value is {@link MimeTypes#VIDEO_MP4}.
* Supported values are:
*
* <ul>
* <li>{@link MimeTypes#VIDEO_MP4}
* <li>{@link MimeTypes#VIDEO_WEBM} from API level 21
* </ul>
*
* @param containerMimeType The MIME type of the output.
* @return This builder.
*/
public Builder setContainerMimeType(String containerMimeType) {
this.containerMimeType = containerMimeType;
return this;
}
/**
* Sets the {@link Transformer.Listener} to listen to the transformation events.
*
@ -435,9 +409,9 @@ public final class Transformer {
*
* <p>Concurrent transformations on the same Transformer object are not allowed.
*
* <p>The output can contain at most one video track and one audio track. Other track types are
* ignored. For adaptive bitrate {@link MediaSource media sources}, the highest bitrate video and
* audio streams are selected.
* <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest
* bitrate video and audio streams are selected.
*
* @param mediaItem The {@link MediaItem} to transform. The supported sample formats depend on the
* {@link Muxer} and on the output container format. For the {@link FrameworkMuxer}, they are
@ -460,9 +434,9 @@ public final class Transformer {
*
* <p>Concurrent transformations on the same Transformer object are not allowed.
*
* <p>The output can contain at most one video track and one audio track. Other track types are
* ignored. For adaptive bitrate {@link MediaSource media sources}, the highest bitrate video and
* audio streams are selected.
* <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest
* bitrate video and audio streams are selected.
*
* @param mediaItem The {@link MediaItem} to transform. The supported sample formats depend on the
* {@link Muxer} and on the output container format. For the {@link FrameworkMuxer}, they are

View file

@ -30,10 +30,10 @@ import org.junit.runner.RunWith;
public class TransformerBuilderTest {
@Test
public void setContainerMimeType_unsupportedMimeType_throws() {
public void setOutputMimeType_unsupportedMimeType_throws() {
assertThrows(
IllegalStateException.class,
() -> new Transformer.Builder().setContainerMimeType(MimeTypes.VIDEO_FLV).build());
() -> new Transformer.Builder().setOutputMimeType(MimeTypes.VIDEO_FLV).build());
}
@Test