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
42ec358c
authored
Nov 02, 2021
by
tonihei
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev-v2' of
https://github.com/google/ExoPlayer
into dev-v2
parents
93620e47
c5f4843d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
34 deletions
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TranscodingTransformer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformation.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TranscodingTransformer.java
View file @
42ec358c
...
...
@@ -55,7 +55,6 @@ import com.google.android.exoplayer2.source.MediaSourceFactory;
import
com.google.android.exoplayer2.text.TextOutput
;
import
com.google.android.exoplayer2.trackselection.DefaultTrackSelector
;
import
com.google.android.exoplayer2.util.Clock
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.video.VideoRendererEventListener
;
...
...
@@ -92,16 +91,12 @@ public final class TranscodingTransformer {
/** A builder for {@link TranscodingTransformer} instances. */
public
static
final
class
Builder
{
// Mandatory field.
private
@MonotonicNonNull
Context
context
;
// Optional fields.
private
@MonotonicNonNull
MediaSourceFactory
mediaSourceFactory
;
private
Muxer
.
Factory
muxerFactory
;
private
boolean
removeAudio
;
private
boolean
removeVideo
;
private
boolean
flattenForSlowMotion
;
private
int
outputHeight
;
private
String
outputMimeType
;
@Nullable
private
String
audioMimeType
;
@Nullable
private
String
videoMimeType
;
...
...
@@ -126,7 +121,6 @@ public final class TranscodingTransformer {
this
.
removeAudio
=
transcodingTransformer
.
transformation
.
removeAudio
;
this
.
removeVideo
=
transcodingTransformer
.
transformation
.
removeVideo
;
this
.
flattenForSlowMotion
=
transcodingTransformer
.
transformation
.
flattenForSlowMotion
;
this
.
outputHeight
=
transcodingTransformer
.
transformation
.
outputHeight
;
this
.
outputMimeType
=
transcodingTransformer
.
transformation
.
outputMimeType
;
this
.
audioMimeType
=
transcodingTransformer
.
transformation
.
audioMimeType
;
this
.
videoMimeType
=
transcodingTransformer
.
transformation
.
videoMimeType
;
...
...
@@ -220,21 +214,6 @@ public final class TranscodingTransformer {
}
/**
* Sets the output resolution for the video, using the output height. The default value is to
* use the same height as the input. Output width will scale to preserve the input video's
* aspect ratio.
*
* <p>For example, a 1920x1440 video can be scaled to 640x480 by calling setResolution(480).
*
* @param outputHeight The output height for the video, in pixels.
* @return This builder.
*/
public
Builder
setResolution
(
int
outputHeight
)
{
this
.
outputHeight
=
outputHeight
;
return
this
;
}
/**
* Sets the MIME type of the output. The default value is {@link MimeTypes#VIDEO_MP4}. Supported
* values are:
*
...
...
@@ -377,12 +356,6 @@ public final class TranscodingTransformer {
checkState
(
muxerFactory
.
supportsOutputMimeType
(
outputMimeType
),
"Unsupported output MIME type: "
+
outputMimeType
);
// TODO(ME): Test with values of 10, 100, 1000).
Log
.
e
(
"TranscodingTransformer"
,
"outputHeight = "
+
outputHeight
);
if
(
outputHeight
==
0
)
{
// TODO(ME): get output height from input video.
outputHeight
=
480
;
}
if
(
audioMimeType
!=
null
)
{
checkSampleMimeType
(
audioMimeType
);
}
...
...
@@ -394,7 +367,6 @@ public final class TranscodingTransformer {
removeAudio
,
removeVideo
,
flattenForSlowMotion
,
outputHeight
,
outputMimeType
,
audioMimeType
,
videoMimeType
);
...
...
@@ -481,7 +453,6 @@ public final class TranscodingTransformer {
checkState
(
!
transformation
.
removeAudio
||
!
transformation
.
removeVideo
,
"Audio and video cannot both be removed."
);
checkState
(!(
transformation
.
removeVideo
));
this
.
context
=
context
;
this
.
mediaSourceFactory
=
mediaSourceFactory
;
this
.
muxerFactory
=
muxerFactory
;
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformation.java
View file @
42ec358c
...
...
@@ -24,7 +24,6 @@ import androidx.annotation.Nullable;
public
final
boolean
removeAudio
;
public
final
boolean
removeVideo
;
public
final
boolean
flattenForSlowMotion
;
public
final
int
outputHeight
;
public
final
String
outputMimeType
;
@Nullable
public
final
String
audioMimeType
;
@Nullable
public
final
String
videoMimeType
;
...
...
@@ -33,14 +32,12 @@ import androidx.annotation.Nullable;
boolean
removeAudio
,
boolean
removeVideo
,
boolean
flattenForSlowMotion
,
int
outputHeight
,
String
outputMimeType
,
@Nullable
String
audioMimeType
,
@Nullable
String
videoMimeType
)
{
this
.
removeAudio
=
removeAudio
;
this
.
removeVideo
=
removeVideo
;
this
.
flattenForSlowMotion
=
flattenForSlowMotion
;
this
.
outputHeight
=
outputHeight
;
this
.
outputMimeType
=
outputMimeType
;
this
.
audioMimeType
=
audioMimeType
;
this
.
videoMimeType
=
videoMimeType
;
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
View file @
42ec358c
...
...
@@ -297,13 +297,11 @@ public final class Transformer {
checkState
(
muxerFactory
.
supportsOutputMimeType
(
outputMimeType
),
"Unsupported output MIME type: "
+
outputMimeType
);
int
outputHeight
=
0
;
// TODO(ME): How do we get the input height here?
Transformation
transformation
=
new
Transformation
(
removeAudio
,
removeVideo
,
flattenForSlowMotion
,
outputHeight
,
outputMimeType
,
/* audioMimeType= */
null
,
/* videoMimeType= */
null
);
...
...
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