{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaConvert.Types.CmfcSettings
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.CmfcSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.CmfcAudioDuration
import Amazonka.MediaConvert.Types.CmfcAudioTrackType
import Amazonka.MediaConvert.Types.CmfcDescriptiveVideoServiceFlag
import Amazonka.MediaConvert.Types.CmfcIFrameOnlyManifest
import Amazonka.MediaConvert.Types.CmfcScte35Esam
import Amazonka.MediaConvert.Types.CmfcScte35Source
import qualified Amazonka.Prelude as Prelude

-- | These settings relate to the fragmented MP4 container for the segments
-- in your CMAF outputs.
--
-- /See:/ 'newCmfcSettings' smart constructor.
data CmfcSettings = CmfcSettings'
  { -- | Specify whether to flag this audio track as descriptive video service
    -- (DVS) in your HLS parent manifest. When you choose Flag (FLAG),
    -- MediaConvert includes the parameter
    -- CHARACTERISTICS=\"public.accessibility.describes-video\" in the
    -- EXT-X-MEDIA entry for this track. When you keep the default choice,
    -- Don\'t flag (DONT_FLAG), MediaConvert leaves this parameter out. The DVS
    -- flag can help with accessibility on Apple devices. For more information,
    -- see the Apple documentation.
    CmfcSettings -> Maybe CmfcDescriptiveVideoServiceFlag
descriptiveVideoServiceFlag :: Prelude.Maybe CmfcDescriptiveVideoServiceFlag,
    -- | List the audio rendition groups that you want included with this video
    -- rendition. Use a comma-separated list. For example, say you want to
    -- include the audio rendition groups that have the audio group IDs
    -- \"audio_aac_1\" and \"audio_dolby\". Then you would specify this value:
    -- \"audio_aac_1, audio_dolby\". Related setting: The rendition groups that
    -- you include in your comma-separated list should all match values that
    -- you specify in the setting Audio group ID (AudioGroupId) for audio
    -- renditions in the same output group as this video rendition. Default
    -- behavior: If you don\'t specify anything here and for Audio group ID,
    -- MediaConvert puts each audio variant in its own audio rendition group
    -- and associates it with every video variant. Each value in your list
    -- appears in your HLS parent manifest in the EXT-X-STREAM-INF tag as the
    -- value for the AUDIO attribute. To continue the previous example, say
    -- that the file name for the child manifest for your video rendition is
    -- \"amazing_video_1.m3u8\". Then, in your parent manifest, each value will
    -- appear on separate lines, like this:
    -- #EXT-X-STREAM-INF:AUDIO=\"audio_aac_1\"... amazing_video_1.m3u8
    -- #EXT-X-STREAM-INF:AUDIO=\"audio_dolby\"... amazing_video_1.m3u8
    CmfcSettings -> Maybe Text
audioRenditionSets :: Prelude.Maybe Prelude.Text,
    -- | Choose Include (INCLUDE) to have MediaConvert generate an HLS child
    -- manifest that lists only the I-frames for this rendition, in addition to
    -- your regular manifest for this rendition. You might use this manifest as
    -- part of a workflow that creates preview functions for your video.
    -- MediaConvert adds both the I-frame only child manifest and the regular
    -- child manifest to the parent manifest. When you don\'t need the I-frame
    -- only child manifest, keep the default value Exclude (EXCLUDE).
    CmfcSettings -> Maybe CmfcIFrameOnlyManifest
iFrameOnlyManifest :: Prelude.Maybe CmfcIFrameOnlyManifest,
    -- | Use this setting only when you specify SCTE-35 markers from ESAM. Choose
    -- INSERT to put SCTE-35 markers in this output at the insertion points
    -- that you specify in an ESAM XML document. Provide the document in the
    -- setting SCC XML (sccXml).
    CmfcSettings -> Maybe CmfcScte35Esam
scte35Esam :: Prelude.Maybe CmfcScte35Esam,
    -- | Specify this setting only when your output will be consumed by a
    -- downstream repackaging workflow that is sensitive to very small duration
    -- differences between video and audio. For this situation, choose Match
    -- video duration (MATCH_VIDEO_DURATION). In all other cases, keep the
    -- default value, Default codec duration (DEFAULT_CODEC_DURATION). When you
    -- choose Match video duration, MediaConvert pads the output audio streams
    -- with silence or trims them to ensure that the total duration of each
    -- audio stream is at least as long as the total duration of the video
    -- stream. After padding or trimming, the audio stream duration is no more
    -- than one frame longer than the video stream. MediaConvert applies audio
    -- padding or trimming only to the end of the last segment of the output.
    -- For unsegmented outputs, MediaConvert adds padding only to the end of
    -- the file. When you keep the default value, any minor discrepancies
    -- between audio and video duration will depend on your output audio codec.
    CmfcSettings -> Maybe CmfcAudioDuration
audioDuration :: Prelude.Maybe CmfcAudioDuration,
    -- | Specify the audio rendition group for this audio rendition. Specify up
    -- to one value for each audio output in your output group. This value
    -- appears in your HLS parent manifest in the EXT-X-MEDIA tag of
    -- TYPE=AUDIO, as the value for the GROUP-ID attribute. For example, if you
    -- specify \"audio_aac_1\" for Audio group ID, it appears in your manifest
    -- like this: #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=\"audio_aac_1\". Related
    -- setting: To associate the rendition group that this audio track belongs
    -- to with a video rendition, include the same value that you provide here
    -- for that video output\'s setting Audio rendition sets
    -- (audioRenditionSets).
    CmfcSettings -> Maybe Text
audioGroupId :: Prelude.Maybe Prelude.Text,
    -- | Ignore this setting unless you have SCTE-35 markers in your input video
    -- file. Choose Passthrough (PASSTHROUGH) if you want SCTE-35 markers that
    -- appear in your input to also appear in this output. Choose None (NONE)
    -- if you don\'t want those SCTE-35 markers in this output.
    CmfcSettings -> Maybe CmfcScte35Source
scte35Source :: Prelude.Maybe CmfcScte35Source,
    -- | Use this setting to control the values that MediaConvert puts in your
    -- HLS parent playlist to control how the client player selects which audio
    -- track to play. The other options for this setting determine the values
    -- that MediaConvert writes for the DEFAULT and AUTOSELECT attributes of
    -- the EXT-X-MEDIA entry for the audio variant. For more information about
    -- these attributes, see the Apple documentation article
    -- https:\/\/developer.apple.com\/documentation\/http_live_streaming\/example_playlists_for_http_live_streaming\/adding_alternate_media_to_a_playlist.
    -- Choose Alternate audio, auto select, default
    -- (ALTERNATE_AUDIO_AUTO_SELECT_DEFAULT) to set DEFAULT=YES and
    -- AUTOSELECT=YES. Choose this value for only one variant in your output
    -- group. Choose Alternate audio, auto select, not default
    -- (ALTERNATE_AUDIO_AUTO_SELECT) to set DEFAULT=NO and AUTOSELECT=YES.
    -- Choose Alternate Audio, Not Auto Select to set DEFAULT=NO and
    -- AUTOSELECT=NO. When you don\'t specify a value for this setting,
    -- MediaConvert defaults to Alternate audio, auto select, default. When
    -- there is more than one variant in your output group, you must explicitly
    -- choose a value for this setting.
    CmfcSettings -> Maybe CmfcAudioTrackType
audioTrackType :: Prelude.Maybe CmfcAudioTrackType
  }
  deriving (CmfcSettings -> CmfcSettings -> Bool
(CmfcSettings -> CmfcSettings -> Bool)
-> (CmfcSettings -> CmfcSettings -> Bool) -> Eq CmfcSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CmfcSettings -> CmfcSettings -> Bool
$c/= :: CmfcSettings -> CmfcSettings -> Bool
== :: CmfcSettings -> CmfcSettings -> Bool
$c== :: CmfcSettings -> CmfcSettings -> Bool
Prelude.Eq, ReadPrec [CmfcSettings]
ReadPrec CmfcSettings
Int -> ReadS CmfcSettings
ReadS [CmfcSettings]
(Int -> ReadS CmfcSettings)
-> ReadS [CmfcSettings]
-> ReadPrec CmfcSettings
-> ReadPrec [CmfcSettings]
-> Read CmfcSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CmfcSettings]
$creadListPrec :: ReadPrec [CmfcSettings]
readPrec :: ReadPrec CmfcSettings
$creadPrec :: ReadPrec CmfcSettings
readList :: ReadS [CmfcSettings]
$creadList :: ReadS [CmfcSettings]
readsPrec :: Int -> ReadS CmfcSettings
$creadsPrec :: Int -> ReadS CmfcSettings
Prelude.Read, Int -> CmfcSettings -> ShowS
[CmfcSettings] -> ShowS
CmfcSettings -> String
(Int -> CmfcSettings -> ShowS)
-> (CmfcSettings -> String)
-> ([CmfcSettings] -> ShowS)
-> Show CmfcSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CmfcSettings] -> ShowS
$cshowList :: [CmfcSettings] -> ShowS
show :: CmfcSettings -> String
$cshow :: CmfcSettings -> String
showsPrec :: Int -> CmfcSettings -> ShowS
$cshowsPrec :: Int -> CmfcSettings -> ShowS
Prelude.Show, (forall x. CmfcSettings -> Rep CmfcSettings x)
-> (forall x. Rep CmfcSettings x -> CmfcSettings)
-> Generic CmfcSettings
forall x. Rep CmfcSettings x -> CmfcSettings
forall x. CmfcSettings -> Rep CmfcSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CmfcSettings x -> CmfcSettings
$cfrom :: forall x. CmfcSettings -> Rep CmfcSettings x
Prelude.Generic)

-- |
-- Create a value of 'CmfcSettings' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'descriptiveVideoServiceFlag', 'cmfcSettings_descriptiveVideoServiceFlag' - Specify whether to flag this audio track as descriptive video service
-- (DVS) in your HLS parent manifest. When you choose Flag (FLAG),
-- MediaConvert includes the parameter
-- CHARACTERISTICS=\"public.accessibility.describes-video\" in the
-- EXT-X-MEDIA entry for this track. When you keep the default choice,
-- Don\'t flag (DONT_FLAG), MediaConvert leaves this parameter out. The DVS
-- flag can help with accessibility on Apple devices. For more information,
-- see the Apple documentation.
--
-- 'audioRenditionSets', 'cmfcSettings_audioRenditionSets' - List the audio rendition groups that you want included with this video
-- rendition. Use a comma-separated list. For example, say you want to
-- include the audio rendition groups that have the audio group IDs
-- \"audio_aac_1\" and \"audio_dolby\". Then you would specify this value:
-- \"audio_aac_1, audio_dolby\". Related setting: The rendition groups that
-- you include in your comma-separated list should all match values that
-- you specify in the setting Audio group ID (AudioGroupId) for audio
-- renditions in the same output group as this video rendition. Default
-- behavior: If you don\'t specify anything here and for Audio group ID,
-- MediaConvert puts each audio variant in its own audio rendition group
-- and associates it with every video variant. Each value in your list
-- appears in your HLS parent manifest in the EXT-X-STREAM-INF tag as the
-- value for the AUDIO attribute. To continue the previous example, say
-- that the file name for the child manifest for your video rendition is
-- \"amazing_video_1.m3u8\". Then, in your parent manifest, each value will
-- appear on separate lines, like this:
-- #EXT-X-STREAM-INF:AUDIO=\"audio_aac_1\"... amazing_video_1.m3u8
-- #EXT-X-STREAM-INF:AUDIO=\"audio_dolby\"... amazing_video_1.m3u8
--
-- 'iFrameOnlyManifest', 'cmfcSettings_iFrameOnlyManifest' - Choose Include (INCLUDE) to have MediaConvert generate an HLS child
-- manifest that lists only the I-frames for this rendition, in addition to
-- your regular manifest for this rendition. You might use this manifest as
-- part of a workflow that creates preview functions for your video.
-- MediaConvert adds both the I-frame only child manifest and the regular
-- child manifest to the parent manifest. When you don\'t need the I-frame
-- only child manifest, keep the default value Exclude (EXCLUDE).
--
-- 'scte35Esam', 'cmfcSettings_scte35Esam' - Use this setting only when you specify SCTE-35 markers from ESAM. Choose
-- INSERT to put SCTE-35 markers in this output at the insertion points
-- that you specify in an ESAM XML document. Provide the document in the
-- setting SCC XML (sccXml).
--
-- 'audioDuration', 'cmfcSettings_audioDuration' - Specify this setting only when your output will be consumed by a
-- downstream repackaging workflow that is sensitive to very small duration
-- differences between video and audio. For this situation, choose Match
-- video duration (MATCH_VIDEO_DURATION). In all other cases, keep the
-- default value, Default codec duration (DEFAULT_CODEC_DURATION). When you
-- choose Match video duration, MediaConvert pads the output audio streams
-- with silence or trims them to ensure that the total duration of each
-- audio stream is at least as long as the total duration of the video
-- stream. After padding or trimming, the audio stream duration is no more
-- than one frame longer than the video stream. MediaConvert applies audio
-- padding or trimming only to the end of the last segment of the output.
-- For unsegmented outputs, MediaConvert adds padding only to the end of
-- the file. When you keep the default value, any minor discrepancies
-- between audio and video duration will depend on your output audio codec.
--
-- 'audioGroupId', 'cmfcSettings_audioGroupId' - Specify the audio rendition group for this audio rendition. Specify up
-- to one value for each audio output in your output group. This value
-- appears in your HLS parent manifest in the EXT-X-MEDIA tag of
-- TYPE=AUDIO, as the value for the GROUP-ID attribute. For example, if you
-- specify \"audio_aac_1\" for Audio group ID, it appears in your manifest
-- like this: #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=\"audio_aac_1\". Related
-- setting: To associate the rendition group that this audio track belongs
-- to with a video rendition, include the same value that you provide here
-- for that video output\'s setting Audio rendition sets
-- (audioRenditionSets).
--
-- 'scte35Source', 'cmfcSettings_scte35Source' - Ignore this setting unless you have SCTE-35 markers in your input video
-- file. Choose Passthrough (PASSTHROUGH) if you want SCTE-35 markers that
-- appear in your input to also appear in this output. Choose None (NONE)
-- if you don\'t want those SCTE-35 markers in this output.
--
-- 'audioTrackType', 'cmfcSettings_audioTrackType' - Use this setting to control the values that MediaConvert puts in your
-- HLS parent playlist to control how the client player selects which audio
-- track to play. The other options for this setting determine the values
-- that MediaConvert writes for the DEFAULT and AUTOSELECT attributes of
-- the EXT-X-MEDIA entry for the audio variant. For more information about
-- these attributes, see the Apple documentation article
-- https:\/\/developer.apple.com\/documentation\/http_live_streaming\/example_playlists_for_http_live_streaming\/adding_alternate_media_to_a_playlist.
-- Choose Alternate audio, auto select, default
-- (ALTERNATE_AUDIO_AUTO_SELECT_DEFAULT) to set DEFAULT=YES and
-- AUTOSELECT=YES. Choose this value for only one variant in your output
-- group. Choose Alternate audio, auto select, not default
-- (ALTERNATE_AUDIO_AUTO_SELECT) to set DEFAULT=NO and AUTOSELECT=YES.
-- Choose Alternate Audio, Not Auto Select to set DEFAULT=NO and
-- AUTOSELECT=NO. When you don\'t specify a value for this setting,
-- MediaConvert defaults to Alternate audio, auto select, default. When
-- there is more than one variant in your output group, you must explicitly
-- choose a value for this setting.
newCmfcSettings ::
  CmfcSettings
newCmfcSettings :: CmfcSettings
newCmfcSettings =
  CmfcSettings' :: Maybe CmfcDescriptiveVideoServiceFlag
-> Maybe Text
-> Maybe CmfcIFrameOnlyManifest
-> Maybe CmfcScte35Esam
-> Maybe CmfcAudioDuration
-> Maybe Text
-> Maybe CmfcScte35Source
-> Maybe CmfcAudioTrackType
-> CmfcSettings
CmfcSettings'
    { $sel:descriptiveVideoServiceFlag:CmfcSettings' :: Maybe CmfcDescriptiveVideoServiceFlag
descriptiveVideoServiceFlag =
        Maybe CmfcDescriptiveVideoServiceFlag
forall a. Maybe a
Prelude.Nothing,
      $sel:audioRenditionSets:CmfcSettings' :: Maybe Text
audioRenditionSets = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:iFrameOnlyManifest:CmfcSettings' :: Maybe CmfcIFrameOnlyManifest
iFrameOnlyManifest = Maybe CmfcIFrameOnlyManifest
forall a. Maybe a
Prelude.Nothing,
      $sel:scte35Esam:CmfcSettings' :: Maybe CmfcScte35Esam
scte35Esam = Maybe CmfcScte35Esam
forall a. Maybe a
Prelude.Nothing,
      $sel:audioDuration:CmfcSettings' :: Maybe CmfcAudioDuration
audioDuration = Maybe CmfcAudioDuration
forall a. Maybe a
Prelude.Nothing,
      $sel:audioGroupId:CmfcSettings' :: Maybe Text
audioGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scte35Source:CmfcSettings' :: Maybe CmfcScte35Source
scte35Source = Maybe CmfcScte35Source
forall a. Maybe a
Prelude.Nothing,
      $sel:audioTrackType:CmfcSettings' :: Maybe CmfcAudioTrackType
audioTrackType = Maybe CmfcAudioTrackType
forall a. Maybe a
Prelude.Nothing
    }

-- | Specify whether to flag this audio track as descriptive video service
-- (DVS) in your HLS parent manifest. When you choose Flag (FLAG),
-- MediaConvert includes the parameter
-- CHARACTERISTICS=\"public.accessibility.describes-video\" in the
-- EXT-X-MEDIA entry for this track. When you keep the default choice,
-- Don\'t flag (DONT_FLAG), MediaConvert leaves this parameter out. The DVS
-- flag can help with accessibility on Apple devices. For more information,
-- see the Apple documentation.
cmfcSettings_descriptiveVideoServiceFlag :: Lens.Lens' CmfcSettings (Prelude.Maybe CmfcDescriptiveVideoServiceFlag)
cmfcSettings_descriptiveVideoServiceFlag :: (Maybe CmfcDescriptiveVideoServiceFlag
 -> f (Maybe CmfcDescriptiveVideoServiceFlag))
-> CmfcSettings -> f CmfcSettings
cmfcSettings_descriptiveVideoServiceFlag = (CmfcSettings -> Maybe CmfcDescriptiveVideoServiceFlag)
-> (CmfcSettings
    -> Maybe CmfcDescriptiveVideoServiceFlag -> CmfcSettings)
-> Lens
     CmfcSettings
     CmfcSettings
     (Maybe CmfcDescriptiveVideoServiceFlag)
     (Maybe CmfcDescriptiveVideoServiceFlag)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmfcSettings' {Maybe CmfcDescriptiveVideoServiceFlag
descriptiveVideoServiceFlag :: Maybe CmfcDescriptiveVideoServiceFlag
$sel:descriptiveVideoServiceFlag:CmfcSettings' :: CmfcSettings -> Maybe CmfcDescriptiveVideoServiceFlag
descriptiveVideoServiceFlag} -> Maybe CmfcDescriptiveVideoServiceFlag
descriptiveVideoServiceFlag) (\s :: CmfcSettings
s@CmfcSettings' {} Maybe CmfcDescriptiveVideoServiceFlag
a -> CmfcSettings
s {$sel:descriptiveVideoServiceFlag:CmfcSettings' :: Maybe CmfcDescriptiveVideoServiceFlag
descriptiveVideoServiceFlag = Maybe CmfcDescriptiveVideoServiceFlag
a} :: CmfcSettings)

-- | List the audio rendition groups that you want included with this video
-- rendition. Use a comma-separated list. For example, say you want to
-- include the audio rendition groups that have the audio group IDs
-- \"audio_aac_1\" and \"audio_dolby\". Then you would specify this value:
-- \"audio_aac_1, audio_dolby\". Related setting: The rendition groups that
-- you include in your comma-separated list should all match values that
-- you specify in the setting Audio group ID (AudioGroupId) for audio
-- renditions in the same output group as this video rendition. Default
-- behavior: If you don\'t specify anything here and for Audio group ID,
-- MediaConvert puts each audio variant in its own audio rendition group
-- and associates it with every video variant. Each value in your list
-- appears in your HLS parent manifest in the EXT-X-STREAM-INF tag as the
-- value for the AUDIO attribute. To continue the previous example, say
-- that the file name for the child manifest for your video rendition is
-- \"amazing_video_1.m3u8\". Then, in your parent manifest, each value will
-- appear on separate lines, like this:
-- #EXT-X-STREAM-INF:AUDIO=\"audio_aac_1\"... amazing_video_1.m3u8
-- #EXT-X-STREAM-INF:AUDIO=\"audio_dolby\"... amazing_video_1.m3u8
cmfcSettings_audioRenditionSets :: Lens.Lens' CmfcSettings (Prelude.Maybe Prelude.Text)
cmfcSettings_audioRenditionSets :: (Maybe Text -> f (Maybe Text)) -> CmfcSettings -> f CmfcSettings
cmfcSettings_audioRenditionSets = (CmfcSettings -> Maybe Text)
-> (CmfcSettings -> Maybe Text -> CmfcSettings)
-> Lens CmfcSettings CmfcSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmfcSettings' {Maybe Text
audioRenditionSets :: Maybe Text
$sel:audioRenditionSets:CmfcSettings' :: CmfcSettings -> Maybe Text
audioRenditionSets} -> Maybe Text
audioRenditionSets) (\s :: CmfcSettings
s@CmfcSettings' {} Maybe Text
a -> CmfcSettings
s {$sel:audioRenditionSets:CmfcSettings' :: Maybe Text
audioRenditionSets = Maybe Text
a} :: CmfcSettings)

-- | Choose Include (INCLUDE) to have MediaConvert generate an HLS child
-- manifest that lists only the I-frames for this rendition, in addition to
-- your regular manifest for this rendition. You might use this manifest as
-- part of a workflow that creates preview functions for your video.
-- MediaConvert adds both the I-frame only child manifest and the regular
-- child manifest to the parent manifest. When you don\'t need the I-frame
-- only child manifest, keep the default value Exclude (EXCLUDE).
cmfcSettings_iFrameOnlyManifest :: Lens.Lens' CmfcSettings (Prelude.Maybe CmfcIFrameOnlyManifest)
cmfcSettings_iFrameOnlyManifest :: (Maybe CmfcIFrameOnlyManifest -> f (Maybe CmfcIFrameOnlyManifest))
-> CmfcSettings -> f CmfcSettings
cmfcSettings_iFrameOnlyManifest = (CmfcSettings -> Maybe CmfcIFrameOnlyManifest)
-> (CmfcSettings -> Maybe CmfcIFrameOnlyManifest -> CmfcSettings)
-> Lens
     CmfcSettings
     CmfcSettings
     (Maybe CmfcIFrameOnlyManifest)
     (Maybe CmfcIFrameOnlyManifest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmfcSettings' {Maybe CmfcIFrameOnlyManifest
iFrameOnlyManifest :: Maybe CmfcIFrameOnlyManifest
$sel:iFrameOnlyManifest:CmfcSettings' :: CmfcSettings -> Maybe CmfcIFrameOnlyManifest
iFrameOnlyManifest} -> Maybe CmfcIFrameOnlyManifest
iFrameOnlyManifest) (\s :: CmfcSettings
s@CmfcSettings' {} Maybe CmfcIFrameOnlyManifest
a -> CmfcSettings
s {$sel:iFrameOnlyManifest:CmfcSettings' :: Maybe CmfcIFrameOnlyManifest
iFrameOnlyManifest = Maybe CmfcIFrameOnlyManifest
a} :: CmfcSettings)

-- | Use this setting only when you specify SCTE-35 markers from ESAM. Choose
-- INSERT to put SCTE-35 markers in this output at the insertion points
-- that you specify in an ESAM XML document. Provide the document in the
-- setting SCC XML (sccXml).
cmfcSettings_scte35Esam :: Lens.Lens' CmfcSettings (Prelude.Maybe CmfcScte35Esam)
cmfcSettings_scte35Esam :: (Maybe CmfcScte35Esam -> f (Maybe CmfcScte35Esam))
-> CmfcSettings -> f CmfcSettings
cmfcSettings_scte35Esam = (CmfcSettings -> Maybe CmfcScte35Esam)
-> (CmfcSettings -> Maybe CmfcScte35Esam -> CmfcSettings)
-> Lens
     CmfcSettings
     CmfcSettings
     (Maybe CmfcScte35Esam)
     (Maybe CmfcScte35Esam)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmfcSettings' {Maybe CmfcScte35Esam
scte35Esam :: Maybe CmfcScte35Esam
$sel:scte35Esam:CmfcSettings' :: CmfcSettings -> Maybe CmfcScte35Esam
scte35Esam} -> Maybe CmfcScte35Esam
scte35Esam) (\s :: CmfcSettings
s@CmfcSettings' {} Maybe CmfcScte35Esam
a -> CmfcSettings
s {$sel:scte35Esam:CmfcSettings' :: Maybe CmfcScte35Esam
scte35Esam = Maybe CmfcScte35Esam
a} :: CmfcSettings)

-- | Specify this setting only when your output will be consumed by a
-- downstream repackaging workflow that is sensitive to very small duration
-- differences between video and audio. For this situation, choose Match
-- video duration (MATCH_VIDEO_DURATION). In all other cases, keep the
-- default value, Default codec duration (DEFAULT_CODEC_DURATION). When you
-- choose Match video duration, MediaConvert pads the output audio streams
-- with silence or trims them to ensure that the total duration of each
-- audio stream is at least as long as the total duration of the video
-- stream. After padding or trimming, the audio stream duration is no more
-- than one frame longer than the video stream. MediaConvert applies audio
-- padding or trimming only to the end of the last segment of the output.
-- For unsegmented outputs, MediaConvert adds padding only to the end of
-- the file. When you keep the default value, any minor discrepancies
-- between audio and video duration will depend on your output audio codec.
cmfcSettings_audioDuration :: Lens.Lens' CmfcSettings (Prelude.Maybe CmfcAudioDuration)
cmfcSettings_audioDuration :: (Maybe CmfcAudioDuration -> f (Maybe CmfcAudioDuration))
-> CmfcSettings -> f CmfcSettings
cmfcSettings_audioDuration = (CmfcSettings -> Maybe CmfcAudioDuration)
-> (CmfcSettings -> Maybe CmfcAudioDuration -> CmfcSettings)
-> Lens
     CmfcSettings
     CmfcSettings
     (Maybe CmfcAudioDuration)
     (Maybe CmfcAudioDuration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmfcSettings' {Maybe CmfcAudioDuration
audioDuration :: Maybe CmfcAudioDuration
$sel:audioDuration:CmfcSettings' :: CmfcSettings -> Maybe CmfcAudioDuration
audioDuration} -> Maybe CmfcAudioDuration
audioDuration) (\s :: CmfcSettings
s@CmfcSettings' {} Maybe CmfcAudioDuration
a -> CmfcSettings
s {$sel:audioDuration:CmfcSettings' :: Maybe CmfcAudioDuration
audioDuration = Maybe CmfcAudioDuration
a} :: CmfcSettings)

-- | Specify the audio rendition group for this audio rendition. Specify up
-- to one value for each audio output in your output group. This value
-- appears in your HLS parent manifest in the EXT-X-MEDIA tag of
-- TYPE=AUDIO, as the value for the GROUP-ID attribute. For example, if you
-- specify \"audio_aac_1\" for Audio group ID, it appears in your manifest
-- like this: #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=\"audio_aac_1\". Related
-- setting: To associate the rendition group that this audio track belongs
-- to with a video rendition, include the same value that you provide here
-- for that video output\'s setting Audio rendition sets
-- (audioRenditionSets).
cmfcSettings_audioGroupId :: Lens.Lens' CmfcSettings (Prelude.Maybe Prelude.Text)
cmfcSettings_audioGroupId :: (Maybe Text -> f (Maybe Text)) -> CmfcSettings -> f CmfcSettings
cmfcSettings_audioGroupId = (CmfcSettings -> Maybe Text)
-> (CmfcSettings -> Maybe Text -> CmfcSettings)
-> Lens CmfcSettings CmfcSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmfcSettings' {Maybe Text
audioGroupId :: Maybe Text
$sel:audioGroupId:CmfcSettings' :: CmfcSettings -> Maybe Text
audioGroupId} -> Maybe Text
audioGroupId) (\s :: CmfcSettings
s@CmfcSettings' {} Maybe Text
a -> CmfcSettings
s {$sel:audioGroupId:CmfcSettings' :: Maybe Text
audioGroupId = Maybe Text
a} :: CmfcSettings)

-- | Ignore this setting unless you have SCTE-35 markers in your input video
-- file. Choose Passthrough (PASSTHROUGH) if you want SCTE-35 markers that
-- appear in your input to also appear in this output. Choose None (NONE)
-- if you don\'t want those SCTE-35 markers in this output.
cmfcSettings_scte35Source :: Lens.Lens' CmfcSettings (Prelude.Maybe CmfcScte35Source)
cmfcSettings_scte35Source :: (Maybe CmfcScte35Source -> f (Maybe CmfcScte35Source))
-> CmfcSettings -> f CmfcSettings
cmfcSettings_scte35Source = (CmfcSettings -> Maybe CmfcScte35Source)
-> (CmfcSettings -> Maybe CmfcScte35Source -> CmfcSettings)
-> Lens
     CmfcSettings
     CmfcSettings
     (Maybe CmfcScte35Source)
     (Maybe CmfcScte35Source)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmfcSettings' {Maybe CmfcScte35Source
scte35Source :: Maybe CmfcScte35Source
$sel:scte35Source:CmfcSettings' :: CmfcSettings -> Maybe CmfcScte35Source
scte35Source} -> Maybe CmfcScte35Source
scte35Source) (\s :: CmfcSettings
s@CmfcSettings' {} Maybe CmfcScte35Source
a -> CmfcSettings
s {$sel:scte35Source:CmfcSettings' :: Maybe CmfcScte35Source
scte35Source = Maybe CmfcScte35Source
a} :: CmfcSettings)

-- | Use this setting to control the values that MediaConvert puts in your
-- HLS parent playlist to control how the client player selects which audio
-- track to play. The other options for this setting determine the values
-- that MediaConvert writes for the DEFAULT and AUTOSELECT attributes of
-- the EXT-X-MEDIA entry for the audio variant. For more information about
-- these attributes, see the Apple documentation article
-- https:\/\/developer.apple.com\/documentation\/http_live_streaming\/example_playlists_for_http_live_streaming\/adding_alternate_media_to_a_playlist.
-- Choose Alternate audio, auto select, default
-- (ALTERNATE_AUDIO_AUTO_SELECT_DEFAULT) to set DEFAULT=YES and
-- AUTOSELECT=YES. Choose this value for only one variant in your output
-- group. Choose Alternate audio, auto select, not default
-- (ALTERNATE_AUDIO_AUTO_SELECT) to set DEFAULT=NO and AUTOSELECT=YES.
-- Choose Alternate Audio, Not Auto Select to set DEFAULT=NO and
-- AUTOSELECT=NO. When you don\'t specify a value for this setting,
-- MediaConvert defaults to Alternate audio, auto select, default. When
-- there is more than one variant in your output group, you must explicitly
-- choose a value for this setting.
cmfcSettings_audioTrackType :: Lens.Lens' CmfcSettings (Prelude.Maybe CmfcAudioTrackType)
cmfcSettings_audioTrackType :: (Maybe CmfcAudioTrackType -> f (Maybe CmfcAudioTrackType))
-> CmfcSettings -> f CmfcSettings
cmfcSettings_audioTrackType = (CmfcSettings -> Maybe CmfcAudioTrackType)
-> (CmfcSettings -> Maybe CmfcAudioTrackType -> CmfcSettings)
-> Lens
     CmfcSettings
     CmfcSettings
     (Maybe CmfcAudioTrackType)
     (Maybe CmfcAudioTrackType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmfcSettings' {Maybe CmfcAudioTrackType
audioTrackType :: Maybe CmfcAudioTrackType
$sel:audioTrackType:CmfcSettings' :: CmfcSettings -> Maybe CmfcAudioTrackType
audioTrackType} -> Maybe CmfcAudioTrackType
audioTrackType) (\s :: CmfcSettings
s@CmfcSettings' {} Maybe CmfcAudioTrackType
a -> CmfcSettings
s {$sel:audioTrackType:CmfcSettings' :: Maybe CmfcAudioTrackType
audioTrackType = Maybe CmfcAudioTrackType
a} :: CmfcSettings)

instance Core.FromJSON CmfcSettings where
  parseJSON :: Value -> Parser CmfcSettings
parseJSON =
    String
-> (Object -> Parser CmfcSettings) -> Value -> Parser CmfcSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CmfcSettings"
      ( \Object
x ->
          Maybe CmfcDescriptiveVideoServiceFlag
-> Maybe Text
-> Maybe CmfcIFrameOnlyManifest
-> Maybe CmfcScte35Esam
-> Maybe CmfcAudioDuration
-> Maybe Text
-> Maybe CmfcScte35Source
-> Maybe CmfcAudioTrackType
-> CmfcSettings
CmfcSettings'
            (Maybe CmfcDescriptiveVideoServiceFlag
 -> Maybe Text
 -> Maybe CmfcIFrameOnlyManifest
 -> Maybe CmfcScte35Esam
 -> Maybe CmfcAudioDuration
 -> Maybe Text
 -> Maybe CmfcScte35Source
 -> Maybe CmfcAudioTrackType
 -> CmfcSettings)
-> Parser (Maybe CmfcDescriptiveVideoServiceFlag)
-> Parser
     (Maybe Text
      -> Maybe CmfcIFrameOnlyManifest
      -> Maybe CmfcScte35Esam
      -> Maybe CmfcAudioDuration
      -> Maybe Text
      -> Maybe CmfcScte35Source
      -> Maybe CmfcAudioTrackType
      -> CmfcSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CmfcDescriptiveVideoServiceFlag)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"descriptiveVideoServiceFlag")
            Parser
  (Maybe Text
   -> Maybe CmfcIFrameOnlyManifest
   -> Maybe CmfcScte35Esam
   -> Maybe CmfcAudioDuration
   -> Maybe Text
   -> Maybe CmfcScte35Source
   -> Maybe CmfcAudioTrackType
   -> CmfcSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe CmfcIFrameOnlyManifest
      -> Maybe CmfcScte35Esam
      -> Maybe CmfcAudioDuration
      -> Maybe Text
      -> Maybe CmfcScte35Source
      -> Maybe CmfcAudioTrackType
      -> CmfcSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioRenditionSets")
            Parser
  (Maybe CmfcIFrameOnlyManifest
   -> Maybe CmfcScte35Esam
   -> Maybe CmfcAudioDuration
   -> Maybe Text
   -> Maybe CmfcScte35Source
   -> Maybe CmfcAudioTrackType
   -> CmfcSettings)
-> Parser (Maybe CmfcIFrameOnlyManifest)
-> Parser
     (Maybe CmfcScte35Esam
      -> Maybe CmfcAudioDuration
      -> Maybe Text
      -> Maybe CmfcScte35Source
      -> Maybe CmfcAudioTrackType
      -> CmfcSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CmfcIFrameOnlyManifest)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iFrameOnlyManifest")
            Parser
  (Maybe CmfcScte35Esam
   -> Maybe CmfcAudioDuration
   -> Maybe Text
   -> Maybe CmfcScte35Source
   -> Maybe CmfcAudioTrackType
   -> CmfcSettings)
-> Parser (Maybe CmfcScte35Esam)
-> Parser
     (Maybe CmfcAudioDuration
      -> Maybe Text
      -> Maybe CmfcScte35Source
      -> Maybe CmfcAudioTrackType
      -> CmfcSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CmfcScte35Esam)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scte35Esam")
            Parser
  (Maybe CmfcAudioDuration
   -> Maybe Text
   -> Maybe CmfcScte35Source
   -> Maybe CmfcAudioTrackType
   -> CmfcSettings)
-> Parser (Maybe CmfcAudioDuration)
-> Parser
     (Maybe Text
      -> Maybe CmfcScte35Source
      -> Maybe CmfcAudioTrackType
      -> CmfcSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CmfcAudioDuration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioDuration")
            Parser
  (Maybe Text
   -> Maybe CmfcScte35Source
   -> Maybe CmfcAudioTrackType
   -> CmfcSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe CmfcScte35Source
      -> Maybe CmfcAudioTrackType -> CmfcSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioGroupId")
            Parser
  (Maybe CmfcScte35Source
   -> Maybe CmfcAudioTrackType -> CmfcSettings)
-> Parser (Maybe CmfcScte35Source)
-> Parser (Maybe CmfcAudioTrackType -> CmfcSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CmfcScte35Source)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scte35Source")
            Parser (Maybe CmfcAudioTrackType -> CmfcSettings)
-> Parser (Maybe CmfcAudioTrackType) -> Parser CmfcSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CmfcAudioTrackType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioTrackType")
      )

instance Prelude.Hashable CmfcSettings

instance Prelude.NFData CmfcSettings

instance Core.ToJSON CmfcSettings where
  toJSON :: CmfcSettings -> Value
toJSON CmfcSettings' {Maybe Text
Maybe CmfcAudioDuration
Maybe CmfcAudioTrackType
Maybe CmfcDescriptiveVideoServiceFlag
Maybe CmfcIFrameOnlyManifest
Maybe CmfcScte35Esam
Maybe CmfcScte35Source
audioTrackType :: Maybe CmfcAudioTrackType
scte35Source :: Maybe CmfcScte35Source
audioGroupId :: Maybe Text
audioDuration :: Maybe CmfcAudioDuration
scte35Esam :: Maybe CmfcScte35Esam
iFrameOnlyManifest :: Maybe CmfcIFrameOnlyManifest
audioRenditionSets :: Maybe Text
descriptiveVideoServiceFlag :: Maybe CmfcDescriptiveVideoServiceFlag
$sel:audioTrackType:CmfcSettings' :: CmfcSettings -> Maybe CmfcAudioTrackType
$sel:scte35Source:CmfcSettings' :: CmfcSettings -> Maybe CmfcScte35Source
$sel:audioGroupId:CmfcSettings' :: CmfcSettings -> Maybe Text
$sel:audioDuration:CmfcSettings' :: CmfcSettings -> Maybe CmfcAudioDuration
$sel:scte35Esam:CmfcSettings' :: CmfcSettings -> Maybe CmfcScte35Esam
$sel:iFrameOnlyManifest:CmfcSettings' :: CmfcSettings -> Maybe CmfcIFrameOnlyManifest
$sel:audioRenditionSets:CmfcSettings' :: CmfcSettings -> Maybe Text
$sel:descriptiveVideoServiceFlag:CmfcSettings' :: CmfcSettings -> Maybe CmfcDescriptiveVideoServiceFlag
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"descriptiveVideoServiceFlag" Text -> CmfcDescriptiveVideoServiceFlag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CmfcDescriptiveVideoServiceFlag -> Pair)
-> Maybe CmfcDescriptiveVideoServiceFlag -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmfcDescriptiveVideoServiceFlag
descriptiveVideoServiceFlag,
            (Text
"audioRenditionSets" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
audioRenditionSets,
            (Text
"iFrameOnlyManifest" Text -> CmfcIFrameOnlyManifest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CmfcIFrameOnlyManifest -> Pair)
-> Maybe CmfcIFrameOnlyManifest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmfcIFrameOnlyManifest
iFrameOnlyManifest,
            (Text
"scte35Esam" Text -> CmfcScte35Esam -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CmfcScte35Esam -> Pair) -> Maybe CmfcScte35Esam -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmfcScte35Esam
scte35Esam,
            (Text
"audioDuration" Text -> CmfcAudioDuration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CmfcAudioDuration -> Pair)
-> Maybe CmfcAudioDuration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmfcAudioDuration
audioDuration,
            (Text
"audioGroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
audioGroupId,
            (Text
"scte35Source" Text -> CmfcScte35Source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CmfcScte35Source -> Pair) -> Maybe CmfcScte35Source -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmfcScte35Source
scte35Source,
            (Text
"audioTrackType" Text -> CmfcAudioTrackType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CmfcAudioTrackType -> Pair)
-> Maybe CmfcAudioTrackType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmfcAudioTrackType
audioTrackType
          ]
      )