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
03d6da85
authored
Dec 12, 2022
by
samrobinson
Committed by
Ian Baker
Dec 15, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add codec names to TransformationResult
PiperOrigin-RevId: 494736085
parent
b18d34fc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
255 additions
and
95 deletions
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/TransformationTestResult.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/TransformerAndroidTestRunner.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/CapturingDecoderFactory.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/CapturingEncoderFactory.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformationResult.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerInternal.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/TransformationTestResult.java
View file @
03d6da85
...
@@ -144,6 +144,18 @@ public class TransformationTestResult {
...
@@ -144,6 +144,18 @@ public class TransformationTestResult {
if
(
transformationResult
.
videoFrameCount
>
0
)
{
if
(
transformationResult
.
videoFrameCount
>
0
)
{
jsonObject
.
put
(
"videoFrameCount"
,
transformationResult
.
videoFrameCount
);
jsonObject
.
put
(
"videoFrameCount"
,
transformationResult
.
videoFrameCount
);
}
}
if
(
transformationResult
.
audioDecoderName
!=
null
)
{
jsonObject
.
put
(
"audioDecoderName"
,
transformationResult
.
audioDecoderName
);
}
if
(
transformationResult
.
videoDecoderName
!=
null
)
{
jsonObject
.
put
(
"videoDecoderName"
,
transformationResult
.
videoDecoderName
);
}
if
(
transformationResult
.
audioEncoderName
!=
null
)
{
jsonObject
.
put
(
"audioEncoderName"
,
transformationResult
.
audioEncoderName
);
}
if
(
transformationResult
.
videoEncoderName
!=
null
)
{
jsonObject
.
put
(
"videoEncoderName"
,
transformationResult
.
videoEncoderName
);
}
if
(
throughputFps
!=
C
.
RATE_UNSET
)
{
if
(
throughputFps
!=
C
.
RATE_UNSET
)
{
jsonObject
.
put
(
"throughputFps"
,
throughputFps
);
jsonObject
.
put
(
"throughputFps"
,
throughputFps
);
}
}
...
...
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/TransformerAndroidTestRunner.java
View file @
03d6da85
...
@@ -23,10 +23,8 @@ import android.net.ConnectivityManager;
...
@@ -23,10 +23,8 @@ import android.net.ConnectivityManager;
import
android.net.NetworkCapabilities
;
import
android.net.NetworkCapabilities
;
import
android.net.NetworkInfo
;
import
android.net.NetworkInfo
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.view.Surface
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.test.platform.app.InstrumentationRegistry
;
import
androidx.test.platform.app.InstrumentationRegistry
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.MediaItem
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.Log
;
import
com.google.android.exoplayer2.util.SystemClock
;
import
com.google.android.exoplayer2.util.SystemClock
;
...
@@ -155,7 +153,8 @@ public class TransformerAndroidTestRunner {
...
@@ -155,7 +153,8 @@ public class TransformerAndroidTestRunner {
}
}
private
final
Context
context
;
private
final
Context
context
;
private
final
CodecNameForwardingCodecFactory
transformerCodecFactory
;
private
final
CapturingDecoderFactory
decoderFactory
;
private
final
CapturingEncoderFactory
encoderFactory
;
private
final
Transformer
transformer
;
private
final
Transformer
transformer
;
private
final
int
timeoutSeconds
;
private
final
int
timeoutSeconds
;
private
final
boolean
requestCalculateSsim
;
private
final
boolean
requestCalculateSsim
;
...
@@ -170,13 +169,13 @@ public class TransformerAndroidTestRunner {
...
@@ -170,13 +169,13 @@ public class TransformerAndroidTestRunner {
boolean
suppressAnalysisExceptions
,
boolean
suppressAnalysisExceptions
,
@Nullable
Map
<
String
,
Object
>
inputValues
)
{
@Nullable
Map
<
String
,
Object
>
inputValues
)
{
this
.
context
=
context
;
this
.
context
=
context
;
this
.
transformerCodecFactory
=
this
.
decoderFactory
=
new
CapturingDecoderFactory
(
transformer
.
decoderFactory
);
new
CodecNameForwardingCodecFactory
(
transformer
.
decoderFactory
,
transformer
.
encoderFactory
);
this
.
encoderFactory
=
new
CapturingEncoderFactory
(
transformer
.
encoderFactory
);
this
.
transformer
=
this
.
transformer
=
transformer
transformer
.
buildUpon
()
.
buildUpon
()
.
setDecoderFactory
(
transformerCodec
Factory
)
.
setDecoderFactory
(
decoder
Factory
)
.
setEncoderFactory
(
transformerCodec
Factory
)
.
setEncoderFactory
(
encoder
Factory
)
.
build
();
.
build
();
this
.
timeoutSeconds
=
timeoutSeconds
;
this
.
timeoutSeconds
=
timeoutSeconds
;
this
.
requestCalculateSsim
=
requestCalculateSsim
;
this
.
requestCalculateSsim
=
requestCalculateSsim
;
...
@@ -209,7 +208,7 @@ public class TransformerAndroidTestRunner {
...
@@ -209,7 +208,7 @@ public class TransformerAndroidTestRunner {
resultJson
.
put
(
"exception"
,
AndroidTestUtil
.
exceptionAsJsonObject
(
e
));
resultJson
.
put
(
"exception"
,
AndroidTestUtil
.
exceptionAsJsonObject
(
e
));
throw
e
;
throw
e
;
}
finally
{
}
finally
{
resultJson
.
put
(
"codecDetails"
,
transformerCodecFactory
.
getCodecNamesAsJsonObject
());
resultJson
.
put
(
"codecDetails"
,
getCodecNamesAsJsonObject
());
AndroidTestUtil
.
writeTestSummaryToFile
(
context
,
testId
,
resultJson
);
AndroidTestUtil
.
writeTestSummaryToFile
(
context
,
testId
,
resultJson
);
}
}
}
}
...
@@ -402,87 +401,20 @@ public class TransformerAndroidTestRunner {
...
@@ -402,87 +401,20 @@ public class TransformerAndroidTestRunner {
return
false
;
return
false
;
}
}
/**
private
JSONObject
getCodecNamesAsJsonObject
()
throws
JSONException
{
* A {@link Codec.EncoderFactory} that forwards all methods to another encoder factory, whilst
JSONObject
detailsJson
=
new
JSONObject
();
* providing visibility into the names of last codecs created by it.
if
(
decoderFactory
.
getAudioDecoderName
()
!=
null
)
{
*/
detailsJson
.
put
(
"audioDecoderName"
,
decoderFactory
.
getAudioDecoderName
());
private
static
class
CodecNameForwardingCodecFactory
implements
Codec
.
DecoderFactory
,
Codec
.
EncoderFactory
{
/** The name of the last audio {@link Codec decoder} created. */
@Nullable
public
String
audioDecoderName
;
/** The name of the last video {@link Codec decoder} created. */
@Nullable
public
String
videoDecoderName
;
/** The name of the last audio {@link Codec encoder} created. */
@Nullable
public
String
audioEncoderName
;
/** The name of the last video {@link Codec encoder} created. */
@Nullable
public
String
videoEncoderName
;
private
final
Codec
.
DecoderFactory
decoderFactory
;
private
final
Codec
.
EncoderFactory
encoderFactory
;
public
CodecNameForwardingCodecFactory
(
Codec
.
DecoderFactory
decoderFactory
,
Codec
.
EncoderFactory
encoderFactory
)
{
this
.
decoderFactory
=
decoderFactory
;
this
.
encoderFactory
=
encoderFactory
;
}
@Override
public
Codec
createForAudioDecoding
(
Format
format
)
throws
TransformationException
{
Codec
audioDecoder
=
decoderFactory
.
createForAudioDecoding
(
format
);
audioDecoderName
=
audioDecoder
.
getName
();
return
audioDecoder
;
}
@Override
public
Codec
createForVideoDecoding
(
Format
format
,
Surface
outputSurface
,
boolean
requestSdrToneMapping
)
throws
TransformationException
{
Codec
videoDecoder
=
decoderFactory
.
createForVideoDecoding
(
format
,
outputSurface
,
requestSdrToneMapping
);
videoDecoderName
=
videoDecoder
.
getName
();
return
videoDecoder
;
}
@Override
public
Codec
createForAudioEncoding
(
Format
format
)
throws
TransformationException
{
Codec
audioEncoder
=
encoderFactory
.
createForAudioEncoding
(
format
);
audioEncoderName
=
audioEncoder
.
getName
();
return
audioEncoder
;
}
}
if
(
decoderFactory
.
getVideoDecoderName
()
!=
null
)
{
@Override
detailsJson
.
put
(
"videoDecoderName"
,
decoderFactory
.
getVideoDecoderName
());
public
Codec
createForVideoEncoding
(
Format
format
)
throws
TransformationException
{
Codec
videoEncoder
=
encoderFactory
.
createForVideoEncoding
(
format
);
videoEncoderName
=
videoEncoder
.
getName
();
return
videoEncoder
;
}
}
if
(
encoderFactory
.
getAudioEncoderName
()
!=
null
)
{
@Override
detailsJson
.
put
(
"audioEncoderName"
,
encoderFactory
.
getAudioEncoderName
());
public
boolean
audioNeedsEncoding
()
{
return
encoderFactory
.
audioNeedsEncoding
();
}
@Override
public
boolean
videoNeedsEncoding
()
{
return
encoderFactory
.
videoNeedsEncoding
();
}
}
if
(
encoderFactory
.
getVideoEncoderName
()
!=
null
)
{
public
JSONObject
getCodecNamesAsJsonObject
()
throws
JSONException
{
detailsJson
.
put
(
"videoEncoderName"
,
encoderFactory
.
getVideoEncoderName
());
JSONObject
detailsJson
=
new
JSONObject
();
if
(
audioDecoderName
!=
null
)
{
detailsJson
.
put
(
"audioDecoderName"
,
audioDecoderName
);
}
if
(
videoDecoderName
!=
null
)
{
detailsJson
.
put
(
"videoDecoderName"
,
videoDecoderName
);
}
if
(
audioEncoderName
!=
null
)
{
detailsJson
.
put
(
"audioEncoderName"
,
audioEncoderName
);
}
if
(
videoEncoderName
!=
null
)
{
detailsJson
.
put
(
"videoEncoderName"
,
videoEncoderName
);
}
return
detailsJson
;
}
}
return
detailsJson
;
}
}
}
}
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/CapturingDecoderFactory.java
0 → 100644
View file @
03d6da85
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
transformer
;
import
android.view.Surface
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.Format
;
/** A forwarding {@link Codec.DecoderFactory} that captures details about the codecs created. */
/* package */
final
class
CapturingDecoderFactory
implements
Codec
.
DecoderFactory
{
private
final
Codec
.
DecoderFactory
decoderFactory
;
@Nullable
private
String
audioDecoderName
;
@Nullable
private
String
videoDecoderName
;
public
CapturingDecoderFactory
(
Codec
.
DecoderFactory
decoderFactory
)
{
this
.
decoderFactory
=
decoderFactory
;
}
@Override
public
Codec
createForAudioDecoding
(
Format
format
)
throws
TransformationException
{
Codec
audioDecoder
=
decoderFactory
.
createForAudioDecoding
(
format
);
audioDecoderName
=
audioDecoder
.
getName
();
return
audioDecoder
;
}
@Override
public
Codec
createForVideoDecoding
(
Format
format
,
Surface
outputSurface
,
boolean
requestSdrToneMapping
)
throws
TransformationException
{
Codec
videoDecoder
=
decoderFactory
.
createForVideoDecoding
(
format
,
outputSurface
,
requestSdrToneMapping
);
videoDecoderName
=
videoDecoder
.
getName
();
return
videoDecoder
;
}
/**
* Returns the name of the last audio {@linkplain Codec decoder} created, or {@code null} if none
* were created.
*/
@Nullable
public
String
getAudioDecoderName
()
{
return
audioDecoderName
;
}
/**
* Returns the name of the last video {@linkplain Codec decoder} created, or {@code null} if none
* were created.
*/
@Nullable
public
String
getVideoDecoderName
()
{
return
videoDecoderName
;
}
}
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/CapturingEncoderFactory.java
0 → 100644
View file @
03d6da85
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
transformer
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.Format
;
/** A forwarding {@link Codec.EncoderFactory} that captures details about the codecs created. */
/* package */
final
class
CapturingEncoderFactory
implements
Codec
.
EncoderFactory
{
private
final
Codec
.
EncoderFactory
encoderFactory
;
@Nullable
private
String
audioEncoderName
;
@Nullable
private
String
videoEncoderName
;
public
CapturingEncoderFactory
(
Codec
.
EncoderFactory
encoderFactory
)
{
this
.
encoderFactory
=
encoderFactory
;
}
@Override
public
Codec
createForAudioEncoding
(
Format
format
)
throws
TransformationException
{
Codec
audioEncoder
=
encoderFactory
.
createForAudioEncoding
(
format
);
audioEncoderName
=
audioEncoder
.
getName
();
return
audioEncoder
;
}
@Override
public
Codec
createForVideoEncoding
(
Format
format
)
throws
TransformationException
{
Codec
videoEncoder
=
encoderFactory
.
createForVideoEncoding
(
format
);
videoEncoderName
=
videoEncoder
.
getName
();
return
videoEncoder
;
}
@Override
public
boolean
audioNeedsEncoding
()
{
return
encoderFactory
.
audioNeedsEncoding
();
}
@Override
public
boolean
videoNeedsEncoding
()
{
return
encoderFactory
.
videoNeedsEncoding
();
}
/**
* Returns the name of the last audio {@linkplain Codec encoder} created, or {@code null} if none
* were created.
*/
@Nullable
public
String
getAudioEncoderName
()
{
return
audioEncoderName
;
}
/**
* Returns the name of the last video {@linkplain Codec encoder} created, or {@code null} if none
* were created.
*/
@Nullable
public
String
getVideoEncoderName
()
{
return
videoEncoderName
;
}
}
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformationResult.java
View file @
03d6da85
...
@@ -20,8 +20,9 @@ import static com.google.android.exoplayer2.util.Assertions.checkArgument;
...
@@ -20,8 +20,9 @@ import static com.google.android.exoplayer2.util.Assertions.checkArgument;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.errorprone.annotations.CanIgnoreReturnValue
;
import
com.google.errorprone.annotations.CanIgnoreReturnValue
;
import
java.util.Objects
;
/** Information about the result of a
successful
transformation. */
/** Information about the result of a transformation. */
public
final
class
TransformationResult
{
public
final
class
TransformationResult
{
/** A builder for {@link TransformationResult} instances. */
/** A builder for {@link TransformationResult} instances. */
...
@@ -31,6 +32,10 @@ public final class TransformationResult {
...
@@ -31,6 +32,10 @@ public final class TransformationResult {
private
int
averageAudioBitrate
;
private
int
averageAudioBitrate
;
private
int
averageVideoBitrate
;
private
int
averageVideoBitrate
;
private
int
videoFrameCount
;
private
int
videoFrameCount
;
@Nullable
private
String
audioDecoderName
;
@Nullable
private
String
audioEncoderName
;
@Nullable
private
String
videoDecoderName
;
@Nullable
private
String
videoEncoderName
;
public
Builder
()
{
public
Builder
()
{
durationMs
=
C
.
TIME_UNSET
;
durationMs
=
C
.
TIME_UNSET
;
...
@@ -99,9 +104,45 @@ public final class TransformationResult {
...
@@ -99,9 +104,45 @@ public final class TransformationResult {
return
this
;
return
this
;
}
}
/** Sets the name of the audio decoder used. */
@CanIgnoreReturnValue
public
Builder
setAudioDecoderName
(
@Nullable
String
audioDecoderName
)
{
this
.
audioDecoderName
=
audioDecoderName
;
return
this
;
}
/** Sets the name of the audio encoder used. */
@CanIgnoreReturnValue
public
Builder
setAudioEncoderName
(
@Nullable
String
audioEncoderName
)
{
this
.
audioEncoderName
=
audioEncoderName
;
return
this
;
}
/** Sets the name of the video decoder used. */
@CanIgnoreReturnValue
public
Builder
setVideoDecoderName
(
@Nullable
String
videoDecoderName
)
{
this
.
videoDecoderName
=
videoDecoderName
;
return
this
;
}
/** Sets the name of the video encoder used. */
@CanIgnoreReturnValue
public
Builder
setVideoEncoderName
(
@Nullable
String
videoEncoderName
)
{
this
.
videoEncoderName
=
videoEncoderName
;
return
this
;
}
public
TransformationResult
build
()
{
public
TransformationResult
build
()
{
return
new
TransformationResult
(
return
new
TransformationResult
(
durationMs
,
fileSizeBytes
,
averageAudioBitrate
,
averageVideoBitrate
,
videoFrameCount
);
durationMs
,
fileSizeBytes
,
averageAudioBitrate
,
averageVideoBitrate
,
videoFrameCount
,
audioDecoderName
,
audioEncoderName
,
videoDecoderName
,
videoEncoderName
);
}
}
}
}
...
@@ -120,17 +161,34 @@ public final class TransformationResult {
...
@@ -120,17 +161,34 @@ public final class TransformationResult {
/** The number of video frames. */
/** The number of video frames. */
public
final
int
videoFrameCount
;
public
final
int
videoFrameCount
;
/** The name of the audio decoder used, or {@code null} if none were used. */
@Nullable
public
final
String
audioDecoderName
;
/** The name of the audio encoder used, or {@code null} if none were used. */
@Nullable
public
final
String
audioEncoderName
;
/** The name of the video decoder used, or {@code null} if none were used. */
@Nullable
public
final
String
videoDecoderName
;
/** The name of the video encoder used, or {@code null} if none were used. */
@Nullable
public
final
String
videoEncoderName
;
private
TransformationResult
(
private
TransformationResult
(
long
durationMs
,
long
durationMs
,
long
fileSizeBytes
,
long
fileSizeBytes
,
int
averageAudioBitrate
,
int
averageAudioBitrate
,
int
averageVideoBitrate
,
int
averageVideoBitrate
,
int
videoFrameCount
)
{
int
videoFrameCount
,
@Nullable
String
audioDecoderName
,
@Nullable
String
audioEncoderName
,
@Nullable
String
videoDecoderName
,
@Nullable
String
videoEncoderName
)
{
this
.
durationMs
=
durationMs
;
this
.
durationMs
=
durationMs
;
this
.
fileSizeBytes
=
fileSizeBytes
;
this
.
fileSizeBytes
=
fileSizeBytes
;
this
.
averageAudioBitrate
=
averageAudioBitrate
;
this
.
averageAudioBitrate
=
averageAudioBitrate
;
this
.
averageVideoBitrate
=
averageVideoBitrate
;
this
.
averageVideoBitrate
=
averageVideoBitrate
;
this
.
videoFrameCount
=
videoFrameCount
;
this
.
videoFrameCount
=
videoFrameCount
;
this
.
audioDecoderName
=
audioDecoderName
;
this
.
audioEncoderName
=
audioEncoderName
;
this
.
videoDecoderName
=
videoDecoderName
;
this
.
videoEncoderName
=
videoEncoderName
;
}
}
public
Builder
buildUpon
()
{
public
Builder
buildUpon
()
{
...
@@ -139,7 +197,11 @@ public final class TransformationResult {
...
@@ -139,7 +197,11 @@ public final class TransformationResult {
.
setFileSizeBytes
(
fileSizeBytes
)
.
setFileSizeBytes
(
fileSizeBytes
)
.
setAverageAudioBitrate
(
averageAudioBitrate
)
.
setAverageAudioBitrate
(
averageAudioBitrate
)
.
setAverageVideoBitrate
(
averageVideoBitrate
)
.
setAverageVideoBitrate
(
averageVideoBitrate
)
.
setVideoFrameCount
(
videoFrameCount
);
.
setVideoFrameCount
(
videoFrameCount
)
.
setAudioDecoderName
(
audioDecoderName
)
.
setAudioEncoderName
(
audioEncoderName
)
.
setVideoDecoderName
(
videoDecoderName
)
.
setVideoEncoderName
(
videoEncoderName
);
}
}
@Override
@Override
...
@@ -155,7 +217,11 @@ public final class TransformationResult {
...
@@ -155,7 +217,11 @@ public final class TransformationResult {
&&
fileSizeBytes
==
result
.
fileSizeBytes
&&
fileSizeBytes
==
result
.
fileSizeBytes
&&
averageAudioBitrate
==
result
.
averageAudioBitrate
&&
averageAudioBitrate
==
result
.
averageAudioBitrate
&&
averageVideoBitrate
==
result
.
averageVideoBitrate
&&
averageVideoBitrate
==
result
.
averageVideoBitrate
&&
videoFrameCount
==
result
.
videoFrameCount
;
&&
videoFrameCount
==
result
.
videoFrameCount
&&
Objects
.
equals
(
audioDecoderName
,
result
.
audioDecoderName
)
&&
Objects
.
equals
(
audioEncoderName
,
result
.
audioEncoderName
)
&&
Objects
.
equals
(
videoDecoderName
,
result
.
videoDecoderName
)
&&
Objects
.
equals
(
videoEncoderName
,
result
.
videoEncoderName
);
}
}
@Override
@Override
...
@@ -165,6 +231,10 @@ public final class TransformationResult {
...
@@ -165,6 +231,10 @@ public final class TransformationResult {
result
=
31
*
result
+
averageAudioBitrate
;
result
=
31
*
result
+
averageAudioBitrate
;
result
=
31
*
result
+
averageVideoBitrate
;
result
=
31
*
result
+
averageVideoBitrate
;
result
=
31
*
result
+
videoFrameCount
;
result
=
31
*
result
+
videoFrameCount
;
result
=
31
*
result
+
Objects
.
hashCode
(
audioDecoderName
);
result
=
31
*
result
+
Objects
.
hashCode
(
audioEncoderName
);
result
=
31
*
result
+
Objects
.
hashCode
(
videoDecoderName
);
result
=
31
*
result
+
Objects
.
hashCode
(
videoEncoderName
);
return
result
;
return
result
;
}
}
}
}
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerInternal.java
View file @
03d6da85
...
@@ -94,8 +94,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -94,8 +94,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private
final
ImmutableList
<
AudioProcessor
>
audioProcessors
;
private
final
ImmutableList
<
AudioProcessor
>
audioProcessors
;
private
final
ImmutableList
<
Effect
>
videoEffects
;
private
final
ImmutableList
<
Effect
>
videoEffects
;
private
final
boolean
forceSilentAudio
;
private
final
boolean
forceSilentAudio
;
private
final
C
odec
.
DecoderFactory
decoderFactory
;
private
final
C
apturing
DecoderFactory
decoderFactory
;
private
final
C
odec
.
EncoderFactory
encoderFactory
;
private
final
C
apturing
EncoderFactory
encoderFactory
;
private
final
FrameProcessor
.
Factory
frameProcessorFactory
;
private
final
FrameProcessor
.
Factory
frameProcessorFactory
;
private
final
Listener
listener
;
private
final
Listener
listener
;
private
final
DebugViewProvider
debugViewProvider
;
private
final
DebugViewProvider
debugViewProvider
;
...
@@ -141,8 +141,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -141,8 +141,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
this
.
audioProcessors
=
audioProcessors
;
this
.
audioProcessors
=
audioProcessors
;
this
.
videoEffects
=
videoEffects
;
this
.
videoEffects
=
videoEffects
;
this
.
forceSilentAudio
=
forceSilentAudio
;
this
.
forceSilentAudio
=
forceSilentAudio
;
this
.
decoderFactory
=
decoderFactory
;
this
.
decoderFactory
=
new
CapturingDecoderFactory
(
decoderFactory
)
;
this
.
encoderFactory
=
encoderFactory
;
this
.
encoderFactory
=
new
CapturingEncoderFactory
(
encoderFactory
)
;
this
.
frameProcessorFactory
=
frameProcessorFactory
;
this
.
frameProcessorFactory
=
frameProcessorFactory
;
this
.
listener
=
listener
;
this
.
listener
=
listener
;
this
.
debugViewProvider
=
debugViewProvider
;
this
.
debugViewProvider
=
debugViewProvider
;
...
@@ -316,6 +316,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -316,6 +316,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
for
(
int
i
=
0
;
i
<
samplePipelines
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
samplePipelines
.
size
();
i
++)
{
samplePipelines
.
get
(
i
).
release
();
samplePipelines
.
get
(
i
).
release
();
}
}
// TODO(b/250564186): Create TransformationResult on END_REASON_ERROR as well.
if
(
endReason
==
END_REASON_COMPLETED
)
{
if
(
endReason
==
END_REASON_COMPLETED
)
{
transformationResult
=
transformationResult
=
new
TransformationResult
.
Builder
()
new
TransformationResult
.
Builder
()
...
@@ -326,6 +328,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -326,6 +328,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
muxerWrapper
.
getTrackAverageBitrate
(
C
.
TRACK_TYPE_VIDEO
))
muxerWrapper
.
getTrackAverageBitrate
(
C
.
TRACK_TYPE_VIDEO
))
.
setVideoFrameCount
(
muxerWrapper
.
getTrackSampleCount
(
C
.
TRACK_TYPE_VIDEO
))
.
setVideoFrameCount
(
muxerWrapper
.
getTrackSampleCount
(
C
.
TRACK_TYPE_VIDEO
))
.
setFileSizeBytes
(
muxerWrapper
.
getCurrentOutputSizeBytes
())
.
setFileSizeBytes
(
muxerWrapper
.
getCurrentOutputSizeBytes
())
.
setAudioDecoderName
(
decoderFactory
.
getAudioDecoderName
())
.
setAudioEncoderName
(
encoderFactory
.
getAudioEncoderName
())
.
setVideoDecoderName
(
decoderFactory
.
getVideoDecoderName
())
.
setVideoEncoderName
(
encoderFactory
.
getVideoEncoderName
())
.
build
();
.
build
();
}
}
}
finally
{
}
finally
{
...
...
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