Skip to content

Commit

Permalink
Add method to disable passthrough.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 432461547
  • Loading branch information
claincly authored and icbaker committed Mar 4, 2022
1 parent b83c2cb commit 3f61504
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ Codec createForAudioEncoding(Format format, List<String> allowedMimeTypes)
*/
Codec createForVideoEncoding(Format format, List<String> allowedMimeTypes)
throws TransformationException;

/** Returns whether the video needs to be encoded because of encoder specific configuration. */
default boolean videoNeedsEncoding() {
return false;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ protected boolean ensureConfigured() throws TransformationException {
}

private boolean shouldPassthrough(Format inputFormat) {
if (encoderFactory.videoNeedsEncoding()) {
return false;
}
if (transformationRequest.enableHdrEditing) {
return false;
}
Expand Down

0 comments on commit 3f61504

Please sign in to comment.