Class: Mediakit::FFmpeg::Options::StreamSpecifier

Inherits:
Object
  • Object
show all
Defined in:
lib/mediakit/ffmpeg/options.rb

Overview

Constant Summary collapse

STREAM_TYPES =
['v', 'a', 's'].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream_index: nil, stream_type: nil, program_id: nil, metadata_tag_key: nil, metadata_tag_value: nil, usable: nil) ⇒ StreamSpecifier

Returns a new instance of StreamSpecifier.

Raises:

  • (ArgumentError)


168
169
170
171
172
173
174
175
176
# File 'lib/mediakit/ffmpeg/options.rb', line 168

def initialize(stream_index: nil, stream_type: nil, program_id: nil, metadata_tag_key: nil, metadata_tag_value: nil, usable: nil)
  raise(ArgumentError, "invalid args stream_type = #{stream_type}") if stream_type && !STREAM_TYPES.include?(stream_type)
  @stream_index       = stream_index
  @stream_type        = stream_type
  @program_id         = program_id
  @metadata_tag_key   = 
  @metadata_tag_value = 
  @usable             = usable
end

Instance Attribute Details

#metadata_tag_keyObject (readonly)

Returns the value of attribute metadata_tag_key.



165
166
167
# File 'lib/mediakit/ffmpeg/options.rb', line 165

def 
  @metadata_tag_key
end

#metadata_tag_valueObject (readonly)

Returns the value of attribute metadata_tag_value.



165
166
167
# File 'lib/mediakit/ffmpeg/options.rb', line 165

def 
  @metadata_tag_value
end

#program_idObject (readonly)

Returns the value of attribute program_id.



165
166
167
# File 'lib/mediakit/ffmpeg/options.rb', line 165

def program_id
  @program_id
end

#stream_indexObject (readonly)

Returns the value of attribute stream_index.



165
166
167
# File 'lib/mediakit/ffmpeg/options.rb', line 165

def stream_index
  @stream_index
end

#stream_typeObject (readonly)

Returns the value of attribute stream_type.



165
166
167
# File 'lib/mediakit/ffmpeg/options.rb', line 165

def stream_type
  @stream_type
end

#usableObject (readonly)

Returns the value of attribute usable.



165
166
167
# File 'lib/mediakit/ffmpeg/options.rb', line 165

def usable
  @usable
end

Instance Method Details

#to_sObject



178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/mediakit/ffmpeg/options.rb', line 178

def to_s
  case
  when stream_index?, stream_type?
    stream_specifier
  when program?
    program_specifier
  when meta?
    
  when usable?
    usable_specifier
  else
    raise(RuntimeError)
  end
end