{-# 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.MediaConnect.Types.Fmtp
-- 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.MediaConnect.Types.Fmtp where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.Colorimetry
import Amazonka.MediaConnect.Types.Range
import Amazonka.MediaConnect.Types.ScanMode
import Amazonka.MediaConnect.Types.Tcs
import qualified Amazonka.Prelude as Prelude

-- | FMTP
--
-- /See:/ 'newFmtp' smart constructor.
data Fmtp = Fmtp'
  { -- | The transfer characteristic system (TCS) that is used in the video.
    Fmtp -> Maybe Tcs
tcs :: Prelude.Maybe Tcs,
    -- | The frame rate for the video stream, in frames\/second. For example:
    -- 60000\/1001. If you specify a whole number, MediaConnect uses a ratio of
    -- N\/1. For example, if you specify 60, MediaConnect uses 60\/1 as the
    -- exactFramerate.
    Fmtp -> Maybe Text
exactFramerate :: Prelude.Maybe Prelude.Text,
    -- | The pixel aspect ratio (PAR) of the video.
    Fmtp -> Maybe Text
par :: Prelude.Maybe Prelude.Text,
    -- | The type of compression that was used to smooth the video’s appearance
    Fmtp -> Maybe ScanMode
scanMode :: Prelude.Maybe ScanMode,
    -- | The encoding range of the video.
    Fmtp -> Maybe Range
range :: Prelude.Maybe Range,
    -- | The format of the audio channel.
    Fmtp -> Maybe Text
channelOrder :: Prelude.Maybe Prelude.Text,
    -- | The format that is used for the representation of color.
    Fmtp -> Maybe Colorimetry
colorimetry :: Prelude.Maybe Colorimetry
  }
  deriving (Fmtp -> Fmtp -> Bool
(Fmtp -> Fmtp -> Bool) -> (Fmtp -> Fmtp -> Bool) -> Eq Fmtp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Fmtp -> Fmtp -> Bool
$c/= :: Fmtp -> Fmtp -> Bool
== :: Fmtp -> Fmtp -> Bool
$c== :: Fmtp -> Fmtp -> Bool
Prelude.Eq, ReadPrec [Fmtp]
ReadPrec Fmtp
Int -> ReadS Fmtp
ReadS [Fmtp]
(Int -> ReadS Fmtp)
-> ReadS [Fmtp] -> ReadPrec Fmtp -> ReadPrec [Fmtp] -> Read Fmtp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Fmtp]
$creadListPrec :: ReadPrec [Fmtp]
readPrec :: ReadPrec Fmtp
$creadPrec :: ReadPrec Fmtp
readList :: ReadS [Fmtp]
$creadList :: ReadS [Fmtp]
readsPrec :: Int -> ReadS Fmtp
$creadsPrec :: Int -> ReadS Fmtp
Prelude.Read, Int -> Fmtp -> ShowS
[Fmtp] -> ShowS
Fmtp -> String
(Int -> Fmtp -> ShowS)
-> (Fmtp -> String) -> ([Fmtp] -> ShowS) -> Show Fmtp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Fmtp] -> ShowS
$cshowList :: [Fmtp] -> ShowS
show :: Fmtp -> String
$cshow :: Fmtp -> String
showsPrec :: Int -> Fmtp -> ShowS
$cshowsPrec :: Int -> Fmtp -> ShowS
Prelude.Show, (forall x. Fmtp -> Rep Fmtp x)
-> (forall x. Rep Fmtp x -> Fmtp) -> Generic Fmtp
forall x. Rep Fmtp x -> Fmtp
forall x. Fmtp -> Rep Fmtp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Fmtp x -> Fmtp
$cfrom :: forall x. Fmtp -> Rep Fmtp x
Prelude.Generic)

-- |
-- Create a value of 'Fmtp' 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:
--
-- 'tcs', 'fmtp_tcs' - The transfer characteristic system (TCS) that is used in the video.
--
-- 'exactFramerate', 'fmtp_exactFramerate' - The frame rate for the video stream, in frames\/second. For example:
-- 60000\/1001. If you specify a whole number, MediaConnect uses a ratio of
-- N\/1. For example, if you specify 60, MediaConnect uses 60\/1 as the
-- exactFramerate.
--
-- 'par', 'fmtp_par' - The pixel aspect ratio (PAR) of the video.
--
-- 'scanMode', 'fmtp_scanMode' - The type of compression that was used to smooth the video’s appearance
--
-- 'range', 'fmtp_range' - The encoding range of the video.
--
-- 'channelOrder', 'fmtp_channelOrder' - The format of the audio channel.
--
-- 'colorimetry', 'fmtp_colorimetry' - The format that is used for the representation of color.
newFmtp ::
  Fmtp
newFmtp :: Fmtp
newFmtp =
  Fmtp' :: Maybe Tcs
-> Maybe Text
-> Maybe Text
-> Maybe ScanMode
-> Maybe Range
-> Maybe Text
-> Maybe Colorimetry
-> Fmtp
Fmtp'
    { $sel:tcs:Fmtp' :: Maybe Tcs
tcs = Maybe Tcs
forall a. Maybe a
Prelude.Nothing,
      $sel:exactFramerate:Fmtp' :: Maybe Text
exactFramerate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:par:Fmtp' :: Maybe Text
par = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scanMode:Fmtp' :: Maybe ScanMode
scanMode = Maybe ScanMode
forall a. Maybe a
Prelude.Nothing,
      $sel:range:Fmtp' :: Maybe Range
range = Maybe Range
forall a. Maybe a
Prelude.Nothing,
      $sel:channelOrder:Fmtp' :: Maybe Text
channelOrder = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:colorimetry:Fmtp' :: Maybe Colorimetry
colorimetry = Maybe Colorimetry
forall a. Maybe a
Prelude.Nothing
    }

-- | The transfer characteristic system (TCS) that is used in the video.
fmtp_tcs :: Lens.Lens' Fmtp (Prelude.Maybe Tcs)
fmtp_tcs :: (Maybe Tcs -> f (Maybe Tcs)) -> Fmtp -> f Fmtp
fmtp_tcs = (Fmtp -> Maybe Tcs)
-> (Fmtp -> Maybe Tcs -> Fmtp)
-> Lens Fmtp Fmtp (Maybe Tcs) (Maybe Tcs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmtp' {Maybe Tcs
tcs :: Maybe Tcs
$sel:tcs:Fmtp' :: Fmtp -> Maybe Tcs
tcs} -> Maybe Tcs
tcs) (\s :: Fmtp
s@Fmtp' {} Maybe Tcs
a -> Fmtp
s {$sel:tcs:Fmtp' :: Maybe Tcs
tcs = Maybe Tcs
a} :: Fmtp)

-- | The frame rate for the video stream, in frames\/second. For example:
-- 60000\/1001. If you specify a whole number, MediaConnect uses a ratio of
-- N\/1. For example, if you specify 60, MediaConnect uses 60\/1 as the
-- exactFramerate.
fmtp_exactFramerate :: Lens.Lens' Fmtp (Prelude.Maybe Prelude.Text)
fmtp_exactFramerate :: (Maybe Text -> f (Maybe Text)) -> Fmtp -> f Fmtp
fmtp_exactFramerate = (Fmtp -> Maybe Text)
-> (Fmtp -> Maybe Text -> Fmtp)
-> Lens Fmtp Fmtp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmtp' {Maybe Text
exactFramerate :: Maybe Text
$sel:exactFramerate:Fmtp' :: Fmtp -> Maybe Text
exactFramerate} -> Maybe Text
exactFramerate) (\s :: Fmtp
s@Fmtp' {} Maybe Text
a -> Fmtp
s {$sel:exactFramerate:Fmtp' :: Maybe Text
exactFramerate = Maybe Text
a} :: Fmtp)

-- | The pixel aspect ratio (PAR) of the video.
fmtp_par :: Lens.Lens' Fmtp (Prelude.Maybe Prelude.Text)
fmtp_par :: (Maybe Text -> f (Maybe Text)) -> Fmtp -> f Fmtp
fmtp_par = (Fmtp -> Maybe Text)
-> (Fmtp -> Maybe Text -> Fmtp)
-> Lens Fmtp Fmtp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmtp' {Maybe Text
par :: Maybe Text
$sel:par:Fmtp' :: Fmtp -> Maybe Text
par} -> Maybe Text
par) (\s :: Fmtp
s@Fmtp' {} Maybe Text
a -> Fmtp
s {$sel:par:Fmtp' :: Maybe Text
par = Maybe Text
a} :: Fmtp)

-- | The type of compression that was used to smooth the video’s appearance
fmtp_scanMode :: Lens.Lens' Fmtp (Prelude.Maybe ScanMode)
fmtp_scanMode :: (Maybe ScanMode -> f (Maybe ScanMode)) -> Fmtp -> f Fmtp
fmtp_scanMode = (Fmtp -> Maybe ScanMode)
-> (Fmtp -> Maybe ScanMode -> Fmtp)
-> Lens Fmtp Fmtp (Maybe ScanMode) (Maybe ScanMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmtp' {Maybe ScanMode
scanMode :: Maybe ScanMode
$sel:scanMode:Fmtp' :: Fmtp -> Maybe ScanMode
scanMode} -> Maybe ScanMode
scanMode) (\s :: Fmtp
s@Fmtp' {} Maybe ScanMode
a -> Fmtp
s {$sel:scanMode:Fmtp' :: Maybe ScanMode
scanMode = Maybe ScanMode
a} :: Fmtp)

-- | The encoding range of the video.
fmtp_range :: Lens.Lens' Fmtp (Prelude.Maybe Range)
fmtp_range :: (Maybe Range -> f (Maybe Range)) -> Fmtp -> f Fmtp
fmtp_range = (Fmtp -> Maybe Range)
-> (Fmtp -> Maybe Range -> Fmtp)
-> Lens Fmtp Fmtp (Maybe Range) (Maybe Range)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmtp' {Maybe Range
range :: Maybe Range
$sel:range:Fmtp' :: Fmtp -> Maybe Range
range} -> Maybe Range
range) (\s :: Fmtp
s@Fmtp' {} Maybe Range
a -> Fmtp
s {$sel:range:Fmtp' :: Maybe Range
range = Maybe Range
a} :: Fmtp)

-- | The format of the audio channel.
fmtp_channelOrder :: Lens.Lens' Fmtp (Prelude.Maybe Prelude.Text)
fmtp_channelOrder :: (Maybe Text -> f (Maybe Text)) -> Fmtp -> f Fmtp
fmtp_channelOrder = (Fmtp -> Maybe Text)
-> (Fmtp -> Maybe Text -> Fmtp)
-> Lens Fmtp Fmtp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmtp' {Maybe Text
channelOrder :: Maybe Text
$sel:channelOrder:Fmtp' :: Fmtp -> Maybe Text
channelOrder} -> Maybe Text
channelOrder) (\s :: Fmtp
s@Fmtp' {} Maybe Text
a -> Fmtp
s {$sel:channelOrder:Fmtp' :: Maybe Text
channelOrder = Maybe Text
a} :: Fmtp)

-- | The format that is used for the representation of color.
fmtp_colorimetry :: Lens.Lens' Fmtp (Prelude.Maybe Colorimetry)
fmtp_colorimetry :: (Maybe Colorimetry -> f (Maybe Colorimetry)) -> Fmtp -> f Fmtp
fmtp_colorimetry = (Fmtp -> Maybe Colorimetry)
-> (Fmtp -> Maybe Colorimetry -> Fmtp)
-> Lens Fmtp Fmtp (Maybe Colorimetry) (Maybe Colorimetry)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Fmtp' {Maybe Colorimetry
colorimetry :: Maybe Colorimetry
$sel:colorimetry:Fmtp' :: Fmtp -> Maybe Colorimetry
colorimetry} -> Maybe Colorimetry
colorimetry) (\s :: Fmtp
s@Fmtp' {} Maybe Colorimetry
a -> Fmtp
s {$sel:colorimetry:Fmtp' :: Maybe Colorimetry
colorimetry = Maybe Colorimetry
a} :: Fmtp)

instance Core.FromJSON Fmtp where
  parseJSON :: Value -> Parser Fmtp
parseJSON =
    String -> (Object -> Parser Fmtp) -> Value -> Parser Fmtp
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Fmtp"
      ( \Object
x ->
          Maybe Tcs
-> Maybe Text
-> Maybe Text
-> Maybe ScanMode
-> Maybe Range
-> Maybe Text
-> Maybe Colorimetry
-> Fmtp
Fmtp'
            (Maybe Tcs
 -> Maybe Text
 -> Maybe Text
 -> Maybe ScanMode
 -> Maybe Range
 -> Maybe Text
 -> Maybe Colorimetry
 -> Fmtp)
-> Parser (Maybe Tcs)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ScanMode
      -> Maybe Range
      -> Maybe Text
      -> Maybe Colorimetry
      -> Fmtp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Tcs)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tcs")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ScanMode
   -> Maybe Range
   -> Maybe Text
   -> Maybe Colorimetry
   -> Fmtp)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ScanMode
      -> Maybe Range
      -> Maybe Text
      -> Maybe Colorimetry
      -> Fmtp)
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
"exactFramerate")
            Parser
  (Maybe Text
   -> Maybe ScanMode
   -> Maybe Range
   -> Maybe Text
   -> Maybe Colorimetry
   -> Fmtp)
-> Parser (Maybe Text)
-> Parser
     (Maybe ScanMode
      -> Maybe Range -> Maybe Text -> Maybe Colorimetry -> Fmtp)
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
"par")
            Parser
  (Maybe ScanMode
   -> Maybe Range -> Maybe Text -> Maybe Colorimetry -> Fmtp)
-> Parser (Maybe ScanMode)
-> Parser (Maybe Range -> Maybe Text -> Maybe Colorimetry -> Fmtp)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ScanMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scanMode")
            Parser (Maybe Range -> Maybe Text -> Maybe Colorimetry -> Fmtp)
-> Parser (Maybe Range)
-> Parser (Maybe Text -> Maybe Colorimetry -> Fmtp)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Range)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"range")
            Parser (Maybe Text -> Maybe Colorimetry -> Fmtp)
-> Parser (Maybe Text) -> Parser (Maybe Colorimetry -> Fmtp)
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
"channelOrder")
            Parser (Maybe Colorimetry -> Fmtp)
-> Parser (Maybe Colorimetry) -> Parser Fmtp
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Colorimetry)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"colorimetry")
      )

instance Prelude.Hashable Fmtp

instance Prelude.NFData Fmtp