software.amazon.awssdk.services.mediaconvert.model.VideoCodecSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mediaconvert Show documentation
Show all versions of mediaconvert Show documentation
The AWS Java SDK for AWS Elemental MediaConvert module holds the client classes that are used for
communicating
with AWS Elemental MediaConvert Service
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 software.amazon.awssdk.services.mediaconvert.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* Video codec settings contains the group of settings related to video encoding. The settings in this group vary
* depending on the value that you choose for Video codec. For each codec enum that you choose, define the corresponding
* settings object. The following lists the codec enum, settings object pairs. * AV1, Av1Settings * AVC_INTRA,
* AvcIntraSettings * FRAME_CAPTURE, FrameCaptureSettings * H_264, H264Settings * H_265, H265Settings * MPEG2,
* Mpeg2Settings * PRORES, ProresSettings * UNCOMPRESSED, UncompressedSettings * VC3, Vc3Settings * VP8, Vp8Settings *
* VP9, Vp9Settings * XAVC, XavcSettings
*/
@Generated("software.amazon.awssdk:codegen")
public final class VideoCodecSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField AV1_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Av1Settings").getter(getter(VideoCodecSettings::av1Settings)).setter(setter(Builder::av1Settings))
.constructor(Av1Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("av1Settings").build()).build();
private static final SdkField AVC_INTRA_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AvcIntraSettings")
.getter(getter(VideoCodecSettings::avcIntraSettings)).setter(setter(Builder::avcIntraSettings))
.constructor(AvcIntraSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("avcIntraSettings").build()).build();
private static final SdkField CODEC_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Codec")
.getter(getter(VideoCodecSettings::codecAsString)).setter(setter(Builder::codec))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("codec").build()).build();
private static final SdkField FRAME_CAPTURE_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("FrameCaptureSettings")
.getter(getter(VideoCodecSettings::frameCaptureSettings)).setter(setter(Builder::frameCaptureSettings))
.constructor(FrameCaptureSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("frameCaptureSettings").build())
.build();
private static final SdkField H264_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("H264Settings").getter(getter(VideoCodecSettings::h264Settings)).setter(setter(Builder::h264Settings))
.constructor(H264Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("h264Settings").build()).build();
private static final SdkField H265_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("H265Settings").getter(getter(VideoCodecSettings::h265Settings)).setter(setter(Builder::h265Settings))
.constructor(H265Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("h265Settings").build()).build();
private static final SdkField MPEG2_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Mpeg2Settings")
.getter(getter(VideoCodecSettings::mpeg2Settings)).setter(setter(Builder::mpeg2Settings))
.constructor(Mpeg2Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mpeg2Settings").build()).build();
private static final SdkField PRORES_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ProresSettings")
.getter(getter(VideoCodecSettings::proresSettings)).setter(setter(Builder::proresSettings))
.constructor(ProresSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("proresSettings").build()).build();
private static final SdkField UNCOMPRESSED_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("UncompressedSettings")
.getter(getter(VideoCodecSettings::uncompressedSettings)).setter(setter(Builder::uncompressedSettings))
.constructor(UncompressedSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("uncompressedSettings").build())
.build();
private static final SdkField VC3_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Vc3Settings").getter(getter(VideoCodecSettings::vc3Settings)).setter(setter(Builder::vc3Settings))
.constructor(Vc3Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vc3Settings").build()).build();
private static final SdkField VP8_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Vp8Settings").getter(getter(VideoCodecSettings::vp8Settings)).setter(setter(Builder::vp8Settings))
.constructor(Vp8Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vp8Settings").build()).build();
private static final SdkField VP9_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Vp9Settings").getter(getter(VideoCodecSettings::vp9Settings)).setter(setter(Builder::vp9Settings))
.constructor(Vp9Settings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vp9Settings").build()).build();
private static final SdkField XAVC_SETTINGS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("XavcSettings").getter(getter(VideoCodecSettings::xavcSettings)).setter(setter(Builder::xavcSettings))
.constructor(XavcSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("xavcSettings").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AV1_SETTINGS_FIELD,
AVC_INTRA_SETTINGS_FIELD, CODEC_FIELD, FRAME_CAPTURE_SETTINGS_FIELD, H264_SETTINGS_FIELD, H265_SETTINGS_FIELD,
MPEG2_SETTINGS_FIELD, PRORES_SETTINGS_FIELD, UNCOMPRESSED_SETTINGS_FIELD, VC3_SETTINGS_FIELD, VP8_SETTINGS_FIELD,
VP9_SETTINGS_FIELD, XAVC_SETTINGS_FIELD));
private static final long serialVersionUID = 1L;
private final Av1Settings av1Settings;
private final AvcIntraSettings avcIntraSettings;
private final String codec;
private final FrameCaptureSettings frameCaptureSettings;
private final H264Settings h264Settings;
private final H265Settings h265Settings;
private final Mpeg2Settings mpeg2Settings;
private final ProresSettings proresSettings;
private final UncompressedSettings uncompressedSettings;
private final Vc3Settings vc3Settings;
private final Vp8Settings vp8Settings;
private final Vp9Settings vp9Settings;
private final XavcSettings xavcSettings;
private VideoCodecSettings(BuilderImpl builder) {
this.av1Settings = builder.av1Settings;
this.avcIntraSettings = builder.avcIntraSettings;
this.codec = builder.codec;
this.frameCaptureSettings = builder.frameCaptureSettings;
this.h264Settings = builder.h264Settings;
this.h265Settings = builder.h265Settings;
this.mpeg2Settings = builder.mpeg2Settings;
this.proresSettings = builder.proresSettings;
this.uncompressedSettings = builder.uncompressedSettings;
this.vc3Settings = builder.vc3Settings;
this.vp8Settings = builder.vp8Settings;
this.vp9Settings = builder.vp9Settings;
this.xavcSettings = builder.xavcSettings;
}
/**
* Required when you set Codec, under VideoDescription>CodecSettings to the value AV1.
*
* @return Required when you set Codec, under VideoDescription>CodecSettings to the value AV1.
*/
public final Av1Settings av1Settings() {
return av1Settings;
}
/**
* Required when you choose AVC-Intra for your output video codec. For more information about the AVC-Intra
* settings, see the relevant specification. For detailed information about SD and HD in AVC-Intra, see
* https://ieeexplore.ieee.org/document/7290936. For information about 4K/2K in AVC-Intra, see
* https://pro-av.panasonic.net/en/avc-ultra/AVC-ULTRAoverview.pdf.
*
* @return Required when you choose AVC-Intra for your output video codec. For more information about the AVC-Intra
* settings, see the relevant specification. For detailed information about SD and HD in AVC-Intra, see
* https://ieeexplore.ieee.org/document/7290936. For information about 4K/2K in AVC-Intra, see
* https://pro-av.panasonic.net/en/avc-ultra/AVC-ULTRAoverview.pdf.
*/
public final AvcIntraSettings avcIntraSettings() {
return avcIntraSettings;
}
/**
* Specifies the video codec. This must be equal to one of the enum values defined by the object VideoCodec. To
* passthrough the video stream of your input JPEG2000, VC-3, AVC-INTRA or Apple ProRes video without any video
* encoding: Choose Passthrough. If you have multiple input videos, note that they must have identical encoding
* attributes. When you choose Passthrough, your output container must be MXF or QuickTime MOV.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #codec} will return
* {@link VideoCodec#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #codecAsString}.
*
*
* @return Specifies the video codec. This must be equal to one of the enum values defined by the object VideoCodec.
* To passthrough the video stream of your input JPEG2000, VC-3, AVC-INTRA or Apple ProRes video without any
* video encoding: Choose Passthrough. If you have multiple input videos, note that they must have identical
* encoding attributes. When you choose Passthrough, your output container must be MXF or QuickTime MOV.
* @see VideoCodec
*/
public final VideoCodec codec() {
return VideoCodec.fromValue(codec);
}
/**
* Specifies the video codec. This must be equal to one of the enum values defined by the object VideoCodec. To
* passthrough the video stream of your input JPEG2000, VC-3, AVC-INTRA or Apple ProRes video without any video
* encoding: Choose Passthrough. If you have multiple input videos, note that they must have identical encoding
* attributes. When you choose Passthrough, your output container must be MXF or QuickTime MOV.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #codec} will return
* {@link VideoCodec#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #codecAsString}.
*
*
* @return Specifies the video codec. This must be equal to one of the enum values defined by the object VideoCodec.
* To passthrough the video stream of your input JPEG2000, VC-3, AVC-INTRA or Apple ProRes video without any
* video encoding: Choose Passthrough. If you have multiple input videos, note that they must have identical
* encoding attributes. When you choose Passthrough, your output container must be MXF or QuickTime MOV.
* @see VideoCodec
*/
public final String codecAsString() {
return codec;
}
/**
* Required when you set Codec to the value FRAME_CAPTURE.
*
* @return Required when you set Codec to the value FRAME_CAPTURE.
*/
public final FrameCaptureSettings frameCaptureSettings() {
return frameCaptureSettings;
}
/**
* Required when you set Codec to the value H_264.
*
* @return Required when you set Codec to the value H_264.
*/
public final H264Settings h264Settings() {
return h264Settings;
}
/**
* Settings for H265 codec
*
* @return Settings for H265 codec
*/
public final H265Settings h265Settings() {
return h265Settings;
}
/**
* Required when you set Codec to the value MPEG2.
*
* @return Required when you set Codec to the value MPEG2.
*/
public final Mpeg2Settings mpeg2Settings() {
return mpeg2Settings;
}
/**
* Required when you set Codec to the value PRORES.
*
* @return Required when you set Codec to the value PRORES.
*/
public final ProresSettings proresSettings() {
return proresSettings;
}
/**
* Required when you set Codec, under VideoDescription>CodecSettings to the value UNCOMPRESSED.
*
* @return Required when you set Codec, under VideoDescription>CodecSettings to the value UNCOMPRESSED.
*/
public final UncompressedSettings uncompressedSettings() {
return uncompressedSettings;
}
/**
* Required when you set Codec to the value VC3
*
* @return Required when you set Codec to the value VC3
*/
public final Vc3Settings vc3Settings() {
return vc3Settings;
}
/**
* Required when you set Codec to the value VP8.
*
* @return Required when you set Codec to the value VP8.
*/
public final Vp8Settings vp8Settings() {
return vp8Settings;
}
/**
* Required when you set Codec to the value VP9.
*
* @return Required when you set Codec to the value VP9.
*/
public final Vp9Settings vp9Settings() {
return vp9Settings;
}
/**
* Required when you set Codec to the value XAVC.
*
* @return Required when you set Codec to the value XAVC.
*/
public final XavcSettings xavcSettings() {
return xavcSettings;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(av1Settings());
hashCode = 31 * hashCode + Objects.hashCode(avcIntraSettings());
hashCode = 31 * hashCode + Objects.hashCode(codecAsString());
hashCode = 31 * hashCode + Objects.hashCode(frameCaptureSettings());
hashCode = 31 * hashCode + Objects.hashCode(h264Settings());
hashCode = 31 * hashCode + Objects.hashCode(h265Settings());
hashCode = 31 * hashCode + Objects.hashCode(mpeg2Settings());
hashCode = 31 * hashCode + Objects.hashCode(proresSettings());
hashCode = 31 * hashCode + Objects.hashCode(uncompressedSettings());
hashCode = 31 * hashCode + Objects.hashCode(vc3Settings());
hashCode = 31 * hashCode + Objects.hashCode(vp8Settings());
hashCode = 31 * hashCode + Objects.hashCode(vp9Settings());
hashCode = 31 * hashCode + Objects.hashCode(xavcSettings());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof VideoCodecSettings)) {
return false;
}
VideoCodecSettings other = (VideoCodecSettings) obj;
return Objects.equals(av1Settings(), other.av1Settings()) && Objects.equals(avcIntraSettings(), other.avcIntraSettings())
&& Objects.equals(codecAsString(), other.codecAsString())
&& Objects.equals(frameCaptureSettings(), other.frameCaptureSettings())
&& Objects.equals(h264Settings(), other.h264Settings()) && Objects.equals(h265Settings(), other.h265Settings())
&& Objects.equals(mpeg2Settings(), other.mpeg2Settings())
&& Objects.equals(proresSettings(), other.proresSettings())
&& Objects.equals(uncompressedSettings(), other.uncompressedSettings())
&& Objects.equals(vc3Settings(), other.vc3Settings()) && Objects.equals(vp8Settings(), other.vp8Settings())
&& Objects.equals(vp9Settings(), other.vp9Settings()) && Objects.equals(xavcSettings(), other.xavcSettings());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("VideoCodecSettings").add("Av1Settings", av1Settings())
.add("AvcIntraSettings", avcIntraSettings()).add("Codec", codecAsString())
.add("FrameCaptureSettings", frameCaptureSettings()).add("H264Settings", h264Settings())
.add("H265Settings", h265Settings()).add("Mpeg2Settings", mpeg2Settings())
.add("ProresSettings", proresSettings()).add("UncompressedSettings", uncompressedSettings())
.add("Vc3Settings", vc3Settings()).add("Vp8Settings", vp8Settings()).add("Vp9Settings", vp9Settings())
.add("XavcSettings", xavcSettings()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Av1Settings":
return Optional.ofNullable(clazz.cast(av1Settings()));
case "AvcIntraSettings":
return Optional.ofNullable(clazz.cast(avcIntraSettings()));
case "Codec":
return Optional.ofNullable(clazz.cast(codecAsString()));
case "FrameCaptureSettings":
return Optional.ofNullable(clazz.cast(frameCaptureSettings()));
case "H264Settings":
return Optional.ofNullable(clazz.cast(h264Settings()));
case "H265Settings":
return Optional.ofNullable(clazz.cast(h265Settings()));
case "Mpeg2Settings":
return Optional.ofNullable(clazz.cast(mpeg2Settings()));
case "ProresSettings":
return Optional.ofNullable(clazz.cast(proresSettings()));
case "UncompressedSettings":
return Optional.ofNullable(clazz.cast(uncompressedSettings()));
case "Vc3Settings":
return Optional.ofNullable(clazz.cast(vc3Settings()));
case "Vp8Settings":
return Optional.ofNullable(clazz.cast(vp8Settings()));
case "Vp9Settings":
return Optional.ofNullable(clazz.cast(vp9Settings()));
case "XavcSettings":
return Optional.ofNullable(clazz.cast(xavcSettings()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function