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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | Always keep the default value (SELF_CONTAINED) for this setting.
    MovSettings -> Maybe MovReference
reference :: Prelude.Maybe MovReference,
    -- | 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,
    -- | When enabled, include \'clap\' atom if appropriate for the video output
    -- settings.
    MovSettings -> Maybe MovClapAtom
clapAtom :: Prelude.Maybe MovClapAtom
  }
  deriving (MovSettings -> MovSettings -> Bool
(MovSettings -> MovSettings -> Bool)
-> (MovSettings -> MovSettings -> Bool) -> Eq MovSettings
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]
(Int -> ReadS MovSettings)
-> ReadS [MovSettings]
-> ReadPrec MovSettings
-> ReadPrec [MovSettings]
-> Read 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
(Int -> MovSettings -> ShowS)
-> (MovSettings -> String)
-> ([MovSettings] -> ShowS)
-> Show MovSettings
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. MovSettings -> Rep MovSettings x)
-> (forall x. Rep MovSettings x -> MovSettings)
-> Generic MovSettings
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:
--
-- 'reference', 'movSettings_reference' - Always keep the default value (SELF_CONTAINED) for this setting.
--
-- '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.
--
-- 'clapAtom', 'movSettings_clapAtom' - When enabled, include \'clap\' atom if appropriate for the video output
-- settings.
newMovSettings ::
  MovSettings
newMovSettings :: MovSettings
newMovSettings =
  MovSettings' :: Maybe MovReference
-> Maybe MovCslgAtom
-> Maybe MovMpeg2FourCCControl
-> Maybe MovPaddingControl
-> Maybe MovClapAtom
-> MovSettings
MovSettings'
    { $sel:reference:MovSettings' :: Maybe MovReference
reference = Maybe MovReference
forall a. Maybe a
Prelude.Nothing,
      $sel:cslgAtom:MovSettings' :: Maybe MovCslgAtom
cslgAtom = Maybe MovCslgAtom
forall a. Maybe a
Prelude.Nothing,
      $sel:mpeg2FourCCControl:MovSettings' :: Maybe MovMpeg2FourCCControl
mpeg2FourCCControl = Maybe MovMpeg2FourCCControl
forall a. Maybe a
Prelude.Nothing,
      $sel:paddingControl:MovSettings' :: Maybe MovPaddingControl
paddingControl = Maybe MovPaddingControl
forall a. Maybe a
Prelude.Nothing,
      $sel:clapAtom:MovSettings' :: Maybe MovClapAtom
clapAtom = Maybe MovClapAtom
forall a. Maybe a
Prelude.Nothing
    }

-- | Always keep the default value (SELF_CONTAINED) for this setting.
movSettings_reference :: Lens.Lens' MovSettings (Prelude.Maybe MovReference)
movSettings_reference :: (Maybe MovReference -> f (Maybe MovReference))
-> MovSettings -> f MovSettings
movSettings_reference = (MovSettings -> Maybe MovReference)
-> (MovSettings -> Maybe MovReference -> MovSettings)
-> Lens
     MovSettings MovSettings (Maybe MovReference) (Maybe MovReference)
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)

-- | 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 :: (Maybe MovCslgAtom -> f (Maybe MovCslgAtom))
-> MovSettings -> f MovSettings
movSettings_cslgAtom = (MovSettings -> Maybe MovCslgAtom)
-> (MovSettings -> Maybe MovCslgAtom -> MovSettings)
-> Lens
     MovSettings MovSettings (Maybe MovCslgAtom) (Maybe MovCslgAtom)
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 :: (Maybe MovMpeg2FourCCControl -> f (Maybe MovMpeg2FourCCControl))
-> MovSettings -> f MovSettings
movSettings_mpeg2FourCCControl = (MovSettings -> Maybe MovMpeg2FourCCControl)
-> (MovSettings -> Maybe MovMpeg2FourCCControl -> MovSettings)
-> Lens
     MovSettings
     MovSettings
     (Maybe MovMpeg2FourCCControl)
     (Maybe MovMpeg2FourCCControl)
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 :: (Maybe MovPaddingControl -> f (Maybe MovPaddingControl))
-> MovSettings -> f MovSettings
movSettings_paddingControl = (MovSettings -> Maybe MovPaddingControl)
-> (MovSettings -> Maybe MovPaddingControl -> MovSettings)
-> Lens
     MovSettings
     MovSettings
     (Maybe MovPaddingControl)
     (Maybe MovPaddingControl)
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)

-- | When enabled, include \'clap\' atom if appropriate for the video output
-- settings.
movSettings_clapAtom :: Lens.Lens' MovSettings (Prelude.Maybe MovClapAtom)
movSettings_clapAtom :: (Maybe MovClapAtom -> f (Maybe MovClapAtom))
-> MovSettings -> f MovSettings
movSettings_clapAtom = (MovSettings -> Maybe MovClapAtom)
-> (MovSettings -> Maybe MovClapAtom -> MovSettings)
-> Lens
     MovSettings MovSettings (Maybe MovClapAtom) (Maybe MovClapAtom)
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)

instance Core.FromJSON MovSettings where
  parseJSON :: Value -> Parser MovSettings
parseJSON =
    String
-> (Object -> Parser MovSettings) -> Value -> Parser MovSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MovSettings"
      ( \Object
x ->
          Maybe MovReference
-> Maybe MovCslgAtom
-> Maybe MovMpeg2FourCCControl
-> Maybe MovPaddingControl
-> Maybe MovClapAtom
-> MovSettings
MovSettings'
            (Maybe MovReference
 -> Maybe MovCslgAtom
 -> Maybe MovMpeg2FourCCControl
 -> Maybe MovPaddingControl
 -> Maybe MovClapAtom
 -> MovSettings)
-> Parser (Maybe MovReference)
-> Parser
     (Maybe MovCslgAtom
      -> Maybe MovMpeg2FourCCControl
      -> Maybe MovPaddingControl
      -> Maybe MovClapAtom
      -> MovSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MovReference)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reference")
            Parser
  (Maybe MovCslgAtom
   -> Maybe MovMpeg2FourCCControl
   -> Maybe MovPaddingControl
   -> Maybe MovClapAtom
   -> MovSettings)
-> Parser (Maybe MovCslgAtom)
-> Parser
     (Maybe MovMpeg2FourCCControl
      -> Maybe MovPaddingControl -> Maybe MovClapAtom -> MovSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MovCslgAtom)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cslgAtom")
            Parser
  (Maybe MovMpeg2FourCCControl
   -> Maybe MovPaddingControl -> Maybe MovClapAtom -> MovSettings)
-> Parser (Maybe MovMpeg2FourCCControl)
-> Parser
     (Maybe MovPaddingControl -> Maybe MovClapAtom -> MovSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MovMpeg2FourCCControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mpeg2FourCCControl")
            Parser
  (Maybe MovPaddingControl -> Maybe MovClapAtom -> MovSettings)
-> Parser (Maybe MovPaddingControl)
-> Parser (Maybe MovClapAtom -> MovSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MovPaddingControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"paddingControl")
            Parser (Maybe MovClapAtom -> MovSettings)
-> Parser (Maybe MovClapAtom) -> Parser MovSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MovClapAtom)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clapAtom")
      )

instance Prelude.Hashable MovSettings

instance Prelude.NFData MovSettings

instance Core.ToJSON MovSettings where
  toJSON :: MovSettings -> Value
toJSON MovSettings' {Maybe MovClapAtom
Maybe MovCslgAtom
Maybe MovMpeg2FourCCControl
Maybe MovPaddingControl
Maybe MovReference
clapAtom :: Maybe MovClapAtom
paddingControl :: Maybe MovPaddingControl
mpeg2FourCCControl :: Maybe MovMpeg2FourCCControl
cslgAtom :: Maybe MovCslgAtom
reference :: Maybe MovReference
$sel:clapAtom:MovSettings' :: MovSettings -> Maybe MovClapAtom
$sel:paddingControl:MovSettings' :: MovSettings -> Maybe MovPaddingControl
$sel:mpeg2FourCCControl:MovSettings' :: MovSettings -> Maybe MovMpeg2FourCCControl
$sel:cslgAtom:MovSettings' :: MovSettings -> Maybe MovCslgAtom
$sel:reference:MovSettings' :: MovSettings -> Maybe MovReference
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"reference" Text -> MovReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MovReference -> Pair) -> Maybe MovReference -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MovReference
reference,
            (Text
"cslgAtom" Text -> MovCslgAtom -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MovCslgAtom -> Pair) -> Maybe MovCslgAtom -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MovCslgAtom
cslgAtom,
            (Text
"mpeg2FourCCControl" Text -> MovMpeg2FourCCControl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MovMpeg2FourCCControl -> Pair)
-> Maybe MovMpeg2FourCCControl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MovMpeg2FourCCControl
mpeg2FourCCControl,
            (Text
"paddingControl" Text -> MovPaddingControl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MovPaddingControl -> Pair)
-> Maybe MovPaddingControl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MovPaddingControl
paddingControl,
            (Text
"clapAtom" Text -> MovClapAtom -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MovClapAtom -> Pair) -> Maybe MovClapAtom -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MovClapAtom
clapAtom
          ]
      )