Class: ONVIF::MediaAction::GetAudioEncoderConfiguration
- Defined in:
- lib/ruby_onvif_client/media/get_audio_encoder_configuration.rb
Instance Method Summary collapse
-
#run(c_token, cb) ⇒ Object
c_token 的结构 c_token //[ReferenceToken] Token of the requested audio encoder configuration.
Methods inherited from Action
#attribute, #callback, #create_event_onvif_message, #create_media_onvif_message, #create_ptz_onvif_message, #initialize, #send_message, #value
Constructor Details
This class inherits a constructor from ONVIF::Action
Instance Method Details
#run(c_token, cb) ⇒ Object
c_token 的结构
c_token //[ReferenceToken] Token of the requested audio encoder configuration.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ruby_onvif_client/media/get_audio_encoder_configuration.rb', line 9 def run c_token, cb = .body = ->(xml) do xml.wsdl(:GetAudioEncoderConfiguration) do xml.wsdl :ConfigurationToken, c_token end end do |success, result| if success xml_doc = Nokogiri::XML(result[:content]) success_result = { configuration: { name: value(xml_doc, '//tt:name'), use_count: value(xml_doc, '//tt:UseCount'), token: attribute(xml_doc, 'token'), encoding: value(xml_doc, '//tt:Encoding'), bitrate: value(xml_doc, '//tt:Bitrate'), sample_rate: value(xml_doc, '//tt:SampleRate'), multicast: { address: { type: value(xml_doc, '//tt:Type'), ipv4_address: value(xml_doc, '//tt:IPv4Address'), ipv6_address: value(xml_doc, '//tt:IPv6Address') }, port: value(xml_doc, "//tt:Port"), ttl: value(xml_doc, "//tt:TTL"), auto_start: value(xml_doc, "//tt:AutoStart") }, session_timeout: value(xml_doc, '//tt:SessionTimeout') } } callback cb, success, success_result else callback cb, success, result end end end |