Class: Media::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/media/container.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Container

Returns a new instance of Container.



9
10
11
12
# File 'lib/media/container.rb', line 9

def initialize(args)
  @input = args.fetch(:input)
  @probe = args.fetch(:probe, Command::Probe) 
end

Instance Method Details

#formatObject



14
15
16
# File 'lib/media/container.rb', line 14

def format
  OpenStruct.new(['format'])
end

#streams(args = {}) ⇒ Object



18
19
20
21
22
23
# File 'lib/media/container.rb', line 18

def streams(args={})
  type = args.fetch(:type, /.*/)
  
  ['streams'].select {|s| s['codec_type'].match(type)}.
    map {|s| OpenStruct.new(s)}
end