{-# 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-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.MxfXavcProfileSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | 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
  }
  deriving (MxfXavcProfileSettings -> MxfXavcProfileSettings -> Bool
(MxfXavcProfileSettings -> MxfXavcProfileSettings -> Bool)
-> (MxfXavcProfileSettings -> MxfXavcProfileSettings -> Bool)
-> Eq MxfXavcProfileSettings
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]
(Int -> ReadS MxfXavcProfileSettings)
-> ReadS [MxfXavcProfileSettings]
-> ReadPrec MxfXavcProfileSettings
-> ReadPrec [MxfXavcProfileSettings]
-> Read 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
(Int -> MxfXavcProfileSettings -> ShowS)
-> (MxfXavcProfileSettings -> String)
-> ([MxfXavcProfileSettings] -> ShowS)
-> Show MxfXavcProfileSettings
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. MxfXavcProfileSettings -> Rep MxfXavcProfileSettings x)
-> (forall x.
    Rep MxfXavcProfileSettings x -> MxfXavcProfileSettings)
-> Generic MxfXavcProfileSettings
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:
--
-- '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.
--
-- '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.
newMxfXavcProfileSettings ::
  MxfXavcProfileSettings
newMxfXavcProfileSettings :: MxfXavcProfileSettings
newMxfXavcProfileSettings =
  MxfXavcProfileSettings' :: Maybe Natural
-> Maybe MxfXavcDurationMode -> MxfXavcProfileSettings
MxfXavcProfileSettings'
    { $sel:maxAncDataSize:MxfXavcProfileSettings' :: Maybe Natural
maxAncDataSize =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:durationMode:MxfXavcProfileSettings' :: Maybe MxfXavcDurationMode
durationMode = Maybe MxfXavcDurationMode
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> MxfXavcProfileSettings -> f MxfXavcProfileSettings
mxfXavcProfileSettings_maxAncDataSize = (MxfXavcProfileSettings -> Maybe Natural)
-> (MxfXavcProfileSettings
    -> Maybe Natural -> MxfXavcProfileSettings)
-> Lens
     MxfXavcProfileSettings
     MxfXavcProfileSettings
     (Maybe Natural)
     (Maybe Natural)
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)

-- | 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 :: (Maybe MxfXavcDurationMode -> f (Maybe MxfXavcDurationMode))
-> MxfXavcProfileSettings -> f MxfXavcProfileSettings
mxfXavcProfileSettings_durationMode = (MxfXavcProfileSettings -> Maybe MxfXavcDurationMode)
-> (MxfXavcProfileSettings
    -> Maybe MxfXavcDurationMode -> MxfXavcProfileSettings)
-> Lens
     MxfXavcProfileSettings
     MxfXavcProfileSettings
     (Maybe MxfXavcDurationMode)
     (Maybe MxfXavcDurationMode)
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)

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

instance Prelude.Hashable MxfXavcProfileSettings

instance Prelude.NFData MxfXavcProfileSettings

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