Commit 74fb54a6 by kimvde Committed by Ian Baker

Transformer: deprecate setOutputMimeType

PiperOrigin-RevId: 411010270
parent b82bcdd0
...@@ -252,17 +252,8 @@ public final class TranscodingTransformer { ...@@ -252,17 +252,8 @@ public final class TranscodingTransformer {
} }
/** /**
* Sets the MIME type of the output. The default value is {@link MimeTypes#VIDEO_MP4}. Supported * @deprecated This feature will be removed in a following release and the MIME type of the
* values are: * output will always be MP4.
*
* <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 @Deprecated
public Builder setOutputMimeType(String outputMimeType) { public Builder setOutputMimeType(String outputMimeType) {
...@@ -271,23 +262,6 @@ public final class TranscodingTransformer { ...@@ -271,23 +262,6 @@ public final class TranscodingTransformer {
} }
/** /**
* 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 * Sets the video MIME type of the output. The default value is to use the same MIME type as the
* input. Supported values are: * input. Supported values are:
* *
...@@ -547,9 +521,9 @@ public final class TranscodingTransformer { ...@@ -547,9 +521,9 @@ public final class TranscodingTransformer {
* *
* <p>Concurrent transformations on the same TranscodingTransformer object are not allowed. * <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 * <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* ignored. For adaptive bitrate {@link MediaSource media sources}, the highest bitrate video and * track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest
* audio streams are selected. * bitrate video and audio streams are selected.
* *
* @param mediaItem The {@link MediaItem} to transform. The supported sample formats depend on the * @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 * {@link Muxer} and on the output container format. For the {@link FrameworkMuxer}, they are
...@@ -572,9 +546,9 @@ public final class TranscodingTransformer { ...@@ -572,9 +546,9 @@ public final class TranscodingTransformer {
* *
* <p>Concurrent transformations on the same TranscodingTransformer object are not allowed. * <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 * <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* ignored. For adaptive bitrate {@link MediaSource media sources}, the highest bitrate video and * track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest
* audio streams are selected. * bitrate video and audio streams are selected.
* *
* @param mediaItem The {@link MediaItem} to transform. The supported sample formats depend on the * @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 * {@link Muxer} and on the output container format. For the {@link FrameworkMuxer}, they are
......
...@@ -210,17 +210,8 @@ public final class Transformer { ...@@ -210,17 +210,8 @@ public final class Transformer {
} }
/** /**
* Sets the MIME type of the output. The default value is {@link MimeTypes#VIDEO_MP4}. Supported * @deprecated This feature will be removed in a following release and the MIME type of the
* values are: * output will always be MP4.
*
* <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 @Deprecated
public Builder setOutputMimeType(String outputMimeType) { public Builder setOutputMimeType(String outputMimeType) {
...@@ -229,23 +220,6 @@ public final class Transformer { ...@@ -229,23 +220,6 @@ public final class Transformer {
} }
/** /**
* 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. * Sets the {@link Transformer.Listener} to listen to the transformation events.
* *
* <p>This is equivalent to {@link Transformer#setListener(Listener)}. * <p>This is equivalent to {@link Transformer#setListener(Listener)}.
...@@ -435,9 +409,9 @@ public final class Transformer { ...@@ -435,9 +409,9 @@ public final class Transformer {
* *
* <p>Concurrent transformations on the same Transformer object are not allowed. * <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 * <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* ignored. For adaptive bitrate {@link MediaSource media sources}, the highest bitrate video and * track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest
* audio streams are selected. * bitrate video and audio streams are selected.
* *
* @param mediaItem The {@link MediaItem} to transform. The supported sample formats depend on the * @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 * {@link Muxer} and on the output container format. For the {@link FrameworkMuxer}, they are
...@@ -460,9 +434,9 @@ public final class Transformer { ...@@ -460,9 +434,9 @@ public final class Transformer {
* *
* <p>Concurrent transformations on the same Transformer object are not allowed. * <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 * <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* ignored. For adaptive bitrate {@link MediaSource media sources}, the highest bitrate video and * track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest
* audio streams are selected. * bitrate video and audio streams are selected.
* *
* @param mediaItem The {@link MediaItem} to transform. The supported sample formats depend on the * @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 * {@link Muxer} and on the output container format. For the {@link FrameworkMuxer}, they are
......
...@@ -30,10 +30,10 @@ import org.junit.runner.RunWith; ...@@ -30,10 +30,10 @@ import org.junit.runner.RunWith;
public class TransformerBuilderTest { public class TransformerBuilderTest {
@Test @Test
public void setContainerMimeType_unsupportedMimeType_throws() { public void setOutputMimeType_unsupportedMimeType_throws() {
assertThrows( assertThrows(
IllegalStateException.class, IllegalStateException.class,
() -> new Transformer.Builder().setContainerMimeType(MimeTypes.VIDEO_FLV).build()); () -> new Transformer.Builder().setOutputMimeType(MimeTypes.VIDEO_FLV).build());
} }
@Test @Test
......
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