{-# 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.MovSettings
-- 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.MovSettings 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.MovClapAtom
import Amazonka.MediaConvert.Types.MovCslgAtom
import Amazonka.MediaConvert.Types.MovMpeg2FourCCControl
import Amazonka.MediaConvert.Types.MovPaddingControl
import Amazonka.MediaConvert.Types.MovReference
import qualified Amazonka.Prelude as Prelude

-- | These settings relate to your QuickTime MOV output container.
--
-- /See:/ 'newMovSettings' smart constructor.
data MovSettings = MovSettings'
  { -- | When enabled, include \'clap\' atom if appropriate for the video output
    -- settings.
    MovSettings -> Maybe MovClapAtom
clapAtom :: Prelude.Maybe MovClapAtom,
    -- | When enabled, file composition times will start at zero, composition
    -- times in the \'ctts\' (composition time to sample) box for B-frames will
    -- be negative, and a \'cslg\' (composition shift least greatest) box will
    -- be included per 14496-1 amendment 1. This improves compatibility with
    -- Apple players and tools.
    MovSettings -> Maybe MovCslgAtom
cslgAtom :: Prelude.Maybe MovCslgAtom,
    -- | When set to XDCAM, writes MPEG2 video streams into the QuickTime file
    -- using XDCAM fourcc codes. This increases compatibility with Apple
    -- editors and players, but may decrease compatibility with other players.
    -- Only applicable when the video codec is MPEG2.
    MovSettings -> Maybe MovMpeg2FourCCControl
mpeg2FourCCControl :: Prelude.Maybe MovMpeg2FourCCControl,
    -- | To make this output compatible with Omenon, keep the default value,
    -- OMNEON. Unless you need Omneon compatibility, set this value to NONE.
    -- When you keep the default value, OMNEON, MediaConvert increases the
    -- length of the edit list atom. This might cause file rejections when a
    -- recipient of the output file doesn\'t expct this extra padding.
    MovSettings -> Maybe MovPaddingControl
paddingControl :: Prelude.Maybe MovPaddingControl,
    -- | Always keep the default value (SELF_CONTAINED) for this setting.
    MovSettings -> Maybe MovReference
reference :: Prelude.Maybe MovReference
  }
  deriving (MovSettings -> MovSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MovSettings -> MovSettings -> Bool
$c/= :: MovSettings -> MovSettings -> Bool
== :: MovSettings -> MovSettings -> Bool
$c== :: MovSettings -> MovSettings -> Bool
Prelude.Eq, ReadPrec [MovSettings]
ReadPrec MovSettings
Int -> ReadS MovSettings
ReadS [MovSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MovSettings]
$creadListPrec :: ReadPrec [MovSettings]
readPrec :: ReadPrec MovSettings
$creadPrec :: ReadPrec MovSettings
readList :: ReadS [MovSettings]
$creadList :: ReadS [MovSettings]
readsPrec :: Int -> ReadS MovSettings
$creadsPrec :: Int -> ReadS MovSettings
Prelude.Read, Int -> MovSettings -> ShowS
[MovSettings] -> ShowS
MovSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MovSettings] -> ShowS
$cshowList :: [MovSettings] -> ShowS
show :: MovSettings -> String
$cshow :: MovSettings -> String
showsPrec :: Int -> MovSettings -> ShowS
$cshowsPrec :: Int -> MovSettings -> ShowS
Prelude.Show, forall x. Rep MovSettings x -> MovSettings
forall x. MovSettings -> Rep MovSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MovSettings x -> MovSettings
$cfrom :: forall x. MovSettings -> Rep MovSettings x
Prelude.Generic)

-- |
-- Create a value of 'MovSettings' 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:
--
-- 'clapAtom', 'movSettings_clapAtom' - When enabled, include \'clap\' atom if appropriate for the video output
-- settings.
--
-- 'cslgAtom', 'movSettings_cslgAtom' - When enabled, file composition times will start at zero, composition
-- times in the \'ctts\' (composition time to sample) box for B-frames will
-- be negative, and a \'cslg\' (composition shift least greatest) box will
-- be included per 14496-1 amendment 1. This improves compatibility with
-- Apple players and tools.
--
-- 'mpeg2FourCCControl', 'movSettings_mpeg2FourCCControl' - When set to XDCAM, writes MPEG2 video streams into the QuickTime file
-- using XDCAM fourcc codes. This increases compatibility with Apple
-- editors and players, but may decrease compatibility with other players.
-- Only applicable when the video codec is MPEG2.
--
-- 'paddingControl', 'movSettings_paddingControl' - To make this output compatible with Omenon, keep the default value,
-- OMNEON. Unless you need Omneon compatibility, set this value to NONE.
-- When you keep the default value, OMNEON, MediaConvert increases the
-- length of the edit list atom. This might cause file rejections when a
-- recipient of the output file doesn\'t expct this extra padding.
--
-- 'reference', 'movSettings_reference' - Always keep the default value (SELF_CONTAINED) for this setting.
newMovSettings ::
  MovSettings
newMovSettings :: MovSettings
newMovSettings =
  MovSettings'
    { $sel:clapAtom:MovSettings' :: Maybe MovClapAtom
clapAtom = forall a. Maybe a
Prelude.Nothing,
      $sel:cslgAtom:MovSettings' :: Maybe MovCslgAtom
cslgAtom = forall a. Maybe a
Prelude.Nothing,
      $sel:mpeg2FourCCControl:MovSettings' :: Maybe MovMpeg2FourCCControl
mpeg2FourCCControl = forall a. Maybe a
Prelude.Nothing,
      $sel:paddingControl:MovSettings' :: Maybe MovPaddingControl
paddingControl = forall a. Maybe a
Prelude.Nothing,
      $sel:reference:MovSettings' :: Maybe MovReference
reference = forall a. Maybe a
Prelude.Nothing
    }

-- | When enabled, include \'clap\' atom if appropriate for the video output
-- settings.
movSettings_clapAtom :: Lens.Lens' MovSettings (Prelude.Maybe MovClapAtom)
movSettings_clapAtom :: Lens' MovSettings (Maybe MovClapAtom)
movSettings_clapAtom = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MovSettings' {Maybe MovClapAtom
clapAtom :: Maybe MovClapAtom
$sel:clapAtom:MovSettings' :: MovSettings -> Maybe MovClapAtom
clapAtom} -> Maybe MovClapAtom
clapAtom) (\s :: MovSettings
s@MovSettings' {} Maybe MovClapAtom
a -> MovSettings
s {$sel:clapAtom:MovSettings' :: Maybe MovClapAtom
clapAtom = Maybe MovClapAtom
a} :: MovSettings)

-- | When enabled, file composition times will start at zero, composition
-- times in the \'ctts\' (composition time to sample) box for B-frames will
-- be negative, and a \'cslg\' (composition shift least greatest) box will
-- be included per 14496-1 amendment 1. This improves compatibility with
-- Apple players and tools.
movSettings_cslgAtom :: Lens.Lens' MovSettings (Prelude.Maybe MovCslgAtom)
movSettings_cslgAtom :: Lens' MovSettings (Maybe MovCslgAtom)
movSettings_cslgAtom = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MovSettings' {Maybe MovCslgAtom
cslgAtom :: Maybe MovCslgAtom
$sel:cslgAtom:MovSettings' :: MovSettings -> Maybe MovCslgAtom
cslgAtom} -> Maybe MovCslgAtom
cslgAtom) (\s :: MovSettings
s@MovSettings' {} Maybe MovCslgAtom
a -> MovSettings
s {$sel:cslgAtom:MovSettings' :: Maybe MovCslgAtom
cslgAtom = Maybe MovCslgAtom
a} :: MovSettings)

-- | When set to XDCAM, writes MPEG2 video streams into the QuickTime file
-- using XDCAM fourcc codes. This increases compatibility with Apple
-- editors and players, but may decrease compatibility with other players.
-- Only applicable when the video codec is MPEG2.
movSettings_mpeg2FourCCControl :: Lens.Lens' MovSettings (Prelude.Maybe MovMpeg2FourCCControl)
movSettings_mpeg2FourCCControl :: Lens' MovSettings (Maybe MovMpeg2FourCCControl)
movSettings_mpeg2FourCCControl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MovSettings' {Maybe MovMpeg2FourCCControl
mpeg2FourCCControl :: Maybe MovMpeg2FourCCControl
$sel:mpeg2FourCCControl:MovSettings' :: MovSettings -> Maybe MovMpeg2FourCCControl
mpeg2FourCCControl} -> Maybe MovMpeg2FourCCControl
mpeg2FourCCControl) (\s :: MovSettings
s@MovSettings' {} Maybe MovMpeg2FourCCControl
a -> MovSettings
s {$sel:mpeg2FourCCControl:MovSettings' :: Maybe MovMpeg2FourCCControl
mpeg2FourCCControl = Maybe MovMpeg2FourCCControl
a} :: MovSettings)

-- | To make this output compatible with Omenon, keep the default value,
-- OMNEON. Unless you need Omneon compatibility, set this value to NONE.
-- When you keep the default value, OMNEON, MediaConvert increases the
-- length of the edit list atom. This might cause file rejections when a
-- recipient of the output file doesn\'t expct this extra padding.
movSettings_paddingControl :: Lens.Lens' MovSettings (Prelude.Maybe MovPaddingControl)
movSettings_paddingControl :: Lens' MovSettings (Maybe MovPaddingControl)
movSettings_paddingControl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MovSettings' {Maybe MovPaddingControl
paddingControl :: Maybe MovPaddingControl
$sel:paddingControl:MovSettings' :: MovSettings -> Maybe MovPaddingControl
paddingControl} -> Maybe MovPaddingControl
paddingControl) (\s :: MovSettings
s@MovSettings' {} Maybe MovPaddingControl
a -> MovSettings
s {$sel:paddingControl:MovSettings' :: Maybe MovPaddingControl
paddingControl = Maybe MovPaddingControl
a} :: MovSettings)

-- | Always keep the default value (SELF_CONTAINED) for this setting.
movSettings_reference :: Lens.Lens' MovSettings (Prelude.Maybe MovReference)
movSettings_reference :: Lens' MovSettings (Maybe MovReference)
movSettings_reference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MovSettings' {Maybe MovReference
reference :: Maybe MovReference
$sel:reference:MovSettings' :: MovSettings -> Maybe MovReference
reference} -> Maybe MovReference
reference) (\s :: MovSettings
s@MovSettings' {} Maybe MovReference
a -> MovSettings
s {$sel:reference:MovSettings' :: Maybe MovReference
reference = Maybe MovReference
a} :: MovSettings)

instance Data.FromJSON MovSettings where
  parseJSON :: Value -> Parser MovSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MovSettings"
      ( \Object
x ->
          Maybe MovClapAtom
-> Maybe MovCslgAtom
-> Maybe MovMpeg2FourCCControl
-> Maybe MovPaddingControl
-> Maybe MovReference
-> MovSettings
MovSettings'
            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
"clapAtom")
            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
"cslgAtom")
            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
"mpeg2FourCCControl")
            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
"paddingControl")
            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
"reference")
      )

instance Prelude.Hashable MovSettings where
  hashWithSalt :: Int -> MovSettings -> Int
hashWithSalt Int
_salt MovSettings' {Maybe MovClapAtom
Maybe MovCslgAtom
Maybe MovMpeg2FourCCControl
Maybe MovPaddingControl
Maybe MovReference
reference :: Maybe MovReference
paddingControl :: Maybe MovPaddingControl
mpeg2FourCCControl :: Maybe MovMpeg2FourCCControl
cslgAtom :: Maybe MovCslgAtom
clapAtom :: Maybe MovClapAtom
$sel:reference:MovSettings' :: MovSettings -> Maybe MovReference
$sel:paddingControl:MovSettings' :: MovSettings -> Maybe MovPaddingControl
$sel:mpeg2FourCCControl:MovSettings' :: MovSettings -> Maybe MovMpeg2FourCCControl
$sel:cslgAtom:MovSettings' :: MovSettings -> Maybe MovCslgAtom
$sel:clapAtom:MovSettings' :: MovSettings -> Maybe MovClapAtom
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MovClapAtom
clapAtom
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MovCslgAtom
cslgAtom
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MovMpeg2FourCCControl
mpeg2FourCCControl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MovPaddingControl
paddingControl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MovReference
reference

instance Prelude.NFData MovSettings where
  rnf :: MovSettings -> ()
rnf MovSettings' {Maybe MovClapAtom
Maybe MovCslgAtom
Maybe MovMpeg2FourCCControl
Maybe MovPaddingControl
Maybe MovReference
reference :: Maybe MovReference
paddingControl :: Maybe MovPaddingControl
mpeg2FourCCControl :: Maybe MovMpeg2FourCCControl
cslgAtom :: Maybe MovCslgAtom
clapAtom :: Maybe MovClapAtom
$sel:reference:MovSettings' :: MovSettings -> Maybe MovReference
$sel:paddingControl:MovSettings' :: MovSettings -> Maybe MovPaddingControl
$sel:mpeg2FourCCControl:MovSettings' :: MovSettings -> Maybe MovMpeg2FourCCControl
$sel:cslgAtom:MovSettings' :: MovSettings -> Maybe MovCslgAtom
$sel:clapAtom:MovSettings' :: MovSettings -> Maybe MovClapAtom
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MovClapAtom
clapAtom
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MovCslgAtom
cslgAtom
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MovMpeg2FourCCControl
mpeg2FourCCControl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MovPaddingControl
paddingControl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MovReference
reference

instance Data.ToJSON MovSettings where
  toJSON :: MovSettings -> Value
toJSON MovSettings' {Maybe MovClapAtom
Maybe MovCslgAtom
Maybe MovMpeg2FourCCControl
Maybe MovPaddingControl
Maybe MovReference
reference :: Maybe MovReference
paddingControl :: Maybe MovPaddingControl
mpeg2FourCCControl :: Maybe MovMpeg2FourCCControl
cslgAtom :: Maybe MovCslgAtom
clapAtom :: Maybe MovClapAtom
$sel:reference:MovSettings' :: MovSettings -> Maybe MovReference
$sel:paddingControl:MovSettings' :: MovSettings -> Maybe MovPaddingControl
$sel:mpeg2FourCCControl:MovSettings' :: MovSettings -> Maybe MovMpeg2FourCCControl
$sel:cslgAtom:MovSettings' :: MovSettings -> Maybe MovCslgAtom
$sel:clapAtom:MovSettings' :: MovSettings -> Maybe MovClapAtom
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"clapAtom" 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 MovClapAtom
clapAtom,
            (Key
"cslgAtom" 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 MovCslgAtom
cslgAtom,
            (Key
"mpeg2FourCCControl" 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 MovMpeg2FourCCControl
mpeg2FourCCControl,
            (Key
"paddingControl" 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 MovPaddingControl
paddingControl,
            (Key
"reference" 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 MovReference
reference
          ]
      )