mirror of
https://github.com/samsonjs/media.git
synced 2026-04-18 13:25:47 +00:00
Make clear video encoder HighQualityTargeting is experimental.
PiperOrigin-RevId: 495860300
This commit is contained in:
parent
a1954f7e0a
commit
def6ca581e
4 changed files with 9 additions and 5 deletions
|
|
@ -59,7 +59,7 @@ public final class TranscodeQualityTest {
|
||||||
new DefaultEncoderFactory.Builder(context)
|
new DefaultEncoderFactory.Builder(context)
|
||||||
.setRequestedVideoEncoderSettings(
|
.setRequestedVideoEncoderSettings(
|
||||||
new VideoEncoderSettings.Builder()
|
new VideoEncoderSettings.Builder()
|
||||||
.setEnableHighQualityTargeting(true)
|
.experimentalSetEnableHighQualityTargeting(true)
|
||||||
.build())
|
.build())
|
||||||
.build())
|
.build())
|
||||||
.setRemoveAudio(true)
|
.setRemoveAudio(true)
|
||||||
|
|
|
||||||
|
|
@ -427,7 +427,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
||||||
requestedFormat.frameRate);
|
requestedFormat.frameRate);
|
||||||
// Resets the flag after getting a targeted bitrate, so that supportedEncodingSetting can have
|
// Resets the flag after getting a targeted bitrate, so that supportedEncodingSetting can have
|
||||||
// bitrate set.
|
// bitrate set.
|
||||||
supportedEncodingSettingBuilder.setEnableHighQualityTargeting(false);
|
supportedEncodingSettingBuilder.experimentalSetEnableHighQualityTargeting(false);
|
||||||
}
|
}
|
||||||
int closestSupportedBitrate =
|
int closestSupportedBitrate =
|
||||||
EncoderUtil.getSupportedBitrateRange(pickedEncoderInfo, mimeType).clamp(requestedBitrate);
|
EncoderUtil.getSupportedBitrateRange(pickedEncoderInfo, mimeType).clamp(requestedBitrate);
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ public final class VideoEncoderSettings {
|
||||||
/**
|
/**
|
||||||
* Sets {@link VideoEncoderSettings#bitrate}. The default value is {@link #NO_VALUE}.
|
* Sets {@link VideoEncoderSettings#bitrate}. The default value is {@link #NO_VALUE}.
|
||||||
*
|
*
|
||||||
* <p>Can not be set if enabling {@link #setEnableHighQualityTargeting(boolean)}.
|
* <p>Can not be set if enabling {@link #experimentalSetEnableHighQualityTargeting(boolean)}.
|
||||||
*
|
*
|
||||||
* @param bitrate The {@link VideoEncoderSettings#bitrate}.
|
* @param bitrate The {@link VideoEncoderSettings#bitrate}.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
|
|
@ -182,6 +182,8 @@ public final class VideoEncoderSettings {
|
||||||
/**
|
/**
|
||||||
* Sets whether to enable automatic adjustment of the bitrate to target a high quality encoding.
|
* Sets whether to enable automatic adjustment of the bitrate to target a high quality encoding.
|
||||||
*
|
*
|
||||||
|
* <p>This method is experimental and may be removed or changed without warning.
|
||||||
|
*
|
||||||
* <p>Default value is {@code false}.
|
* <p>Default value is {@code false}.
|
||||||
*
|
*
|
||||||
* <p>Requires {@link android.media.MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_VBR}.
|
* <p>Requires {@link android.media.MediaCodecInfo.EncoderCapabilities#BITRATE_MODE_VBR}.
|
||||||
|
|
@ -189,7 +191,7 @@ public final class VideoEncoderSettings {
|
||||||
* <p>Can not be enabled alongside setting a custom bitrate with {@link #setBitrate(int)}.
|
* <p>Can not be enabled alongside setting a custom bitrate with {@link #setBitrate(int)}.
|
||||||
*/
|
*/
|
||||||
@CanIgnoreReturnValue
|
@CanIgnoreReturnValue
|
||||||
public Builder setEnableHighQualityTargeting(boolean enableHighQualityTargeting) {
|
public Builder experimentalSetEnableHighQualityTargeting(boolean enableHighQualityTargeting) {
|
||||||
this.enableHighQualityTargeting = enableHighQualityTargeting;
|
this.enableHighQualityTargeting = enableHighQualityTargeting;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,9 @@ public class DefaultEncoderFactoryTest {
|
||||||
Format actualVideoFormat =
|
Format actualVideoFormat =
|
||||||
new DefaultEncoderFactory.Builder(context)
|
new DefaultEncoderFactory.Builder(context)
|
||||||
.setRequestedVideoEncoderSettings(
|
.setRequestedVideoEncoderSettings(
|
||||||
new VideoEncoderSettings.Builder().setEnableHighQualityTargeting(true).build())
|
new VideoEncoderSettings.Builder()
|
||||||
|
.experimentalSetEnableHighQualityTargeting(true)
|
||||||
|
.build())
|
||||||
.build()
|
.build()
|
||||||
.createForVideoEncoding(requestedVideoFormat)
|
.createForVideoEncoding(requestedVideoFormat)
|
||||||
.getConfigurationFormat();
|
.getConfigurationFormat();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue