Class: QTRefMovie::QTQuality
Overview
Quality Atom A quality atom describes the relative quality of a movie. This acts as a tie-breaker if more than one movie meets the specified requirements, and it is not otherwise obvious which movie should be played. This would be the case if two qualified movies have the same data rate and CPU speed requirements, for example, or if one movie requires a higher data rate and another requires a higher CPU speed, but both can be played on the current system. In these cases, applications should play the movie with the highest quality, as specified in the quality atom. Only one quality atom is allowed in a given reference movie descriptor atom.
A quality atom may contain the following information.
Size The number of bytes in this quality atom.
Type The type of this atom; this field must be set to ‘rmqu’.
Quality The relative quality of the movie, expressed as a 32-bit integer. A larger number indicates higher quality. A unique value should be given to each movie.
Instance Method Summary collapse
-
#initialize(quality = nil) ⇒ QTQuality
constructor
A new instance of QTQuality.
- #set_quality(quality) ⇒ Object
- #size ⇒ Object
- #to_s ⇒ Object
Methods inherited from QTBase
Constructor Details
#initialize(quality = nil) ⇒ QTQuality
Returns a new instance of QTQuality.
489 490 491 492 493 494 495 |
# File 'lib/qtrefmovie.rb', line 489 def initialize( quality = nil ) super() @type = 'rmqu' @flag = 0 @quality = 500 set_quality(quality) if quality end |
Instance Method Details
#set_quality(quality) ⇒ Object
497 498 499 |
# File 'lib/qtrefmovie.rb', line 497 def set_quality( quality ) @quality = quality end |
#size ⇒ Object
501 502 503 |
# File 'lib/qtrefmovie.rb', line 501 def size 4 * 4 end |
#to_s ⇒ Object
505 506 507 508 509 510 |
# File 'lib/qtrefmovie.rb', line 505 def to_s str = [size].pack('N') str += @type str += [@flag].pack('N') str += [@quality].pack('N') end |