Sha256: edee611b789f3543005c83b344f81c7a63d3dd202593c2044eb3e451384bb895

Contents?: true

Size: 575 Bytes

Versions: 15

Compression:

Stored size: 575 Bytes

Contents

#
# Implementes MetaInfo Interface for libAV
#

# MetaInformation = Struct.new(:duration, :bit_rate, :size, :format, :extension, :raw)

require_relative '../time_index'

module VCSRuby
  class LibAVMetaInfo
    attr_reader :raw

    def initialize meta_info
      @raw = meta_info
    end

    def duration
      TimeIndex.new(@raw['duration'].to_f)
    end

    def bit_rate
      @raw['bit_rate'].to_i
    end

    def size
      @raw['size'].to_i
    end

    def format
      @raw['format_long_name']
    end

    def extension
      @raw['format_name']
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vcs_ruby-1.1.16 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.15 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.14 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.13 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.12 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.11 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.10 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.8 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.7 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.6 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.5 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.4 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.3 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.2 lib/libAV/libav_meta_info.rb
vcs_ruby-1.1.0 lib/libAV/libav_meta_info.rb