Class: HLS::ApplicationVideo::Declaration
- Inherits:
-
Data
- Object
- Data
- HLS::ApplicationVideo::Declaration
- Defined in:
- lib/hls/application_video.rb
Overview
A class-level rendition declaration. Resolved against an input at instance time to a concrete Rendition.
Instance Attribute Summary collapse
-
#bitrate ⇒ Object
readonly
Returns the value of attribute bitrate.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
Instance Attribute Details
#bitrate ⇒ Object (readonly)
Returns the value of attribute bitrate
47 48 49 |
# File 'lib/hls/application_video.rb', line 47 def bitrate @bitrate end |
#height ⇒ Object (readonly)
Returns the value of attribute height
47 48 49 |
# File 'lib/hls/application_video.rb', line 47 def height @height end |
#name ⇒ Object (readonly)
Returns the value of attribute name
47 48 49 |
# File 'lib/hls/application_video.rb', line 47 def name @name end |
#scale ⇒ Object (readonly)
Returns the value of attribute scale
47 48 49 |
# File 'lib/hls/application_video.rb', line 47 def scale @scale end |
#width ⇒ Object (readonly)
Returns the value of attribute width
47 48 49 |
# File 'lib/hls/application_video.rb', line 47 def width @width end |
Instance Method Details
#resolve(input:, bits_per_pixel:, max_bitrate_kbps:) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/hls/application_video.rb', line 50 def resolve(input:, bits_per_pixel:, max_bitrate_kbps:) if scaled? w = (input.width * scale).floor h = (input.height * scale).floor Rendition.new(width: w, height: h, bitrate: estimate_bitrate(w, h, bits_per_pixel, max_bitrate_kbps)) else Rendition.new(width: width, height: height, bitrate: bitrate) end end |
#scaled? ⇒ Boolean
48 |
# File 'lib/hls/application_video.rb', line 48 def scaled? = !scale.nil? |