{-# 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.MxfXavcProfileSettings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.MxfXavcProfileSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.MxfXavcDurationMode
import qualified Amazonka.Prelude as Prelude

-- | Specify the XAVC profile settings for MXF outputs when you set your MXF
-- profile to XAVC.
--
-- /See:/ 'newMxfXavcProfileSettings' smart constructor.
data MxfXavcProfileSettings = MxfXavcProfileSettings'
  { -- | To create an output that complies with the XAVC file format guidelines
    -- for interoperability, keep the default value, Drop frames for compliance
    -- (DROP_FRAMES_FOR_COMPLIANCE). To include all frames from your input in
    -- this output, keep the default setting, Allow any duration
    -- (ALLOW_ANY_DURATION). The number of frames that MediaConvert excludes
    -- when you set this to Drop frames for compliance depends on the output
    -- frame rate and duration.
    MxfXavcProfileSettings -> Maybe MxfXavcDurationMode
durationMode :: Prelude.Maybe MxfXavcDurationMode,
    -- | Specify a value for this setting only for outputs that you set up with
    -- one of these two XAVC profiles: XAVC HD Intra CBG (XAVC_HD_INTRA_CBG) or
    -- XAVC 4K Intra CBG (XAVC_4K_INTRA_CBG). Specify the amount of space in
    -- each frame that the service reserves for ancillary data, such as
    -- teletext captions. The default value for this setting is 1492 bytes per
    -- frame. This should be sufficient to prevent overflow unless you have
    -- multiple pages of teletext captions data. If you have a large amount of
    -- teletext data, specify a larger number.
    MxfXavcProfileSettings -> Maybe Natural
maxAncDataSize :: Prelude.Maybe Prelude.Natural
  }
  deriving (MxfXavcProfileSettings -> MxfXavcProfileSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MxfXavcProfileSettings -> MxfXavcProfileSettings -> Bool
$c/= :: MxfXavcProfileSettings -> MxfXavcProfileSettings -> Bool
== :: MxfXavcProfileSettings -> MxfXavcProfileSettings -> Bool
$c== :: MxfXavcProfileSettings -> MxfXavcProfileSettings -> Bool
Prelude.Eq, ReadPrec [MxfXavcProfileSettings]
ReadPrec MxfXavcProfileSettings
Int -> ReadS MxfXavcProfileSettings
ReadS [MxfXavcProfileSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MxfXavcProfileSettings]
$creadListPrec :: ReadPrec [MxfXavcProfileSettings]
readPrec :: ReadPrec MxfXavcProfileSettings
$creadPrec :: ReadPrec MxfXavcProfileSettings
readList :: ReadS [MxfXavcProfileSettings]
$creadList :: ReadS [MxfXavcProfileSettings]
readsPrec :: Int -> ReadS MxfXavcProfileSettings
$creadsPrec :: Int -> ReadS MxfXavcProfileSettings
Prelude.Read, Int -> MxfXavcProfileSettings -> ShowS
[MxfXavcProfileSettings] -> ShowS
MxfXavcProfileSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MxfXavcProfileSettings] -> ShowS
$cshowList :: [MxfXavcProfileSettings] -> ShowS
show :: MxfXavcProfileSettings -> String
$cshow :: MxfXavcProfileSettings -> String
showsPrec :: Int -> MxfXavcProfileSettings -> ShowS
$cshowsPrec :: Int -> MxfXavcProfileSettings -> ShowS
Prelude.Show, forall x. Rep MxfXavcProfileSettings x -> MxfXavcProfileSettings
forall x. MxfXavcProfileSettings -> Rep MxfXavcProfileSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MxfXavcProfileSettings x -> MxfXavcProfileSettings
$cfrom :: forall x. MxfXavcProfileSettings -> Rep MxfXavcProfileSettings x
Prelude.Generic)

-- |
-- Create a value of 'MxfXavcProfileSettings' 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:
--
-- 'durationMode', 'mxfXavcProfileSettings_durationMode' - To create an output that complies with the XAVC file format guidelines
-- for interoperability, keep the default value, Drop frames for compliance
-- (DROP_FRAMES_FOR_COMPLIANCE). To include all frames from your input in
-- this output, keep the default setting, Allow any duration
-- (ALLOW_ANY_DURATION). The number of frames that MediaConvert excludes
-- when you set this to Drop frames for compliance depends on the output
-- frame rate and duration.
--
-- 'maxAncDataSize', 'mxfXavcProfileSettings_maxAncDataSize' - Specify a value for this setting only for outputs that you set up with
-- one of these two XAVC profiles: XAVC HD Intra CBG (XAVC_HD_INTRA_CBG) or
-- XAVC 4K Intra CBG (XAVC_4K_INTRA_CBG). Specify the amount of space in
-- each frame that the service reserves for ancillary data, such as
-- teletext captions. The default value for this setting is 1492 bytes per
-- frame. This should be sufficient to prevent overflow unless you have
-- multiple pages of teletext captions data. If you have a large amount of
-- teletext data, specify a larger number.
newMxfXavcProfileSettings ::
  MxfXavcProfileSettings
newMxfXavcProfileSettings :: MxfXavcProfileSettings
newMxfXavcProfileSettings =
  MxfXavcProfileSettings'
    { $sel:durationMode:MxfXavcProfileSettings' :: Maybe MxfXavcDurationMode
durationMode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxAncDataSize:MxfXavcProfileSettings' :: Maybe Natural
maxAncDataSize = forall a. Maybe a
Prelude.Nothing
    }

-- | To create an output that complies with the XAVC file format guidelines
-- for interoperability, keep the default value, Drop frames for compliance
-- (DROP_FRAMES_FOR_COMPLIANCE). To include all frames from your input in
-- this output, keep the default setting, Allow any duration
-- (ALLOW_ANY_DURATION). The number of frames that MediaConvert excludes
-- when you set this to Drop frames for compliance depends on the output
-- frame rate and duration.
mxfXavcProfileSettings_durationMode :: Lens.Lens' MxfXavcProfileSettings (Prelude.Maybe MxfXavcDurationMode)
mxfXavcProfileSettings_durationMode :: Lens' MxfXavcProfileSettings (Maybe MxfXavcDurationMode)
mxfXavcProfileSettings_durationMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MxfXavcProfileSettings' {Maybe MxfXavcDurationMode
durationMode :: Maybe MxfXavcDurationMode
$sel:durationMode:MxfXavcProfileSettings' :: MxfXavcProfileSettings -> Maybe MxfXavcDurationMode
durationMode} -> Maybe MxfXavcDurationMode
durationMode) (\s :: MxfXavcProfileSettings
s@MxfXavcProfileSettings' {} Maybe MxfXavcDurationMode
a -> MxfXavcProfileSettings
s {$sel:durationMode:MxfXavcProfileSettings' :: Maybe MxfXavcDurationMode
durationMode = Maybe MxfXavcDurationMode
a} :: MxfXavcProfileSettings)

-- | Specify a value for this setting only for outputs that you set up with
-- one of these two XAVC profiles: XAVC HD Intra CBG (XAVC_HD_INTRA_CBG) or
-- XAVC 4K Intra CBG (XAVC_4K_INTRA_CBG). Specify the amount of space in
-- each frame that the service reserves for ancillary data, such as
-- teletext captions. The default value for this setting is 1492 bytes per
-- frame. This should be sufficient to prevent overflow unless you have
-- multiple pages of teletext captions data. If you have a large amount of
-- teletext data, specify a larger number.
mxfXavcProfileSettings_maxAncDataSize :: Lens.Lens' MxfXavcProfileSettings (Prelude.Maybe Prelude.Natural)
mxfXavcProfileSettings_maxAncDataSize :: Lens' MxfXavcProfileSettings (Maybe Natural)
mxfXavcProfileSettings_maxAncDataSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MxfXavcProfileSettings' {Maybe Natural
maxAncDataSize :: Maybe Natural
$sel:maxAncDataSize:MxfXavcProfileSettings' :: MxfXavcProfileSettings -> Maybe Natural
maxAncDataSize} -> Maybe Natural
maxAncDataSize) (\s :: MxfXavcProfileSettings
s@MxfXavcProfileSettings' {} Maybe Natural
a -> MxfXavcProfileSettings
s {$sel:maxAncDataSize:MxfXavcProfileSettings' :: Maybe Natural
maxAncDataSize = Maybe Natural
a} :: MxfXavcProfileSettings)

instance Data.FromJSON MxfXavcProfileSettings where
  parseJSON :: Value -> Parser MxfXavcProfileSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MxfXavcProfileSettings"
      ( \Object
x ->
          Maybe MxfXavcDurationMode
-> Maybe Natural -> MxfXavcProfileSettings
MxfXavcProfileSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"durationMode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"maxAncDataSize")
      )

instance Prelude.Hashable MxfXavcProfileSettings where
  hashWithSalt :: Int -> MxfXavcProfileSettings -> Int
hashWithSalt Int
_salt MxfXavcProfileSettings' {Maybe Natural
Maybe MxfXavcDurationMode
maxAncDataSize :: Maybe Natural
durationMode :: Maybe MxfXavcDurationMode
$sel:maxAncDataSize:MxfXavcProfileSettings' :: MxfXavcProfileSettings -> Maybe Natural
$sel:durationMode:MxfXavcProfileSettings' :: MxfXavcProfileSettings -> Maybe MxfXavcDurationMode
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MxfXavcDurationMode
durationMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxAncDataSize

instance Prelude.NFData MxfXavcProfileSettings where
  rnf :: MxfXavcProfileSettings -> ()
rnf MxfXavcProfileSettings' {Maybe Natural
Maybe MxfXavcDurationMode
maxAncDataSize :: Maybe Natural
durationMode :: Maybe MxfXavcDurationMode
$sel:maxAncDataSize:MxfXavcProfileSettings' :: MxfXavcProfileSettings -> Maybe Natural
$sel:durationMode:MxfXavcProfileSettings' :: MxfXavcProfileSettings -> Maybe MxfXavcDurationMode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MxfXavcDurationMode
durationMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxAncDataSize

instance Data.ToJSON MxfXavcProfileSettings where
  toJSON :: MxfXavcProfileSettings -> Value
toJSON MxfXavcProfileSettings' {Maybe Natural
Maybe MxfXavcDurationMode
maxAncDataSize :: Maybe Natural
durationMode :: Maybe MxfXavcDurationMode
$sel:maxAncDataSize:MxfXavcProfileSettings' :: MxfXavcProfileSettings -> Maybe Natural
$sel:durationMode:MxfXavcProfileSettings' :: MxfXavcProfileSettings -> Maybe MxfXavcDurationMode
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"durationMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MxfXavcDurationMode
durationMode,
            (Key
"maxAncDataSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxAncDataSize
          ]
      )