Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
74fb54a6
authored
Nov 19, 2021
by
kimvde
Committed by
Ian Baker
Nov 19, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Transformer: deprecate setOutputMimeType
PiperOrigin-RevId: 411010270
parent
b82bcdd0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
70 deletions
libraries/transformer/src/main/java/androidx/media3/transformer/TranscodingTransformer.java
libraries/transformer/src/main/java/androidx/media3/transformer/Transformer.java
libraries/transformer/src/test/java/androidx/media3/transformer/TransformerBuilderTest.java
libraries/transformer/src/main/java/androidx/media3/transformer/TranscodingTransformer.java
View file @
74fb54a6
...
...
@@ -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
)
{
...
...
@@ -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
* 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
...
...
libraries/transformer/src/main/java/androidx/media3/transformer/Transformer.java
View file @
74fb54a6
...
...
@@ -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
)
{
...
...
@@ -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.
*
* <p>This is equivalent to {@link Transformer#setListener(Listener)}.
...
...
@@ -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
...
...
libraries/transformer/src/test/java/androidx/media3/transformer/TransformerBuilderTest.java
View file @
74fb54a6
...
...
@@ -30,10 +30,10 @@ import org.junit.runner.RunWith;
public
class
TransformerBuilderTest
{
@Test
public
void
set
Container
MimeType_unsupportedMimeType_throws
()
{
public
void
set
Output
MimeType_unsupportedMimeType_throws
()
{
assertThrows
(
IllegalStateException
.
class
,
()
->
new
Transformer
.
Builder
().
set
Container
MimeType
(
MimeTypes
.
VIDEO_FLV
).
build
());
()
->
new
Transformer
.
Builder
().
set
Output
MimeType
(
MimeTypes
.
VIDEO_FLV
).
build
());
}
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment