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
810f451e
authored
Jul 29, 2022
by
huangdarwin
Committed by
Marc Baechinger
Oct 19, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Transformer: Improve misc javadocs and exception logs.
PiperOrigin-RevId: 463971447
parent
44c42fef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
11 deletions
library/common/src/main/java/com/google/android/exoplayer2/C.java
library/common/src/main/java/com/google/android/exoplayer2/util/MediaFormatUtil.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultCodec.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/GlEffectsFrameProcessor.java
library/common/src/main/java/com/google/android/exoplayer2/C.java
View file @
810f451e
...
@@ -1024,23 +1024,23 @@ public final class C {
...
@@ -1024,23 +1024,23 @@ public final class C {
// LINT.IfChange(color_space)
// LINT.IfChange(color_space)
/**
/**
* Video colorspaces. One of {@link Format#NO_VALUE}, {@link #COLOR_SPACE_BT
709
}, {@link
* Video colorspaces. One of {@link Format#NO_VALUE}, {@link #COLOR_SPACE_BT
601
}, {@link
* #COLOR_SPACE_BT
601
} or {@link #COLOR_SPACE_BT2020}.
* #COLOR_SPACE_BT
709
} or {@link #COLOR_SPACE_BT2020}.
*/
*/
@Documented
@Documented
@Retention
(
RetentionPolicy
.
SOURCE
)
@Retention
(
RetentionPolicy
.
SOURCE
)
@Target
(
TYPE_USE
)
@Target
(
TYPE_USE
)
@IntDef
({
Format
.
NO_VALUE
,
COLOR_SPACE_BT
709
,
COLOR_SPACE_BT601
,
COLOR_SPACE_BT2020
})
@IntDef
({
Format
.
NO_VALUE
,
COLOR_SPACE_BT
601
,
COLOR_SPACE_BT709
,
COLOR_SPACE_BT2020
})
public
@interface
ColorSpace
{}
public
@interface
ColorSpace
{}
/**
/**
* @see MediaFormat#COLOR_STANDARD_BT709
*/
public
static
final
int
COLOR_SPACE_BT709
=
MediaFormat
.
COLOR_STANDARD_BT709
;
/**
* @see MediaFormat#COLOR_STANDARD_BT601_PAL
* @see MediaFormat#COLOR_STANDARD_BT601_PAL
*/
*/
public
static
final
int
COLOR_SPACE_BT601
=
MediaFormat
.
COLOR_STANDARD_BT601_PAL
;
public
static
final
int
COLOR_SPACE_BT601
=
MediaFormat
.
COLOR_STANDARD_BT601_PAL
;
/**
/**
* @see MediaFormat#COLOR_STANDARD_BT709
*/
public
static
final
int
COLOR_SPACE_BT709
=
MediaFormat
.
COLOR_STANDARD_BT709
;
/**
* @see MediaFormat#COLOR_STANDARD_BT2020
* @see MediaFormat#COLOR_STANDARD_BT2020
*/
*/
public
static
final
int
COLOR_SPACE_BT2020
=
MediaFormat
.
COLOR_STANDARD_BT2020
;
public
static
final
int
COLOR_SPACE_BT2020
=
MediaFormat
.
COLOR_STANDARD_BT2020
;
...
...
library/common/src/main/java/com/google/android/exoplayer2/util/MediaFormatUtil.java
View file @
810f451e
...
@@ -302,8 +302,8 @@ public final class MediaFormatUtil {
...
@@ -302,8 +302,8 @@ public final class MediaFormatUtil {
/** Whether this is a valid {@link C.ColorSpace} instance. */
/** Whether this is a valid {@link C.ColorSpace} instance. */
private
static
boolean
isValidColorSpace
(
int
colorSpace
)
{
private
static
boolean
isValidColorSpace
(
int
colorSpace
)
{
// LINT.IfChange(color_space)
// LINT.IfChange(color_space)
return
colorSpace
==
C
.
COLOR_SPACE_BT
709
return
colorSpace
==
C
.
COLOR_SPACE_BT
601
||
colorSpace
==
C
.
COLOR_SPACE_BT
601
||
colorSpace
==
C
.
COLOR_SPACE_BT
709
||
colorSpace
==
C
.
COLOR_SPACE_BT2020
||
colorSpace
==
C
.
COLOR_SPACE_BT2020
||
colorSpace
==
Format
.
NO_VALUE
;
||
colorSpace
==
Format
.
NO_VALUE
;
}
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/DefaultCodec.java
View file @
810f451e
...
@@ -24,6 +24,7 @@ import static com.google.android.exoplayer2.util.Util.SDK_INT;
...
@@ -24,6 +24,7 @@ import static com.google.android.exoplayer2.util.Util.SDK_INT;
import
android.content.Context
;
import
android.content.Context
;
import
android.media.MediaCodec
;
import
android.media.MediaCodec
;
import
android.media.MediaCodec.BufferInfo
;
import
android.media.MediaCodec.BufferInfo
;
import
android.media.MediaCrypto
;
import
android.media.MediaFormat
;
import
android.media.MediaFormat
;
import
android.view.Surface
;
import
android.view.Surface
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
...
@@ -325,7 +326,7 @@ public final class DefaultCodec implements Codec {
...
@@ -325,7 +326,7 @@ public final class DefaultCodec implements Codec {
throw
createTransformationException
(
throw
createTransformationException
(
new
IllegalStateException
(
new
IllegalStateException
(
"Codec output color format does not match configured color format. Configured: "
"Codec output color format does not match configured color format. Configured: "
+
configur
ationFormat
.
colorInfo
+
configur
edOutputColor
+
". Actual: "
+
". Actual: "
+
outputFormat
.
colorInfo
));
+
outputFormat
.
colorInfo
));
}
}
...
@@ -443,6 +444,7 @@ public final class DefaultCodec implements Codec {
...
@@ -443,6 +444,7 @@ public final class DefaultCodec implements Codec {
return
formatBuilder
.
build
();
return
formatBuilder
.
build
();
}
}
/** Calls and traces {@link MediaCodec#configure(MediaFormat, Surface, MediaCrypto, int)}. */
private
static
void
configureCodec
(
private
static
void
configureCodec
(
MediaCodec
codec
,
MediaCodec
codec
,
MediaFormat
mediaFormat
,
MediaFormat
mediaFormat
,
...
@@ -457,6 +459,7 @@ public final class DefaultCodec implements Codec {
...
@@ -457,6 +459,7 @@ public final class DefaultCodec implements Codec {
TraceUtil
.
endSection
();
TraceUtil
.
endSection
();
}
}
/** Calls and traces {@link MediaCodec#start()}. */
private
static
void
startCodec
(
MediaCodec
codec
)
{
private
static
void
startCodec
(
MediaCodec
codec
)
{
TraceUtil
.
beginSection
(
"startCodec"
);
TraceUtil
.
beginSection
(
"startCodec"
);
codec
.
start
();
codec
.
start
();
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/GlEffectsFrameProcessor.java
View file @
810f451e
...
@@ -401,7 +401,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
...
@@ -401,7 +401,7 @@ public final class GlEffectsFrameProcessor implements FrameProcessor {
/**
/**
* Expands or shrinks the frame based on the {@link FrameInfo#pixelWidthHeightRatio} and returns a
* Expands or shrinks the frame based on the {@link FrameInfo#pixelWidthHeightRatio} and returns a
* new {@link FrameInfo} instance with scaled dimensions and {@link
* new {@link FrameInfo} instance with scaled dimensions and {@link
* FrameInfo#pixelWidthHeightRatio}
1
.
* FrameInfo#pixelWidthHeightRatio}
of {@code 1}
.
*/
*/
private
FrameInfo
adjustForPixelWidthHeightRatio
(
FrameInfo
frameInfo
)
{
private
FrameInfo
adjustForPixelWidthHeightRatio
(
FrameInfo
frameInfo
)
{
if
(
frameInfo
.
pixelWidthHeightRatio
>
1
f
)
{
if
(
frameInfo
.
pixelWidthHeightRatio
>
1
f
)
{
...
...
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