{-# 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.IVS.Types.VideoConfiguration
-- 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.IVS.Types.VideoConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Object specifying a stream’s video configuration, as set up by the
-- broadcaster (usually in an encoder). This is part of the
-- IngestConfiguration object and used for monitoring stream health.
--
-- /See:/ 'newVideoConfiguration' smart constructor.
data VideoConfiguration = VideoConfiguration'
  { -- | Indicates the degree of required decoder performance for a profile.
    -- Normally this is set automatically by the encoder. For details, see the
    -- H.264 specification.
    VideoConfiguration -> Maybe Text
avcLevel :: Prelude.Maybe Prelude.Text,
    -- | Indicates to the decoder the requirements for decoding the stream. For
    -- definitions of the valid values, see the H.264 specification.
    VideoConfiguration -> Maybe Text
avcProfile :: Prelude.Maybe Prelude.Text,
    -- | Codec used for the video encoding.
    VideoConfiguration -> Maybe Text
codec :: Prelude.Maybe Prelude.Text,
    -- | Software or hardware used to encode the video.
    VideoConfiguration -> Maybe Text
encoder :: Prelude.Maybe Prelude.Text,
    -- | The expected ingest bitrate (bits per second). This is configured in the
    -- encoder.
    VideoConfiguration -> Maybe Integer
targetBitrate :: Prelude.Maybe Prelude.Integer,
    -- | The expected ingest framerate. This is configured in the encoder.
    VideoConfiguration -> Maybe Integer
targetFramerate :: Prelude.Maybe Prelude.Integer,
    -- | Video-resolution height in pixels.
    VideoConfiguration -> Maybe Integer
videoHeight :: Prelude.Maybe Prelude.Integer,
    -- | Video-resolution width in pixels.
    VideoConfiguration -> Maybe Integer
videoWidth :: Prelude.Maybe Prelude.Integer
  }
  deriving (VideoConfiguration -> VideoConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoConfiguration -> VideoConfiguration -> Bool
$c/= :: VideoConfiguration -> VideoConfiguration -> Bool
== :: VideoConfiguration -> VideoConfiguration -> Bool
$c== :: VideoConfiguration -> VideoConfiguration -> Bool
Prelude.Eq, ReadPrec [VideoConfiguration]
ReadPrec VideoConfiguration
Int -> ReadS VideoConfiguration
ReadS [VideoConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VideoConfiguration]
$creadListPrec :: ReadPrec [VideoConfiguration]
readPrec :: ReadPrec VideoConfiguration
$creadPrec :: ReadPrec VideoConfiguration
readList :: ReadS [VideoConfiguration]
$creadList :: ReadS [VideoConfiguration]
readsPrec :: Int -> ReadS VideoConfiguration
$creadsPrec :: Int -> ReadS VideoConfiguration
Prelude.Read, Int -> VideoConfiguration -> ShowS
[VideoConfiguration] -> ShowS
VideoConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoConfiguration] -> ShowS
$cshowList :: [VideoConfiguration] -> ShowS
show :: VideoConfiguration -> String
$cshow :: VideoConfiguration -> String
showsPrec :: Int -> VideoConfiguration -> ShowS
$cshowsPrec :: Int -> VideoConfiguration -> ShowS
Prelude.Show, forall x. Rep VideoConfiguration x -> VideoConfiguration
forall x. VideoConfiguration -> Rep VideoConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VideoConfiguration x -> VideoConfiguration
$cfrom :: forall x. VideoConfiguration -> Rep VideoConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'VideoConfiguration' 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:
--
-- 'avcLevel', 'videoConfiguration_avcLevel' - Indicates the degree of required decoder performance for a profile.
-- Normally this is set automatically by the encoder. For details, see the
-- H.264 specification.
--
-- 'avcProfile', 'videoConfiguration_avcProfile' - Indicates to the decoder the requirements for decoding the stream. For
-- definitions of the valid values, see the H.264 specification.
--
-- 'codec', 'videoConfiguration_codec' - Codec used for the video encoding.
--
-- 'encoder', 'videoConfiguration_encoder' - Software or hardware used to encode the video.
--
-- 'targetBitrate', 'videoConfiguration_targetBitrate' - The expected ingest bitrate (bits per second). This is configured in the
-- encoder.
--
-- 'targetFramerate', 'videoConfiguration_targetFramerate' - The expected ingest framerate. This is configured in the encoder.
--
-- 'videoHeight', 'videoConfiguration_videoHeight' - Video-resolution height in pixels.
--
-- 'videoWidth', 'videoConfiguration_videoWidth' - Video-resolution width in pixels.
newVideoConfiguration ::
  VideoConfiguration
newVideoConfiguration :: VideoConfiguration
newVideoConfiguration =
  VideoConfiguration'
    { $sel:avcLevel:VideoConfiguration' :: Maybe Text
avcLevel = forall a. Maybe a
Prelude.Nothing,
      $sel:avcProfile:VideoConfiguration' :: Maybe Text
avcProfile = forall a. Maybe a
Prelude.Nothing,
      $sel:codec:VideoConfiguration' :: Maybe Text
codec = forall a. Maybe a
Prelude.Nothing,
      $sel:encoder:VideoConfiguration' :: Maybe Text
encoder = forall a. Maybe a
Prelude.Nothing,
      $sel:targetBitrate:VideoConfiguration' :: Maybe Integer
targetBitrate = forall a. Maybe a
Prelude.Nothing,
      $sel:targetFramerate:VideoConfiguration' :: Maybe Integer
targetFramerate = forall a. Maybe a
Prelude.Nothing,
      $sel:videoHeight:VideoConfiguration' :: Maybe Integer
videoHeight = forall a. Maybe a
Prelude.Nothing,
      $sel:videoWidth:VideoConfiguration' :: Maybe Integer
videoWidth = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates the degree of required decoder performance for a profile.
-- Normally this is set automatically by the encoder. For details, see the
-- H.264 specification.
videoConfiguration_avcLevel :: Lens.Lens' VideoConfiguration (Prelude.Maybe Prelude.Text)
videoConfiguration_avcLevel :: Lens' VideoConfiguration (Maybe Text)
videoConfiguration_avcLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoConfiguration' {Maybe Text
avcLevel :: Maybe Text
$sel:avcLevel:VideoConfiguration' :: VideoConfiguration -> Maybe Text
avcLevel} -> Maybe Text
avcLevel) (\s :: VideoConfiguration
s@VideoConfiguration' {} Maybe Text
a -> VideoConfiguration
s {$sel:avcLevel:VideoConfiguration' :: Maybe Text
avcLevel = Maybe Text
a} :: VideoConfiguration)

-- | Indicates to the decoder the requirements for decoding the stream. For
-- definitions of the valid values, see the H.264 specification.
videoConfiguration_avcProfile :: Lens.Lens' VideoConfiguration (Prelude.Maybe Prelude.Text)
videoConfiguration_avcProfile :: Lens' VideoConfiguration (Maybe Text)
videoConfiguration_avcProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoConfiguration' {Maybe Text
avcProfile :: Maybe Text
$sel:avcProfile:VideoConfiguration' :: VideoConfiguration -> Maybe Text
avcProfile} -> Maybe Text
avcProfile) (\s :: VideoConfiguration
s@VideoConfiguration' {} Maybe Text
a -> VideoConfiguration
s {$sel:avcProfile:VideoConfiguration' :: Maybe Text
avcProfile = Maybe Text
a} :: VideoConfiguration)

-- | Codec used for the video encoding.
videoConfiguration_codec :: Lens.Lens' VideoConfiguration (Prelude.Maybe Prelude.Text)
videoConfiguration_codec :: Lens' VideoConfiguration (Maybe Text)
videoConfiguration_codec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoConfiguration' {Maybe Text
codec :: Maybe Text
$sel:codec:VideoConfiguration' :: VideoConfiguration -> Maybe Text
codec} -> Maybe Text
codec) (\s :: VideoConfiguration
s@VideoConfiguration' {} Maybe Text
a -> VideoConfiguration
s {$sel:codec:VideoConfiguration' :: Maybe Text
codec = Maybe Text
a} :: VideoConfiguration)

-- | Software or hardware used to encode the video.
videoConfiguration_encoder :: Lens.Lens' VideoConfiguration (Prelude.Maybe Prelude.Text)
videoConfiguration_encoder :: Lens' VideoConfiguration (Maybe Text)
videoConfiguration_encoder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoConfiguration' {Maybe Text
encoder :: Maybe Text
$sel:encoder:VideoConfiguration' :: VideoConfiguration -> Maybe Text
encoder} -> Maybe Text
encoder) (\s :: VideoConfiguration
s@VideoConfiguration' {} Maybe Text
a -> VideoConfiguration
s {$sel:encoder:VideoConfiguration' :: Maybe Text
encoder = Maybe Text
a} :: VideoConfiguration)

-- | The expected ingest bitrate (bits per second). This is configured in the
-- encoder.
videoConfiguration_targetBitrate :: Lens.Lens' VideoConfiguration (Prelude.Maybe Prelude.Integer)
videoConfiguration_targetBitrate :: Lens' VideoConfiguration (Maybe Integer)
videoConfiguration_targetBitrate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoConfiguration' {Maybe Integer
targetBitrate :: Maybe Integer
$sel:targetBitrate:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
targetBitrate} -> Maybe Integer
targetBitrate) (\s :: VideoConfiguration
s@VideoConfiguration' {} Maybe Integer
a -> VideoConfiguration
s {$sel:targetBitrate:VideoConfiguration' :: Maybe Integer
targetBitrate = Maybe Integer
a} :: VideoConfiguration)

-- | The expected ingest framerate. This is configured in the encoder.
videoConfiguration_targetFramerate :: Lens.Lens' VideoConfiguration (Prelude.Maybe Prelude.Integer)
videoConfiguration_targetFramerate :: Lens' VideoConfiguration (Maybe Integer)
videoConfiguration_targetFramerate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoConfiguration' {Maybe Integer
targetFramerate :: Maybe Integer
$sel:targetFramerate:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
targetFramerate} -> Maybe Integer
targetFramerate) (\s :: VideoConfiguration
s@VideoConfiguration' {} Maybe Integer
a -> VideoConfiguration
s {$sel:targetFramerate:VideoConfiguration' :: Maybe Integer
targetFramerate = Maybe Integer
a} :: VideoConfiguration)

-- | Video-resolution height in pixels.
videoConfiguration_videoHeight :: Lens.Lens' VideoConfiguration (Prelude.Maybe Prelude.Integer)
videoConfiguration_videoHeight :: Lens' VideoConfiguration (Maybe Integer)
videoConfiguration_videoHeight = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoConfiguration' {Maybe Integer
videoHeight :: Maybe Integer
$sel:videoHeight:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
videoHeight} -> Maybe Integer
videoHeight) (\s :: VideoConfiguration
s@VideoConfiguration' {} Maybe Integer
a -> VideoConfiguration
s {$sel:videoHeight:VideoConfiguration' :: Maybe Integer
videoHeight = Maybe Integer
a} :: VideoConfiguration)

-- | Video-resolution width in pixels.
videoConfiguration_videoWidth :: Lens.Lens' VideoConfiguration (Prelude.Maybe Prelude.Integer)
videoConfiguration_videoWidth :: Lens' VideoConfiguration (Maybe Integer)
videoConfiguration_videoWidth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoConfiguration' {Maybe Integer
videoWidth :: Maybe Integer
$sel:videoWidth:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
videoWidth} -> Maybe Integer
videoWidth) (\s :: VideoConfiguration
s@VideoConfiguration' {} Maybe Integer
a -> VideoConfiguration
s {$sel:videoWidth:VideoConfiguration' :: Maybe Integer
videoWidth = Maybe Integer
a} :: VideoConfiguration)

instance Data.FromJSON VideoConfiguration where
  parseJSON :: Value -> Parser VideoConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VideoConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> VideoConfiguration
VideoConfiguration'
            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
"avcLevel")
            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
"avcProfile")
            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
"codec")
            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
"encoder")
            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
"targetBitrate")
            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
"targetFramerate")
            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
"videoHeight")
            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
"videoWidth")
      )

instance Prelude.Hashable VideoConfiguration where
  hashWithSalt :: Int -> VideoConfiguration -> Int
hashWithSalt Int
_salt VideoConfiguration' {Maybe Integer
Maybe Text
videoWidth :: Maybe Integer
videoHeight :: Maybe Integer
targetFramerate :: Maybe Integer
targetBitrate :: Maybe Integer
encoder :: Maybe Text
codec :: Maybe Text
avcProfile :: Maybe Text
avcLevel :: Maybe Text
$sel:videoWidth:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
$sel:videoHeight:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
$sel:targetFramerate:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
$sel:targetBitrate:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
$sel:encoder:VideoConfiguration' :: VideoConfiguration -> Maybe Text
$sel:codec:VideoConfiguration' :: VideoConfiguration -> Maybe Text
$sel:avcProfile:VideoConfiguration' :: VideoConfiguration -> Maybe Text
$sel:avcLevel:VideoConfiguration' :: VideoConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
avcLevel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
avcProfile
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
codec
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encoder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
targetBitrate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
targetFramerate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
videoHeight
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
videoWidth

instance Prelude.NFData VideoConfiguration where
  rnf :: VideoConfiguration -> ()
rnf VideoConfiguration' {Maybe Integer
Maybe Text
videoWidth :: Maybe Integer
videoHeight :: Maybe Integer
targetFramerate :: Maybe Integer
targetBitrate :: Maybe Integer
encoder :: Maybe Text
codec :: Maybe Text
avcProfile :: Maybe Text
avcLevel :: Maybe Text
$sel:videoWidth:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
$sel:videoHeight:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
$sel:targetFramerate:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
$sel:targetBitrate:VideoConfiguration' :: VideoConfiguration -> Maybe Integer
$sel:encoder:VideoConfiguration' :: VideoConfiguration -> Maybe Text
$sel:codec:VideoConfiguration' :: VideoConfiguration -> Maybe Text
$sel:avcProfile:VideoConfiguration' :: VideoConfiguration -> Maybe Text
$sel:avcLevel:VideoConfiguration' :: VideoConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
avcLevel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
avcProfile
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
codec
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encoder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
targetBitrate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
targetFramerate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
videoHeight
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
videoWidth