def initialize(source_element)
@pipeline = Gst::Pipeline.new 'media-info'
@typefind = Gst::ElementFactory.make 'typefind', 'typefind'
@source_element = source_element
@source = Gst::ElementFactory.make @source_element, 'source'
if @source != nil
@pipeline.add @source
else
@source_element = nil
@source = nil
end
@decoder = @type = @format = @metadata = @stream = nil
@decoders = Hash.new
@pipeline.signal_connect 'deep_notify' do |obj, origin, pspec|
case pspec.name
when 'metadata'
@metadata = origin.metadata
when 'caps'
@format = origin.caps if origin == @decoder_pad
when 'streaminfo'
@streaminfo = origin.streaminfo
end
end
end