ruby_onvif_client 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5de91917b21531b02c1bd80b44102e85ad17674
4
- data.tar.gz: b2b90e5cac810290a37390e991c8fda2e4ff4e60
3
+ metadata.gz: 26111b2bbab6d053cd761d5e8f3ce694555a3820
4
+ data.tar.gz: 177d799002e666078f5e9745597e991b335bbb59
5
5
  SHA512:
6
- metadata.gz: 0cb26f8d7a4b9a82168d2daeef0d75d9dfa831e50abae5a95a5c5d670da0057cf23c329a89ba14edc01a8359e7b7bc0ed7dd5999d43b85ee1f97c6f9eab6761f
7
- data.tar.gz: d29d4118492dd338da8d90504a616664b2133176ac78515d09ba43528191f6eabf51d652bf7e584337795ae785ae09ee1611074cb5f0c7a320cd63937ff4c129
6
+ metadata.gz: ebefbbcb4ad636628332356be467704039375cc343402a05a8ee717731f512d93c8b92280ebff1d69d9712e3271e5eed4bfa10e43583e6d06aa7bc1918b61416
7
+ data.tar.gz: de0d5b0cdf6eca5792d6eb5d46fcbd9c165590d477c8adf3b6846727f168fc0e97777b7411b9e2a2b71079107929bce4f50507c1eedabad3befa72792e5d9203
@@ -1,3 +1,4 @@
1
1
  require_relative 'ruby_onvif_client/path'
2
2
  require_relative 'ruby_onvif_client/device_management'
3
+ require_relative 'ruby_onvif_client/media'
3
4
  require_relative 'ruby_onvif_client/device_discovery'
@@ -27,5 +27,13 @@ module ONVIF
27
27
  return node unless node.nil?
28
28
  ''
29
29
  end
30
+
31
+ def create_media_onvif_message options = {}
32
+ namespaces = {
33
+ :'xmlns:wsdl' => "http://www.onvif.org/ver10/media/wsdl"
34
+ }.merge(options[:namespaces] || {})
35
+ options[:namespaces] = namespaces
36
+ Message.new options
37
+ end
30
38
  end
31
39
  end
@@ -7,7 +7,7 @@ module ONVIF
7
7
  # c_token //[ReferenceToken] Token of the requested audio encoder configuration.
8
8
  #
9
9
  def run c_token, cb
10
- message = Message.new
10
+ message = create_media_onvif_message
11
11
  message.body = ->(xml) do
12
12
  xml.wsdl(:GetAudioEncoderConfiguration) do
13
13
  xml.wsdl :ConfigurationToken, c_token
@@ -9,7 +9,7 @@ module ONVIF
9
9
  # p_token: "xxxxxxx" //[ReferenceToken] Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
10
10
  # }
11
11
  def run options, cb
12
- message = Message.new
12
+ message = create_media_onvif_message
13
13
  message.body = ->(xml) do
14
14
  xml.wsdl(:GetAudioEncoderConfigurationOptions) do
15
15
  xml.wsdl :ConfigurationToken, options["c_token"]
@@ -4,7 +4,7 @@ module ONVIF
4
4
  module MediaAction
5
5
  class GetAudioEncoderConfigurations < Action
6
6
  def run cb
7
- message = Message.new
7
+ message = create_media_onvif_message
8
8
  message.body = ->(xml) do
9
9
  xml.wsdl(:GetAudioEncoderConfigurations)
10
10
  end
@@ -4,7 +4,7 @@ module ONVIF
4
4
  module MediaAction
5
5
  class GetAudioSourceConfigurations < Action
6
6
  def run cb
7
- message = Message.new
7
+ message = create_media_onvif_message
8
8
  message.body = ->(xml) do
9
9
  xml.wsdl(:GetAudioSourceConfigurations)
10
10
  end
@@ -0,0 +1,269 @@
1
+ require_relative '../action'
2
+
3
+ module ONVIF
4
+ module MediaAction
5
+ class GetProfiles < Action
6
+ def run cb
7
+ message = create_media_onvif_message
8
+ message.body = ->(xml) do
9
+ xml.wsdl(:GetProfiles)
10
+ end
11
+ send_message message do |success, result|
12
+ if success
13
+ xml_doc = Nokogiri::XML(result[:content])
14
+ profiles = []
15
+ xml_doc.xpath('//trt:Profiles').each do |root_node|
16
+ video_source = root_node.at_xpath("tt:VideoSourceConfiguration")
17
+ audio_source = root_node.at_xpath("tt:AudioSourceConfiguration")
18
+ video_encoder = root_node.at_xpath("tt:VideoEncoderConfiguration")
19
+ audio_encoder = root_node.at_xpath("tt:AudioEncoderConfiguration")
20
+ video_analytics = root_node.at_xpath("tt:VideoAnalyticsConfiguration")
21
+ ptz = root_node.at_xpath("tt:PTZConfiguration")
22
+ metadata = root_node.at_xpath("tt:MetadataConfiguration")
23
+ success_result = {
24
+ name: _get_name(root_node),
25
+ token: _get_token(root_node),
26
+ fixed: attribute(root_node, "fixed"),
27
+ extension: ""
28
+ }
29
+ success_result["video_source_configuration"] = _get_video_source_configuration(video_source) unless video_source.nil?
30
+ success_result["audio_source_configuration"] = _get_audio_source_configuration(audio_source) unless audio_source.nil?
31
+ success_result["video_encoder_configuration"] = _get_video_encoder_configuration(video_encoder) unless video_encoder.nil?
32
+ success_result["audio_encoder_configuration"] = _get_audio_encoder_configuration(audio_encoder) unless audio_encoder.nil?
33
+ success_result["video_analytics_configuration"] = _get_video_analytics_configuration(video_analytics) unless video_analytics.nil?
34
+ success_result["ptz_configuration"] = _get_ptz_configuration(ptz) unless ptz.nil?
35
+ success_result["metadata_configuration"] = _get_metadata_configuration(metadata) unless metadata.nil?
36
+ profiles << success_result
37
+ end
38
+ callback cb, success, profiles
39
+ else
40
+ callback cb, success, result
41
+ end
42
+ end
43
+ end
44
+
45
+ def _get_node parent_node, node_name
46
+ parent_node.at_xpath(node_name)
47
+ end
48
+ def _get_name parent_node
49
+ value(parent_node, "tt:Name")
50
+ end
51
+ def _get_use_count parent_node
52
+ value(parent_node, "tt:UseCount")
53
+ end
54
+ def _get_token parent_node
55
+ attribute(parent_node, "token")
56
+ end
57
+ def _get_min_max xml_doc, parent_name
58
+ this_node = xml_doc
59
+ unless parent_name.nil?
60
+ this_node = xml_doc.at_xpath(parent_name)
61
+ end
62
+ return {
63
+ min: value(this_node, "tt:Min"),
64
+ max: value(this_node, "tt:Max")
65
+ }
66
+ end
67
+ def _get_public_sector parent_node
68
+ {
69
+ name: _get_name(parent_node),
70
+ token: _get_token(parent_node),
71
+ use_count: _get_use_count(parent_node)
72
+ }
73
+ end
74
+
75
+ def _get_video_source_configuration parent_node
76
+ configuration = _get_public_sector(parent_node)
77
+ configuration["source_token"] = value(parent_node, "tt:SourceToken")
78
+ bounds = parent_node.at_xpath("tt:Bounds")
79
+ configuration["bounds"] = {
80
+ x: attribute(bounds, "x"),
81
+ y: attribute(bounds, "y"),
82
+ width: attribute(bounds, "width"),
83
+ height: attribute(bounds, "height")
84
+ }
85
+ return configuration
86
+ end
87
+
88
+ def _get_audio_source_configuration parent_node
89
+ configuration = _get_public_sector(parent_node)
90
+ configuration["source_token"] = value(parent_node, "tt:SourceToken")
91
+ return configuration
92
+ end
93
+
94
+ def _get_video_encoder_configuration parent_node
95
+ configuration = _get_public_sector(parent_node)
96
+ configuration["encoding"] = value(parent_node, "tt:Encoding")
97
+ configuration["resolution"] = {
98
+ width: value(_get_node(parent_node, "tt:Resolution"), "tt:Width"),
99
+ height: value(_get_node(parent_node, "tt:Resolution"), "tt:Height")
100
+ }
101
+ configuration["quality"] = value(parent_node, "tt:Quality")
102
+ configuration["rate_control"] = {
103
+ frame_rate_limit: value(_get_node(parent_node, "tt:RateControl"), "tt:FrameRateLimit"),
104
+ encoding_interval: value(_get_node(parent_node, "tt:RateControl"), "tt:EncodingInterval"),
105
+ bitrate_limit: value(_get_node(parent_node, "tt:RateControl"), "tt:BitrateLimit")
106
+ }
107
+ unless parent_node.at_xpath('//tt:MPEG4').nil?
108
+ configuration["MPEG4"] = {
109
+ gov_length: value(_get_node(parent_node, "tt:MPEG4"), "tt:GovLength"),
110
+ mpeg4_profile: value(_get_node(parent_node, "tt:MPEG4"), "tt:Mpeg4Profile")
111
+ }
112
+ end
113
+ unless parent_node.at_xpath('//tt:H264').nil?
114
+ configuration["H264"] = {
115
+ gov_length: value(_get_node(parent_node, "tt:H264"), "tt:GovLength"),
116
+ h264_profile: value(_get_node(parent_node, "tt:H264"), "tt:H264Profile")
117
+ }
118
+ end
119
+ configuration["multicast"] = _get_multicast(parent_node)
120
+ configuration["session_timeout"] = value(parent_node, "tt:SessionTimeout")
121
+ return configuration
122
+ end
123
+
124
+ def _get_audio_encoder_configuration parent_node
125
+ configuration = _get_public_sector(parent_node)
126
+ configuration["encoding"] = value(parent_node, "tt:Encoding")
127
+ configuration["bitrate"] = value(parent_node, "tt:Bitrate")
128
+ configuration["sample_rate"] = value(parent_node, "tt:SampleRate")
129
+ configuration["multicast"] = _get_multicast(parent_node)
130
+ configuration["session_timeout"] = value(parent_node, "tt:SessionTimeout")
131
+ return configuration
132
+ end
133
+
134
+ def _get_video_analytics_configuration parent_node
135
+ configuration = _get_public_sector(parent_node)
136
+ analytics_module = []; rule = []
137
+ parent_node.at_xpath("tt:AnalyticsEngineConfiguration//tt:AnalyticsModule").each do |node|
138
+ analytics_module << {
139
+ name: attribute(node, "Name"),
140
+ type: attribute(node, "Type"),
141
+ parameters: _get_parameters(node)
142
+ }
143
+ end
144
+ parent_node.at_xpath("tt:AnalyticsEngineConfiguration//tt:RuleEngineConfiguration").each do |node|
145
+ rule << {
146
+ name: attribute(node, "Name"),
147
+ type: attribute(node, "Type"),
148
+ parameters: _get_parameters(node)
149
+ }
150
+ end
151
+ configuration["analytics_engine_configuration"] = {
152
+ analytics_module: analytics_module,
153
+ extension: ""
154
+ }
155
+ configuration["rule_engine_configuration"] = {
156
+ rule: rule,
157
+ extension: ""
158
+ }
159
+ return configuration
160
+ end
161
+
162
+ def _get_ptz_configuration parent_node
163
+ configuration = _get_public_sector(parent_node)
164
+ configuration["node_token"] = value(parent_node, "tt:NodeToken")
165
+ configuration["default_absolute_pant_tilt_position_space"] = value(parent_node, "tt:DefaultAbsolutePantTiltPositionSpace")
166
+ configuration["default_absolute_zoom_position_space"] = value(parent_node, "tt:DefaultAbsoluteZoomPositionSpace")
167
+ configuration["default_relative_pan_tilt_translation_space"] = value(parent_node, "tt:DefaultRelativePanTiltTranslationSpace")
168
+ configuration["default_relative_zoom_translation_space"] = value(parent_node, "tt:DefaultRelativeZoomTranslationSpace")
169
+ configuration["default_continuous_pan_tilt_velocity_space"] = value(parent_node, "tt:DefaultContinuousPanTiltVelocitySpace")
170
+ configuration["default_continuous_zoom_velocity_space"] = value(parent_node, "tt:DefaultContinuousZoomVelocitySpace")
171
+ pan_tilt = _get_node(parent_node,"//tt:DefaultPTZSpeed//tt:PanTilt")
172
+ zoom = _get_node(parent_node,"//tt:DefaultPTZSpeed//tt:Zoom")
173
+ configuration["default_ptz_speed"] = {
174
+ pan_tilt:{
175
+ x: attribute(pan_tilt, "x"),
176
+ y: attribute(pan_tilt, "y"),
177
+ space: attribute(pan_tilt, "space")
178
+ },
179
+ zoom: {
180
+ x: attribute(zoom, "x"),
181
+ space: attribute(zoom, "space")
182
+ }
183
+ }
184
+ configuration["fefault_ptz_timeout"] = value(parent_node, "tt:DefaultPTZTimeout")
185
+ configuration["pan_tilt_limits"] = {
186
+ range: {
187
+ uri: value(_get_node(parent_node, "tt:PanTiltLimits//tt:Range"), "tt:URI"),
188
+ x_range: _get_min_max(_get_node(parent_node,"tt:PanTiltLimits//tt:Range"), "tt:XRange"),
189
+ y_range: _get_min_max(_get_node(parent_node,"tt:PanTiltLimits//tt:Range"), "tt:YRange")
190
+ }
191
+ }
192
+ configuration["zoom_limits"] = {
193
+ range: {
194
+ uri: value(_get_node(parent_node, "tt:PanTiltLimits//tt:Range"), "tt:URI"),
195
+ x_range: _get_min_max(_get_node(parent_node,"tt:PanTiltLimits//tt:Range"), "tt:XRange"),
196
+ }
197
+ }
198
+ configuration["extension"] = ""
199
+ return configuration
200
+ end
201
+
202
+ def _get_metadata_configuration parent_node
203
+ configuration = _get_public_sector(parent_node)
204
+ configuration["ptz_status"] = {
205
+ status: value(_get_node(parent_node, "tt:PTZStatus"), "tt:Status"),
206
+ sosition: value(_get_node(parent_node, "tt:PTZStatus"), "tt:Position")
207
+ }
208
+ configuration["events"] = {
209
+ filter: value(_get_node(parent_node, "tt:Events"), "tt:Filter"),
210
+ subscription_policy: value(_get_node(parent_node, "tt:Events"), "tt:SubscriptionPolicy")
211
+ }
212
+ configuration["analytics"] = value(parent_node, "tt:Analytics")
213
+ configuration["multicast"] = _get_multicast(parent_node)
214
+ configuration["session_timeout"] = value(parent_node, "tt:SessionTimeout")
215
+ unless parent_node.at_xpath("tt:AnalyticsEngineConfiguration//tt:AnalyticsModule").nil?
216
+ analytics_module = []
217
+ parent_node.at_xpath("tt:AnalyticsEngineConfiguration//tt:AnalyticsModule").each do |node|
218
+ analytics_module << {
219
+ name: attribute(node, "Name"),
220
+ type: attribute(node, "Type"),
221
+ parameters: _get_parameters(node)
222
+ }
223
+ end
224
+ configuration["analytics_engine_configuration"] = {
225
+ analytics_module: analytics_module,
226
+ extension: ""
227
+ }
228
+ end
229
+ configuration["extension"] = ""
230
+ return configuration
231
+ end
232
+
233
+ def _get_multicast parent_node
234
+ {
235
+ address: {
236
+ type: value(_get_node(parent_node, "//tt:Multicast//tt:Address"), '//tt:Type'),
237
+ ipv4_address: value(_get_node(parent_node, "//tt:Multicast//tt:Address"), '//tt:IPv4Address'),
238
+ ipv6_address: value(_get_node(parent_node, "//tt:Multicast//tt:Address"), '//tt:IPv6Address')
239
+ },
240
+ port: value(_get_node(parent_node, "//tt:Multicast"), "tt:Port"),
241
+ ttl: value(_get_node(parent_node, "//tt:Multicast"), "tt:TTL"),
242
+ auto_start: value(_get_node(parent_node, "//tt:Multicast"), "tt:AutoStart")
243
+ }
244
+ end
245
+
246
+ def _get_parameters parent_node
247
+ simple_item = []
248
+ element_item = []
249
+ parent_node.at_xpath("tt:SimpleItem").each do |node|
250
+ simple_item << {
251
+ name: attribute(node, "Name"),
252
+ value: attribute(node, "Value")
253
+ }
254
+ end
255
+ parent_node.at_xpath("tt:ElementItem").each do |node|
256
+ element_item << {
257
+ xsd_any: value(node, "tt:xsd:any"),
258
+ name: attribute(node, "Name")
259
+ }
260
+ end
261
+ return {
262
+ simple_item: simple_item,
263
+ element_item: element_item,
264
+ extension: ""
265
+ }
266
+ end
267
+ end
268
+ end
269
+ end
@@ -17,7 +17,7 @@ module ONVIF
17
17
  # profile_token: "xxxxxxx" // [ReferenceToken]
18
18
  # }
19
19
  def run options, cb
20
- message = Message.new namespaces: {:'xmlns:sch' => 'http://www.onvif.org/ver10/schema'}
20
+ message = create_media_onvif_message namespaces: {:'xmlns:sch' => 'http://www.onvif.org/ver10/schema'}
21
21
  message.body = ->(xml) do
22
22
  xml.wsdl(:GetStreamUri) do
23
23
  xml.wsdl(:StreamSetup) do
@@ -5,7 +5,7 @@ module ONVIF
5
5
  class GetVideoEncoderConfiguration < Action
6
6
  # c_token 的结构 // [ReferenceToken] Token of the requested video encoder configuration.
7
7
  def run c_token, cb
8
- message = Message.new
8
+ message = create_media_onvif_message
9
9
  message.body = ->(xml) do
10
10
  xml.wsdl(:GetVideoEncoderConfiguration) do
11
11
  xml.wsdl :ConfigurationToken, c_token
@@ -31,14 +31,6 @@ module ONVIF
31
31
  encoding_interval: value(rcl, "tt:EncodingInterval"),
32
32
  bitrate_limit: value(rcl, "tt:BitrateLimit")
33
33
  },
34
- mpeg4: {
35
- gov_length: value(_get_node(xml_doc, "//tt:MPEG4"), "//tt:GovLength"),
36
- mpeg4_profile: value(_get_node(xml_doc, "//tt:MPEG4"), "//tt:Mpeg4Profile")
37
- },
38
- h264: {
39
- gov_length: value(_get_node(xml_doc, "//tt:H264"), "//tt:GovLength"),
40
- h264_profile: value(_get_node(xml_doc, "//tt:H264"), "//tt:H264Profile")
41
- },
42
34
  multicast: {
43
35
  address: {
44
36
  type: value(_get_node(xml_doc, "//tt:Multicast//tt:Address"), '//tt:Type'),
@@ -51,54 +43,28 @@ module ONVIF
51
43
  },
52
44
  session_timeout: value(xml_doc, "//tt:SessionTimeout")
53
45
  }
54
-
46
+ unless xml_doc.at_xpath('//tt:MPEG4').nil?
47
+ configuration["mpeg4"] = {
48
+ gov_length: value(_get_node(xml_doc, "//tt:MPEG4"), "//tt:GovLength"),
49
+ mpeg4_profile: value(_get_node(xml_doc, "//tt:MPEG4"), "//tt:Mpeg4Profile")
50
+ }
51
+ end
52
+ unless xml_doc.at_xpath('//tt:H264').nil?
53
+ configuration["h264"] = {
54
+ gov_length: value(_get_node(xml_doc, "//tt:H264"), "//tt:GovLength"),
55
+ h264_profile: value(_get_node(xml_doc, "//tt:H264"), "//tt:H264Profile")
56
+ }
57
+ end
55
58
  callback cb, success, configuration
56
59
  else
57
60
  callback cb, success, result
58
61
  end
59
62
  end
60
63
  end
61
- def _get_profiles_supported xml_doc, parent_name
62
- this_node = xml_doc.at_xpath(parent_name)
63
- result_val = []
64
- this_node.each do |node|
65
- result_val << node.content
66
- end
67
- return result_val
68
- end
64
+
69
65
  def _get_node parent_node, node_name
70
66
  parent_node.at_xpath(node_name)
71
67
  end
72
-
73
- def _get_each_val xml_doc, parent_name
74
- result_val = []
75
- xml_doc.each do |node|
76
- result_val << _get_width_height(node, parent_name)
77
- end
78
- return result_val
79
- end
80
-
81
- def _get_min_max xml_doc, parent_name
82
- this_node = xml_doc
83
- unless parent_name.nil?
84
- this_node = xml_doc.at_xpath(parent_name)
85
- end
86
- return {
87
- min: value(this_node, "tt:Min"),
88
- max: value(this_node, "tt:Max")
89
- }
90
- end
91
-
92
- def _get_width_height xml_doc, parent_name
93
- this_node = xml_doc
94
- unless parent_name.nil?
95
- this_node = xml_doc.at_xpath(parent_name)
96
- end
97
- return {
98
- width: value(this_node, "tt:Width"),
99
- height: value(this_node, "tt:Height")
100
- }
101
- end
102
68
  end
103
69
  end
104
70
  end
@@ -9,7 +9,7 @@ module ONVIF
9
9
  # p_token: "xxxxxxx" //[ReferenceToken] Optional ProfileToken that specifies an existing media profile that the options shall be compatible with.
10
10
  # }
11
11
  def run options, cb
12
- message = Message.new
12
+ message = create_media_onvif_message
13
13
  message.body = ->(xml) do
14
14
  xml.wsdl(:GetVideoEncoderConfigurationOptions) do
15
15
  xml.wsdl :ConfigurationToken, options["c_token"]
@@ -26,23 +26,26 @@ module ONVIF
26
26
  frame_rate_range: _get_min_max(_get_node(xml_doc, "//tt:JPEG"), "//tt:FrameRateRange"),
27
27
  rncoding_interval_range: _get_min_max(_get_node(xml_doc, "//tt:JPEG"), "//tt:FrameRateRange")
28
28
  },
29
- mpeg4: {
29
+ extension: ""
30
+ }
31
+ unless xml_doc.at_xpath('//tt:MPEG4').nil?
32
+ options["mpeg4"] = {
30
33
  resolutions_available: _get_each_val(_get_node(xml_doc, "//tt:MPEG4"), "//tt:ResolutionsAvailable"),
31
34
  gov_length_range: _get_min_max(_get_node(xml_doc, "//tt:MPEG4"), "//tt:GovLengthRange"),
32
35
  frame_rate_range: _get_min_max(_get_node(xml_doc, "//tt:MPEG4"), "//tt:FrameRateRange"),
33
36
  rncoding_interval_range: _get_min_max(_get_node(xml_doc, "//tt:MPEG4"), "//tt:EncodingIntervalRange"),
34
37
  mpeg4_profiles_supported: _get_profiles_supported(_get_node(xml_doc, "//tt:MPEG4"), "//tt:Mpeg4ProfilesSupported")
35
- },
36
- h264: {
37
- resolutions_available: _get_each_val(_get_node(xml_doc, "//tt:h264"), "//tt:ResolutionsAvailable"),
38
- gov_length_range: _get_min_max(_get_node(xml_doc, "//tt:h264"), "//tt:GovLengthRange"),
39
- frame_rate_range: _get_min_max(_get_node(xml_doc, "//tt:h264"), "//tt:FrameRateRange"),
40
- rncoding_interval_range: _get_min_max(_get_node(xml_doc, "//tt:h264"), "//tt:EncodingIntervalRange"),
41
- h264_profiles_supported: _get_profiles_supported(_get_node(xml_doc, "//tt:h264"), "//tt:H264ProfilesSupported")
42
- },
43
- extension: ""
44
- }
45
-
38
+ }
39
+ end
40
+ unless xml_doc.at_xpath('//tt:H264').nil?
41
+ options["h264"] = {
42
+ resolutions_available: _get_each_val(_get_node(xml_doc, "//tt:H264"), "//tt:ResolutionsAvailable"),
43
+ gov_length_range: _get_min_max(_get_node(xml_doc, "//tt:H264"), "//tt:GovLengthRange"),
44
+ frame_rate_range: _get_min_max(_get_node(xml_doc, "//tt:H264"), "//tt:FrameRateRange"),
45
+ rncoding_interval_range: _get_min_max(_get_node(xml_doc, "//tt:H264"), "//tt:EncodingIntervalRange"),
46
+ h264_profiles_supported: _get_profiles_supported(_get_node(xml_doc, "//tt:H264"), "//tt:H264ProfilesSupported")
47
+ }
48
+ end
46
49
  callback cb, success, options
47
50
  else
48
51
  callback cb, success, result
@@ -7,7 +7,7 @@ module ONVIF
7
7
  # c_token //[ReferenceToken] Token of the requested audio encoder configuration.
8
8
  #
9
9
  def run c_token, cb
10
- message = Message.new
10
+ message = create_media_onvif_message
11
11
  message.body = ->(xml) do
12
12
  xml.wsdl(:GetVideoSourceConfiguration) do
13
13
  xml.wsdl :ConfigurationToken, c_token
@@ -4,7 +4,7 @@ module ONVIF
4
4
  module MediaAction
5
5
  class GetVideoSourceConfigurations < Action
6
6
  def run cb
7
- message = Message.new
7
+ message = create_media_onvif_message
8
8
  message.body = ->(xml) do
9
9
  xml.wsdl(:GetVideoSourceConfigurations)
10
10
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ruby_onvif_client'
3
- s.version = '0.0.3'
3
+ s.version = '0.0.4'
4
4
  s.date = '2013-07-04'
5
5
  s.summary = "Ruby实现的onvif客户端"
6
6
  s.description = "使用ruby实现的简单的onvif客户端"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_onvif_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jimxl
@@ -93,6 +93,7 @@ files:
93
93
  - lib/ruby_onvif_client/media/get_audio_encoder_configurations.rb
94
94
  - lib/ruby_onvif_client/media/get_audio_encoder_configuration_options.rb
95
95
  - lib/ruby_onvif_client/media/get_audio_encoder_configuration.rb
96
+ - lib/ruby_onvif_client/media/get_profiles.rb
96
97
  - lib/ruby_onvif_client/media/get_video_source_configuration.rb
97
98
  - lib/ruby_onvif_client/media/get_video_source_configurations.rb
98
99
  - lib/ruby_onvif_client/media/get_audio_source_configurations.rb