mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add method to disable passthrough.
PiperOrigin-RevId: 432461547
This commit is contained in:
parent
0206622370
commit
6ae2629c60
2 changed files with 8 additions and 0 deletions
|
|
@ -106,6 +106,11 @@ public interface Codec {
|
||||||
*/
|
*/
|
||||||
Codec createForVideoEncoding(Format format, List<String> allowedMimeTypes)
|
Codec createForVideoEncoding(Format format, List<String> allowedMimeTypes)
|
||||||
throws TransformationException;
|
throws TransformationException;
|
||||||
|
|
||||||
|
/** Returns whether the video needs to be encoded because of encoder specific configuration. */
|
||||||
|
default boolean videoNeedsEncoding() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldPassthrough(Format inputFormat) {
|
private boolean shouldPassthrough(Format inputFormat) {
|
||||||
|
if (encoderFactory.videoNeedsEncoding()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (transformationRequest.enableHdrEditing) {
|
if (transformationRequest.enableHdrEditing) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue