{-# 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.MediaLive.Types.InputSettings
-- 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.MediaLive.Types.InputSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.AudioSelector
import Amazonka.MediaLive.Types.CaptionSelector
import Amazonka.MediaLive.Types.InputDeblockFilter
import Amazonka.MediaLive.Types.InputDenoiseFilter
import Amazonka.MediaLive.Types.InputFilter
import Amazonka.MediaLive.Types.InputSourceEndBehavior
import Amazonka.MediaLive.Types.NetworkInputSettings
import Amazonka.MediaLive.Types.Smpte2038DataPreference
import Amazonka.MediaLive.Types.VideoSelector
import qualified Amazonka.Prelude as Prelude

-- | Live Event input parameters. There can be multiple inputs in a single
-- Live Event.
--
-- /See:/ 'newInputSettings' smart constructor.
data InputSettings = InputSettings'
  { -- | Informs which video elementary stream to decode for input types that
    -- have multiple available.
    InputSettings -> Maybe VideoSelector
videoSelector :: Prelude.Maybe VideoSelector,
    -- | Specifies whether to extract applicable ancillary data from a SMPTE-2038
    -- source in this input. Applicable data types are captions, timecode, AFD,
    -- and SCTE-104 messages. - PREFER: Extract from SMPTE-2038 if present in
    -- this input, otherwise extract from another source (if any). - IGNORE:
    -- Never extract any ancillary data from SMPTE-2038.
    InputSettings -> Maybe Smpte2038DataPreference
smpte2038DataPreference :: Prelude.Maybe Smpte2038DataPreference,
    -- | Input settings.
    InputSettings -> Maybe NetworkInputSettings
networkInputSettings :: Prelude.Maybe NetworkInputSettings,
    -- | Used to select the audio stream to decode for inputs that have multiple
    -- available.
    InputSettings -> Maybe [AudioSelector]
audioSelectors :: Prelude.Maybe [AudioSelector],
    -- | Enable or disable the deblock filter when filtering.
    InputSettings -> Maybe InputDeblockFilter
deblockFilter :: Prelude.Maybe InputDeblockFilter,
    -- | Enable or disable the denoise filter when filtering.
    InputSettings -> Maybe InputDenoiseFilter
denoiseFilter :: Prelude.Maybe InputDenoiseFilter,
    -- | Adjusts the magnitude of filtering from 1 (minimal) to 5 (strongest).
    InputSettings -> Maybe Natural
filterStrength :: Prelude.Maybe Prelude.Natural,
    -- | Used to select the caption input to use for inputs that have multiple
    -- available.
    InputSettings -> Maybe [CaptionSelector]
captionSelectors :: Prelude.Maybe [CaptionSelector],
    -- | Turns on the filter for this input. MPEG-2 inputs have the deblocking
    -- filter enabled by default. 1) auto - filtering will be applied depending
    -- on input type\/quality 2) disabled - no filtering will be applied to the
    -- input 3) forced - filtering will be applied regardless of input type
    InputSettings -> Maybe InputFilter
inputFilter :: Prelude.Maybe InputFilter,
    -- | Loop input if it is a file. This allows a file input to be streamed
    -- indefinitely.
    InputSettings -> Maybe InputSourceEndBehavior
sourceEndBehavior :: Prelude.Maybe InputSourceEndBehavior
  }
  deriving (InputSettings -> InputSettings -> Bool
(InputSettings -> InputSettings -> Bool)
-> (InputSettings -> InputSettings -> Bool) -> Eq InputSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputSettings -> InputSettings -> Bool
$c/= :: InputSettings -> InputSettings -> Bool
== :: InputSettings -> InputSettings -> Bool
$c== :: InputSettings -> InputSettings -> Bool
Prelude.Eq, ReadPrec [InputSettings]
ReadPrec InputSettings
Int -> ReadS InputSettings
ReadS [InputSettings]
(Int -> ReadS InputSettings)
-> ReadS [InputSettings]
-> ReadPrec InputSettings
-> ReadPrec [InputSettings]
-> Read InputSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputSettings]
$creadListPrec :: ReadPrec [InputSettings]
readPrec :: ReadPrec InputSettings
$creadPrec :: ReadPrec InputSettings
readList :: ReadS [InputSettings]
$creadList :: ReadS [InputSettings]
readsPrec :: Int -> ReadS InputSettings
$creadsPrec :: Int -> ReadS InputSettings
Prelude.Read, Int -> InputSettings -> ShowS
[InputSettings] -> ShowS
InputSettings -> String
(Int -> InputSettings -> ShowS)
-> (InputSettings -> String)
-> ([InputSettings] -> ShowS)
-> Show InputSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputSettings] -> ShowS
$cshowList :: [InputSettings] -> ShowS
show :: InputSettings -> String
$cshow :: InputSettings -> String
showsPrec :: Int -> InputSettings -> ShowS
$cshowsPrec :: Int -> InputSettings -> ShowS
Prelude.Show, (forall x. InputSettings -> Rep InputSettings x)
-> (forall x. Rep InputSettings x -> InputSettings)
-> Generic InputSettings
forall x. Rep InputSettings x -> InputSettings
forall x. InputSettings -> Rep InputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputSettings x -> InputSettings
$cfrom :: forall x. InputSettings -> Rep InputSettings x
Prelude.Generic)

-- |
-- Create a value of 'InputSettings' 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:
--
-- 'videoSelector', 'inputSettings_videoSelector' - Informs which video elementary stream to decode for input types that
-- have multiple available.
--
-- 'smpte2038DataPreference', 'inputSettings_smpte2038DataPreference' - Specifies whether to extract applicable ancillary data from a SMPTE-2038
-- source in this input. Applicable data types are captions, timecode, AFD,
-- and SCTE-104 messages. - PREFER: Extract from SMPTE-2038 if present in
-- this input, otherwise extract from another source (if any). - IGNORE:
-- Never extract any ancillary data from SMPTE-2038.
--
-- 'networkInputSettings', 'inputSettings_networkInputSettings' - Input settings.
--
-- 'audioSelectors', 'inputSettings_audioSelectors' - Used to select the audio stream to decode for inputs that have multiple
-- available.
--
-- 'deblockFilter', 'inputSettings_deblockFilter' - Enable or disable the deblock filter when filtering.
--
-- 'denoiseFilter', 'inputSettings_denoiseFilter' - Enable or disable the denoise filter when filtering.
--
-- 'filterStrength', 'inputSettings_filterStrength' - Adjusts the magnitude of filtering from 1 (minimal) to 5 (strongest).
--
-- 'captionSelectors', 'inputSettings_captionSelectors' - Used to select the caption input to use for inputs that have multiple
-- available.
--
-- 'inputFilter', 'inputSettings_inputFilter' - Turns on the filter for this input. MPEG-2 inputs have the deblocking
-- filter enabled by default. 1) auto - filtering will be applied depending
-- on input type\/quality 2) disabled - no filtering will be applied to the
-- input 3) forced - filtering will be applied regardless of input type
--
-- 'sourceEndBehavior', 'inputSettings_sourceEndBehavior' - Loop input if it is a file. This allows a file input to be streamed
-- indefinitely.
newInputSettings ::
  InputSettings
newInputSettings :: InputSettings
newInputSettings =
  InputSettings' :: Maybe VideoSelector
-> Maybe Smpte2038DataPreference
-> Maybe NetworkInputSettings
-> Maybe [AudioSelector]
-> Maybe InputDeblockFilter
-> Maybe InputDenoiseFilter
-> Maybe Natural
-> Maybe [CaptionSelector]
-> Maybe InputFilter
-> Maybe InputSourceEndBehavior
-> InputSettings
InputSettings'
    { $sel:videoSelector:InputSettings' :: Maybe VideoSelector
videoSelector = Maybe VideoSelector
forall a. Maybe a
Prelude.Nothing,
      $sel:smpte2038DataPreference:InputSettings' :: Maybe Smpte2038DataPreference
smpte2038DataPreference = Maybe Smpte2038DataPreference
forall a. Maybe a
Prelude.Nothing,
      $sel:networkInputSettings:InputSettings' :: Maybe NetworkInputSettings
networkInputSettings = Maybe NetworkInputSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:audioSelectors:InputSettings' :: Maybe [AudioSelector]
audioSelectors = Maybe [AudioSelector]
forall a. Maybe a
Prelude.Nothing,
      $sel:deblockFilter:InputSettings' :: Maybe InputDeblockFilter
deblockFilter = Maybe InputDeblockFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:denoiseFilter:InputSettings' :: Maybe InputDenoiseFilter
denoiseFilter = Maybe InputDenoiseFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:filterStrength:InputSettings' :: Maybe Natural
filterStrength = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:captionSelectors:InputSettings' :: Maybe [CaptionSelector]
captionSelectors = Maybe [CaptionSelector]
forall a. Maybe a
Prelude.Nothing,
      $sel:inputFilter:InputSettings' :: Maybe InputFilter
inputFilter = Maybe InputFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceEndBehavior:InputSettings' :: Maybe InputSourceEndBehavior
sourceEndBehavior = Maybe InputSourceEndBehavior
forall a. Maybe a
Prelude.Nothing
    }

-- | Informs which video elementary stream to decode for input types that
-- have multiple available.
inputSettings_videoSelector :: Lens.Lens' InputSettings (Prelude.Maybe VideoSelector)
inputSettings_videoSelector :: (Maybe VideoSelector -> f (Maybe VideoSelector))
-> InputSettings -> f InputSettings
inputSettings_videoSelector = (InputSettings -> Maybe VideoSelector)
-> (InputSettings -> Maybe VideoSelector -> InputSettings)
-> Lens
     InputSettings
     InputSettings
     (Maybe VideoSelector)
     (Maybe VideoSelector)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe VideoSelector
videoSelector :: Maybe VideoSelector
$sel:videoSelector:InputSettings' :: InputSettings -> Maybe VideoSelector
videoSelector} -> Maybe VideoSelector
videoSelector) (\s :: InputSettings
s@InputSettings' {} Maybe VideoSelector
a -> InputSettings
s {$sel:videoSelector:InputSettings' :: Maybe VideoSelector
videoSelector = Maybe VideoSelector
a} :: InputSettings)

-- | Specifies whether to extract applicable ancillary data from a SMPTE-2038
-- source in this input. Applicable data types are captions, timecode, AFD,
-- and SCTE-104 messages. - PREFER: Extract from SMPTE-2038 if present in
-- this input, otherwise extract from another source (if any). - IGNORE:
-- Never extract any ancillary data from SMPTE-2038.
inputSettings_smpte2038DataPreference :: Lens.Lens' InputSettings (Prelude.Maybe Smpte2038DataPreference)
inputSettings_smpte2038DataPreference :: (Maybe Smpte2038DataPreference
 -> f (Maybe Smpte2038DataPreference))
-> InputSettings -> f InputSettings
inputSettings_smpte2038DataPreference = (InputSettings -> Maybe Smpte2038DataPreference)
-> (InputSettings
    -> Maybe Smpte2038DataPreference -> InputSettings)
-> Lens
     InputSettings
     InputSettings
     (Maybe Smpte2038DataPreference)
     (Maybe Smpte2038DataPreference)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe Smpte2038DataPreference
smpte2038DataPreference :: Maybe Smpte2038DataPreference
$sel:smpte2038DataPreference:InputSettings' :: InputSettings -> Maybe Smpte2038DataPreference
smpte2038DataPreference} -> Maybe Smpte2038DataPreference
smpte2038DataPreference) (\s :: InputSettings
s@InputSettings' {} Maybe Smpte2038DataPreference
a -> InputSettings
s {$sel:smpte2038DataPreference:InputSettings' :: Maybe Smpte2038DataPreference
smpte2038DataPreference = Maybe Smpte2038DataPreference
a} :: InputSettings)

-- | Input settings.
inputSettings_networkInputSettings :: Lens.Lens' InputSettings (Prelude.Maybe NetworkInputSettings)
inputSettings_networkInputSettings :: (Maybe NetworkInputSettings -> f (Maybe NetworkInputSettings))
-> InputSettings -> f InputSettings
inputSettings_networkInputSettings = (InputSettings -> Maybe NetworkInputSettings)
-> (InputSettings -> Maybe NetworkInputSettings -> InputSettings)
-> Lens
     InputSettings
     InputSettings
     (Maybe NetworkInputSettings)
     (Maybe NetworkInputSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe NetworkInputSettings
networkInputSettings :: Maybe NetworkInputSettings
$sel:networkInputSettings:InputSettings' :: InputSettings -> Maybe NetworkInputSettings
networkInputSettings} -> Maybe NetworkInputSettings
networkInputSettings) (\s :: InputSettings
s@InputSettings' {} Maybe NetworkInputSettings
a -> InputSettings
s {$sel:networkInputSettings:InputSettings' :: Maybe NetworkInputSettings
networkInputSettings = Maybe NetworkInputSettings
a} :: InputSettings)

-- | Used to select the audio stream to decode for inputs that have multiple
-- available.
inputSettings_audioSelectors :: Lens.Lens' InputSettings (Prelude.Maybe [AudioSelector])
inputSettings_audioSelectors :: (Maybe [AudioSelector] -> f (Maybe [AudioSelector]))
-> InputSettings -> f InputSettings
inputSettings_audioSelectors = (InputSettings -> Maybe [AudioSelector])
-> (InputSettings -> Maybe [AudioSelector] -> InputSettings)
-> Lens
     InputSettings
     InputSettings
     (Maybe [AudioSelector])
     (Maybe [AudioSelector])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe [AudioSelector]
audioSelectors :: Maybe [AudioSelector]
$sel:audioSelectors:InputSettings' :: InputSettings -> Maybe [AudioSelector]
audioSelectors} -> Maybe [AudioSelector]
audioSelectors) (\s :: InputSettings
s@InputSettings' {} Maybe [AudioSelector]
a -> InputSettings
s {$sel:audioSelectors:InputSettings' :: Maybe [AudioSelector]
audioSelectors = Maybe [AudioSelector]
a} :: InputSettings) ((Maybe [AudioSelector] -> f (Maybe [AudioSelector]))
 -> InputSettings -> f InputSettings)
-> ((Maybe [AudioSelector] -> f (Maybe [AudioSelector]))
    -> Maybe [AudioSelector] -> f (Maybe [AudioSelector]))
-> (Maybe [AudioSelector] -> f (Maybe [AudioSelector]))
-> InputSettings
-> f InputSettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AudioSelector] [AudioSelector] [AudioSelector] [AudioSelector]
-> Iso
     (Maybe [AudioSelector])
     (Maybe [AudioSelector])
     (Maybe [AudioSelector])
     (Maybe [AudioSelector])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [AudioSelector] [AudioSelector] [AudioSelector] [AudioSelector]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Enable or disable the deblock filter when filtering.
inputSettings_deblockFilter :: Lens.Lens' InputSettings (Prelude.Maybe InputDeblockFilter)
inputSettings_deblockFilter :: (Maybe InputDeblockFilter -> f (Maybe InputDeblockFilter))
-> InputSettings -> f InputSettings
inputSettings_deblockFilter = (InputSettings -> Maybe InputDeblockFilter)
-> (InputSettings -> Maybe InputDeblockFilter -> InputSettings)
-> Lens
     InputSettings
     InputSettings
     (Maybe InputDeblockFilter)
     (Maybe InputDeblockFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe InputDeblockFilter
deblockFilter :: Maybe InputDeblockFilter
$sel:deblockFilter:InputSettings' :: InputSettings -> Maybe InputDeblockFilter
deblockFilter} -> Maybe InputDeblockFilter
deblockFilter) (\s :: InputSettings
s@InputSettings' {} Maybe InputDeblockFilter
a -> InputSettings
s {$sel:deblockFilter:InputSettings' :: Maybe InputDeblockFilter
deblockFilter = Maybe InputDeblockFilter
a} :: InputSettings)

-- | Enable or disable the denoise filter when filtering.
inputSettings_denoiseFilter :: Lens.Lens' InputSettings (Prelude.Maybe InputDenoiseFilter)
inputSettings_denoiseFilter :: (Maybe InputDenoiseFilter -> f (Maybe InputDenoiseFilter))
-> InputSettings -> f InputSettings
inputSettings_denoiseFilter = (InputSettings -> Maybe InputDenoiseFilter)
-> (InputSettings -> Maybe InputDenoiseFilter -> InputSettings)
-> Lens
     InputSettings
     InputSettings
     (Maybe InputDenoiseFilter)
     (Maybe InputDenoiseFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe InputDenoiseFilter
denoiseFilter :: Maybe InputDenoiseFilter
$sel:denoiseFilter:InputSettings' :: InputSettings -> Maybe InputDenoiseFilter
denoiseFilter} -> Maybe InputDenoiseFilter
denoiseFilter) (\s :: InputSettings
s@InputSettings' {} Maybe InputDenoiseFilter
a -> InputSettings
s {$sel:denoiseFilter:InputSettings' :: Maybe InputDenoiseFilter
denoiseFilter = Maybe InputDenoiseFilter
a} :: InputSettings)

-- | Adjusts the magnitude of filtering from 1 (minimal) to 5 (strongest).
inputSettings_filterStrength :: Lens.Lens' InputSettings (Prelude.Maybe Prelude.Natural)
inputSettings_filterStrength :: (Maybe Natural -> f (Maybe Natural))
-> InputSettings -> f InputSettings
inputSettings_filterStrength = (InputSettings -> Maybe Natural)
-> (InputSettings -> Maybe Natural -> InputSettings)
-> Lens InputSettings InputSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe Natural
filterStrength :: Maybe Natural
$sel:filterStrength:InputSettings' :: InputSettings -> Maybe Natural
filterStrength} -> Maybe Natural
filterStrength) (\s :: InputSettings
s@InputSettings' {} Maybe Natural
a -> InputSettings
s {$sel:filterStrength:InputSettings' :: Maybe Natural
filterStrength = Maybe Natural
a} :: InputSettings)

-- | Used to select the caption input to use for inputs that have multiple
-- available.
inputSettings_captionSelectors :: Lens.Lens' InputSettings (Prelude.Maybe [CaptionSelector])
inputSettings_captionSelectors :: (Maybe [CaptionSelector] -> f (Maybe [CaptionSelector]))
-> InputSettings -> f InputSettings
inputSettings_captionSelectors = (InputSettings -> Maybe [CaptionSelector])
-> (InputSettings -> Maybe [CaptionSelector] -> InputSettings)
-> Lens
     InputSettings
     InputSettings
     (Maybe [CaptionSelector])
     (Maybe [CaptionSelector])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe [CaptionSelector]
captionSelectors :: Maybe [CaptionSelector]
$sel:captionSelectors:InputSettings' :: InputSettings -> Maybe [CaptionSelector]
captionSelectors} -> Maybe [CaptionSelector]
captionSelectors) (\s :: InputSettings
s@InputSettings' {} Maybe [CaptionSelector]
a -> InputSettings
s {$sel:captionSelectors:InputSettings' :: Maybe [CaptionSelector]
captionSelectors = Maybe [CaptionSelector]
a} :: InputSettings) ((Maybe [CaptionSelector] -> f (Maybe [CaptionSelector]))
 -> InputSettings -> f InputSettings)
-> ((Maybe [CaptionSelector] -> f (Maybe [CaptionSelector]))
    -> Maybe [CaptionSelector] -> f (Maybe [CaptionSelector]))
-> (Maybe [CaptionSelector] -> f (Maybe [CaptionSelector]))
-> InputSettings
-> f InputSettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CaptionSelector]
  [CaptionSelector]
  [CaptionSelector]
  [CaptionSelector]
-> Iso
     (Maybe [CaptionSelector])
     (Maybe [CaptionSelector])
     (Maybe [CaptionSelector])
     (Maybe [CaptionSelector])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [CaptionSelector]
  [CaptionSelector]
  [CaptionSelector]
  [CaptionSelector]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Turns on the filter for this input. MPEG-2 inputs have the deblocking
-- filter enabled by default. 1) auto - filtering will be applied depending
-- on input type\/quality 2) disabled - no filtering will be applied to the
-- input 3) forced - filtering will be applied regardless of input type
inputSettings_inputFilter :: Lens.Lens' InputSettings (Prelude.Maybe InputFilter)
inputSettings_inputFilter :: (Maybe InputFilter -> f (Maybe InputFilter))
-> InputSettings -> f InputSettings
inputSettings_inputFilter = (InputSettings -> Maybe InputFilter)
-> (InputSettings -> Maybe InputFilter -> InputSettings)
-> Lens
     InputSettings InputSettings (Maybe InputFilter) (Maybe InputFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe InputFilter
inputFilter :: Maybe InputFilter
$sel:inputFilter:InputSettings' :: InputSettings -> Maybe InputFilter
inputFilter} -> Maybe InputFilter
inputFilter) (\s :: InputSettings
s@InputSettings' {} Maybe InputFilter
a -> InputSettings
s {$sel:inputFilter:InputSettings' :: Maybe InputFilter
inputFilter = Maybe InputFilter
a} :: InputSettings)

-- | Loop input if it is a file. This allows a file input to be streamed
-- indefinitely.
inputSettings_sourceEndBehavior :: Lens.Lens' InputSettings (Prelude.Maybe InputSourceEndBehavior)
inputSettings_sourceEndBehavior :: (Maybe InputSourceEndBehavior -> f (Maybe InputSourceEndBehavior))
-> InputSettings -> f InputSettings
inputSettings_sourceEndBehavior = (InputSettings -> Maybe InputSourceEndBehavior)
-> (InputSettings -> Maybe InputSourceEndBehavior -> InputSettings)
-> Lens
     InputSettings
     InputSettings
     (Maybe InputSourceEndBehavior)
     (Maybe InputSourceEndBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSettings' {Maybe InputSourceEndBehavior
sourceEndBehavior :: Maybe InputSourceEndBehavior
$sel:sourceEndBehavior:InputSettings' :: InputSettings -> Maybe InputSourceEndBehavior
sourceEndBehavior} -> Maybe InputSourceEndBehavior
sourceEndBehavior) (\s :: InputSettings
s@InputSettings' {} Maybe InputSourceEndBehavior
a -> InputSettings
s {$sel:sourceEndBehavior:InputSettings' :: Maybe InputSourceEndBehavior
sourceEndBehavior = Maybe InputSourceEndBehavior
a} :: InputSettings)

instance Core.FromJSON InputSettings where
  parseJSON :: Value -> Parser InputSettings
parseJSON =
    String
-> (Object -> Parser InputSettings)
-> Value
-> Parser InputSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InputSettings"
      ( \Object
x ->
          Maybe VideoSelector
-> Maybe Smpte2038DataPreference
-> Maybe NetworkInputSettings
-> Maybe [AudioSelector]
-> Maybe InputDeblockFilter
-> Maybe InputDenoiseFilter
-> Maybe Natural
-> Maybe [CaptionSelector]
-> Maybe InputFilter
-> Maybe InputSourceEndBehavior
-> InputSettings
InputSettings'
            (Maybe VideoSelector
 -> Maybe Smpte2038DataPreference
 -> Maybe NetworkInputSettings
 -> Maybe [AudioSelector]
 -> Maybe InputDeblockFilter
 -> Maybe InputDenoiseFilter
 -> Maybe Natural
 -> Maybe [CaptionSelector]
 -> Maybe InputFilter
 -> Maybe InputSourceEndBehavior
 -> InputSettings)
-> Parser (Maybe VideoSelector)
-> Parser
     (Maybe Smpte2038DataPreference
      -> Maybe NetworkInputSettings
      -> Maybe [AudioSelector]
      -> Maybe InputDeblockFilter
      -> Maybe InputDenoiseFilter
      -> Maybe Natural
      -> Maybe [CaptionSelector]
      -> Maybe InputFilter
      -> Maybe InputSourceEndBehavior
      -> InputSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe VideoSelector)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"videoSelector")
            Parser
  (Maybe Smpte2038DataPreference
   -> Maybe NetworkInputSettings
   -> Maybe [AudioSelector]
   -> Maybe InputDeblockFilter
   -> Maybe InputDenoiseFilter
   -> Maybe Natural
   -> Maybe [CaptionSelector]
   -> Maybe InputFilter
   -> Maybe InputSourceEndBehavior
   -> InputSettings)
-> Parser (Maybe Smpte2038DataPreference)
-> Parser
     (Maybe NetworkInputSettings
      -> Maybe [AudioSelector]
      -> Maybe InputDeblockFilter
      -> Maybe InputDenoiseFilter
      -> Maybe Natural
      -> Maybe [CaptionSelector]
      -> Maybe InputFilter
      -> Maybe InputSourceEndBehavior
      -> InputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Smpte2038DataPreference)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"smpte2038DataPreference")
            Parser
  (Maybe NetworkInputSettings
   -> Maybe [AudioSelector]
   -> Maybe InputDeblockFilter
   -> Maybe InputDenoiseFilter
   -> Maybe Natural
   -> Maybe [CaptionSelector]
   -> Maybe InputFilter
   -> Maybe InputSourceEndBehavior
   -> InputSettings)
-> Parser (Maybe NetworkInputSettings)
-> Parser
     (Maybe [AudioSelector]
      -> Maybe InputDeblockFilter
      -> Maybe InputDenoiseFilter
      -> Maybe Natural
      -> Maybe [CaptionSelector]
      -> Maybe InputFilter
      -> Maybe InputSourceEndBehavior
      -> InputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NetworkInputSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networkInputSettings")
            Parser
  (Maybe [AudioSelector]
   -> Maybe InputDeblockFilter
   -> Maybe InputDenoiseFilter
   -> Maybe Natural
   -> Maybe [CaptionSelector]
   -> Maybe InputFilter
   -> Maybe InputSourceEndBehavior
   -> InputSettings)
-> Parser (Maybe [AudioSelector])
-> Parser
     (Maybe InputDeblockFilter
      -> Maybe InputDenoiseFilter
      -> Maybe Natural
      -> Maybe [CaptionSelector]
      -> Maybe InputFilter
      -> Maybe InputSourceEndBehavior
      -> InputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [AudioSelector]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioSelectors" Parser (Maybe (Maybe [AudioSelector]))
-> Maybe [AudioSelector] -> Parser (Maybe [AudioSelector])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AudioSelector]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe InputDeblockFilter
   -> Maybe InputDenoiseFilter
   -> Maybe Natural
   -> Maybe [CaptionSelector]
   -> Maybe InputFilter
   -> Maybe InputSourceEndBehavior
   -> InputSettings)
-> Parser (Maybe InputDeblockFilter)
-> Parser
     (Maybe InputDenoiseFilter
      -> Maybe Natural
      -> Maybe [CaptionSelector]
      -> Maybe InputFilter
      -> Maybe InputSourceEndBehavior
      -> InputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InputDeblockFilter)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deblockFilter")
            Parser
  (Maybe InputDenoiseFilter
   -> Maybe Natural
   -> Maybe [CaptionSelector]
   -> Maybe InputFilter
   -> Maybe InputSourceEndBehavior
   -> InputSettings)
-> Parser (Maybe InputDenoiseFilter)
-> Parser
     (Maybe Natural
      -> Maybe [CaptionSelector]
      -> Maybe InputFilter
      -> Maybe InputSourceEndBehavior
      -> InputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InputDenoiseFilter)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"denoiseFilter")
            Parser
  (Maybe Natural
   -> Maybe [CaptionSelector]
   -> Maybe InputFilter
   -> Maybe InputSourceEndBehavior
   -> InputSettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe [CaptionSelector]
      -> Maybe InputFilter
      -> Maybe InputSourceEndBehavior
      -> InputSettings)
forall (f :: * -> *) a b. Applicative f => 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
"filterStrength")
            Parser
  (Maybe [CaptionSelector]
   -> Maybe InputFilter
   -> Maybe InputSourceEndBehavior
   -> InputSettings)
-> Parser (Maybe [CaptionSelector])
-> Parser
     (Maybe InputFilter
      -> Maybe InputSourceEndBehavior -> InputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [CaptionSelector]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"captionSelectors"
                            Parser (Maybe (Maybe [CaptionSelector]))
-> Maybe [CaptionSelector] -> Parser (Maybe [CaptionSelector])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CaptionSelector]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe InputFilter
   -> Maybe InputSourceEndBehavior -> InputSettings)
-> Parser (Maybe InputFilter)
-> Parser (Maybe InputSourceEndBehavior -> InputSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InputFilter)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"inputFilter")
            Parser (Maybe InputSourceEndBehavior -> InputSettings)
-> Parser (Maybe InputSourceEndBehavior) -> Parser InputSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InputSourceEndBehavior)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceEndBehavior")
      )

instance Prelude.Hashable InputSettings

instance Prelude.NFData InputSettings

instance Core.ToJSON InputSettings where
  toJSON :: InputSettings -> Value
toJSON InputSettings' {Maybe Natural
Maybe [AudioSelector]
Maybe [CaptionSelector]
Maybe InputDeblockFilter
Maybe InputDenoiseFilter
Maybe InputFilter
Maybe InputSourceEndBehavior
Maybe NetworkInputSettings
Maybe Smpte2038DataPreference
Maybe VideoSelector
sourceEndBehavior :: Maybe InputSourceEndBehavior
inputFilter :: Maybe InputFilter
captionSelectors :: Maybe [CaptionSelector]
filterStrength :: Maybe Natural
denoiseFilter :: Maybe InputDenoiseFilter
deblockFilter :: Maybe InputDeblockFilter
audioSelectors :: Maybe [AudioSelector]
networkInputSettings :: Maybe NetworkInputSettings
smpte2038DataPreference :: Maybe Smpte2038DataPreference
videoSelector :: Maybe VideoSelector
$sel:sourceEndBehavior:InputSettings' :: InputSettings -> Maybe InputSourceEndBehavior
$sel:inputFilter:InputSettings' :: InputSettings -> Maybe InputFilter
$sel:captionSelectors:InputSettings' :: InputSettings -> Maybe [CaptionSelector]
$sel:filterStrength:InputSettings' :: InputSettings -> Maybe Natural
$sel:denoiseFilter:InputSettings' :: InputSettings -> Maybe InputDenoiseFilter
$sel:deblockFilter:InputSettings' :: InputSettings -> Maybe InputDeblockFilter
$sel:audioSelectors:InputSettings' :: InputSettings -> Maybe [AudioSelector]
$sel:networkInputSettings:InputSettings' :: InputSettings -> Maybe NetworkInputSettings
$sel:smpte2038DataPreference:InputSettings' :: InputSettings -> Maybe Smpte2038DataPreference
$sel:videoSelector:InputSettings' :: InputSettings -> Maybe VideoSelector
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"videoSelector" Text -> VideoSelector -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VideoSelector -> Pair) -> Maybe VideoSelector -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoSelector
videoSelector,
            (Text
"smpte2038DataPreference" Text -> Smpte2038DataPreference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Smpte2038DataPreference -> Pair)
-> Maybe Smpte2038DataPreference -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Smpte2038DataPreference
smpte2038DataPreference,
            (Text
"networkInputSettings" Text -> NetworkInputSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NetworkInputSettings -> Pair)
-> Maybe NetworkInputSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkInputSettings
networkInputSettings,
            (Text
"audioSelectors" Text -> [AudioSelector] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AudioSelector] -> Pair) -> Maybe [AudioSelector] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AudioSelector]
audioSelectors,
            (Text
"deblockFilter" Text -> InputDeblockFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (InputDeblockFilter -> Pair)
-> Maybe InputDeblockFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputDeblockFilter
deblockFilter,
            (Text
"denoiseFilter" Text -> InputDenoiseFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (InputDenoiseFilter -> Pair)
-> Maybe InputDenoiseFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputDenoiseFilter
denoiseFilter,
            (Text
"filterStrength" 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
filterStrength,
            (Text
"captionSelectors" Text -> [CaptionSelector] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([CaptionSelector] -> Pair)
-> Maybe [CaptionSelector] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CaptionSelector]
captionSelectors,
            (Text
"inputFilter" Text -> InputFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (InputFilter -> Pair) -> Maybe InputFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputFilter
inputFilter,
            (Text
"sourceEndBehavior" Text -> InputSourceEndBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (InputSourceEndBehavior -> Pair)
-> Maybe InputSourceEndBehavior -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputSourceEndBehavior
sourceEndBehavior
          ]
      )