From c4683d90a90c2974a9c3d1d3d111f46182803dac Mon Sep 17 00:00:00 2001 From: Aaron Kling Date: Tue, 26 Mar 2024 13:43:58 -0500 Subject: [PATCH] Format code using astyle google format Commands used: astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.cpp astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.h --- src/bindings.h | 4533 ++++++++--------- src/zm.cpp | 8 +- src/zm.h | 8 +- src/zm_analysis_thread.cpp | 2 +- src/zm_box.h | 8 +- src/zm_buffer.cpp | 8 +- src/zm_buffer.h | 14 +- src/zm_camera.cpp | 83 +- src/zm_camera.h | 44 +- src/zm_comms.h | 28 +- src/zm_config.cpp | 16 +- src/zm_config.h | 10 +- src/zm_crypt.cpp | 55 +- src/zm_crypt.h | 8 +- src/zm_db.cpp | 39 +- src/zm_db.h | 36 +- src/zm_decoder_thread.cpp | 2 +- src/zm_event.cpp | 209 +- src/zm_event.h | 216 +- src/zm_eventstream.cpp | 734 ++- src/zm_eventstream.h | 187 +- src/zm_exception.cpp | 8 +- src/zm_exception.h | 17 +- src/zm_ffmpeg.cpp | 252 +- src/zm_ffmpeg.h | 143 +- src/zm_ffmpeg_camera.cpp | 219 +- src/zm_ffmpeg_camera.h | 126 +- src/zm_ffmpeg_input.cpp | 82 +- src/zm_ffmpeg_input.h | 78 +- src/zm_ffmpeg_output.cpp | 78 +- src/zm_ffmpeg_output.h | 48 +- src/zm_fifo.h | 44 +- src/zm_fifo_debug.cpp | 14 +- src/zm_fifo_debug.h | 12 +- src/zm_fifo_stream.cpp | 14 +- src/zm_fifo_stream.h | 34 +- src/zm_file_camera.cpp | 25 +- src/zm_file_camera.h | 8 +- src/zm_font.cpp | 4 +- src/zm_frame.cpp | 14 +- src/zm_frame.h | 10 +- src/zm_group.cpp | 23 +- src/zm_group.h | 8 +- src/zm_group_permission.cpp | 2 +- src/zm_group_permission.h | 11 +- src/zm_image.cpp | 1961 ++++--- src/zm_image.h | 350 +- src/zm_image_analyser.cpp | 24 +- src/zm_image_analyser.h | 6 +- src/zm_jpeg.cpp | 746 +-- src/zm_jpeg.h | 33 +- src/zm_libvlc_camera.cpp | 87 +- src/zm_libvlc_camera.h | 14 +- src/zm_libvnc_camera.cpp | 133 +- src/zm_libvnc_camera.h | 36 +- src/zm_local_camera.cpp | 550 +- src/zm_local_camera.h | 42 +- src/zm_logger.cpp | 74 +- src/zm_logger.h | 32 +- src/zm_mem_utils.h | 20 +- src/zm_monitor.cpp | 1337 ++--- src/zm_monitor.h | 98 +- src/zm_monitor_amcrest.cpp | 17 +- src/zm_monitor_janus.cpp | 48 +- src/zm_monitor_monitorlink.cpp | 3 +- src/zm_monitor_permission.h | 11 +- src/zm_monitor_rtsp2web.cpp | 3 +- src/zm_monitorlink_expression.cpp | 102 +- src/zm_monitorlink_expression.h | 128 +- src/zm_monitorlink_token.h | 324 +- src/zm_monitorstream.cpp | 423 +- src/zm_monitorstream.h | 92 +- src/zm_mpeg.cpp | 549 +- src/zm_mpeg.h | 10 +- src/zm_mqtt.cpp | 9 +- src/zm_mqtt.h | 50 +- src/zm_packet.cpp | 85 +- src/zm_packet.h | 160 +- src/zm_packetqueue.cpp | 155 +- src/zm_packetqueue.h | 104 +- src/zm_poll_thread.cpp | 2 +- src/zm_poly.cpp | 14 +- src/zm_poly.h | 8 +- src/zm_regexp.cpp | 57 +- src/zm_regexp.h | 21 +- src/zm_remote_camera.cpp | 59 +- src/zm_remote_camera.h | 12 +- src/zm_remote_camera_http.cpp | 1368 +++-- src/zm_remote_camera_http.h | 48 +- src/zm_remote_camera_nvsocket.cpp | 19 +- src/zm_remote_camera_nvsocket.h | 38 +- src/zm_remote_camera_rtsp.cpp | 71 +- src/zm_remote_camera_rtsp.h | 48 +- src/zm_rgb.h | 56 +- src/zm_rtp.cpp | 8 +- src/zm_rtp.h | 8 +- src/zm_rtp_ctrl.cpp | 188 +- src/zm_rtp_ctrl.h | 22 +- src/zm_rtp_data.cpp | 69 +- src/zm_rtp_data.h | 22 +- src/zm_rtp_source.cpp | 100 +- src/zm_rtp_source.h | 76 +- src/zm_rtsp.cpp | 465 +- src/zm_rtsp.h | 47 +- src/zm_rtsp_auth.cpp | 36 +- src/zm_rtsp_auth.h | 22 +- src/zm_rtsp_server.cpp | 56 +- src/zm_rtsp_server_adts_source.cpp | 29 +- src/zm_rtsp_server_adts_source.h | 62 +- src/zm_rtsp_server_authenticator.h | 124 +- src/zm_rtsp_server_device_source.cpp | 81 +- src/zm_rtsp_server_device_source.h | 96 +- src/zm_rtsp_server_fifo_adts_source.cpp | 25 +- src/zm_rtsp_server_fifo_adts_source.h | 16 +- src/zm_rtsp_server_fifo_audio_source.cpp | 19 +- src/zm_rtsp_server_fifo_audio_source.h | 50 +- src/zm_rtsp_server_fifo_h264_source.cpp | 278 +- src/zm_rtsp_server_fifo_h264_source.h | 78 +- src/zm_rtsp_server_fifo_source.cpp | 27 +- src/zm_rtsp_server_fifo_source.h | 76 +- src/zm_rtsp_server_fifo_video_source.cpp | 13 +- src/zm_rtsp_server_fifo_video_source.h | 38 +- src/zm_rtsp_server_frame.h | 110 +- ...zm_rtsp_server_server_media_subsession.cpp | 131 +- src/zm_rtsp_server_server_media_subsession.h | 40 +- ...server_unicast_server_media_subsession.cpp | 44 +- ...p_server_unicast_server_media_subsession.h | 45 +- src/zm_sdp.cpp | 328 +- src/zm_sdp.h | 108 +- src/zm_server.cpp | 6 +- src/zm_server.h | 34 +- src/zm_signal.cpp | 236 +- src/zm_signal.h | 8 +- src/zm_storage.cpp | 6 +- src/zm_storage.h | 42 +- src/zm_stream.cpp | 39 +- src/zm_stream.h | 25 +- src/zm_swscale.cpp | 113 +- src/zm_swscale.h | 44 +- src/zm_time.cpp | 14 +- src/zm_time.h | 18 +- src/zm_uri.cpp | 66 +- src/zm_uri.h | 2 +- src/zm_user.cpp | 76 +- src/zm_user.h | 11 +- src/zm_utils.cpp | 76 +- src/zm_utils.h | 22 +- src/zm_vector2.h | 8 +- src/zm_videostore.cpp | 271 +- src/zm_videostore.h | 158 +- src/zm_zone.cpp | 248 +- src/zm_zone.h | 345 +- src/zm_zone_stats.h | 28 +- src/zmbenchmark.cpp | 74 +- src/zmc.cpp | 100 +- src/zms.cpp | 18 +- src/zmu.cpp | 481 +- 157 files changed, 11313 insertions(+), 11352 deletions(-) diff --git a/src/bindings.h b/src/bindings.h index 5fcf865e0..feab8b59f 100644 --- a/src/bindings.h +++ b/src/bindings.h @@ -517,8 +517,8 @@ typedef xsd__token wstop__ConcreteTopicExpression "(([\\i-[:]][\\c-[:]]*:)?[\\i- /// - tev__Capabilities* tev__Capabilities::soap_dup(soap*) returns deep copy of tev__Capabilities, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - tev__Capabilities::soap_del() deep deletes tev__Capabilities data members, use only after tev__Capabilities::soap_dup(NULL) (use soapcpp2 -Ed) /// - int tev__Capabilities::soap_type() returns SOAP_TYPE_tev__Capabilities or derived type identifier -class tev__Capabilities -{ public: +class tev__Capabilities { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -526,7 +526,7 @@ class tev__Capabilities /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. ///
/// Indicates that the WS Subscription policy is supported. ///
@@ -582,7 +582,7 @@ class tev__Capabilities /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief "http://www.onvif.org/ver10/events/wsdl":EventBrokerConfig is a complexType. @@ -598,62 +598,62 @@ class tev__Capabilities /// - tev__EventBrokerConfig* tev__EventBrokerConfig::soap_dup(soap*) returns deep copy of tev__EventBrokerConfig, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - tev__EventBrokerConfig::soap_del() deep deletes tev__EventBrokerConfig data members, use only after tev__EventBrokerConfig::soap_dup(NULL) (use soapcpp2 -Ed) /// - int tev__EventBrokerConfig::soap_type() returns SOAP_TYPE_tev__EventBrokerConfig or derived type identifier -class tev__EventBrokerConfig -{ public: +class tev__EventBrokerConfig { + public: ///
/// Event broker address in the format "scheme://host:port[/resource]". The supported schemes shall be returned by the EventBrokerProtocols capability. The resource part of the URL is only valid when using websocket. The Address must be unique. ///
/// /// Element "Address" of type xs:anyURI. - xsd__anyURI Address 1; ///< Required element. + xsd__anyURI Address 1; ///< Required element. ///
/// Prefix that will be prepended to all topics before they are published. This is used to make published topics unique for each device. TopicPrefix is not allowed to be empty. ///
/// /// Element "TopicPrefix" of type xs:string. - std::string TopicPrefix 1; ///< Required element. + std::string TopicPrefix 1; ///< Required element. ///
/// User name for the event broker. ///
/// /// Element "UserName" of type xs:string. - std::string* UserName 0; ///< Optional element. + std::string* UserName 0; ///< Optional element. ///
/// Password for the event broker. Password shall not be included when returned with GetEventBrokers. ///
/// /// Element "Password" of type xs:string. - std::string* Password 0; ///< Optional element. + std::string* Password 0; ///< Optional element. ///
/// Optional certificate ID in the key store pointing to a client certificate to be used for authenticating the device at the message broker. ///
/// /// Element "CertificateID" of type xs:token. - xsd__token* CertificateID 0; ///< Optional element. + xsd__token* CertificateID 0; ///< Optional element. ///
/// Concrete Topic Expression to select specific topics to publish. ///
/// /// Element "PublishFilter" of type "http://docs.oasis-open.org/wsn/b-2":FilterType. - wsnt__FilterType* PublishFilter 0; ///< Optional element. + wsnt__FilterType* PublishFilter 0; ///< Optional element. ///
/// Quality of service level to use when publishing. This defines the guarantee of delivery for a specific message: 0 = At most once, 1 = At least once, 2 = Exactly once. ///
/// /// Element "QoS" of type xs:int. - int* QoS 0; ///< Optional element. + int* QoS 0; ///< Optional element. ///
/// Current connection status (see tev:ConnectionStatus for possible values). ///
/// /// Element "Status" of type xs:string. - std::string* Status 0; ///< Optional element. + std::string* Status 0; ///< Optional element. ///
/// The ID of the certification path validation policy used to validate the broker certificate. In case encryption is used but no validation policy is specified, the device shall not validate the broker certificate. ///
/// /// Element "CertPathValidationPolicyID" of type xs:string. - std::string* CertPathValidationPolicyID 0; ///< Optional element. + std::string* CertPathValidationPolicyID 0; ///< Optional element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -661,7 +661,7 @@ class tev__EventBrokerConfig /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -669,7 +669,7 @@ class tev__EventBrokerConfig /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":GetServiceCapabilities @@ -686,10 +686,10 @@ class tev__EventBrokerConfig /// - _tev__GetServiceCapabilities* _tev__GetServiceCapabilities::soap_dup(soap*) returns deep copy of _tev__GetServiceCapabilities, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__GetServiceCapabilities::soap_del() deep deletes _tev__GetServiceCapabilities data members, use only after _tev__GetServiceCapabilities::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__GetServiceCapabilities::soap_type() returns SOAP_TYPE__tev__GetServiceCapabilities or derived type identifier -class _tev__GetServiceCapabilities -{ public: +class _tev__GetServiceCapabilities { + public: /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":GetServiceCapabilitiesResponse @@ -706,16 +706,16 @@ class _tev__GetServiceCapabilities /// - _tev__GetServiceCapabilitiesResponse* _tev__GetServiceCapabilitiesResponse::soap_dup(soap*) returns deep copy of _tev__GetServiceCapabilitiesResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__GetServiceCapabilitiesResponse::soap_del() deep deletes _tev__GetServiceCapabilitiesResponse data members, use only after _tev__GetServiceCapabilitiesResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__GetServiceCapabilitiesResponse::soap_type() returns SOAP_TYPE__tev__GetServiceCapabilitiesResponse or derived type identifier -class _tev__GetServiceCapabilitiesResponse -{ public: +class _tev__GetServiceCapabilitiesResponse { + public: ///
/// The capabilities for the event service is returned in the Capabilities element. ///
/// /// Element "Capabilities" of type "http://www.onvif.org/ver10/events/wsdl":Capabilities. - tev__Capabilities* Capabilities 1; ///< Required element. + tev__Capabilities* Capabilities 1; ///< Required element. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":CreatePullPointSubscription @@ -732,20 +732,20 @@ class _tev__GetServiceCapabilitiesResponse /// - _tev__CreatePullPointSubscription* _tev__CreatePullPointSubscription::soap_dup(soap*) returns deep copy of _tev__CreatePullPointSubscription, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__CreatePullPointSubscription::soap_del() deep deletes _tev__CreatePullPointSubscription data members, use only after _tev__CreatePullPointSubscription::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__CreatePullPointSubscription::soap_type() returns SOAP_TYPE__tev__CreatePullPointSubscription or derived type identifier -class _tev__CreatePullPointSubscription -{ public: +class _tev__CreatePullPointSubscription { + public: ///
/// Optional XPATH expression to select specific topics. ///
/// /// Element "Filter" of type "http://docs.oasis-open.org/wsn/b-2":FilterType. - wsnt__FilterType* Filter 0; ///< Optional element. + wsnt__FilterType* Filter 0; ///< Optional element. ///
/// Initial termination time. ///
/// /// Element "InitialTerminationTime" of type "http://docs.oasis-open.org/wsn/b-2":AbsoluteOrRelativeTimeType. - wsnt__AbsoluteOrRelativeTimeType* InitialTerminationTime 0; ///< Optional element. + wsnt__AbsoluteOrRelativeTimeType* InitialTerminationTime 0; ///< Optional element. ///
/// Refer to Web Services Base Notification 1.3 (WS-BaseNotification). ///
@@ -761,8 +761,8 @@ class _tev__CreatePullPointSubscription /// - _tev__CreatePullPointSubscription_SubscriptionPolicy* _tev__CreatePullPointSubscription_SubscriptionPolicy::soap_dup(soap*) returns deep copy of _tev__CreatePullPointSubscription_SubscriptionPolicy, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__CreatePullPointSubscription_SubscriptionPolicy::soap_del() deep deletes _tev__CreatePullPointSubscription_SubscriptionPolicy data members, use only after _tev__CreatePullPointSubscription_SubscriptionPolicy::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__CreatePullPointSubscription_SubscriptionPolicy::soap_type() returns SOAP_TYPE__tev__CreatePullPointSubscription_SubscriptionPolicy or derived type identifier - class _tev__CreatePullPointSubscription_SubscriptionPolicy - { public: + class _tev__CreatePullPointSubscription_SubscriptionPolicy { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -771,7 +771,7 @@ class _tev__CreatePullPointSubscription /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. - } *SubscriptionPolicy 0; ///< Optional element. + } *SubscriptionPolicy 0; ///< Optional element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -779,9 +779,9 @@ class _tev__CreatePullPointSubscription /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":CreatePullPointSubscriptionResponse @@ -798,26 +798,26 @@ class _tev__CreatePullPointSubscription /// - _tev__CreatePullPointSubscriptionResponse* _tev__CreatePullPointSubscriptionResponse::soap_dup(soap*) returns deep copy of _tev__CreatePullPointSubscriptionResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__CreatePullPointSubscriptionResponse::soap_del() deep deletes _tev__CreatePullPointSubscriptionResponse data members, use only after _tev__CreatePullPointSubscriptionResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__CreatePullPointSubscriptionResponse::soap_type() returns SOAP_TYPE__tev__CreatePullPointSubscriptionResponse or derived type identifier -class _tev__CreatePullPointSubscriptionResponse -{ public: +class _tev__CreatePullPointSubscriptionResponse { + public: ///
/// Endpoint reference of the subscription to be used for pulling the messages. ///
/// /// Element "SubscriptionReference" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType SubscriptionReference 1; ///< Required element. + wsa5__EndpointReferenceType SubscriptionReference 1; ///< Required element. ///
/// Current time of the server for synchronization purposes. ///
/// /// Element reference "http://www.onvif.org/ver10/events/wsdl:"CurrentTime. - time_t wsnt__CurrentTime 1; ///< Required element. + time_t wsnt__CurrentTime 1; ///< Required element. ///
/// Date time when the PullPoint will be shut down without further pull requests. ///
/// /// Element reference "http://www.onvif.org/ver10/events/wsdl:"TerminationTime. - time_t wsnt__TerminationTime 1; ///< Required element. + time_t wsnt__TerminationTime 1; ///< Required element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -825,9 +825,9 @@ class _tev__CreatePullPointSubscriptionResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":PullMessages @@ -844,20 +844,20 @@ class _tev__CreatePullPointSubscriptionResponse /// - _tev__PullMessages* _tev__PullMessages::soap_dup(soap*) returns deep copy of _tev__PullMessages, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__PullMessages::soap_del() deep deletes _tev__PullMessages data members, use only after _tev__PullMessages::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__PullMessages::soap_type() returns SOAP_TYPE__tev__PullMessages or derived type identifier -class _tev__PullMessages -{ public: +class _tev__PullMessages { + public: ///
/// Maximum time to block until this method returns. ///
/// /// Element "Timeout" of type xs:duration. - xsd__duration Timeout 1; ///< Required element. + xsd__duration Timeout 1; ///< Required element. ///
/// Upper limit for the number of messages to return at once. A server implementation may decide to return less messages. ///
/// /// Element "MessageLimit" of type xs:int. - int MessageLimit 1; ///< Required element. + int MessageLimit 1; ///< Required element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -865,9 +865,9 @@ class _tev__PullMessages /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":PullMessagesResponse @@ -884,28 +884,28 @@ class _tev__PullMessages /// - _tev__PullMessagesResponse* _tev__PullMessagesResponse::soap_dup(soap*) returns deep copy of _tev__PullMessagesResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__PullMessagesResponse::soap_del() deep deletes _tev__PullMessagesResponse data members, use only after _tev__PullMessagesResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__PullMessagesResponse::soap_type() returns SOAP_TYPE__tev__PullMessagesResponse or derived type identifier -class _tev__PullMessagesResponse -{ public: +class _tev__PullMessagesResponse { + public: ///
/// The date and time when the messages have been delivered by the web server to the client. ///
/// /// Element "CurrentTime" of type xs:dateTime. - time_t CurrentTime 1; ///< Required element. + time_t CurrentTime 1; ///< Required element. ///
/// Date time when the PullPoint will be shut down without further pull requests. ///
/// /// Element "TerminationTime" of type xs:dateTime. - time_t TerminationTime 1; ///< Required element. + time_t TerminationTime 1; ///< Required element. ///
/// List of messages. This list shall be empty in case of a timeout. ///
/// /// Vector of wsnt__NotificationMessageHolderType* element refs of length 0..unbounded. - std::vector wsnt__NotificationMessage 0; ///< Multiple elements. + std::vector wsnt__NotificationMessage 0; ///< Multiple elements. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":PullMessagesFaultResponse @@ -922,20 +922,20 @@ class _tev__PullMessagesResponse /// - _tev__PullMessagesFaultResponse* _tev__PullMessagesFaultResponse::soap_dup(soap*) returns deep copy of _tev__PullMessagesFaultResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__PullMessagesFaultResponse::soap_del() deep deletes _tev__PullMessagesFaultResponse data members, use only after _tev__PullMessagesFaultResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__PullMessagesFaultResponse::soap_type() returns SOAP_TYPE__tev__PullMessagesFaultResponse or derived type identifier -class _tev__PullMessagesFaultResponse -{ public: +class _tev__PullMessagesFaultResponse { + public: ///
/// Maximum timeout supported by the device. ///
/// /// Element "MaxTimeout" of type xs:duration. - xsd__duration MaxTimeout 1; ///< Required element. + xsd__duration MaxTimeout 1; ///< Required element. ///
/// Maximum message limit supported by the device. ///
/// /// Element "MaxMessageLimit" of type xs:int. - int MaxMessageLimit 1; ///< Required element. + int MaxMessageLimit 1; ///< Required element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -943,9 +943,9 @@ class _tev__PullMessagesFaultResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":Seek @@ -962,20 +962,20 @@ class _tev__PullMessagesFaultResponse /// - _tev__Seek* _tev__Seek::soap_dup(soap*) returns deep copy of _tev__Seek, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__Seek::soap_del() deep deletes _tev__Seek data members, use only after _tev__Seek::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__Seek::soap_type() returns SOAP_TYPE__tev__Seek or derived type identifier -class _tev__Seek -{ public: +class _tev__Seek { + public: ///
/// The date and time to match against stored messages. ///
/// /// Element "UtcTime" of type xs:dateTime. - time_t UtcTime 1; ///< Required element. + time_t UtcTime 1; ///< Required element. ///
/// Reverse the pull direction of PullMessages. ///
/// /// Element "Reverse" of type xs:boolean. - bool* Reverse 0; ///< Optional element. + bool* Reverse 0; ///< Optional element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -983,9 +983,9 @@ class _tev__Seek /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":SeekResponse @@ -1002,10 +1002,10 @@ class _tev__Seek /// - _tev__SeekResponse* _tev__SeekResponse::soap_dup(soap*) returns deep copy of _tev__SeekResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__SeekResponse::soap_del() deep deletes _tev__SeekResponse data members, use only after _tev__SeekResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__SeekResponse::soap_type() returns SOAP_TYPE__tev__SeekResponse or derived type identifier -class _tev__SeekResponse -{ public: +class _tev__SeekResponse { + public: /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":SetSynchronizationPoint @@ -1022,10 +1022,10 @@ class _tev__SeekResponse /// - _tev__SetSynchronizationPoint* _tev__SetSynchronizationPoint::soap_dup(soap*) returns deep copy of _tev__SetSynchronizationPoint, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__SetSynchronizationPoint::soap_del() deep deletes _tev__SetSynchronizationPoint data members, use only after _tev__SetSynchronizationPoint::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__SetSynchronizationPoint::soap_type() returns SOAP_TYPE__tev__SetSynchronizationPoint or derived type identifier -class _tev__SetSynchronizationPoint -{ public: +class _tev__SetSynchronizationPoint { + public: /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":SetSynchronizationPointResponse @@ -1042,10 +1042,10 @@ class _tev__SetSynchronizationPoint /// - _tev__SetSynchronizationPointResponse* _tev__SetSynchronizationPointResponse::soap_dup(soap*) returns deep copy of _tev__SetSynchronizationPointResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__SetSynchronizationPointResponse::soap_del() deep deletes _tev__SetSynchronizationPointResponse data members, use only after _tev__SetSynchronizationPointResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__SetSynchronizationPointResponse::soap_type() returns SOAP_TYPE__tev__SetSynchronizationPointResponse or derived type identifier -class _tev__SetSynchronizationPointResponse -{ public: +class _tev__SetSynchronizationPointResponse { + public: /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":GetEventProperties @@ -1062,10 +1062,10 @@ class _tev__SetSynchronizationPointResponse /// - _tev__GetEventProperties* _tev__GetEventProperties::soap_dup(soap*) returns deep copy of _tev__GetEventProperties, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__GetEventProperties::soap_del() deep deletes _tev__GetEventProperties data members, use only after _tev__GetEventProperties::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__GetEventProperties::soap_type() returns SOAP_TYPE__tev__GetEventProperties or derived type identifier -class _tev__GetEventProperties -{ public: +class _tev__GetEventProperties { + public: /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":GetEventPropertiesResponse @@ -1082,26 +1082,26 @@ class _tev__GetEventProperties /// - _tev__GetEventPropertiesResponse* _tev__GetEventPropertiesResponse::soap_dup(soap*) returns deep copy of _tev__GetEventPropertiesResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__GetEventPropertiesResponse::soap_del() deep deletes _tev__GetEventPropertiesResponse data members, use only after _tev__GetEventPropertiesResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__GetEventPropertiesResponse::soap_type() returns SOAP_TYPE__tev__GetEventPropertiesResponse or derived type identifier -class _tev__GetEventPropertiesResponse -{ public: +class _tev__GetEventPropertiesResponse { + public: ///
/// List of topic namespaces supported. ///
/// /// Vector of xsd__anyURI of length 1..unbounded. - std::vector TopicNamespaceLocation 1; ///< Multiple elements. + std::vector TopicNamespaceLocation 1; ///< Multiple elements. ///
/// True when topicset is fixed for all times. ///
/// /// Element reference "http://www.onvif.org/ver10/events/wsdl:"FixedTopicSet. - bool wsnt__FixedTopicSet 1 = true; ///< Required element with default value="true". + bool wsnt__FixedTopicSet 1 = true; ///< Required element with default value="true". ///
/// Set of topics supported. ///
/// /// Element reference "http://www.onvif.org/ver10/events/wsdl:"TopicSet. - wstop__TopicSetType* wstop__TopicSet 1; ///< Required element. + wstop__TopicSetType* wstop__TopicSet 1; ///< Required element. ///
/// Defines the XPath expression syntax supported for matching topic expressions.
/// The following TopicExpressionDialects are mandatory for an ONVIF compliant device : @@ -1112,7 +1112,7 @@ class _tev__GetEventPropertiesResponse ///
/// /// Vector of xsd__anyURI element refs of length 1..unbounded. - std::vector wsnt__TopicExpressionDialect 1; ///< Multiple elements. + std::vector wsnt__TopicExpressionDialect 1; ///< Multiple elements. ///
/// Defines the XPath function set supported for message content filtering.
The following MessageContentFilterDialects should be returned if a device supports the message content filtering: ///
    @@ -1122,13 +1122,13 @@ class _tev__GetEventPropertiesResponse ///
/// /// Vector of xsd__anyURI of length 1..unbounded. - std::vector MessageContentFilterDialect 1; ///< Multiple elements. + std::vector MessageContentFilterDialect 1; ///< Multiple elements. ///
/// Optional ProducerPropertiesDialects. Refer to Web Services Base Notification 1.3 (WS-BaseNotification) for advanced filtering. ///
/// /// Vector of xsd__anyURI of length 0..unbounded. - std::vector ProducerPropertiesFilterDialect 0; ///< Multiple elements. + std::vector ProducerPropertiesFilterDialect 0; ///< Multiple elements. ///
/// The Message Content Description Language allows referencing /// of vendor-specific types. In order to ease the integration of such types into a client application, @@ -1137,7 +1137,7 @@ class _tev__GetEventPropertiesResponse ///
/// /// Vector of xsd__anyURI of length 1..unbounded. - std::vector MessageContentSchemaLocation 1; ///< Multiple elements. + std::vector MessageContentSchemaLocation 1; ///< Multiple elements. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1145,9 +1145,9 @@ class _tev__GetEventPropertiesResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":AddEventBroker @@ -1164,12 +1164,12 @@ class _tev__GetEventPropertiesResponse /// - _tev__AddEventBroker* _tev__AddEventBroker::soap_dup(soap*) returns deep copy of _tev__AddEventBroker, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__AddEventBroker::soap_del() deep deletes _tev__AddEventBroker data members, use only after _tev__AddEventBroker::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__AddEventBroker::soap_type() returns SOAP_TYPE__tev__AddEventBroker or derived type identifier -class _tev__AddEventBroker -{ public: +class _tev__AddEventBroker { + public: /// Element "EventBroker" of type "http://www.onvif.org/ver10/events/wsdl":EventBrokerConfig. - tev__EventBrokerConfig* EventBroker 1; ///< Required element. + tev__EventBrokerConfig* EventBroker 1; ///< Required element. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":AddEventBrokerResponse @@ -1186,10 +1186,10 @@ class _tev__AddEventBroker /// - _tev__AddEventBrokerResponse* _tev__AddEventBrokerResponse::soap_dup(soap*) returns deep copy of _tev__AddEventBrokerResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__AddEventBrokerResponse::soap_del() deep deletes _tev__AddEventBrokerResponse data members, use only after _tev__AddEventBrokerResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__AddEventBrokerResponse::soap_type() returns SOAP_TYPE__tev__AddEventBrokerResponse or derived type identifier -class _tev__AddEventBrokerResponse -{ public: +class _tev__AddEventBrokerResponse { + public: /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":DeleteEventBroker @@ -1206,12 +1206,12 @@ class _tev__AddEventBrokerResponse /// - _tev__DeleteEventBroker* _tev__DeleteEventBroker::soap_dup(soap*) returns deep copy of _tev__DeleteEventBroker, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__DeleteEventBroker::soap_del() deep deletes _tev__DeleteEventBroker data members, use only after _tev__DeleteEventBroker::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__DeleteEventBroker::soap_type() returns SOAP_TYPE__tev__DeleteEventBroker or derived type identifier -class _tev__DeleteEventBroker -{ public: +class _tev__DeleteEventBroker { + public: /// Element "Address" of type xs:anyURI. - xsd__anyURI Address 1; ///< Required element. + xsd__anyURI Address 1; ///< Required element. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":DeleteEventBrokerResponse @@ -1228,10 +1228,10 @@ class _tev__DeleteEventBroker /// - _tev__DeleteEventBrokerResponse* _tev__DeleteEventBrokerResponse::soap_dup(soap*) returns deep copy of _tev__DeleteEventBrokerResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__DeleteEventBrokerResponse::soap_del() deep deletes _tev__DeleteEventBrokerResponse data members, use only after _tev__DeleteEventBrokerResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__DeleteEventBrokerResponse::soap_type() returns SOAP_TYPE__tev__DeleteEventBrokerResponse or derived type identifier -class _tev__DeleteEventBrokerResponse -{ public: +class _tev__DeleteEventBrokerResponse { + public: /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":GetEventBrokers @@ -1248,12 +1248,12 @@ class _tev__DeleteEventBrokerResponse /// - _tev__GetEventBrokers* _tev__GetEventBrokers::soap_dup(soap*) returns deep copy of _tev__GetEventBrokers, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__GetEventBrokers::soap_del() deep deletes _tev__GetEventBrokers data members, use only after _tev__GetEventBrokers::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__GetEventBrokers::soap_type() returns SOAP_TYPE__tev__GetEventBrokers or derived type identifier -class _tev__GetEventBrokers -{ public: +class _tev__GetEventBrokers { + public: /// Element "Address" of type xs:anyURI. - xsd__anyURI* Address 0; ///< Optional element. + xsd__anyURI* Address 0; ///< Optional element. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://www.onvif.org/ver10/events/wsdl":GetEventBrokersResponse @@ -1270,12 +1270,12 @@ class _tev__GetEventBrokers /// - _tev__GetEventBrokersResponse* _tev__GetEventBrokersResponse::soap_dup(soap*) returns deep copy of _tev__GetEventBrokersResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _tev__GetEventBrokersResponse::soap_del() deep deletes _tev__GetEventBrokersResponse data members, use only after _tev__GetEventBrokersResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _tev__GetEventBrokersResponse::soap_type() returns SOAP_TYPE__tev__GetEventBrokersResponse or derived type identifier -class _tev__GetEventBrokersResponse -{ public: +class _tev__GetEventBrokersResponse { + public: /// Vector of tev__EventBrokerConfig* of length 0..unbounded. - std::vector EventBroker 0; ///< Multiple elements. + std::vector EventBroker 0; ///< Multiple elements. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; @@ -1347,8 +1347,8 @@ class _tev__GetEventBrokersResponse /// - wsrfbf__BaseFaultType* wsrfbf__BaseFaultType::soap_dup(soap*) returns deep copy of wsrfbf__BaseFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsrfbf__BaseFaultType::soap_del() deep deletes wsrfbf__BaseFaultType data members, use only after wsrfbf__BaseFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsrfbf__BaseFaultType::soap_type() returns SOAP_TYPE_wsrfbf__BaseFaultType or derived type identifier -class wsrfbf__BaseFaultType -{ public: +class wsrfbf__BaseFaultType { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1356,11 +1356,11 @@ class wsrfbf__BaseFaultType /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. + time_t Timestamp 1; ///< Required element. /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. /// @note class _wsrfbf__BaseFaultType_ErrorCode operations: /// - _wsrfbf__BaseFaultType_ErrorCode* soap_new__wsrfbf__BaseFaultType_ErrorCode(soap*) allocate and default initialize /// - _wsrfbf__BaseFaultType_ErrorCode* soap_new__wsrfbf__BaseFaultType_ErrorCode(soap*, int num) allocate and default initialize an array @@ -1372,18 +1372,18 @@ class wsrfbf__BaseFaultType /// - _wsrfbf__BaseFaultType_ErrorCode* _wsrfbf__BaseFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__BaseFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsrfbf__BaseFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__BaseFaultType_ErrorCode data members, use only after _wsrfbf__BaseFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsrfbf__BaseFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__BaseFaultType_ErrorCode or derived type identifier - class _wsrfbf__BaseFaultType_ErrorCode - { public: + class _wsrfbf__BaseFaultType_ErrorCode { + public: /// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. + @ xsd__anyURI dialect 1; ///< Required attribute. /// Mixed content. /// @note Mixed content is user-definable. /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. + } *ErrorCode 0; ///< Optional element. /// Vector of Description of length 0..unbounded. - std::vector< + std::vector< /// @note class _wsrfbf__BaseFaultType_Description operations: /// - _wsrfbf__BaseFaultType_Description* soap_new__wsrfbf__BaseFaultType_Description(soap*) allocate and default initialize /// - _wsrfbf__BaseFaultType_Description* soap_new__wsrfbf__BaseFaultType_Description(soap*, int num) allocate and default initialize an array @@ -1395,13 +1395,13 @@ class wsrfbf__BaseFaultType /// - _wsrfbf__BaseFaultType_Description* _wsrfbf__BaseFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__BaseFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsrfbf__BaseFaultType_Description::soap_del() deep deletes _wsrfbf__BaseFaultType_Description data members, use only after _wsrfbf__BaseFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsrfbf__BaseFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__BaseFaultType_Description or derived type identifier - class _wsrfbf__BaseFaultType_Description - { public: + class _wsrfbf__BaseFaultType_Description { + public: /// __item wraps simpleContent of type xs:string. std::string __item ; /// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. /// @note class _wsrfbf__BaseFaultType_FaultCause operations: /// - _wsrfbf__BaseFaultType_FaultCause* soap_new__wsrfbf__BaseFaultType_FaultCause(soap*) allocate and default initialize /// - _wsrfbf__BaseFaultType_FaultCause* soap_new__wsrfbf__BaseFaultType_FaultCause(soap*, int num) allocate and default initialize an array @@ -1413,8 +1413,8 @@ class wsrfbf__BaseFaultType /// - _wsrfbf__BaseFaultType_FaultCause* _wsrfbf__BaseFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__BaseFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsrfbf__BaseFaultType_FaultCause::soap_del() deep deletes _wsrfbf__BaseFaultType_FaultCause data members, use only after _wsrfbf__BaseFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsrfbf__BaseFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__BaseFaultType_FaultCause or derived type identifier - class _wsrfbf__BaseFaultType_FaultCause - { public: + class _wsrfbf__BaseFaultType_FaultCause { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1422,7 +1422,7 @@ class wsrfbf__BaseFaultType /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. + } *FaultCause 0; ///< Optional element. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1430,7 +1430,7 @@ class wsrfbf__BaseFaultType /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; @@ -1454,24 +1454,24 @@ class wsrfbf__BaseFaultType /// - wsnt__QueryExpressionType* wsnt__QueryExpressionType::soap_dup(soap*) returns deep copy of wsnt__QueryExpressionType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__QueryExpressionType::soap_del() deep deletes wsnt__QueryExpressionType data members, use only after wsnt__QueryExpressionType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__QueryExpressionType::soap_type() returns SOAP_TYPE_wsnt__QueryExpressionType or derived type identifier -class wsnt__QueryExpressionType -{ public: +class wsnt__QueryExpressionType { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -x to remove this element. /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. /// Attribute "Dialect" of type xs:anyURI. @ xsd__anyURI Dialect 1; ///< Required attribute. /// Mixed content. /// @note Mixed content is user-definable. /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief "http://docs.oasis-open.org/wsn/b-2":TopicExpressionType is a complexType. @@ -1487,15 +1487,15 @@ class wsnt__QueryExpressionType /// - wsnt__TopicExpressionType* wsnt__TopicExpressionType::soap_dup(soap*) returns deep copy of wsnt__TopicExpressionType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__TopicExpressionType::soap_del() deep deletes wsnt__TopicExpressionType data members, use only after wsnt__TopicExpressionType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__TopicExpressionType::soap_type() returns SOAP_TYPE_wsnt__TopicExpressionType or derived type identifier -class wsnt__TopicExpressionType -{ public: +class wsnt__TopicExpressionType { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -x to remove this element. /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. /// Attribute "Dialect" of type xs:anyURI. @ xsd__anyURI Dialect 1; ///< Required attribute. /// . @@ -1508,9 +1508,9 @@ class wsnt__TopicExpressionType /// @note Mixed content is user-definable. /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief "http://docs.oasis-open.org/wsn/b-2":FilterType is a complexType. @@ -1526,8 +1526,8 @@ class wsnt__TopicExpressionType /// - wsnt__FilterType* wsnt__FilterType::soap_dup(soap*) returns deep copy of wsnt__FilterType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__FilterType::soap_del() deep deletes wsnt__FilterType data members, use only after wsnt__FilterType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__FilterType::soap_type() returns SOAP_TYPE_wsnt__FilterType or derived type identifier -class wsnt__FilterType -{ public: +class wsnt__FilterType { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1535,9 +1535,9 @@ class wsnt__FilterType /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief "http://docs.oasis-open.org/wsn/b-2":SubscriptionPolicyType is a complexType. @@ -1553,8 +1553,8 @@ class wsnt__FilterType /// - wsnt__SubscriptionPolicyType* wsnt__SubscriptionPolicyType::soap_dup(soap*) returns deep copy of wsnt__SubscriptionPolicyType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__SubscriptionPolicyType::soap_del() deep deletes wsnt__SubscriptionPolicyType data members, use only after wsnt__SubscriptionPolicyType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__SubscriptionPolicyType::soap_type() returns SOAP_TYPE_wsnt__SubscriptionPolicyType or derived type identifier -class wsnt__SubscriptionPolicyType -{ public: +class wsnt__SubscriptionPolicyType { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1562,9 +1562,9 @@ class wsnt__SubscriptionPolicyType /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief "http://docs.oasis-open.org/wsn/b-2":NotificationMessageHolderType is a complexType. @@ -1580,14 +1580,14 @@ class wsnt__SubscriptionPolicyType /// - wsnt__NotificationMessageHolderType* wsnt__NotificationMessageHolderType::soap_dup(soap*) returns deep copy of wsnt__NotificationMessageHolderType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__NotificationMessageHolderType::soap_del() deep deletes wsnt__NotificationMessageHolderType data members, use only after wsnt__NotificationMessageHolderType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__NotificationMessageHolderType::soap_type() returns SOAP_TYPE_wsnt__NotificationMessageHolderType or derived type identifier -class wsnt__NotificationMessageHolderType -{ public: +class wsnt__NotificationMessageHolderType { + public: /// Element reference "http://docs.oasis-open.org/wsn/b-2:"SubscriptionReference. - wsa5__EndpointReferenceType* SubscriptionReference 0; ///< Optional element. + wsa5__EndpointReferenceType* SubscriptionReference 0; ///< Optional element. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"Topic. - wsnt__TopicExpressionType* Topic 0; ///< Optional element. + wsnt__TopicExpressionType* Topic 0; ///< Optional element. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"ProducerReference. - wsa5__EndpointReferenceType* ProducerReference 0; ///< Optional element. + wsa5__EndpointReferenceType* ProducerReference 0; ///< Optional element. /// @note class _wsnt__NotificationMessageHolderType_Message operations: /// - _wsnt__NotificationMessageHolderType_Message* soap_new__wsnt__NotificationMessageHolderType_Message(soap*) allocate and default initialize /// - _wsnt__NotificationMessageHolderType_Message* soap_new__wsnt__NotificationMessageHolderType_Message(soap*, int num) allocate and default initialize an array @@ -1599,8 +1599,8 @@ class wsnt__NotificationMessageHolderType /// - _wsnt__NotificationMessageHolderType_Message* _wsnt__NotificationMessageHolderType_Message::soap_dup(soap*) returns deep copy of _wsnt__NotificationMessageHolderType_Message, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__NotificationMessageHolderType_Message::soap_del() deep deletes _wsnt__NotificationMessageHolderType_Message data members, use only after _wsnt__NotificationMessageHolderType_Message::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__NotificationMessageHolderType_Message::soap_type() returns SOAP_TYPE__wsnt__NotificationMessageHolderType_Message or derived type identifier - class _wsnt__NotificationMessageHolderType_Message - { public: + class _wsnt__NotificationMessageHolderType_Message { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1608,9 +1608,9 @@ class wsnt__NotificationMessageHolderType /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } Message 1; ///< Required element. + } Message 1; ///< Required element. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":NotificationProducerRP @@ -1627,18 +1627,18 @@ class wsnt__NotificationMessageHolderType /// - _wsnt__NotificationProducerRP* _wsnt__NotificationProducerRP::soap_dup(soap*) returns deep copy of _wsnt__NotificationProducerRP, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__NotificationProducerRP::soap_del() deep deletes _wsnt__NotificationProducerRP data members, use only after _wsnt__NotificationProducerRP::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__NotificationProducerRP::soap_type() returns SOAP_TYPE__wsnt__NotificationProducerRP or derived type identifier -class _wsnt__NotificationProducerRP -{ public: +class _wsnt__NotificationProducerRP { + public: /// Vector of wsnt__TopicExpressionType* element refs of length 0..unbounded. - std::vector TopicExpression 0; ///< Multiple elements. + std::vector TopicExpression 0; ///< Multiple elements. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"FixedTopicSet. - bool* FixedTopicSet 0 = true; ///< Optional element with default value="true". + bool* FixedTopicSet 0 = true; ///< Optional element with default value="true". /// Vector of xsd__anyURI element refs of length 0..unbounded. - std::vector TopicExpressionDialect 0; ///< Multiple elements. + std::vector TopicExpressionDialect 0; ///< Multiple elements. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"TopicSet. - wstop__TopicSetType* wstop__TopicSet 0; ///< Optional element. + wstop__TopicSetType* wstop__TopicSet 0; ///< Optional element. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":SubscriptionManagerRP @@ -1655,18 +1655,18 @@ class _wsnt__NotificationProducerRP /// - _wsnt__SubscriptionManagerRP* _wsnt__SubscriptionManagerRP::soap_dup(soap*) returns deep copy of _wsnt__SubscriptionManagerRP, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__SubscriptionManagerRP::soap_del() deep deletes _wsnt__SubscriptionManagerRP data members, use only after _wsnt__SubscriptionManagerRP::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__SubscriptionManagerRP::soap_type() returns SOAP_TYPE__wsnt__SubscriptionManagerRP or derived type identifier -class _wsnt__SubscriptionManagerRP -{ public: +class _wsnt__SubscriptionManagerRP { + public: /// Element reference "http://docs.oasis-open.org/wsn/b-2:"ConsumerReference. - wsa5__EndpointReferenceType ConsumerReference 1; ///< Required element. + wsa5__EndpointReferenceType ConsumerReference 1; ///< Required element. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"Filter. - wsnt__FilterType* Filter 0; ///< Optional element. + wsnt__FilterType* Filter 0; ///< Optional element. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"SubscriptionPolicy. - wsnt__SubscriptionPolicyType* SubscriptionPolicy 0; ///< Optional element. + wsnt__SubscriptionPolicyType* SubscriptionPolicy 0; ///< Optional element. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"CreationTime. - time_t* CreationTime 0; ///< Optional element. + time_t* CreationTime 0; ///< Optional element. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":Notify @@ -1683,10 +1683,10 @@ class _wsnt__SubscriptionManagerRP /// - _wsnt__Notify* _wsnt__Notify::soap_dup(soap*) returns deep copy of _wsnt__Notify, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__Notify::soap_del() deep deletes _wsnt__Notify data members, use only after _wsnt__Notify::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__Notify::soap_type() returns SOAP_TYPE__wsnt__Notify or derived type identifier -class _wsnt__Notify -{ public: +class _wsnt__Notify { + public: /// Vector of wsnt__NotificationMessageHolderType* element refs of length 1..unbounded. - std::vector NotificationMessage 1; ///< Multiple elements. + std::vector NotificationMessage 1; ///< Multiple elements. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1694,9 +1694,9 @@ class _wsnt__Notify /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":UseRaw @@ -1713,10 +1713,10 @@ class _wsnt__Notify /// - _wsnt__UseRaw* _wsnt__UseRaw::soap_dup(soap*) returns deep copy of _wsnt__UseRaw, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__UseRaw::soap_del() deep deletes _wsnt__UseRaw data members, use only after _wsnt__UseRaw::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__UseRaw::soap_type() returns SOAP_TYPE__wsnt__UseRaw or derived type identifier -class _wsnt__UseRaw -{ public: +class _wsnt__UseRaw { + public: /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":Subscribe @@ -1733,14 +1733,14 @@ class _wsnt__UseRaw /// - _wsnt__Subscribe* _wsnt__Subscribe::soap_dup(soap*) returns deep copy of _wsnt__Subscribe, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__Subscribe::soap_del() deep deletes _wsnt__Subscribe data members, use only after _wsnt__Subscribe::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__Subscribe::soap_type() returns SOAP_TYPE__wsnt__Subscribe or derived type identifier -class _wsnt__Subscribe -{ public: +class _wsnt__Subscribe { + public: /// Element "ConsumerReference" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType ConsumerReference 1; ///< Required element. + wsa5__EndpointReferenceType ConsumerReference 1; ///< Required element. /// Element "Filter" of type "http://docs.oasis-open.org/wsn/b-2":FilterType. - wsnt__FilterType* Filter 0; ///< Optional element. + wsnt__FilterType* Filter 0; ///< Optional element. /// Element "InitialTerminationTime" of type "http://docs.oasis-open.org/wsn/b-2":AbsoluteOrRelativeTimeType. - wsnt__AbsoluteOrRelativeTimeType* InitialTerminationTime 0; ///< Optional element. + wsnt__AbsoluteOrRelativeTimeType* InitialTerminationTime 0; ///< Optional element. /// @note class _wsnt__Subscribe_SubscriptionPolicy operations: /// - _wsnt__Subscribe_SubscriptionPolicy* soap_new__wsnt__Subscribe_SubscriptionPolicy(soap*) allocate and default initialize /// - _wsnt__Subscribe_SubscriptionPolicy* soap_new__wsnt__Subscribe_SubscriptionPolicy(soap*, int num) allocate and default initialize an array @@ -1752,8 +1752,8 @@ class _wsnt__Subscribe /// - _wsnt__Subscribe_SubscriptionPolicy* _wsnt__Subscribe_SubscriptionPolicy::soap_dup(soap*) returns deep copy of _wsnt__Subscribe_SubscriptionPolicy, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__Subscribe_SubscriptionPolicy::soap_del() deep deletes _wsnt__Subscribe_SubscriptionPolicy data members, use only after _wsnt__Subscribe_SubscriptionPolicy::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__Subscribe_SubscriptionPolicy::soap_type() returns SOAP_TYPE__wsnt__Subscribe_SubscriptionPolicy or derived type identifier - class _wsnt__Subscribe_SubscriptionPolicy - { public: + class _wsnt__Subscribe_SubscriptionPolicy { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1762,7 +1762,7 @@ class _wsnt__Subscribe /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. - } *SubscriptionPolicy 0; ///< Optional element. + } *SubscriptionPolicy 0; ///< Optional element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1770,9 +1770,9 @@ class _wsnt__Subscribe /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":SubscribeResponse @@ -1789,14 +1789,14 @@ class _wsnt__Subscribe /// - _wsnt__SubscribeResponse* _wsnt__SubscribeResponse::soap_dup(soap*) returns deep copy of _wsnt__SubscribeResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__SubscribeResponse::soap_del() deep deletes _wsnt__SubscribeResponse data members, use only after _wsnt__SubscribeResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__SubscribeResponse::soap_type() returns SOAP_TYPE__wsnt__SubscribeResponse or derived type identifier -class _wsnt__SubscribeResponse -{ public: +class _wsnt__SubscribeResponse { + public: /// Element "SubscriptionReference" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType SubscriptionReference 1; ///< Required element. + wsa5__EndpointReferenceType SubscriptionReference 1; ///< Required element. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"CurrentTime. - time_t* CurrentTime 0; ///< Optional element. + time_t* CurrentTime 0; ///< Optional element. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"TerminationTime. - time_t* TerminationTime 0; ///< Optional element. + time_t* TerminationTime 0; ///< Optional element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1804,9 +1804,9 @@ class _wsnt__SubscribeResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":GetCurrentMessage @@ -1823,10 +1823,10 @@ class _wsnt__SubscribeResponse /// - _wsnt__GetCurrentMessage* _wsnt__GetCurrentMessage::soap_dup(soap*) returns deep copy of _wsnt__GetCurrentMessage, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__GetCurrentMessage::soap_del() deep deletes _wsnt__GetCurrentMessage data members, use only after _wsnt__GetCurrentMessage::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__GetCurrentMessage::soap_type() returns SOAP_TYPE__wsnt__GetCurrentMessage or derived type identifier -class _wsnt__GetCurrentMessage -{ public: +class _wsnt__GetCurrentMessage { + public: /// Element "Topic" of type "http://docs.oasis-open.org/wsn/b-2":TopicExpressionType. - wsnt__TopicExpressionType* Topic 1; ///< Required element. + wsnt__TopicExpressionType* Topic 1; ///< Required element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1834,9 +1834,9 @@ class _wsnt__GetCurrentMessage /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":GetCurrentMessageResponse @@ -1853,8 +1853,8 @@ class _wsnt__GetCurrentMessage /// - _wsnt__GetCurrentMessageResponse* _wsnt__GetCurrentMessageResponse::soap_dup(soap*) returns deep copy of _wsnt__GetCurrentMessageResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__GetCurrentMessageResponse::soap_del() deep deletes _wsnt__GetCurrentMessageResponse data members, use only after _wsnt__GetCurrentMessageResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__GetCurrentMessageResponse::soap_type() returns SOAP_TYPE__wsnt__GetCurrentMessageResponse or derived type identifier -class _wsnt__GetCurrentMessageResponse -{ public: +class _wsnt__GetCurrentMessageResponse { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1862,9 +1862,9 @@ class _wsnt__GetCurrentMessageResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":GetMessages @@ -1881,10 +1881,10 @@ class _wsnt__GetCurrentMessageResponse /// - _wsnt__GetMessages* _wsnt__GetMessages::soap_dup(soap*) returns deep copy of _wsnt__GetMessages, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__GetMessages::soap_del() deep deletes _wsnt__GetMessages data members, use only after _wsnt__GetMessages::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__GetMessages::soap_type() returns SOAP_TYPE__wsnt__GetMessages or derived type identifier -class _wsnt__GetMessages -{ public: +class _wsnt__GetMessages { + public: /// Element "MaximumNumber" of type xs:nonNegativeInteger. - xsd__nonNegativeInteger* MaximumNumber 0; ///< Optional element. + xsd__nonNegativeInteger* MaximumNumber 0; ///< Optional element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1892,7 +1892,7 @@ class _wsnt__GetMessages /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1900,7 +1900,7 @@ class _wsnt__GetMessages /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":GetMessagesResponse @@ -1917,10 +1917,10 @@ class _wsnt__GetMessages /// - _wsnt__GetMessagesResponse* _wsnt__GetMessagesResponse::soap_dup(soap*) returns deep copy of _wsnt__GetMessagesResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__GetMessagesResponse::soap_del() deep deletes _wsnt__GetMessagesResponse data members, use only after _wsnt__GetMessagesResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__GetMessagesResponse::soap_type() returns SOAP_TYPE__wsnt__GetMessagesResponse or derived type identifier -class _wsnt__GetMessagesResponse -{ public: +class _wsnt__GetMessagesResponse { + public: /// Vector of wsnt__NotificationMessageHolderType* element refs of length 0..unbounded. - std::vector NotificationMessage 0; ///< Multiple elements. + std::vector NotificationMessage 0; ///< Multiple elements. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1928,7 +1928,7 @@ class _wsnt__GetMessagesResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1936,7 +1936,7 @@ class _wsnt__GetMessagesResponse /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":DestroyPullPoint @@ -1953,8 +1953,8 @@ class _wsnt__GetMessagesResponse /// - _wsnt__DestroyPullPoint* _wsnt__DestroyPullPoint::soap_dup(soap*) returns deep copy of _wsnt__DestroyPullPoint, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__DestroyPullPoint::soap_del() deep deletes _wsnt__DestroyPullPoint data members, use only after _wsnt__DestroyPullPoint::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__DestroyPullPoint::soap_type() returns SOAP_TYPE__wsnt__DestroyPullPoint or derived type identifier -class _wsnt__DestroyPullPoint -{ public: +class _wsnt__DestroyPullPoint { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1962,7 +1962,7 @@ class _wsnt__DestroyPullPoint /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1970,7 +1970,7 @@ class _wsnt__DestroyPullPoint /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":DestroyPullPointResponse @@ -1987,8 +1987,8 @@ class _wsnt__DestroyPullPoint /// - _wsnt__DestroyPullPointResponse* _wsnt__DestroyPullPointResponse::soap_dup(soap*) returns deep copy of _wsnt__DestroyPullPointResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__DestroyPullPointResponse::soap_del() deep deletes _wsnt__DestroyPullPointResponse data members, use only after _wsnt__DestroyPullPointResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__DestroyPullPointResponse::soap_type() returns SOAP_TYPE__wsnt__DestroyPullPointResponse or derived type identifier -class _wsnt__DestroyPullPointResponse -{ public: +class _wsnt__DestroyPullPointResponse { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -1996,7 +1996,7 @@ class _wsnt__DestroyPullPointResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2004,7 +2004,7 @@ class _wsnt__DestroyPullPointResponse /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":CreatePullPoint @@ -2021,8 +2021,8 @@ class _wsnt__DestroyPullPointResponse /// - _wsnt__CreatePullPoint* _wsnt__CreatePullPoint::soap_dup(soap*) returns deep copy of _wsnt__CreatePullPoint, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__CreatePullPoint::soap_del() deep deletes _wsnt__CreatePullPoint data members, use only after _wsnt__CreatePullPoint::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__CreatePullPoint::soap_type() returns SOAP_TYPE__wsnt__CreatePullPoint or derived type identifier -class _wsnt__CreatePullPoint -{ public: +class _wsnt__CreatePullPoint { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2030,7 +2030,7 @@ class _wsnt__CreatePullPoint /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2038,7 +2038,7 @@ class _wsnt__CreatePullPoint /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":CreatePullPointResponse @@ -2055,10 +2055,10 @@ class _wsnt__CreatePullPoint /// - _wsnt__CreatePullPointResponse* _wsnt__CreatePullPointResponse::soap_dup(soap*) returns deep copy of _wsnt__CreatePullPointResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__CreatePullPointResponse::soap_del() deep deletes _wsnt__CreatePullPointResponse data members, use only after _wsnt__CreatePullPointResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__CreatePullPointResponse::soap_type() returns SOAP_TYPE__wsnt__CreatePullPointResponse or derived type identifier -class _wsnt__CreatePullPointResponse -{ public: +class _wsnt__CreatePullPointResponse { + public: /// Element "PullPoint" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType PullPoint 1; ///< Required element. + wsa5__EndpointReferenceType PullPoint 1; ///< Required element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2066,7 +2066,7 @@ class _wsnt__CreatePullPointResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2074,7 +2074,7 @@ class _wsnt__CreatePullPointResponse /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":Renew @@ -2091,10 +2091,10 @@ class _wsnt__CreatePullPointResponse /// - _wsnt__Renew* _wsnt__Renew::soap_dup(soap*) returns deep copy of _wsnt__Renew, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__Renew::soap_del() deep deletes _wsnt__Renew data members, use only after _wsnt__Renew::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__Renew::soap_type() returns SOAP_TYPE__wsnt__Renew or derived type identifier -class _wsnt__Renew -{ public: +class _wsnt__Renew { + public: /// Element "TerminationTime" of type "http://docs.oasis-open.org/wsn/b-2":AbsoluteOrRelativeTimeType. - wsnt__AbsoluteOrRelativeTimeType* TerminationTime nullptr 1; ///< Required nillable (xsi:nil when NULL) element. + wsnt__AbsoluteOrRelativeTimeType* TerminationTime nullptr 1; ///< Required nillable (xsi:nil when NULL) element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2102,9 +2102,9 @@ class _wsnt__Renew /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":RenewResponse @@ -2121,12 +2121,12 @@ class _wsnt__Renew /// - _wsnt__RenewResponse* _wsnt__RenewResponse::soap_dup(soap*) returns deep copy of _wsnt__RenewResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__RenewResponse::soap_del() deep deletes _wsnt__RenewResponse data members, use only after _wsnt__RenewResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__RenewResponse::soap_type() returns SOAP_TYPE__wsnt__RenewResponse or derived type identifier -class _wsnt__RenewResponse -{ public: +class _wsnt__RenewResponse { + public: /// Element reference "http://docs.oasis-open.org/wsn/b-2:"TerminationTime. - time_t TerminationTime 1; ///< Required element. + time_t TerminationTime 1; ///< Required element. /// Element reference "http://docs.oasis-open.org/wsn/b-2:"CurrentTime. - time_t* CurrentTime 0; ///< Optional element. + time_t* CurrentTime 0; ///< Optional element. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2134,9 +2134,9 @@ class _wsnt__RenewResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":Unsubscribe @@ -2153,8 +2153,8 @@ class _wsnt__RenewResponse /// - _wsnt__Unsubscribe* _wsnt__Unsubscribe::soap_dup(soap*) returns deep copy of _wsnt__Unsubscribe, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__Unsubscribe::soap_del() deep deletes _wsnt__Unsubscribe data members, use only after _wsnt__Unsubscribe::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__Unsubscribe::soap_type() returns SOAP_TYPE__wsnt__Unsubscribe or derived type identifier -class _wsnt__Unsubscribe -{ public: +class _wsnt__Unsubscribe { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2162,9 +2162,9 @@ class _wsnt__Unsubscribe /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":UnsubscribeResponse @@ -2181,8 +2181,8 @@ class _wsnt__Unsubscribe /// - _wsnt__UnsubscribeResponse* _wsnt__UnsubscribeResponse::soap_dup(soap*) returns deep copy of _wsnt__UnsubscribeResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__UnsubscribeResponse::soap_del() deep deletes _wsnt__UnsubscribeResponse data members, use only after _wsnt__UnsubscribeResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__UnsubscribeResponse::soap_type() returns SOAP_TYPE__wsnt__UnsubscribeResponse or derived type identifier -class _wsnt__UnsubscribeResponse -{ public: +class _wsnt__UnsubscribeResponse { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2190,9 +2190,9 @@ class _wsnt__UnsubscribeResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":PauseSubscription @@ -2209,8 +2209,8 @@ class _wsnt__UnsubscribeResponse /// - _wsnt__PauseSubscription* _wsnt__PauseSubscription::soap_dup(soap*) returns deep copy of _wsnt__PauseSubscription, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__PauseSubscription::soap_del() deep deletes _wsnt__PauseSubscription data members, use only after _wsnt__PauseSubscription::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__PauseSubscription::soap_type() returns SOAP_TYPE__wsnt__PauseSubscription or derived type identifier -class _wsnt__PauseSubscription -{ public: +class _wsnt__PauseSubscription { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2218,9 +2218,9 @@ class _wsnt__PauseSubscription /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":PauseSubscriptionResponse @@ -2237,8 +2237,8 @@ class _wsnt__PauseSubscription /// - _wsnt__PauseSubscriptionResponse* _wsnt__PauseSubscriptionResponse::soap_dup(soap*) returns deep copy of _wsnt__PauseSubscriptionResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__PauseSubscriptionResponse::soap_del() deep deletes _wsnt__PauseSubscriptionResponse data members, use only after _wsnt__PauseSubscriptionResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__PauseSubscriptionResponse::soap_type() returns SOAP_TYPE__wsnt__PauseSubscriptionResponse or derived type identifier -class _wsnt__PauseSubscriptionResponse -{ public: +class _wsnt__PauseSubscriptionResponse { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2246,9 +2246,9 @@ class _wsnt__PauseSubscriptionResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":ResumeSubscription @@ -2265,8 +2265,8 @@ class _wsnt__PauseSubscriptionResponse /// - _wsnt__ResumeSubscription* _wsnt__ResumeSubscription::soap_dup(soap*) returns deep copy of _wsnt__ResumeSubscription, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__ResumeSubscription::soap_del() deep deletes _wsnt__ResumeSubscription data members, use only after _wsnt__ResumeSubscription::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__ResumeSubscription::soap_type() returns SOAP_TYPE__wsnt__ResumeSubscription or derived type identifier -class _wsnt__ResumeSubscription -{ public: +class _wsnt__ResumeSubscription { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2274,9 +2274,9 @@ class _wsnt__ResumeSubscription /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief Top-level root element "http://docs.oasis-open.org/wsn/b-2":ResumeSubscriptionResponse @@ -2293,8 +2293,8 @@ class _wsnt__ResumeSubscription /// - _wsnt__ResumeSubscriptionResponse* _wsnt__ResumeSubscriptionResponse::soap_dup(soap*) returns deep copy of _wsnt__ResumeSubscriptionResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wsnt__ResumeSubscriptionResponse::soap_del() deep deletes _wsnt__ResumeSubscriptionResponse data members, use only after _wsnt__ResumeSubscriptionResponse::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wsnt__ResumeSubscriptionResponse::soap_type() returns SOAP_TYPE__wsnt__ResumeSubscriptionResponse or derived type identifier -class _wsnt__ResumeSubscriptionResponse -{ public: +class _wsnt__ResumeSubscriptionResponse { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2302,9 +2302,9 @@ class _wsnt__ResumeSubscriptionResponse /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; @@ -2328,8 +2328,8 @@ class _wsnt__ResumeSubscriptionResponse /// - wstop__Documentation* wstop__Documentation::soap_dup(soap*) returns deep copy of wstop__Documentation, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wstop__Documentation::soap_del() deep deletes wstop__Documentation data members, use only after wstop__Documentation::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wstop__Documentation::soap_type() returns SOAP_TYPE_wstop__Documentation or derived type identifier -class wstop__Documentation -{ public: +class wstop__Documentation { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2337,14 +2337,14 @@ class wstop__Documentation /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Mixed content. /// @note Mixed content is user-definable. /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief "http://docs.oasis-open.org/wsn/t-1":ExtensibleDocumented is an abstract complexType. @@ -2365,10 +2365,10 @@ class wstop__Documentation /// - wstop__ExtensibleDocumented* wstop__ExtensibleDocumented::soap_dup(soap*) returns deep copy of wstop__ExtensibleDocumented, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wstop__ExtensibleDocumented::soap_del() deep deletes wstop__ExtensibleDocumented data members, use only after wstop__ExtensibleDocumented::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wstop__ExtensibleDocumented::soap_type() returns SOAP_TYPE_wstop__ExtensibleDocumented or derived type identifier -class wstop__ExtensibleDocumented -{ public: +class wstop__ExtensibleDocumented { + public: /// Element "documentation" of type "http://docs.oasis-open.org/wsn/t-1":Documentation. - wstop__Documentation* documentation 0; ///< Optional element. + wstop__Documentation* documentation 0; ///< Optional element. /// . /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -2376,7 +2376,7 @@ class wstop__ExtensibleDocumented /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief "http://docs.oasis-open.org/wsn/t-1":QueryExpressionType is a complexType. @@ -2392,24 +2392,24 @@ class wstop__ExtensibleDocumented /// - wstop__QueryExpressionType* wstop__QueryExpressionType::soap_dup(soap*) returns deep copy of wstop__QueryExpressionType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wstop__QueryExpressionType::soap_del() deep deletes wstop__QueryExpressionType data members, use only after wstop__QueryExpressionType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wstop__QueryExpressionType::soap_type() returns SOAP_TYPE_wstop__QueryExpressionType or derived type identifier -class wstop__QueryExpressionType -{ public: +class wstop__QueryExpressionType { + public: /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -x to remove this element. /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. /// Attribute "Dialect" of type xs:anyURI. @ xsd__anyURI Dialect 1; ///< Required attribute. /// Mixed content. /// @note Mixed content is user-definable. /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). /// Pointer to soap context that manages this instance. - struct soap *soap ; + struct soap *soap ; }; /// @brief "http://docs.oasis-open.org/wsrf/r-2":ResourceUnknownFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -2425,90 +2425,90 @@ class wstop__QueryExpressionType /// - wsrfr__ResourceUnknownFaultType* wsrfr__ResourceUnknownFaultType::soap_dup(soap*) returns deep copy of wsrfr__ResourceUnknownFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsrfr__ResourceUnknownFaultType::soap_del() deep deletes wsrfr__ResourceUnknownFaultType data members, use only after wsrfr__ResourceUnknownFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsrfr__ResourceUnknownFaultType::soap_type() returns SOAP_TYPE_wsrfr__ResourceUnknownFaultType or derived type identifier -class wsrfr__ResourceUnknownFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__ResourceUnknownFaultType_ErrorCode operations: -/// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* soap_new__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* soap_new__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* soap_new_req__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* soap_new_set__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, _wsrfbf__ResourceUnknownFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, _wsrfbf__ResourceUnknownFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnknownFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__ResourceUnknownFaultType_ErrorCode data members, use only after _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnknownFaultType_ErrorCode or derived type identifier - class _wsrfbf__ResourceUnknownFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__ResourceUnknownFaultType_Description operations: -/// - _wsrfbf__ResourceUnknownFaultType_Description* soap_new__wsrfbf__ResourceUnknownFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__ResourceUnknownFaultType_Description* soap_new__wsrfbf__ResourceUnknownFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResourceUnknownFaultType_Description* soap_new_req__wsrfbf__ResourceUnknownFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__ResourceUnknownFaultType_Description* soap_new_set__wsrfbf__ResourceUnknownFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResourceUnknownFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResourceUnknownFaultType_Description(soap*, _wsrfbf__ResourceUnknownFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__ResourceUnknownFaultType_Description(soap*, _wsrfbf__ResourceUnknownFaultType_Description*) serialize to a stream -/// - _wsrfbf__ResourceUnknownFaultType_Description* _wsrfbf__ResourceUnknownFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnknownFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResourceUnknownFaultType_Description::soap_del() deep deletes _wsrfbf__ResourceUnknownFaultType_Description data members, use only after _wsrfbf__ResourceUnknownFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResourceUnknownFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnknownFaultType_Description or derived type identifier - class _wsrfbf__ResourceUnknownFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__ResourceUnknownFaultType_FaultCause operations: -/// - _wsrfbf__ResourceUnknownFaultType_FaultCause* soap_new__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__ResourceUnknownFaultType_FaultCause* soap_new__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResourceUnknownFaultType_FaultCause* soap_new_req__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__ResourceUnknownFaultType_FaultCause* soap_new_set__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, _wsrfbf__ResourceUnknownFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, _wsrfbf__ResourceUnknownFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__ResourceUnknownFaultType_FaultCause* _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnknownFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_del() deep deletes _wsrfbf__ResourceUnknownFaultType_FaultCause data members, use only after _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnknownFaultType_FaultCause or derived type identifier - class _wsrfbf__ResourceUnknownFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsrfr__ResourceUnknownFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__ResourceUnknownFaultType_ErrorCode operations: + /// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* soap_new__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* soap_new__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* soap_new_req__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* soap_new_set__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, _wsrfbf__ResourceUnknownFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__ResourceUnknownFaultType_ErrorCode(soap*, _wsrfbf__ResourceUnknownFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__ResourceUnknownFaultType_ErrorCode* _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnknownFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__ResourceUnknownFaultType_ErrorCode data members, use only after _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResourceUnknownFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnknownFaultType_ErrorCode or derived type identifier + class _wsrfbf__ResourceUnknownFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__ResourceUnknownFaultType_Description operations: + /// - _wsrfbf__ResourceUnknownFaultType_Description* soap_new__wsrfbf__ResourceUnknownFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__ResourceUnknownFaultType_Description* soap_new__wsrfbf__ResourceUnknownFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResourceUnknownFaultType_Description* soap_new_req__wsrfbf__ResourceUnknownFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__ResourceUnknownFaultType_Description* soap_new_set__wsrfbf__ResourceUnknownFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResourceUnknownFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResourceUnknownFaultType_Description(soap*, _wsrfbf__ResourceUnknownFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__ResourceUnknownFaultType_Description(soap*, _wsrfbf__ResourceUnknownFaultType_Description*) serialize to a stream + /// - _wsrfbf__ResourceUnknownFaultType_Description* _wsrfbf__ResourceUnknownFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnknownFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResourceUnknownFaultType_Description::soap_del() deep deletes _wsrfbf__ResourceUnknownFaultType_Description data members, use only after _wsrfbf__ResourceUnknownFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResourceUnknownFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnknownFaultType_Description or derived type identifier + class _wsrfbf__ResourceUnknownFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__ResourceUnknownFaultType_FaultCause operations: + /// - _wsrfbf__ResourceUnknownFaultType_FaultCause* soap_new__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__ResourceUnknownFaultType_FaultCause* soap_new__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResourceUnknownFaultType_FaultCause* soap_new_req__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__ResourceUnknownFaultType_FaultCause* soap_new_set__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, _wsrfbf__ResourceUnknownFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__ResourceUnknownFaultType_FaultCause(soap*, _wsrfbf__ResourceUnknownFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__ResourceUnknownFaultType_FaultCause* _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnknownFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_del() deep deletes _wsrfbf__ResourceUnknownFaultType_FaultCause data members, use only after _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResourceUnknownFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnknownFaultType_FaultCause or derived type identifier + class _wsrfbf__ResourceUnknownFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsrf/r-2":ResourceUnavailableFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -2524,90 +2524,90 @@ class wsrfr__ResourceUnknownFaultType : public wsrfbf__BaseFaultType /// - wsrfr__ResourceUnavailableFaultType* wsrfr__ResourceUnavailableFaultType::soap_dup(soap*) returns deep copy of wsrfr__ResourceUnavailableFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsrfr__ResourceUnavailableFaultType::soap_del() deep deletes wsrfr__ResourceUnavailableFaultType data members, use only after wsrfr__ResourceUnavailableFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsrfr__ResourceUnavailableFaultType::soap_type() returns SOAP_TYPE_wsrfr__ResourceUnavailableFaultType or derived type identifier -class wsrfr__ResourceUnavailableFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__ResourceUnavailableFaultType_ErrorCode operations: -/// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* soap_new__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* soap_new__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* soap_new_req__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* soap_new_set__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, _wsrfbf__ResourceUnavailableFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, _wsrfbf__ResourceUnavailableFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnavailableFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__ResourceUnavailableFaultType_ErrorCode data members, use only after _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnavailableFaultType_ErrorCode or derived type identifier - class _wsrfbf__ResourceUnavailableFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__ResourceUnavailableFaultType_Description operations: -/// - _wsrfbf__ResourceUnavailableFaultType_Description* soap_new__wsrfbf__ResourceUnavailableFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__ResourceUnavailableFaultType_Description* soap_new__wsrfbf__ResourceUnavailableFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResourceUnavailableFaultType_Description* soap_new_req__wsrfbf__ResourceUnavailableFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__ResourceUnavailableFaultType_Description* soap_new_set__wsrfbf__ResourceUnavailableFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResourceUnavailableFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResourceUnavailableFaultType_Description(soap*, _wsrfbf__ResourceUnavailableFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__ResourceUnavailableFaultType_Description(soap*, _wsrfbf__ResourceUnavailableFaultType_Description*) serialize to a stream -/// - _wsrfbf__ResourceUnavailableFaultType_Description* _wsrfbf__ResourceUnavailableFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnavailableFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResourceUnavailableFaultType_Description::soap_del() deep deletes _wsrfbf__ResourceUnavailableFaultType_Description data members, use only after _wsrfbf__ResourceUnavailableFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResourceUnavailableFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnavailableFaultType_Description or derived type identifier - class _wsrfbf__ResourceUnavailableFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__ResourceUnavailableFaultType_FaultCause operations: -/// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* soap_new__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* soap_new__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* soap_new_req__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* soap_new_set__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, _wsrfbf__ResourceUnavailableFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, _wsrfbf__ResourceUnavailableFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnavailableFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_del() deep deletes _wsrfbf__ResourceUnavailableFaultType_FaultCause data members, use only after _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnavailableFaultType_FaultCause or derived type identifier - class _wsrfbf__ResourceUnavailableFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsrfr__ResourceUnavailableFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__ResourceUnavailableFaultType_ErrorCode operations: + /// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* soap_new__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* soap_new__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* soap_new_req__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* soap_new_set__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, _wsrfbf__ResourceUnavailableFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__ResourceUnavailableFaultType_ErrorCode(soap*, _wsrfbf__ResourceUnavailableFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode* _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnavailableFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__ResourceUnavailableFaultType_ErrorCode data members, use only after _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResourceUnavailableFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnavailableFaultType_ErrorCode or derived type identifier + class _wsrfbf__ResourceUnavailableFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__ResourceUnavailableFaultType_Description operations: + /// - _wsrfbf__ResourceUnavailableFaultType_Description* soap_new__wsrfbf__ResourceUnavailableFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__ResourceUnavailableFaultType_Description* soap_new__wsrfbf__ResourceUnavailableFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResourceUnavailableFaultType_Description* soap_new_req__wsrfbf__ResourceUnavailableFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__ResourceUnavailableFaultType_Description* soap_new_set__wsrfbf__ResourceUnavailableFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResourceUnavailableFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResourceUnavailableFaultType_Description(soap*, _wsrfbf__ResourceUnavailableFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__ResourceUnavailableFaultType_Description(soap*, _wsrfbf__ResourceUnavailableFaultType_Description*) serialize to a stream + /// - _wsrfbf__ResourceUnavailableFaultType_Description* _wsrfbf__ResourceUnavailableFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnavailableFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResourceUnavailableFaultType_Description::soap_del() deep deletes _wsrfbf__ResourceUnavailableFaultType_Description data members, use only after _wsrfbf__ResourceUnavailableFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResourceUnavailableFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnavailableFaultType_Description or derived type identifier + class _wsrfbf__ResourceUnavailableFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__ResourceUnavailableFaultType_FaultCause operations: + /// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* soap_new__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* soap_new__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* soap_new_req__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* soap_new_set__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, _wsrfbf__ResourceUnavailableFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__ResourceUnavailableFaultType_FaultCause(soap*, _wsrfbf__ResourceUnavailableFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__ResourceUnavailableFaultType_FaultCause* _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__ResourceUnavailableFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_del() deep deletes _wsrfbf__ResourceUnavailableFaultType_FaultCause data members, use only after _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResourceUnavailableFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__ResourceUnavailableFaultType_FaultCause or derived type identifier + class _wsrfbf__ResourceUnavailableFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":SubscribeCreationFailedFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -2623,90 +2623,90 @@ class wsrfr__ResourceUnavailableFaultType : public wsrfbf__BaseFaultType /// - wsnt__SubscribeCreationFailedFaultType* wsnt__SubscribeCreationFailedFaultType::soap_dup(soap*) returns deep copy of wsnt__SubscribeCreationFailedFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__SubscribeCreationFailedFaultType::soap_del() deep deletes wsnt__SubscribeCreationFailedFaultType data members, use only after wsnt__SubscribeCreationFailedFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__SubscribeCreationFailedFaultType::soap_type() returns SOAP_TYPE_wsnt__SubscribeCreationFailedFaultType or derived type identifier -class wsnt__SubscribeCreationFailedFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode operations: -/// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* soap_new__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* soap_new__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* soap_new_req__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* soap_new_set__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode data members, use only after _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode or derived type identifier - class _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__SubscribeCreationFailedFaultType_Description operations: -/// - _wsrfbf__SubscribeCreationFailedFaultType_Description* soap_new__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__SubscribeCreationFailedFaultType_Description* soap_new__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__SubscribeCreationFailedFaultType_Description* soap_new_req__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__SubscribeCreationFailedFaultType_Description* soap_new_set__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, _wsrfbf__SubscribeCreationFailedFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, _wsrfbf__SubscribeCreationFailedFaultType_Description*) serialize to a stream -/// - _wsrfbf__SubscribeCreationFailedFaultType_Description* _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__SubscribeCreationFailedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_del() deep deletes _wsrfbf__SubscribeCreationFailedFaultType_Description data members, use only after _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__SubscribeCreationFailedFaultType_Description or derived type identifier - class _wsrfbf__SubscribeCreationFailedFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__SubscribeCreationFailedFaultType_FaultCause operations: -/// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* soap_new__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* soap_new__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* soap_new_req__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* soap_new_set__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, _wsrfbf__SubscribeCreationFailedFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, _wsrfbf__SubscribeCreationFailedFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__SubscribeCreationFailedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__SubscribeCreationFailedFaultType_FaultCause data members, use only after _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__SubscribeCreationFailedFaultType_FaultCause or derived type identifier - class _wsrfbf__SubscribeCreationFailedFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__SubscribeCreationFailedFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode operations: + /// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* soap_new__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* soap_new__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* soap_new_req__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* soap_new_set__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode(soap*, _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode* _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode data members, use only after _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__SubscribeCreationFailedFaultType_ErrorCode or derived type identifier + class _wsrfbf__SubscribeCreationFailedFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__SubscribeCreationFailedFaultType_Description operations: + /// - _wsrfbf__SubscribeCreationFailedFaultType_Description* soap_new__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__SubscribeCreationFailedFaultType_Description* soap_new__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__SubscribeCreationFailedFaultType_Description* soap_new_req__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__SubscribeCreationFailedFaultType_Description* soap_new_set__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, _wsrfbf__SubscribeCreationFailedFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__SubscribeCreationFailedFaultType_Description(soap*, _wsrfbf__SubscribeCreationFailedFaultType_Description*) serialize to a stream + /// - _wsrfbf__SubscribeCreationFailedFaultType_Description* _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__SubscribeCreationFailedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_del() deep deletes _wsrfbf__SubscribeCreationFailedFaultType_Description data members, use only after _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__SubscribeCreationFailedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__SubscribeCreationFailedFaultType_Description or derived type identifier + class _wsrfbf__SubscribeCreationFailedFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__SubscribeCreationFailedFaultType_FaultCause operations: + /// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* soap_new__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* soap_new__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* soap_new_req__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* soap_new_set__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, _wsrfbf__SubscribeCreationFailedFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__SubscribeCreationFailedFaultType_FaultCause(soap*, _wsrfbf__SubscribeCreationFailedFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause* _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__SubscribeCreationFailedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__SubscribeCreationFailedFaultType_FaultCause data members, use only after _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__SubscribeCreationFailedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__SubscribeCreationFailedFaultType_FaultCause or derived type identifier + class _wsrfbf__SubscribeCreationFailedFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":InvalidFilterFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -2722,92 +2722,92 @@ class wsnt__SubscribeCreationFailedFaultType : public wsrfbf__BaseFaultType /// - wsnt__InvalidFilterFaultType* wsnt__InvalidFilterFaultType::soap_dup(soap*) returns deep copy of wsnt__InvalidFilterFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__InvalidFilterFaultType::soap_del() deep deletes wsnt__InvalidFilterFaultType data members, use only after wsnt__InvalidFilterFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__InvalidFilterFaultType::soap_type() returns SOAP_TYPE_wsnt__InvalidFilterFaultType or derived type identifier -class wsnt__InvalidFilterFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__InvalidFilterFaultType_ErrorCode operations: -/// - _wsrfbf__InvalidFilterFaultType_ErrorCode* soap_new__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__InvalidFilterFaultType_ErrorCode* soap_new__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidFilterFaultType_ErrorCode* soap_new_req__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidFilterFaultType_ErrorCode* soap_new_set__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, _wsrfbf__InvalidFilterFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, _wsrfbf__InvalidFilterFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__InvalidFilterFaultType_ErrorCode* _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidFilterFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__InvalidFilterFaultType_ErrorCode data members, use only after _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__InvalidFilterFaultType_ErrorCode or derived type identifier - class _wsrfbf__InvalidFilterFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__InvalidFilterFaultType_Description operations: -/// - _wsrfbf__InvalidFilterFaultType_Description* soap_new__wsrfbf__InvalidFilterFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__InvalidFilterFaultType_Description* soap_new__wsrfbf__InvalidFilterFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidFilterFaultType_Description* soap_new_req__wsrfbf__InvalidFilterFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidFilterFaultType_Description* soap_new_set__wsrfbf__InvalidFilterFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidFilterFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidFilterFaultType_Description(soap*, _wsrfbf__InvalidFilterFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidFilterFaultType_Description(soap*, _wsrfbf__InvalidFilterFaultType_Description*) serialize to a stream -/// - _wsrfbf__InvalidFilterFaultType_Description* _wsrfbf__InvalidFilterFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidFilterFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidFilterFaultType_Description::soap_del() deep deletes _wsrfbf__InvalidFilterFaultType_Description data members, use only after _wsrfbf__InvalidFilterFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidFilterFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__InvalidFilterFaultType_Description or derived type identifier - class _wsrfbf__InvalidFilterFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__InvalidFilterFaultType_FaultCause operations: -/// - _wsrfbf__InvalidFilterFaultType_FaultCause* soap_new__wsrfbf__InvalidFilterFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__InvalidFilterFaultType_FaultCause* soap_new__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidFilterFaultType_FaultCause* soap_new_req__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidFilterFaultType_FaultCause* soap_new_set__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidFilterFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, _wsrfbf__InvalidFilterFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, _wsrfbf__InvalidFilterFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__InvalidFilterFaultType_FaultCause* _wsrfbf__InvalidFilterFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidFilterFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidFilterFaultType_FaultCause::soap_del() deep deletes _wsrfbf__InvalidFilterFaultType_FaultCause data members, use only after _wsrfbf__InvalidFilterFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidFilterFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__InvalidFilterFaultType_FaultCause or derived type identifier - class _wsrfbf__InvalidFilterFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__InvalidFilterFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__InvalidFilterFaultType_ErrorCode operations: + /// - _wsrfbf__InvalidFilterFaultType_ErrorCode* soap_new__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__InvalidFilterFaultType_ErrorCode* soap_new__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidFilterFaultType_ErrorCode* soap_new_req__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidFilterFaultType_ErrorCode* soap_new_set__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, _wsrfbf__InvalidFilterFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidFilterFaultType_ErrorCode(soap*, _wsrfbf__InvalidFilterFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__InvalidFilterFaultType_ErrorCode* _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidFilterFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__InvalidFilterFaultType_ErrorCode data members, use only after _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidFilterFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__InvalidFilterFaultType_ErrorCode or derived type identifier + class _wsrfbf__InvalidFilterFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__InvalidFilterFaultType_Description operations: + /// - _wsrfbf__InvalidFilterFaultType_Description* soap_new__wsrfbf__InvalidFilterFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__InvalidFilterFaultType_Description* soap_new__wsrfbf__InvalidFilterFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidFilterFaultType_Description* soap_new_req__wsrfbf__InvalidFilterFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidFilterFaultType_Description* soap_new_set__wsrfbf__InvalidFilterFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidFilterFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidFilterFaultType_Description(soap*, _wsrfbf__InvalidFilterFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidFilterFaultType_Description(soap*, _wsrfbf__InvalidFilterFaultType_Description*) serialize to a stream + /// - _wsrfbf__InvalidFilterFaultType_Description* _wsrfbf__InvalidFilterFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidFilterFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidFilterFaultType_Description::soap_del() deep deletes _wsrfbf__InvalidFilterFaultType_Description data members, use only after _wsrfbf__InvalidFilterFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidFilterFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__InvalidFilterFaultType_Description or derived type identifier + class _wsrfbf__InvalidFilterFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__InvalidFilterFaultType_FaultCause operations: + /// - _wsrfbf__InvalidFilterFaultType_FaultCause* soap_new__wsrfbf__InvalidFilterFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__InvalidFilterFaultType_FaultCause* soap_new__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidFilterFaultType_FaultCause* soap_new_req__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidFilterFaultType_FaultCause* soap_new_set__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidFilterFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, _wsrfbf__InvalidFilterFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidFilterFaultType_FaultCause(soap*, _wsrfbf__InvalidFilterFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__InvalidFilterFaultType_FaultCause* _wsrfbf__InvalidFilterFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidFilterFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidFilterFaultType_FaultCause::soap_del() deep deletes _wsrfbf__InvalidFilterFaultType_FaultCause data members, use only after _wsrfbf__InvalidFilterFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidFilterFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__InvalidFilterFaultType_FaultCause or derived type identifier + class _wsrfbf__InvalidFilterFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ /// Vector of xsd__QName of length 1..unbounded. - std::vector UnknownFilter 1; ///< Multiple elements. + std::vector UnknownFilter 1; ///< Multiple elements. }; /// @brief "http://docs.oasis-open.org/wsn/b-2":TopicExpressionDialectUnknownFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -2823,90 +2823,90 @@ class wsnt__InvalidFilterFaultType : public wsrfbf__BaseFaultType /// - wsnt__TopicExpressionDialectUnknownFaultType* wsnt__TopicExpressionDialectUnknownFaultType::soap_dup(soap*) returns deep copy of wsnt__TopicExpressionDialectUnknownFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__TopicExpressionDialectUnknownFaultType::soap_del() deep deletes wsnt__TopicExpressionDialectUnknownFaultType data members, use only after wsnt__TopicExpressionDialectUnknownFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__TopicExpressionDialectUnknownFaultType::soap_type() returns SOAP_TYPE_wsnt__TopicExpressionDialectUnknownFaultType or derived type identifier -class wsnt__TopicExpressionDialectUnknownFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode operations: -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* soap_new_req__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* soap_new_set__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode data members, use only after _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode or derived type identifier - class _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__TopicExpressionDialectUnknownFaultType_Description operations: -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* soap_new_req__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* soap_new_set__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_Description*) serialize to a stream -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__TopicExpressionDialectUnknownFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_del() deep deletes _wsrfbf__TopicExpressionDialectUnknownFaultType_Description data members, use only after _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__TopicExpressionDialectUnknownFaultType_Description or derived type identifier - class _wsrfbf__TopicExpressionDialectUnknownFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause operations: -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* soap_new_req__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* soap_new_set__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_del() deep deletes _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause data members, use only after _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause or derived type identifier - class _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__TopicExpressionDialectUnknownFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode operations: + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* soap_new_req__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* soap_new_set__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode* _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode data members, use only after _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode or derived type identifier + class _wsrfbf__TopicExpressionDialectUnknownFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__TopicExpressionDialectUnknownFaultType_Description operations: + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* soap_new_req__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* soap_new_set__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__TopicExpressionDialectUnknownFaultType_Description(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_Description*) serialize to a stream + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description* _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__TopicExpressionDialectUnknownFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_del() deep deletes _wsrfbf__TopicExpressionDialectUnknownFaultType_Description data members, use only after _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__TopicExpressionDialectUnknownFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__TopicExpressionDialectUnknownFaultType_Description or derived type identifier + class _wsrfbf__TopicExpressionDialectUnknownFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause operations: + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* soap_new__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* soap_new_req__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* soap_new_set__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause(soap*, _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause* _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_del() deep deletes _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause data members, use only after _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause or derived type identifier + class _wsrfbf__TopicExpressionDialectUnknownFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":InvalidTopicExpressionFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -2922,90 +2922,90 @@ class wsnt__TopicExpressionDialectUnknownFaultType : public wsrfbf__BaseFaultTyp /// - wsnt__InvalidTopicExpressionFaultType* wsnt__InvalidTopicExpressionFaultType::soap_dup(soap*) returns deep copy of wsnt__InvalidTopicExpressionFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__InvalidTopicExpressionFaultType::soap_del() deep deletes wsnt__InvalidTopicExpressionFaultType data members, use only after wsnt__InvalidTopicExpressionFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__InvalidTopicExpressionFaultType::soap_type() returns SOAP_TYPE_wsnt__InvalidTopicExpressionFaultType or derived type identifier -class wsnt__InvalidTopicExpressionFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode operations: -/// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* soap_new_req__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* soap_new_set__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode data members, use only after _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode or derived type identifier - class _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__InvalidTopicExpressionFaultType_Description operations: -/// - _wsrfbf__InvalidTopicExpressionFaultType_Description* soap_new__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__InvalidTopicExpressionFaultType_Description* soap_new__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidTopicExpressionFaultType_Description* soap_new_req__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidTopicExpressionFaultType_Description* soap_new_set__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, _wsrfbf__InvalidTopicExpressionFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, _wsrfbf__InvalidTopicExpressionFaultType_Description*) serialize to a stream -/// - _wsrfbf__InvalidTopicExpressionFaultType_Description* _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidTopicExpressionFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_del() deep deletes _wsrfbf__InvalidTopicExpressionFaultType_Description data members, use only after _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__InvalidTopicExpressionFaultType_Description or derived type identifier - class _wsrfbf__InvalidTopicExpressionFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__InvalidTopicExpressionFaultType_FaultCause operations: -/// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* soap_new_req__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* soap_new_set__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidTopicExpressionFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidTopicExpressionFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidTopicExpressionFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_del() deep deletes _wsrfbf__InvalidTopicExpressionFaultType_FaultCause data members, use only after _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__InvalidTopicExpressionFaultType_FaultCause or derived type identifier - class _wsrfbf__InvalidTopicExpressionFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__InvalidTopicExpressionFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode operations: + /// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* soap_new_req__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* soap_new_set__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode* _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode data members, use only after _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__InvalidTopicExpressionFaultType_ErrorCode or derived type identifier + class _wsrfbf__InvalidTopicExpressionFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__InvalidTopicExpressionFaultType_Description operations: + /// - _wsrfbf__InvalidTopicExpressionFaultType_Description* soap_new__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__InvalidTopicExpressionFaultType_Description* soap_new__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidTopicExpressionFaultType_Description* soap_new_req__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidTopicExpressionFaultType_Description* soap_new_set__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, _wsrfbf__InvalidTopicExpressionFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidTopicExpressionFaultType_Description(soap*, _wsrfbf__InvalidTopicExpressionFaultType_Description*) serialize to a stream + /// - _wsrfbf__InvalidTopicExpressionFaultType_Description* _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidTopicExpressionFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_del() deep deletes _wsrfbf__InvalidTopicExpressionFaultType_Description data members, use only after _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidTopicExpressionFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__InvalidTopicExpressionFaultType_Description or derived type identifier + class _wsrfbf__InvalidTopicExpressionFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__InvalidTopicExpressionFaultType_FaultCause operations: + /// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* soap_new_req__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* soap_new_set__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidTopicExpressionFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidTopicExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidTopicExpressionFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause* _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidTopicExpressionFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_del() deep deletes _wsrfbf__InvalidTopicExpressionFaultType_FaultCause data members, use only after _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidTopicExpressionFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__InvalidTopicExpressionFaultType_FaultCause or derived type identifier + class _wsrfbf__InvalidTopicExpressionFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":TopicNotSupportedFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3021,90 +3021,90 @@ class wsnt__InvalidTopicExpressionFaultType : public wsrfbf__BaseFaultType /// - wsnt__TopicNotSupportedFaultType* wsnt__TopicNotSupportedFaultType::soap_dup(soap*) returns deep copy of wsnt__TopicNotSupportedFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__TopicNotSupportedFaultType::soap_del() deep deletes wsnt__TopicNotSupportedFaultType data members, use only after wsnt__TopicNotSupportedFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__TopicNotSupportedFaultType::soap_type() returns SOAP_TYPE_wsnt__TopicNotSupportedFaultType or derived type identifier -class wsnt__TopicNotSupportedFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__TopicNotSupportedFaultType_ErrorCode operations: -/// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* soap_new__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* soap_new__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* soap_new_req__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* soap_new_set__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, _wsrfbf__TopicNotSupportedFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, _wsrfbf__TopicNotSupportedFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__TopicNotSupportedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__TopicNotSupportedFaultType_ErrorCode data members, use only after _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__TopicNotSupportedFaultType_ErrorCode or derived type identifier - class _wsrfbf__TopicNotSupportedFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__TopicNotSupportedFaultType_Description operations: -/// - _wsrfbf__TopicNotSupportedFaultType_Description* soap_new__wsrfbf__TopicNotSupportedFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__TopicNotSupportedFaultType_Description* soap_new__wsrfbf__TopicNotSupportedFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__TopicNotSupportedFaultType_Description* soap_new_req__wsrfbf__TopicNotSupportedFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__TopicNotSupportedFaultType_Description* soap_new_set__wsrfbf__TopicNotSupportedFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__TopicNotSupportedFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__TopicNotSupportedFaultType_Description(soap*, _wsrfbf__TopicNotSupportedFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__TopicNotSupportedFaultType_Description(soap*, _wsrfbf__TopicNotSupportedFaultType_Description*) serialize to a stream -/// - _wsrfbf__TopicNotSupportedFaultType_Description* _wsrfbf__TopicNotSupportedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__TopicNotSupportedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__TopicNotSupportedFaultType_Description::soap_del() deep deletes _wsrfbf__TopicNotSupportedFaultType_Description data members, use only after _wsrfbf__TopicNotSupportedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__TopicNotSupportedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__TopicNotSupportedFaultType_Description or derived type identifier - class _wsrfbf__TopicNotSupportedFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__TopicNotSupportedFaultType_FaultCause operations: -/// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* soap_new__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* soap_new__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* soap_new_req__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* soap_new_set__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, _wsrfbf__TopicNotSupportedFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, _wsrfbf__TopicNotSupportedFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__TopicNotSupportedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__TopicNotSupportedFaultType_FaultCause data members, use only after _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__TopicNotSupportedFaultType_FaultCause or derived type identifier - class _wsrfbf__TopicNotSupportedFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__TopicNotSupportedFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__TopicNotSupportedFaultType_ErrorCode operations: + /// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* soap_new__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* soap_new__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* soap_new_req__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* soap_new_set__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, _wsrfbf__TopicNotSupportedFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__TopicNotSupportedFaultType_ErrorCode(soap*, _wsrfbf__TopicNotSupportedFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode* _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__TopicNotSupportedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__TopicNotSupportedFaultType_ErrorCode data members, use only after _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__TopicNotSupportedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__TopicNotSupportedFaultType_ErrorCode or derived type identifier + class _wsrfbf__TopicNotSupportedFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__TopicNotSupportedFaultType_Description operations: + /// - _wsrfbf__TopicNotSupportedFaultType_Description* soap_new__wsrfbf__TopicNotSupportedFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__TopicNotSupportedFaultType_Description* soap_new__wsrfbf__TopicNotSupportedFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__TopicNotSupportedFaultType_Description* soap_new_req__wsrfbf__TopicNotSupportedFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__TopicNotSupportedFaultType_Description* soap_new_set__wsrfbf__TopicNotSupportedFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__TopicNotSupportedFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__TopicNotSupportedFaultType_Description(soap*, _wsrfbf__TopicNotSupportedFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__TopicNotSupportedFaultType_Description(soap*, _wsrfbf__TopicNotSupportedFaultType_Description*) serialize to a stream + /// - _wsrfbf__TopicNotSupportedFaultType_Description* _wsrfbf__TopicNotSupportedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__TopicNotSupportedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__TopicNotSupportedFaultType_Description::soap_del() deep deletes _wsrfbf__TopicNotSupportedFaultType_Description data members, use only after _wsrfbf__TopicNotSupportedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__TopicNotSupportedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__TopicNotSupportedFaultType_Description or derived type identifier + class _wsrfbf__TopicNotSupportedFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__TopicNotSupportedFaultType_FaultCause operations: + /// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* soap_new__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* soap_new__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* soap_new_req__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* soap_new_set__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, _wsrfbf__TopicNotSupportedFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__TopicNotSupportedFaultType_FaultCause(soap*, _wsrfbf__TopicNotSupportedFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__TopicNotSupportedFaultType_FaultCause* _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__TopicNotSupportedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__TopicNotSupportedFaultType_FaultCause data members, use only after _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__TopicNotSupportedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__TopicNotSupportedFaultType_FaultCause or derived type identifier + class _wsrfbf__TopicNotSupportedFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":MultipleTopicsSpecifiedFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3120,90 +3120,90 @@ class wsnt__TopicNotSupportedFaultType : public wsrfbf__BaseFaultType /// - wsnt__MultipleTopicsSpecifiedFaultType* wsnt__MultipleTopicsSpecifiedFaultType::soap_dup(soap*) returns deep copy of wsnt__MultipleTopicsSpecifiedFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__MultipleTopicsSpecifiedFaultType::soap_del() deep deletes wsnt__MultipleTopicsSpecifiedFaultType data members, use only after wsnt__MultipleTopicsSpecifiedFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__MultipleTopicsSpecifiedFaultType::soap_type() returns SOAP_TYPE_wsnt__MultipleTopicsSpecifiedFaultType or derived type identifier -class wsnt__MultipleTopicsSpecifiedFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode operations: -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* soap_new_req__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* soap_new_set__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode data members, use only after _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode or derived type identifier - class _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__MultipleTopicsSpecifiedFaultType_Description operations: -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* soap_new_req__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* soap_new_set__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_Description*) serialize to a stream -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__MultipleTopicsSpecifiedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_del() deep deletes _wsrfbf__MultipleTopicsSpecifiedFaultType_Description data members, use only after _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__MultipleTopicsSpecifiedFaultType_Description or derived type identifier - class _wsrfbf__MultipleTopicsSpecifiedFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause operations: -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* soap_new_req__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* soap_new_set__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause data members, use only after _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause or derived type identifier - class _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__MultipleTopicsSpecifiedFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode operations: + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* soap_new_req__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* soap_new_set__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode* _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode data members, use only after _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode or derived type identifier + class _wsrfbf__MultipleTopicsSpecifiedFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__MultipleTopicsSpecifiedFaultType_Description operations: + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* soap_new_req__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* soap_new_set__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__MultipleTopicsSpecifiedFaultType_Description(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_Description*) serialize to a stream + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description* _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__MultipleTopicsSpecifiedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_del() deep deletes _wsrfbf__MultipleTopicsSpecifiedFaultType_Description data members, use only after _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__MultipleTopicsSpecifiedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__MultipleTopicsSpecifiedFaultType_Description or derived type identifier + class _wsrfbf__MultipleTopicsSpecifiedFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause operations: + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* soap_new__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* soap_new_req__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* soap_new_set__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause(soap*, _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause* _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause data members, use only after _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause or derived type identifier + class _wsrfbf__MultipleTopicsSpecifiedFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":InvalidProducerPropertiesExpressionFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3219,90 +3219,90 @@ class wsnt__MultipleTopicsSpecifiedFaultType : public wsrfbf__BaseFaultType /// - wsnt__InvalidProducerPropertiesExpressionFaultType* wsnt__InvalidProducerPropertiesExpressionFaultType::soap_dup(soap*) returns deep copy of wsnt__InvalidProducerPropertiesExpressionFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__InvalidProducerPropertiesExpressionFaultType::soap_del() deep deletes wsnt__InvalidProducerPropertiesExpressionFaultType data members, use only after wsnt__InvalidProducerPropertiesExpressionFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__InvalidProducerPropertiesExpressionFaultType::soap_type() returns SOAP_TYPE_wsnt__InvalidProducerPropertiesExpressionFaultType or derived type identifier -class wsnt__InvalidProducerPropertiesExpressionFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode operations: -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* soap_new_req__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* soap_new_set__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode data members, use only after _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode or derived type identifier - class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description operations: -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* soap_new_req__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* soap_new_set__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description*) serialize to a stream -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_del() deep deletes _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description data members, use only after _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description or derived type identifier - class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause operations: -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* soap_new_req__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* soap_new_set__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_del() deep deletes _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause data members, use only after _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause or derived type identifier - class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__InvalidProducerPropertiesExpressionFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode operations: + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* soap_new_req__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* soap_new_set__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode* _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode data members, use only after _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode or derived type identifier + class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description operations: + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* soap_new_req__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* soap_new_set__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description*) serialize to a stream + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description* _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_del() deep deletes _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description data members, use only after _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description or derived type identifier + class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause operations: + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* soap_new_req__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* soap_new_set__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause* _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_del() deep deletes _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause data members, use only after _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause or derived type identifier + class _wsrfbf__InvalidProducerPropertiesExpressionFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":InvalidMessageContentExpressionFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3318,90 +3318,90 @@ class wsnt__InvalidProducerPropertiesExpressionFaultType : public wsrfbf__BaseFa /// - wsnt__InvalidMessageContentExpressionFaultType* wsnt__InvalidMessageContentExpressionFaultType::soap_dup(soap*) returns deep copy of wsnt__InvalidMessageContentExpressionFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__InvalidMessageContentExpressionFaultType::soap_del() deep deletes wsnt__InvalidMessageContentExpressionFaultType data members, use only after wsnt__InvalidMessageContentExpressionFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__InvalidMessageContentExpressionFaultType::soap_type() returns SOAP_TYPE_wsnt__InvalidMessageContentExpressionFaultType or derived type identifier -class wsnt__InvalidMessageContentExpressionFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode operations: -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* soap_new_req__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* soap_new_set__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode data members, use only after _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode or derived type identifier - class _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__InvalidMessageContentExpressionFaultType_Description operations: -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* soap_new_req__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* soap_new_set__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_Description*) serialize to a stream -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidMessageContentExpressionFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_del() deep deletes _wsrfbf__InvalidMessageContentExpressionFaultType_Description data members, use only after _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__InvalidMessageContentExpressionFaultType_Description or derived type identifier - class _wsrfbf__InvalidMessageContentExpressionFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause operations: -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* soap_new_req__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* soap_new_set__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_del() deep deletes _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause data members, use only after _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause or derived type identifier - class _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__InvalidMessageContentExpressionFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode operations: + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* soap_new_req__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* soap_new_set__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode* _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode data members, use only after _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode or derived type identifier + class _wsrfbf__InvalidMessageContentExpressionFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__InvalidMessageContentExpressionFaultType_Description operations: + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* soap_new_req__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* soap_new_set__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidMessageContentExpressionFaultType_Description(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_Description*) serialize to a stream + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description* _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidMessageContentExpressionFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_del() deep deletes _wsrfbf__InvalidMessageContentExpressionFaultType_Description data members, use only after _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidMessageContentExpressionFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__InvalidMessageContentExpressionFaultType_Description or derived type identifier + class _wsrfbf__InvalidMessageContentExpressionFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause operations: + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* soap_new__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* soap_new_req__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* soap_new_set__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause(soap*, _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause* _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_del() deep deletes _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause data members, use only after _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause or derived type identifier + class _wsrfbf__InvalidMessageContentExpressionFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":UnrecognizedPolicyRequestFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3417,92 +3417,92 @@ class wsnt__InvalidMessageContentExpressionFaultType : public wsrfbf__BaseFaultT /// - wsnt__UnrecognizedPolicyRequestFaultType* wsnt__UnrecognizedPolicyRequestFaultType::soap_dup(soap*) returns deep copy of wsnt__UnrecognizedPolicyRequestFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__UnrecognizedPolicyRequestFaultType::soap_del() deep deletes wsnt__UnrecognizedPolicyRequestFaultType data members, use only after wsnt__UnrecognizedPolicyRequestFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__UnrecognizedPolicyRequestFaultType::soap_type() returns SOAP_TYPE_wsnt__UnrecognizedPolicyRequestFaultType or derived type identifier -class wsnt__UnrecognizedPolicyRequestFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode operations: -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* soap_new_req__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* soap_new_set__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode data members, use only after _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode or derived type identifier - class _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__UnrecognizedPolicyRequestFaultType_Description operations: -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* soap_new_req__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* soap_new_set__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_Description*) serialize to a stream -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnrecognizedPolicyRequestFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_del() deep deletes _wsrfbf__UnrecognizedPolicyRequestFaultType_Description data members, use only after _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnrecognizedPolicyRequestFaultType_Description or derived type identifier - class _wsrfbf__UnrecognizedPolicyRequestFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause operations: -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* soap_new_req__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* soap_new_set__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause data members, use only after _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause or derived type identifier - class _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__UnrecognizedPolicyRequestFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode operations: + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* soap_new_req__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* soap_new_set__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode* _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode data members, use only after _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode or derived type identifier + class _wsrfbf__UnrecognizedPolicyRequestFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__UnrecognizedPolicyRequestFaultType_Description operations: + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* soap_new_req__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* soap_new_set__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__UnrecognizedPolicyRequestFaultType_Description(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_Description*) serialize to a stream + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description* _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnrecognizedPolicyRequestFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_del() deep deletes _wsrfbf__UnrecognizedPolicyRequestFaultType_Description data members, use only after _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnrecognizedPolicyRequestFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnrecognizedPolicyRequestFaultType_Description or derived type identifier + class _wsrfbf__UnrecognizedPolicyRequestFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause operations: + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* soap_new__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* soap_new_req__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* soap_new_set__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause(soap*, _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause* _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause data members, use only after _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause or derived type identifier + class _wsrfbf__UnrecognizedPolicyRequestFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ /// Vector of xsd__QName of length 0..unbounded. - std::vector UnrecognizedPolicy 0; ///< Multiple elements. + std::vector UnrecognizedPolicy 0; ///< Multiple elements. }; /// @brief "http://docs.oasis-open.org/wsn/b-2":UnsupportedPolicyRequestFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3518,92 +3518,92 @@ class wsnt__UnrecognizedPolicyRequestFaultType : public wsrfbf__BaseFaultType /// - wsnt__UnsupportedPolicyRequestFaultType* wsnt__UnsupportedPolicyRequestFaultType::soap_dup(soap*) returns deep copy of wsnt__UnsupportedPolicyRequestFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__UnsupportedPolicyRequestFaultType::soap_del() deep deletes wsnt__UnsupportedPolicyRequestFaultType data members, use only after wsnt__UnsupportedPolicyRequestFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__UnsupportedPolicyRequestFaultType::soap_type() returns SOAP_TYPE_wsnt__UnsupportedPolicyRequestFaultType or derived type identifier -class wsnt__UnsupportedPolicyRequestFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode operations: -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* soap_new_req__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* soap_new_set__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode data members, use only after _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode or derived type identifier - class _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__UnsupportedPolicyRequestFaultType_Description operations: -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* soap_new_req__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* soap_new_set__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_Description*) serialize to a stream -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnsupportedPolicyRequestFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_del() deep deletes _wsrfbf__UnsupportedPolicyRequestFaultType_Description data members, use only after _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnsupportedPolicyRequestFaultType_Description or derived type identifier - class _wsrfbf__UnsupportedPolicyRequestFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause operations: -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* soap_new_req__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* soap_new_set__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause data members, use only after _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause or derived type identifier - class _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__UnsupportedPolicyRequestFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode operations: + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* soap_new_req__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* soap_new_set__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode* _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode data members, use only after _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode or derived type identifier + class _wsrfbf__UnsupportedPolicyRequestFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__UnsupportedPolicyRequestFaultType_Description operations: + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* soap_new_req__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* soap_new_set__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__UnsupportedPolicyRequestFaultType_Description(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_Description*) serialize to a stream + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description* _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnsupportedPolicyRequestFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_del() deep deletes _wsrfbf__UnsupportedPolicyRequestFaultType_Description data members, use only after _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnsupportedPolicyRequestFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnsupportedPolicyRequestFaultType_Description or derived type identifier + class _wsrfbf__UnsupportedPolicyRequestFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause operations: + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* soap_new__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* soap_new_req__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* soap_new_set__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause(soap*, _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause* _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause data members, use only after _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause or derived type identifier + class _wsrfbf__UnsupportedPolicyRequestFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ /// Vector of xsd__QName of length 0..unbounded. - std::vector UnsupportedPolicy 0; ///< Multiple elements. + std::vector UnsupportedPolicy 0; ///< Multiple elements. }; /// @brief "http://docs.oasis-open.org/wsn/b-2":NotifyMessageNotSupportedFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3619,90 +3619,90 @@ class wsnt__UnsupportedPolicyRequestFaultType : public wsrfbf__BaseFaultType /// - wsnt__NotifyMessageNotSupportedFaultType* wsnt__NotifyMessageNotSupportedFaultType::soap_dup(soap*) returns deep copy of wsnt__NotifyMessageNotSupportedFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__NotifyMessageNotSupportedFaultType::soap_del() deep deletes wsnt__NotifyMessageNotSupportedFaultType data members, use only after wsnt__NotifyMessageNotSupportedFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__NotifyMessageNotSupportedFaultType::soap_type() returns SOAP_TYPE_wsnt__NotifyMessageNotSupportedFaultType or derived type identifier -class wsnt__NotifyMessageNotSupportedFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode operations: -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* soap_new_req__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* soap_new_set__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode data members, use only after _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode or derived type identifier - class _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__NotifyMessageNotSupportedFaultType_Description operations: -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* soap_new_req__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* soap_new_set__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_Description*) serialize to a stream -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__NotifyMessageNotSupportedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_del() deep deletes _wsrfbf__NotifyMessageNotSupportedFaultType_Description data members, use only after _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__NotifyMessageNotSupportedFaultType_Description or derived type identifier - class _wsrfbf__NotifyMessageNotSupportedFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause operations: -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* soap_new_req__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* soap_new_set__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause data members, use only after _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause or derived type identifier - class _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__NotifyMessageNotSupportedFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode operations: + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* soap_new_req__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* soap_new_set__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode* _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode data members, use only after _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode or derived type identifier + class _wsrfbf__NotifyMessageNotSupportedFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__NotifyMessageNotSupportedFaultType_Description operations: + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* soap_new_req__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* soap_new_set__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__NotifyMessageNotSupportedFaultType_Description(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_Description*) serialize to a stream + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description* _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__NotifyMessageNotSupportedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_del() deep deletes _wsrfbf__NotifyMessageNotSupportedFaultType_Description data members, use only after _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__NotifyMessageNotSupportedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__NotifyMessageNotSupportedFaultType_Description or derived type identifier + class _wsrfbf__NotifyMessageNotSupportedFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause operations: + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* soap_new__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* soap_new_req__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* soap_new_set__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause(soap*, _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause* _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause data members, use only after _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause or derived type identifier + class _wsrfbf__NotifyMessageNotSupportedFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":UnacceptableInitialTerminationTimeFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3718,94 +3718,94 @@ class wsnt__NotifyMessageNotSupportedFaultType : public wsrfbf__BaseFaultType /// - wsnt__UnacceptableInitialTerminationTimeFaultType* wsnt__UnacceptableInitialTerminationTimeFaultType::soap_dup(soap*) returns deep copy of wsnt__UnacceptableInitialTerminationTimeFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__UnacceptableInitialTerminationTimeFaultType::soap_del() deep deletes wsnt__UnacceptableInitialTerminationTimeFaultType data members, use only after wsnt__UnacceptableInitialTerminationTimeFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__UnacceptableInitialTerminationTimeFaultType::soap_type() returns SOAP_TYPE_wsnt__UnacceptableInitialTerminationTimeFaultType or derived type identifier -class wsnt__UnacceptableInitialTerminationTimeFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode operations: -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* soap_new_req__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* soap_new_set__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode data members, use only after _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode or derived type identifier - class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description operations: -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* soap_new_req__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* soap_new_set__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description*) serialize to a stream -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_del() deep deletes _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description data members, use only after _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description or derived type identifier - class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause operations: -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* soap_new_req__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* soap_new_set__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause data members, use only after _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause or derived type identifier - class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__UnacceptableInitialTerminationTimeFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode operations: + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* soap_new_req__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* soap_new_set__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode* _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode data members, use only after _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode or derived type identifier + class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description operations: + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* soap_new_req__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* soap_new_set__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description*) serialize to a stream + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description* _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_del() deep deletes _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description data members, use only after _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description or derived type identifier + class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause operations: + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* soap_new__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* soap_new_req__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* soap_new_set__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause(soap*, _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause* _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause data members, use only after _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause or derived type identifier + class _wsrfbf__UnacceptableInitialTerminationTimeFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ /// Element "MinimumTime" of type xs:dateTime. - time_t MinimumTime 1; ///< Required element. + time_t MinimumTime 1; ///< Required element. /// Element "MaximumTime" of type xs:dateTime. - time_t* MaximumTime 0; ///< Optional element. + time_t* MaximumTime 0; ///< Optional element. }; /// @brief "http://docs.oasis-open.org/wsn/b-2":NoCurrentMessageOnTopicFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3821,90 +3821,90 @@ class wsnt__UnacceptableInitialTerminationTimeFaultType : public wsrfbf__BaseFau /// - wsnt__NoCurrentMessageOnTopicFaultType* wsnt__NoCurrentMessageOnTopicFaultType::soap_dup(soap*) returns deep copy of wsnt__NoCurrentMessageOnTopicFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__NoCurrentMessageOnTopicFaultType::soap_del() deep deletes wsnt__NoCurrentMessageOnTopicFaultType data members, use only after wsnt__NoCurrentMessageOnTopicFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__NoCurrentMessageOnTopicFaultType::soap_type() returns SOAP_TYPE_wsnt__NoCurrentMessageOnTopicFaultType or derived type identifier -class wsnt__NoCurrentMessageOnTopicFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode operations: -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* soap_new_req__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* soap_new_set__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode data members, use only after _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode or derived type identifier - class _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__NoCurrentMessageOnTopicFaultType_Description operations: -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* soap_new_req__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* soap_new_set__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_Description*) serialize to a stream -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__NoCurrentMessageOnTopicFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_del() deep deletes _wsrfbf__NoCurrentMessageOnTopicFaultType_Description data members, use only after _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__NoCurrentMessageOnTopicFaultType_Description or derived type identifier - class _wsrfbf__NoCurrentMessageOnTopicFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause operations: -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* soap_new_req__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* soap_new_set__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_del() deep deletes _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause data members, use only after _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause or derived type identifier - class _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__NoCurrentMessageOnTopicFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode operations: + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* soap_new_req__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* soap_new_set__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode* _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode data members, use only after _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode or derived type identifier + class _wsrfbf__NoCurrentMessageOnTopicFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__NoCurrentMessageOnTopicFaultType_Description operations: + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* soap_new_req__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* soap_new_set__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__NoCurrentMessageOnTopicFaultType_Description(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_Description*) serialize to a stream + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description* _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__NoCurrentMessageOnTopicFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_del() deep deletes _wsrfbf__NoCurrentMessageOnTopicFaultType_Description data members, use only after _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__NoCurrentMessageOnTopicFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__NoCurrentMessageOnTopicFaultType_Description or derived type identifier + class _wsrfbf__NoCurrentMessageOnTopicFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause operations: + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* soap_new__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* soap_new_req__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* soap_new_set__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause(soap*, _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause* _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_del() deep deletes _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause data members, use only after _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause or derived type identifier + class _wsrfbf__NoCurrentMessageOnTopicFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":UnableToGetMessagesFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -3920,90 +3920,90 @@ class wsnt__NoCurrentMessageOnTopicFaultType : public wsrfbf__BaseFaultType /// - wsnt__UnableToGetMessagesFaultType* wsnt__UnableToGetMessagesFaultType::soap_dup(soap*) returns deep copy of wsnt__UnableToGetMessagesFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__UnableToGetMessagesFaultType::soap_del() deep deletes wsnt__UnableToGetMessagesFaultType data members, use only after wsnt__UnableToGetMessagesFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__UnableToGetMessagesFaultType::soap_type() returns SOAP_TYPE_wsnt__UnableToGetMessagesFaultType or derived type identifier -class wsnt__UnableToGetMessagesFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__UnableToGetMessagesFaultType_ErrorCode operations: -/// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* soap_new__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* soap_new__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* soap_new_req__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* soap_new_set__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, _wsrfbf__UnableToGetMessagesFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, _wsrfbf__UnableToGetMessagesFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToGetMessagesFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnableToGetMessagesFaultType_ErrorCode data members, use only after _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnableToGetMessagesFaultType_ErrorCode or derived type identifier - class _wsrfbf__UnableToGetMessagesFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__UnableToGetMessagesFaultType_Description operations: -/// - _wsrfbf__UnableToGetMessagesFaultType_Description* soap_new__wsrfbf__UnableToGetMessagesFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__UnableToGetMessagesFaultType_Description* soap_new__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToGetMessagesFaultType_Description* soap_new_req__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToGetMessagesFaultType_Description* soap_new_set__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToGetMessagesFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, _wsrfbf__UnableToGetMessagesFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, _wsrfbf__UnableToGetMessagesFaultType_Description*) serialize to a stream -/// - _wsrfbf__UnableToGetMessagesFaultType_Description* _wsrfbf__UnableToGetMessagesFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToGetMessagesFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToGetMessagesFaultType_Description::soap_del() deep deletes _wsrfbf__UnableToGetMessagesFaultType_Description data members, use only after _wsrfbf__UnableToGetMessagesFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToGetMessagesFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnableToGetMessagesFaultType_Description or derived type identifier - class _wsrfbf__UnableToGetMessagesFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__UnableToGetMessagesFaultType_FaultCause operations: -/// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* soap_new__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* soap_new__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* soap_new_req__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* soap_new_set__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, _wsrfbf__UnableToGetMessagesFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, _wsrfbf__UnableToGetMessagesFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToGetMessagesFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnableToGetMessagesFaultType_FaultCause data members, use only after _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnableToGetMessagesFaultType_FaultCause or derived type identifier - class _wsrfbf__UnableToGetMessagesFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__UnableToGetMessagesFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__UnableToGetMessagesFaultType_ErrorCode operations: + /// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* soap_new__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* soap_new__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* soap_new_req__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* soap_new_set__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, _wsrfbf__UnableToGetMessagesFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToGetMessagesFaultType_ErrorCode(soap*, _wsrfbf__UnableToGetMessagesFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode* _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToGetMessagesFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnableToGetMessagesFaultType_ErrorCode data members, use only after _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToGetMessagesFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnableToGetMessagesFaultType_ErrorCode or derived type identifier + class _wsrfbf__UnableToGetMessagesFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__UnableToGetMessagesFaultType_Description operations: + /// - _wsrfbf__UnableToGetMessagesFaultType_Description* soap_new__wsrfbf__UnableToGetMessagesFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__UnableToGetMessagesFaultType_Description* soap_new__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToGetMessagesFaultType_Description* soap_new_req__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToGetMessagesFaultType_Description* soap_new_set__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToGetMessagesFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, _wsrfbf__UnableToGetMessagesFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToGetMessagesFaultType_Description(soap*, _wsrfbf__UnableToGetMessagesFaultType_Description*) serialize to a stream + /// - _wsrfbf__UnableToGetMessagesFaultType_Description* _wsrfbf__UnableToGetMessagesFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToGetMessagesFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToGetMessagesFaultType_Description::soap_del() deep deletes _wsrfbf__UnableToGetMessagesFaultType_Description data members, use only after _wsrfbf__UnableToGetMessagesFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToGetMessagesFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnableToGetMessagesFaultType_Description or derived type identifier + class _wsrfbf__UnableToGetMessagesFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__UnableToGetMessagesFaultType_FaultCause operations: + /// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* soap_new__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* soap_new__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* soap_new_req__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* soap_new_set__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, _wsrfbf__UnableToGetMessagesFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToGetMessagesFaultType_FaultCause(soap*, _wsrfbf__UnableToGetMessagesFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause* _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToGetMessagesFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnableToGetMessagesFaultType_FaultCause data members, use only after _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToGetMessagesFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnableToGetMessagesFaultType_FaultCause or derived type identifier + class _wsrfbf__UnableToGetMessagesFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":UnableToDestroyPullPointFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -4019,90 +4019,90 @@ class wsnt__UnableToGetMessagesFaultType : public wsrfbf__BaseFaultType /// - wsnt__UnableToDestroyPullPointFaultType* wsnt__UnableToDestroyPullPointFaultType::soap_dup(soap*) returns deep copy of wsnt__UnableToDestroyPullPointFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__UnableToDestroyPullPointFaultType::soap_del() deep deletes wsnt__UnableToDestroyPullPointFaultType data members, use only after wsnt__UnableToDestroyPullPointFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__UnableToDestroyPullPointFaultType::soap_type() returns SOAP_TYPE_wsnt__UnableToDestroyPullPointFaultType or derived type identifier -class wsnt__UnableToDestroyPullPointFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode operations: -/// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* soap_new_req__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* soap_new_set__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode data members, use only after _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode or derived type identifier - class _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__UnableToDestroyPullPointFaultType_Description operations: -/// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* soap_new_req__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* soap_new_set__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_Description*) serialize to a stream -/// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroyPullPointFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_del() deep deletes _wsrfbf__UnableToDestroyPullPointFaultType_Description data members, use only after _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroyPullPointFaultType_Description or derived type identifier - class _wsrfbf__UnableToDestroyPullPointFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause operations: -/// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* soap_new_req__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* soap_new_set__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause data members, use only after _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause or derived type identifier - class _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__UnableToDestroyPullPointFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode operations: + /// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* soap_new_req__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* soap_new_set__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode* _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode data members, use only after _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode or derived type identifier + class _wsrfbf__UnableToDestroyPullPointFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__UnableToDestroyPullPointFaultType_Description operations: + /// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* soap_new_req__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* soap_new_set__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToDestroyPullPointFaultType_Description(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_Description*) serialize to a stream + /// - _wsrfbf__UnableToDestroyPullPointFaultType_Description* _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroyPullPointFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_del() deep deletes _wsrfbf__UnableToDestroyPullPointFaultType_Description data members, use only after _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToDestroyPullPointFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroyPullPointFaultType_Description or derived type identifier + class _wsrfbf__UnableToDestroyPullPointFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause operations: + /// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* soap_new__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* soap_new_req__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* soap_new_set__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause(soap*, _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause* _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause data members, use only after _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroyPullPointFaultType_FaultCause or derived type identifier + class _wsrfbf__UnableToDestroyPullPointFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":UnableToCreatePullPointFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -4118,90 +4118,90 @@ class wsnt__UnableToDestroyPullPointFaultType : public wsrfbf__BaseFaultType /// - wsnt__UnableToCreatePullPointFaultType* wsnt__UnableToCreatePullPointFaultType::soap_dup(soap*) returns deep copy of wsnt__UnableToCreatePullPointFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__UnableToCreatePullPointFaultType::soap_del() deep deletes wsnt__UnableToCreatePullPointFaultType data members, use only after wsnt__UnableToCreatePullPointFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__UnableToCreatePullPointFaultType::soap_type() returns SOAP_TYPE_wsnt__UnableToCreatePullPointFaultType or derived type identifier -class wsnt__UnableToCreatePullPointFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode operations: -/// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* soap_new__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* soap_new__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* soap_new_req__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* soap_new_set__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode data members, use only after _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode or derived type identifier - class _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__UnableToCreatePullPointFaultType_Description operations: -/// - _wsrfbf__UnableToCreatePullPointFaultType_Description* soap_new__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__UnableToCreatePullPointFaultType_Description* soap_new__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToCreatePullPointFaultType_Description* soap_new_req__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToCreatePullPointFaultType_Description* soap_new_set__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, _wsrfbf__UnableToCreatePullPointFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, _wsrfbf__UnableToCreatePullPointFaultType_Description*) serialize to a stream -/// - _wsrfbf__UnableToCreatePullPointFaultType_Description* _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToCreatePullPointFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_del() deep deletes _wsrfbf__UnableToCreatePullPointFaultType_Description data members, use only after _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnableToCreatePullPointFaultType_Description or derived type identifier - class _wsrfbf__UnableToCreatePullPointFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__UnableToCreatePullPointFaultType_FaultCause operations: -/// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* soap_new__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* soap_new__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* soap_new_req__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* soap_new_set__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, _wsrfbf__UnableToCreatePullPointFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, _wsrfbf__UnableToCreatePullPointFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToCreatePullPointFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnableToCreatePullPointFaultType_FaultCause data members, use only after _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnableToCreatePullPointFaultType_FaultCause or derived type identifier - class _wsrfbf__UnableToCreatePullPointFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__UnableToCreatePullPointFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode operations: + /// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* soap_new__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* soap_new__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* soap_new_req__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* soap_new_set__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode(soap*, _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode* _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode data members, use only after _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnableToCreatePullPointFaultType_ErrorCode or derived type identifier + class _wsrfbf__UnableToCreatePullPointFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__UnableToCreatePullPointFaultType_Description operations: + /// - _wsrfbf__UnableToCreatePullPointFaultType_Description* soap_new__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__UnableToCreatePullPointFaultType_Description* soap_new__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToCreatePullPointFaultType_Description* soap_new_req__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToCreatePullPointFaultType_Description* soap_new_set__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, _wsrfbf__UnableToCreatePullPointFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToCreatePullPointFaultType_Description(soap*, _wsrfbf__UnableToCreatePullPointFaultType_Description*) serialize to a stream + /// - _wsrfbf__UnableToCreatePullPointFaultType_Description* _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToCreatePullPointFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_del() deep deletes _wsrfbf__UnableToCreatePullPointFaultType_Description data members, use only after _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToCreatePullPointFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnableToCreatePullPointFaultType_Description or derived type identifier + class _wsrfbf__UnableToCreatePullPointFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__UnableToCreatePullPointFaultType_FaultCause operations: + /// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* soap_new__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* soap_new__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* soap_new_req__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* soap_new_set__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, _wsrfbf__UnableToCreatePullPointFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToCreatePullPointFaultType_FaultCause(soap*, _wsrfbf__UnableToCreatePullPointFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause* _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToCreatePullPointFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnableToCreatePullPointFaultType_FaultCause data members, use only after _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToCreatePullPointFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnableToCreatePullPointFaultType_FaultCause or derived type identifier + class _wsrfbf__UnableToCreatePullPointFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":UnacceptableTerminationTimeFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -4217,94 +4217,94 @@ class wsnt__UnableToCreatePullPointFaultType : public wsrfbf__BaseFaultType /// - wsnt__UnacceptableTerminationTimeFaultType* wsnt__UnacceptableTerminationTimeFaultType::soap_dup(soap*) returns deep copy of wsnt__UnacceptableTerminationTimeFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__UnacceptableTerminationTimeFaultType::soap_del() deep deletes wsnt__UnacceptableTerminationTimeFaultType data members, use only after wsnt__UnacceptableTerminationTimeFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__UnacceptableTerminationTimeFaultType::soap_type() returns SOAP_TYPE_wsnt__UnacceptableTerminationTimeFaultType or derived type identifier -class wsnt__UnacceptableTerminationTimeFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode operations: -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* soap_new_req__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* soap_new_set__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode data members, use only after _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode or derived type identifier - class _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__UnacceptableTerminationTimeFaultType_Description operations: -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* soap_new_req__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* soap_new_set__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_Description*) serialize to a stream -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableTerminationTimeFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_del() deep deletes _wsrfbf__UnacceptableTerminationTimeFaultType_Description data members, use only after _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableTerminationTimeFaultType_Description or derived type identifier - class _wsrfbf__UnacceptableTerminationTimeFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause operations: -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* soap_new_req__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* soap_new_set__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause data members, use only after _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause or derived type identifier - class _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__UnacceptableTerminationTimeFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode operations: + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* soap_new_req__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* soap_new_set__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode* _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode data members, use only after _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode or derived type identifier + class _wsrfbf__UnacceptableTerminationTimeFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__UnacceptableTerminationTimeFaultType_Description operations: + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* soap_new_req__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* soap_new_set__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__UnacceptableTerminationTimeFaultType_Description(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_Description*) serialize to a stream + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description* _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableTerminationTimeFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_del() deep deletes _wsrfbf__UnacceptableTerminationTimeFaultType_Description data members, use only after _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnacceptableTerminationTimeFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableTerminationTimeFaultType_Description or derived type identifier + class _wsrfbf__UnacceptableTerminationTimeFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause operations: + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* soap_new__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* soap_new_req__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* soap_new_set__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause(soap*, _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause* _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause data members, use only after _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause or derived type identifier + class _wsrfbf__UnacceptableTerminationTimeFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ /// Element "MinimumTime" of type xs:dateTime. - time_t MinimumTime 1; ///< Required element. + time_t MinimumTime 1; ///< Required element. /// Element "MaximumTime" of type xs:dateTime. - time_t* MaximumTime 0; ///< Optional element. + time_t* MaximumTime 0; ///< Optional element. }; /// @brief "http://docs.oasis-open.org/wsn/b-2":UnableToDestroySubscriptionFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -4320,90 +4320,90 @@ class wsnt__UnacceptableTerminationTimeFaultType : public wsrfbf__BaseFaultType /// - wsnt__UnableToDestroySubscriptionFaultType* wsnt__UnableToDestroySubscriptionFaultType::soap_dup(soap*) returns deep copy of wsnt__UnableToDestroySubscriptionFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__UnableToDestroySubscriptionFaultType::soap_del() deep deletes wsnt__UnableToDestroySubscriptionFaultType data members, use only after wsnt__UnableToDestroySubscriptionFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__UnableToDestroySubscriptionFaultType::soap_type() returns SOAP_TYPE_wsnt__UnableToDestroySubscriptionFaultType or derived type identifier -class wsnt__UnableToDestroySubscriptionFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode operations: -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* soap_new_req__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* soap_new_set__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode data members, use only after _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode or derived type identifier - class _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__UnableToDestroySubscriptionFaultType_Description operations: -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* soap_new_req__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* soap_new_set__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_Description*) serialize to a stream -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroySubscriptionFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_del() deep deletes _wsrfbf__UnableToDestroySubscriptionFaultType_Description data members, use only after _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroySubscriptionFaultType_Description or derived type identifier - class _wsrfbf__UnableToDestroySubscriptionFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause operations: -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* soap_new_req__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* soap_new_set__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause data members, use only after _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause or derived type identifier - class _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__UnableToDestroySubscriptionFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode operations: + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* soap_new_req__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* soap_new_set__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode* _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode data members, use only after _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode or derived type identifier + class _wsrfbf__UnableToDestroySubscriptionFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__UnableToDestroySubscriptionFaultType_Description operations: + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* soap_new_req__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* soap_new_set__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToDestroySubscriptionFaultType_Description(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_Description*) serialize to a stream + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description* _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroySubscriptionFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_del() deep deletes _wsrfbf__UnableToDestroySubscriptionFaultType_Description data members, use only after _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToDestroySubscriptionFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroySubscriptionFaultType_Description or derived type identifier + class _wsrfbf__UnableToDestroySubscriptionFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause operations: + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* soap_new__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* soap_new_req__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* soap_new_set__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause(soap*, _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause* _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_del() deep deletes _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause data members, use only after _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause or derived type identifier + class _wsrfbf__UnableToDestroySubscriptionFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":PauseFailedFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -4419,90 +4419,90 @@ class wsnt__UnableToDestroySubscriptionFaultType : public wsrfbf__BaseFaultType /// - wsnt__PauseFailedFaultType* wsnt__PauseFailedFaultType::soap_dup(soap*) returns deep copy of wsnt__PauseFailedFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__PauseFailedFaultType::soap_del() deep deletes wsnt__PauseFailedFaultType data members, use only after wsnt__PauseFailedFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__PauseFailedFaultType::soap_type() returns SOAP_TYPE_wsnt__PauseFailedFaultType or derived type identifier -class wsnt__PauseFailedFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__PauseFailedFaultType_ErrorCode operations: -/// - _wsrfbf__PauseFailedFaultType_ErrorCode* soap_new__wsrfbf__PauseFailedFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__PauseFailedFaultType_ErrorCode* soap_new__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__PauseFailedFaultType_ErrorCode* soap_new_req__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__PauseFailedFaultType_ErrorCode* soap_new_set__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__PauseFailedFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, _wsrfbf__PauseFailedFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, _wsrfbf__PauseFailedFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__PauseFailedFaultType_ErrorCode* _wsrfbf__PauseFailedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__PauseFailedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__PauseFailedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__PauseFailedFaultType_ErrorCode data members, use only after _wsrfbf__PauseFailedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__PauseFailedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__PauseFailedFaultType_ErrorCode or derived type identifier - class _wsrfbf__PauseFailedFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__PauseFailedFaultType_Description operations: -/// - _wsrfbf__PauseFailedFaultType_Description* soap_new__wsrfbf__PauseFailedFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__PauseFailedFaultType_Description* soap_new__wsrfbf__PauseFailedFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__PauseFailedFaultType_Description* soap_new_req__wsrfbf__PauseFailedFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__PauseFailedFaultType_Description* soap_new_set__wsrfbf__PauseFailedFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__PauseFailedFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__PauseFailedFaultType_Description(soap*, _wsrfbf__PauseFailedFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__PauseFailedFaultType_Description(soap*, _wsrfbf__PauseFailedFaultType_Description*) serialize to a stream -/// - _wsrfbf__PauseFailedFaultType_Description* _wsrfbf__PauseFailedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__PauseFailedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__PauseFailedFaultType_Description::soap_del() deep deletes _wsrfbf__PauseFailedFaultType_Description data members, use only after _wsrfbf__PauseFailedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__PauseFailedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__PauseFailedFaultType_Description or derived type identifier - class _wsrfbf__PauseFailedFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__PauseFailedFaultType_FaultCause operations: -/// - _wsrfbf__PauseFailedFaultType_FaultCause* soap_new__wsrfbf__PauseFailedFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__PauseFailedFaultType_FaultCause* soap_new__wsrfbf__PauseFailedFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__PauseFailedFaultType_FaultCause* soap_new_req__wsrfbf__PauseFailedFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__PauseFailedFaultType_FaultCause* soap_new_set__wsrfbf__PauseFailedFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__PauseFailedFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__PauseFailedFaultType_FaultCause(soap*, _wsrfbf__PauseFailedFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__PauseFailedFaultType_FaultCause(soap*, _wsrfbf__PauseFailedFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__PauseFailedFaultType_FaultCause* _wsrfbf__PauseFailedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__PauseFailedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__PauseFailedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__PauseFailedFaultType_FaultCause data members, use only after _wsrfbf__PauseFailedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__PauseFailedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__PauseFailedFaultType_FaultCause or derived type identifier - class _wsrfbf__PauseFailedFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__PauseFailedFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__PauseFailedFaultType_ErrorCode operations: + /// - _wsrfbf__PauseFailedFaultType_ErrorCode* soap_new__wsrfbf__PauseFailedFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__PauseFailedFaultType_ErrorCode* soap_new__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__PauseFailedFaultType_ErrorCode* soap_new_req__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__PauseFailedFaultType_ErrorCode* soap_new_set__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__PauseFailedFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, _wsrfbf__PauseFailedFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__PauseFailedFaultType_ErrorCode(soap*, _wsrfbf__PauseFailedFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__PauseFailedFaultType_ErrorCode* _wsrfbf__PauseFailedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__PauseFailedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__PauseFailedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__PauseFailedFaultType_ErrorCode data members, use only after _wsrfbf__PauseFailedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__PauseFailedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__PauseFailedFaultType_ErrorCode or derived type identifier + class _wsrfbf__PauseFailedFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__PauseFailedFaultType_Description operations: + /// - _wsrfbf__PauseFailedFaultType_Description* soap_new__wsrfbf__PauseFailedFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__PauseFailedFaultType_Description* soap_new__wsrfbf__PauseFailedFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__PauseFailedFaultType_Description* soap_new_req__wsrfbf__PauseFailedFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__PauseFailedFaultType_Description* soap_new_set__wsrfbf__PauseFailedFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__PauseFailedFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__PauseFailedFaultType_Description(soap*, _wsrfbf__PauseFailedFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__PauseFailedFaultType_Description(soap*, _wsrfbf__PauseFailedFaultType_Description*) serialize to a stream + /// - _wsrfbf__PauseFailedFaultType_Description* _wsrfbf__PauseFailedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__PauseFailedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__PauseFailedFaultType_Description::soap_del() deep deletes _wsrfbf__PauseFailedFaultType_Description data members, use only after _wsrfbf__PauseFailedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__PauseFailedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__PauseFailedFaultType_Description or derived type identifier + class _wsrfbf__PauseFailedFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__PauseFailedFaultType_FaultCause operations: + /// - _wsrfbf__PauseFailedFaultType_FaultCause* soap_new__wsrfbf__PauseFailedFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__PauseFailedFaultType_FaultCause* soap_new__wsrfbf__PauseFailedFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__PauseFailedFaultType_FaultCause* soap_new_req__wsrfbf__PauseFailedFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__PauseFailedFaultType_FaultCause* soap_new_set__wsrfbf__PauseFailedFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__PauseFailedFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__PauseFailedFaultType_FaultCause(soap*, _wsrfbf__PauseFailedFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__PauseFailedFaultType_FaultCause(soap*, _wsrfbf__PauseFailedFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__PauseFailedFaultType_FaultCause* _wsrfbf__PauseFailedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__PauseFailedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__PauseFailedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__PauseFailedFaultType_FaultCause data members, use only after _wsrfbf__PauseFailedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__PauseFailedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__PauseFailedFaultType_FaultCause or derived type identifier + class _wsrfbf__PauseFailedFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/b-2":ResumeFailedFaultType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsrf/bf-2":BaseFaultType. @@ -4518,90 +4518,90 @@ class wsnt__PauseFailedFaultType : public wsrfbf__BaseFaultType /// - wsnt__ResumeFailedFaultType* wsnt__ResumeFailedFaultType::soap_dup(soap*) returns deep copy of wsnt__ResumeFailedFaultType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wsnt__ResumeFailedFaultType::soap_del() deep deletes wsnt__ResumeFailedFaultType data members, use only after wsnt__ResumeFailedFaultType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wsnt__ResumeFailedFaultType::soap_type() returns SOAP_TYPE_wsnt__ResumeFailedFaultType or derived type identifier -class wsnt__ResumeFailedFaultType : public wsrfbf__BaseFaultType -{ public: -/* INHERITED FROM wsrfbf__BaseFaultType: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. -/// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. -/// Element "Timestamp" of type xs:dateTime. - time_t Timestamp 1; ///< Required element. -/// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. - wsa5__EndpointReferenceType* Originator 0; ///< Optional element. -/// @note class _wsrfbf__ResumeFailedFaultType_ErrorCode operations: -/// - _wsrfbf__ResumeFailedFaultType_ErrorCode* soap_new__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*) allocate and default initialize -/// - _wsrfbf__ResumeFailedFaultType_ErrorCode* soap_new__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResumeFailedFaultType_ErrorCode* soap_new_req__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, ...) allocate, set required members -/// - _wsrfbf__ResumeFailedFaultType_ErrorCode* soap_new_set__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, _wsrfbf__ResumeFailedFaultType_ErrorCode*) deserialize from a stream -/// - int soap_write__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, _wsrfbf__ResumeFailedFaultType_ErrorCode*) serialize to a stream -/// - _wsrfbf__ResumeFailedFaultType_ErrorCode* _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__ResumeFailedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__ResumeFailedFaultType_ErrorCode data members, use only after _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__ResumeFailedFaultType_ErrorCode or derived type identifier - class _wsrfbf__ResumeFailedFaultType_ErrorCode - { public: -/// Attribute "dialect" of type xs:anyURI. - @ xsd__anyURI dialect 1; ///< Required attribute. -/// Mixed content. -/// @note Mixed content is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. - xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). - } *ErrorCode 0; ///< Optional element. -/// Vector of Description of length 0..unbounded. - std::vector< -/// @note class _wsrfbf__ResumeFailedFaultType_Description operations: -/// - _wsrfbf__ResumeFailedFaultType_Description* soap_new__wsrfbf__ResumeFailedFaultType_Description(soap*) allocate and default initialize -/// - _wsrfbf__ResumeFailedFaultType_Description* soap_new__wsrfbf__ResumeFailedFaultType_Description(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResumeFailedFaultType_Description* soap_new_req__wsrfbf__ResumeFailedFaultType_Description(soap*, ...) allocate, set required members -/// - _wsrfbf__ResumeFailedFaultType_Description* soap_new_set__wsrfbf__ResumeFailedFaultType_Description(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResumeFailedFaultType_Description::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResumeFailedFaultType_Description(soap*, _wsrfbf__ResumeFailedFaultType_Description*) deserialize from a stream -/// - int soap_write__wsrfbf__ResumeFailedFaultType_Description(soap*, _wsrfbf__ResumeFailedFaultType_Description*) serialize to a stream -/// - _wsrfbf__ResumeFailedFaultType_Description* _wsrfbf__ResumeFailedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__ResumeFailedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResumeFailedFaultType_Description::soap_del() deep deletes _wsrfbf__ResumeFailedFaultType_Description data members, use only after _wsrfbf__ResumeFailedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResumeFailedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__ResumeFailedFaultType_Description or derived type identifier - class _wsrfbf__ResumeFailedFaultType_Description - { public: -/// __item wraps simpleContent of type xs:string. - std::string __item ; -/// Imported attribute reference xml:lang. - @ _xml__lang* xml__lang 0; ///< Optional attribute. - }> Description 0; ///< Multiple elements. -/// @note class _wsrfbf__ResumeFailedFaultType_FaultCause operations: -/// - _wsrfbf__ResumeFailedFaultType_FaultCause* soap_new__wsrfbf__ResumeFailedFaultType_FaultCause(soap*) allocate and default initialize -/// - _wsrfbf__ResumeFailedFaultType_FaultCause* soap_new__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, int num) allocate and default initialize an array -/// - _wsrfbf__ResumeFailedFaultType_FaultCause* soap_new_req__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, ...) allocate, set required members -/// - _wsrfbf__ResumeFailedFaultType_FaultCause* soap_new_set__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, ...) allocate, set all public members -/// - _wsrfbf__ResumeFailedFaultType_FaultCause::soap_default(soap*) default initialize members -/// - int soap_read__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, _wsrfbf__ResumeFailedFaultType_FaultCause*) deserialize from a stream -/// - int soap_write__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, _wsrfbf__ResumeFailedFaultType_FaultCause*) serialize to a stream -/// - _wsrfbf__ResumeFailedFaultType_FaultCause* _wsrfbf__ResumeFailedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__ResumeFailedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) -/// - _wsrfbf__ResumeFailedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__ResumeFailedFaultType_FaultCause data members, use only after _wsrfbf__ResumeFailedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) -/// - int _wsrfbf__ResumeFailedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__ResumeFailedFaultType_FaultCause or derived type identifier - class _wsrfbf__ResumeFailedFaultType_FaultCause - { public: -/// -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this element. -/// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): -/// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. - xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. - } *FaultCause 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wsrfbf__BaseFaultType */ +class wsnt__ResumeFailedFaultType : public wsrfbf__BaseFaultType { + public: + /* INHERITED FROM wsrfbf__BaseFaultType: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + /// Size of the array of XML or DOM nodes is 0..unbounded. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + /// Element "Timestamp" of type xs:dateTime. + time_t Timestamp 1; ///< Required element. + /// Element "Originator" of type "http://www.w3.org/2005/08/addressing":EndpointReferenceType. + wsa5__EndpointReferenceType* Originator 0; ///< Optional element. + /// @note class _wsrfbf__ResumeFailedFaultType_ErrorCode operations: + /// - _wsrfbf__ResumeFailedFaultType_ErrorCode* soap_new__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*) allocate and default initialize + /// - _wsrfbf__ResumeFailedFaultType_ErrorCode* soap_new__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResumeFailedFaultType_ErrorCode* soap_new_req__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, ...) allocate, set required members + /// - _wsrfbf__ResumeFailedFaultType_ErrorCode* soap_new_set__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, _wsrfbf__ResumeFailedFaultType_ErrorCode*) deserialize from a stream + /// - int soap_write__wsrfbf__ResumeFailedFaultType_ErrorCode(soap*, _wsrfbf__ResumeFailedFaultType_ErrorCode*) serialize to a stream + /// - _wsrfbf__ResumeFailedFaultType_ErrorCode* _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_dup(soap*) returns deep copy of _wsrfbf__ResumeFailedFaultType_ErrorCode, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_del() deep deletes _wsrfbf__ResumeFailedFaultType_ErrorCode data members, use only after _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResumeFailedFaultType_ErrorCode::soap_type() returns SOAP_TYPE__wsrfbf__ResumeFailedFaultType_ErrorCode or derived type identifier + class _wsrfbf__ResumeFailedFaultType_ErrorCode + { public: + /// Attribute "dialect" of type xs:anyURI. + @ xsd__anyURI dialect 1; ///< Required attribute. + /// Mixed content. + /// @note Mixed content is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -d for DOM (soap_dom_element) to store mixed content. + xsd__anyType __mixed 0; ///< Store mixed content as xsd:any (by default a xsd__anyType DOM soap_dom_element linked node structure). + } *ErrorCode 0; ///< Optional element. + /// Vector of Description of length 0..unbounded. + std::vector< + /// @note class _wsrfbf__ResumeFailedFaultType_Description operations: + /// - _wsrfbf__ResumeFailedFaultType_Description* soap_new__wsrfbf__ResumeFailedFaultType_Description(soap*) allocate and default initialize + /// - _wsrfbf__ResumeFailedFaultType_Description* soap_new__wsrfbf__ResumeFailedFaultType_Description(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResumeFailedFaultType_Description* soap_new_req__wsrfbf__ResumeFailedFaultType_Description(soap*, ...) allocate, set required members + /// - _wsrfbf__ResumeFailedFaultType_Description* soap_new_set__wsrfbf__ResumeFailedFaultType_Description(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResumeFailedFaultType_Description::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResumeFailedFaultType_Description(soap*, _wsrfbf__ResumeFailedFaultType_Description*) deserialize from a stream + /// - int soap_write__wsrfbf__ResumeFailedFaultType_Description(soap*, _wsrfbf__ResumeFailedFaultType_Description*) serialize to a stream + /// - _wsrfbf__ResumeFailedFaultType_Description* _wsrfbf__ResumeFailedFaultType_Description::soap_dup(soap*) returns deep copy of _wsrfbf__ResumeFailedFaultType_Description, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResumeFailedFaultType_Description::soap_del() deep deletes _wsrfbf__ResumeFailedFaultType_Description data members, use only after _wsrfbf__ResumeFailedFaultType_Description::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResumeFailedFaultType_Description::soap_type() returns SOAP_TYPE__wsrfbf__ResumeFailedFaultType_Description or derived type identifier + class _wsrfbf__ResumeFailedFaultType_Description + { public: + /// __item wraps simpleContent of type xs:string. + std::string __item ; + /// Imported attribute reference xml:lang. + @ _xml__lang* xml__lang 0; ///< Optional attribute. + }> Description 0; ///< Multiple elements. + /// @note class _wsrfbf__ResumeFailedFaultType_FaultCause operations: + /// - _wsrfbf__ResumeFailedFaultType_FaultCause* soap_new__wsrfbf__ResumeFailedFaultType_FaultCause(soap*) allocate and default initialize + /// - _wsrfbf__ResumeFailedFaultType_FaultCause* soap_new__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, int num) allocate and default initialize an array + /// - _wsrfbf__ResumeFailedFaultType_FaultCause* soap_new_req__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, ...) allocate, set required members + /// - _wsrfbf__ResumeFailedFaultType_FaultCause* soap_new_set__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, ...) allocate, set all public members + /// - _wsrfbf__ResumeFailedFaultType_FaultCause::soap_default(soap*) default initialize members + /// - int soap_read__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, _wsrfbf__ResumeFailedFaultType_FaultCause*) deserialize from a stream + /// - int soap_write__wsrfbf__ResumeFailedFaultType_FaultCause(soap*, _wsrfbf__ResumeFailedFaultType_FaultCause*) serialize to a stream + /// - _wsrfbf__ResumeFailedFaultType_FaultCause* _wsrfbf__ResumeFailedFaultType_FaultCause::soap_dup(soap*) returns deep copy of _wsrfbf__ResumeFailedFaultType_FaultCause, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) + /// - _wsrfbf__ResumeFailedFaultType_FaultCause::soap_del() deep deletes _wsrfbf__ResumeFailedFaultType_FaultCause data members, use only after _wsrfbf__ResumeFailedFaultType_FaultCause::soap_dup(NULL) (use soapcpp2 -Ed) + /// - int _wsrfbf__ResumeFailedFaultType_FaultCause::soap_type() returns SOAP_TYPE__wsrfbf__ResumeFailedFaultType_FaultCause or derived type identifier + class _wsrfbf__ResumeFailedFaultType_FaultCause + { public: + /// + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this element. + /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): + /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. + xsd__anyType __any 0; ///< Store any element content in DOM soap_dom_element node. + } *FaultCause 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wsrfbf__BaseFaultType */ }; /// @brief "http://docs.oasis-open.org/wsn/t-1":TopicNamespaceType is a complexType with complexContent extension of type "http://docs.oasis-open.org/wsn/t-1":ExtensibleDocumented. @@ -4617,20 +4617,20 @@ class wsnt__ResumeFailedFaultType : public wsrfbf__BaseFaultType /// - wstop__TopicNamespaceType* wstop__TopicNamespaceType::soap_dup(soap*) returns deep copy of wstop__TopicNamespaceType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wstop__TopicNamespaceType::soap_del() deep deletes wstop__TopicNamespaceType data members, use only after wstop__TopicNamespaceType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wstop__TopicNamespaceType::soap_type() returns SOAP_TYPE_wstop__TopicNamespaceType or derived type identifier -class wstop__TopicNamespaceType : public wstop__ExtensibleDocumented -{ public: -/* INHERITED FROM wstop__ExtensibleDocumented: -/// Element "documentation" of type "http://docs.oasis-open.org/wsn/t-1":Documentation. - wstop__Documentation* documentation 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wstop__ExtensibleDocumented */ +class wstop__TopicNamespaceType : public wstop__ExtensibleDocumented { + public: + /* INHERITED FROM wstop__ExtensibleDocumented: + /// Element "documentation" of type "http://docs.oasis-open.org/wsn/t-1":Documentation. + wstop__Documentation* documentation 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wstop__ExtensibleDocumented */ /// Vector of Topic of length 0..unbounded. - std::vector< + std::vector< /// @note class _wstop__TopicNamespaceType_Topic operations: /// - _wstop__TopicNamespaceType_Topic* soap_new__wstop__TopicNamespaceType_Topic(soap*) allocate and default initialize /// - _wstop__TopicNamespaceType_Topic* soap_new__wstop__TopicNamespaceType_Topic(soap*, int num) allocate and default initialize an array @@ -4642,8 +4642,8 @@ class wstop__TopicNamespaceType : public wstop__ExtensibleDocumented /// - _wstop__TopicNamespaceType_Topic* _wstop__TopicNamespaceType_Topic::soap_dup(soap*) returns deep copy of _wstop__TopicNamespaceType_Topic, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - _wstop__TopicNamespaceType_Topic::soap_del() deep deletes _wstop__TopicNamespaceType_Topic data members, use only after _wstop__TopicNamespaceType_Topic::soap_dup(NULL) (use soapcpp2 -Ed) /// - int _wstop__TopicNamespaceType_Topic::soap_type() returns SOAP_TYPE__wstop__TopicNamespaceType_Topic or derived type identifier - class _wstop__TopicNamespaceType_Topic - { public: + class _wstop__TopicNamespaceType_Topic { + public: /// INHERITED FROM wstop__ExtensibleDocumented: /// Element "documentation" of type "http://docs.oasis-open.org/wsn/t-1":Documentation. wstop__Documentation* documentation 0; ///< Optional element. @@ -4652,7 +4652,7 @@ class wstop__TopicNamespaceType : public wstop__ExtensibleDocumented /// Consult the protocol documentation to change or insert declarations. /// Use wsdl2h option -x to remove this attribute. /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. // END OF INHERITED FROM wstop__ExtensibleDocumented /// INHERITED FROM wstop__TopicType: /// Element "MessagePattern" of type "http://docs.oasis-open.org/wsn/t-1":QueryExpressionType. @@ -4668,16 +4668,16 @@ class wstop__TopicNamespaceType : public wstop__ExtensibleDocumented /// Size of the array of XML or DOM nodes is 0..unbounded. std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Attribute "name" of type xs:NCName. - @ xsd__NCName name 1; ///< Required attribute. -@ xsd__QName + @ xsd__NCName name 1; ///< Required attribute. + @ xsd__QName - *messageTypes 0; ///< Optional attribute. + *messageTypes 0; ///< Optional attribute. /// Attribute "final" of type xs:boolean. - @ bool final_ 0 = false; ///< Optional attribute with default value="false". + @ bool final_ 0 = false; ///< Optional attribute with default value="false". // END OF INHERITED FROM wstop__TopicType /// Attribute "parent" of type "http://docs.oasis-open.org/wsn/t-1":ConcreteTopicExpression. - @ wstop__ConcreteTopicExpression* parent 0; ///< Optional attribute. - }> Topic 0; ///< Multiple elements. + @ wstop__ConcreteTopicExpression* parent 0; ///< Optional attribute. + }> Topic 0; ///< Multiple elements. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -4685,7 +4685,7 @@ class wstop__TopicNamespaceType : public wstop__ExtensibleDocumented /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Attribute "name" of type xs:NCName. @ xsd__NCName* name 0; ///< Optional attribute. /// Attribute "targetNamespace" of type xs:anyURI. @@ -4707,22 +4707,22 @@ class wstop__TopicNamespaceType : public wstop__ExtensibleDocumented /// - wstop__TopicType* wstop__TopicType::soap_dup(soap*) returns deep copy of wstop__TopicType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wstop__TopicType::soap_del() deep deletes wstop__TopicType data members, use only after wstop__TopicType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wstop__TopicType::soap_type() returns SOAP_TYPE_wstop__TopicType or derived type identifier -class wstop__TopicType : public wstop__ExtensibleDocumented -{ public: -/* INHERITED FROM wstop__ExtensibleDocumented: -/// Element "documentation" of type "http://docs.oasis-open.org/wsn/t-1":Documentation. - wstop__Documentation* documentation 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wstop__ExtensibleDocumented */ +class wstop__TopicType : public wstop__ExtensibleDocumented { + public: + /* INHERITED FROM wstop__ExtensibleDocumented: + /// Element "documentation" of type "http://docs.oasis-open.org/wsn/t-1":Documentation. + wstop__Documentation* documentation 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wstop__ExtensibleDocumented */ /// Element "MessagePattern" of type "http://docs.oasis-open.org/wsn/t-1":QueryExpressionType. - wstop__QueryExpressionType* MessagePattern 0; ///< Optional element. + wstop__QueryExpressionType* MessagePattern 0; ///< Optional element. /// Vector of wstop__TopicType* of length 0..unbounded. - std::vector Topic 0; ///< Multiple elements. + std::vector Topic 0; ///< Multiple elements. /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -4730,12 +4730,12 @@ class wstop__TopicType : public wstop__ExtensibleDocumented /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. /// Attribute "name" of type xs:NCName. @ xsd__NCName name 1; ///< Required attribute. -@ xsd__QName + @ xsd__QName - *messageTypes 0; ///< Optional attribute. + *messageTypes 0; ///< Optional attribute. /// Attribute "final" of type xs:boolean. @ bool final_ 0 = false; ///< Optional attribute with default value="false". }; @@ -4753,18 +4753,18 @@ class wstop__TopicType : public wstop__ExtensibleDocumented /// - wstop__TopicSetType* wstop__TopicSetType::soap_dup(soap*) returns deep copy of wstop__TopicSetType, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) /// - wstop__TopicSetType::soap_del() deep deletes wstop__TopicSetType data members, use only after wstop__TopicSetType::soap_dup(NULL) (use soapcpp2 -Ed) /// - int wstop__TopicSetType::soap_type() returns SOAP_TYPE_wstop__TopicSetType or derived type identifier -class wstop__TopicSetType : public wstop__ExtensibleDocumented -{ public: -/* INHERITED FROM wstop__ExtensibleDocumented: -/// Element "documentation" of type "http://docs.oasis-open.org/wsn/t-1":Documentation. - wstop__Documentation* documentation 0; ///< Optional element. -/// . -/// @note Schema extensibility is user-definable. -/// Consult the protocol documentation to change or insert declarations. -/// Use wsdl2h option -x to remove this attribute. -/// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). - @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. - END OF INHERITED FROM wstop__ExtensibleDocumented */ +class wstop__TopicSetType : public wstop__ExtensibleDocumented { + public: + /* INHERITED FROM wstop__ExtensibleDocumented: + /// Element "documentation" of type "http://docs.oasis-open.org/wsn/t-1":Documentation. + wstop__Documentation* documentation 0; ///< Optional element. + /// . + /// @note Schema extensibility is user-definable. + /// Consult the protocol documentation to change or insert declarations. + /// Use wsdl2h option -x to remove this attribute. + /// Use wsdl2h option -d for xsd__anyAttribute DOM (soap_dom_attribute). + @ xsd__anyAttribute __anyAttribute ; ///< Store anyAttribute content in DOM soap_dom_attribute linked node structure. + END OF INHERITED FROM wstop__ExtensibleDocumented */ /// /// @note Schema extensibility is user-definable. /// Consult the protocol documentation to change or insert declarations. @@ -4772,7 +4772,7 @@ class wstop__TopicSetType : public wstop__ExtensibleDocumented /// Use wsdl2h option -d for xsd__anyType DOM (soap_dom_element): /// wsdl2h maps xsd:any to xsd__anyType, use typemap.dat to remap. /// Size of the array of XML or DOM nodes is 0..unbounded. - std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. + std::vector __any 0; ///< Store any element content in DOM soap_dom_element node. }; @@ -5026,10 +5026,10 @@ class wstop__TopicSetType : public wstop__ExtensibleDocumented // This service supports SOAP 1.2 namespaces: #import "soap12.h" -//gsoap tev service name: PullPointSubscriptionBinding -//gsoap tev service type: PullPointSubscription -//gsoap tev service namespace: http://www.onvif.org/ver10/events/wsdl -//gsoap tev service transport: http://schemas.xmlsoap.org/soap/http +//gsoap tev service name: PullPointSubscriptionBinding +//gsoap tev service type: PullPointSubscription +//gsoap tev service namespace: http://www.onvif.org/ver10/events/wsdl +//gsoap tev service transport: http://schemas.xmlsoap.org/soap/http /** @mainpage Service Definitions @@ -5121,56 +5121,55 @@ soap.fault->SOAP_ENV__Detail variable (SOAP 1.2). Use wsdl2h option -j to omit these declarations. */ -mutable struct SOAP_ENV__Detail -{ +mutable struct SOAP_ENV__Detail { @ xsd__anyAttribute __anyAttribute ; ///< Catch any attribute content in DOM. /// SOAP Fault message "InvalidFilterFault" part "InvalidFilterFault" element ""http://docs.oasis-open.org/wsn/b-2":InvalidFilterFault". - wsnt__InvalidFilterFaultType* wsnt__InvalidFilterFault ; + wsnt__InvalidFilterFaultType* wsnt__InvalidFilterFault ; /// SOAP Fault message "InvalidMessageContentExpressionFault" part "InvalidMessageContentExpressionFault" element ""http://docs.oasis-open.org/wsn/b-2":InvalidMessageContentExpressionFault". - wsnt__InvalidMessageContentExpressionFaultType* wsnt__InvalidMessageContentExpressionFault; + wsnt__InvalidMessageContentExpressionFaultType* wsnt__InvalidMessageContentExpressionFault; /// SOAP Fault message "InvalidProducerPropertiesExpressionFault" part "InvalidProducerPropertiesExpressionFault" element ""http://docs.oasis-open.org/wsn/b-2":InvalidProducerPropertiesExpressionFault". - wsnt__InvalidProducerPropertiesExpressionFaultType* wsnt__InvalidProducerPropertiesExpressionFault; + wsnt__InvalidProducerPropertiesExpressionFaultType* wsnt__InvalidProducerPropertiesExpressionFault; /// SOAP Fault message "InvalidTopicExpressionFault" part "InvalidTopicExpressionFault" element ""http://docs.oasis-open.org/wsn/b-2":InvalidTopicExpressionFault". - wsnt__InvalidTopicExpressionFaultType* wsnt__InvalidTopicExpressionFault; + wsnt__InvalidTopicExpressionFaultType* wsnt__InvalidTopicExpressionFault; /// SOAP Fault message "MultipleTopicsSpecifiedFault" part "MultipleTopicsSpecifiedFault" element ""http://docs.oasis-open.org/wsn/b-2":MultipleTopicsSpecifiedFault". - wsnt__MultipleTopicsSpecifiedFaultType* wsnt__MultipleTopicsSpecifiedFault; + wsnt__MultipleTopicsSpecifiedFaultType* wsnt__MultipleTopicsSpecifiedFault; /// SOAP Fault message "NoCurrentMessageOnTopicFault" part "NoCurrentMessageOnTopicFault" element ""http://docs.oasis-open.org/wsn/b-2":NoCurrentMessageOnTopicFault". - wsnt__NoCurrentMessageOnTopicFaultType* wsnt__NoCurrentMessageOnTopicFault; + wsnt__NoCurrentMessageOnTopicFaultType* wsnt__NoCurrentMessageOnTopicFault; /// SOAP Fault message "NotifyMessageNotSupportedFault" part "NotifyMessageNotSupportedFault" element ""http://docs.oasis-open.org/wsn/b-2":NotifyMessageNotSupportedFault". - wsnt__NotifyMessageNotSupportedFaultType* wsnt__NotifyMessageNotSupportedFault; + wsnt__NotifyMessageNotSupportedFaultType* wsnt__NotifyMessageNotSupportedFault; /// SOAP Fault message "PauseFailedFault" part "PauseFailedFault" element ""http://docs.oasis-open.org/wsn/b-2":PauseFailedFault". - wsnt__PauseFailedFaultType* wsnt__PauseFailedFault ; + wsnt__PauseFailedFaultType* wsnt__PauseFailedFault ; /// SOAP Fault message "PullMessagesFaultResponse" part "parameters" element ""http://www.onvif.org/ver10/events/wsdl":PullMessagesFaultResponse". - _tev__PullMessagesFaultResponse* tev__PullMessagesFaultResponse; + _tev__PullMessagesFaultResponse* tev__PullMessagesFaultResponse; /// SOAP Fault message "ResourceUnknownFault" part "ResourceUnknownFault" element ""http://docs.oasis-open.org/wsrf/r-2":ResourceUnknownFault". - wsrfr__ResourceUnknownFaultType* wsrfr__ResourceUnknownFault ; + wsrfr__ResourceUnknownFaultType* wsrfr__ResourceUnknownFault ; /// SOAP Fault message "ResumeFailedFault" part "ResumeFailedFault" element ""http://docs.oasis-open.org/wsn/b-2":ResumeFailedFault". - wsnt__ResumeFailedFaultType* wsnt__ResumeFailedFault ; + wsnt__ResumeFailedFaultType* wsnt__ResumeFailedFault ; /// SOAP Fault message "SubscribeCreationFailedFault" part "SubscribeCreationFailedFault" element ""http://docs.oasis-open.org/wsn/b-2":SubscribeCreationFailedFault". - wsnt__SubscribeCreationFailedFaultType* wsnt__SubscribeCreationFailedFault; + wsnt__SubscribeCreationFailedFaultType* wsnt__SubscribeCreationFailedFault; /// SOAP Fault message "TopicExpressionDialectUnknownFault" part "TopicExpressionDialectUnknownFault" element ""http://docs.oasis-open.org/wsn/b-2":TopicExpressionDialectUnknownFault". - wsnt__TopicExpressionDialectUnknownFaultType* wsnt__TopicExpressionDialectUnknownFault; + wsnt__TopicExpressionDialectUnknownFaultType* wsnt__TopicExpressionDialectUnknownFault; /// SOAP Fault message "TopicNotSupportedFault" part "TopicNotSupportedFault" element ""http://docs.oasis-open.org/wsn/b-2":TopicNotSupportedFault". - wsnt__TopicNotSupportedFaultType* wsnt__TopicNotSupportedFault ; + wsnt__TopicNotSupportedFaultType* wsnt__TopicNotSupportedFault ; /// SOAP Fault message "UnableToCreatePullPointFault" part "UnableToCreatePullPointFault" element ""http://docs.oasis-open.org/wsn/b-2":UnableToCreatePullPointFault". - wsnt__UnableToCreatePullPointFaultType* wsnt__UnableToCreatePullPointFault; + wsnt__UnableToCreatePullPointFaultType* wsnt__UnableToCreatePullPointFault; /// SOAP Fault message "UnableToDestroyPullPointFault" part "UnableToDestroyPullPointFault" element ""http://docs.oasis-open.org/wsn/b-2":UnableToDestroyPullPointFault". - wsnt__UnableToDestroyPullPointFaultType* wsnt__UnableToDestroyPullPointFault; + wsnt__UnableToDestroyPullPointFaultType* wsnt__UnableToDestroyPullPointFault; /// SOAP Fault message "UnableToDestroySubscriptionFault" part "UnableToDestroySubscriptionFault" element ""http://docs.oasis-open.org/wsn/b-2":UnableToDestroySubscriptionFault". - wsnt__UnableToDestroySubscriptionFaultType* wsnt__UnableToDestroySubscriptionFault; + wsnt__UnableToDestroySubscriptionFaultType* wsnt__UnableToDestroySubscriptionFault; /// SOAP Fault message "UnableToGetMessagesFault" part "UnableToGetMessagesFault" element ""http://docs.oasis-open.org/wsn/b-2":UnableToGetMessagesFault". - wsnt__UnableToGetMessagesFaultType* wsnt__UnableToGetMessagesFault; + wsnt__UnableToGetMessagesFaultType* wsnt__UnableToGetMessagesFault; /// SOAP Fault message "UnacceptableInitialTerminationTimeFault" part "UnacceptableInitialTerminationTimeFault" element ""http://docs.oasis-open.org/wsn/b-2":UnacceptableInitialTerminationTimeFault". - wsnt__UnacceptableInitialTerminationTimeFaultType* wsnt__UnacceptableInitialTerminationTimeFault; + wsnt__UnacceptableInitialTerminationTimeFaultType* wsnt__UnacceptableInitialTerminationTimeFault; /// SOAP Fault message "UnacceptableTerminationTimeFault" part "UnacceptableTerminationTimeFault" element ""http://docs.oasis-open.org/wsn/b-2":UnacceptableTerminationTimeFault". - wsnt__UnacceptableTerminationTimeFaultType* wsnt__UnacceptableTerminationTimeFault; + wsnt__UnacceptableTerminationTimeFaultType* wsnt__UnacceptableTerminationTimeFault; /// SOAP Fault message "UnrecognizedPolicyRequestFault" part "UnrecognizedPolicyRequestFault" element ""http://docs.oasis-open.org/wsn/b-2":UnrecognizedPolicyRequestFault". - wsnt__UnrecognizedPolicyRequestFaultType* wsnt__UnrecognizedPolicyRequestFault; + wsnt__UnrecognizedPolicyRequestFaultType* wsnt__UnrecognizedPolicyRequestFault; /// SOAP Fault message "UnsupportedPolicyRequestFault" part "UnsupportedPolicyRequestFault" element ""http://docs.oasis-open.org/wsn/b-2":UnsupportedPolicyRequestFault". - wsnt__UnsupportedPolicyRequestFaultType* wsnt__UnsupportedPolicyRequestFault; - int __type ; ///< set to SOAP_TYPE_T for a serializable type T - void *fault ; ///< points to serializable value of type T or NULL - _XML __any ; ///< Catch any other content in XML string. + wsnt__UnsupportedPolicyRequestFaultType* wsnt__UnsupportedPolicyRequestFault; + int __type ; ///< set to SOAP_TYPE_T for a serializable type T + void *fault ; ///< points to serializable value of type T or NULL + _XML __any ; ///< Catch any other content in XML string. }; @@ -5199,7 +5198,7 @@ command. This method shall not wait until the requested number of messages is available but return as soon as at least one message is available.
The command shall at least support a Timeout of -one minute. In case a device supports retrieval of less messages +one minute. In case a device supports retrieval of less messages than requested it shall return these without generating a fault. @@ -5261,8 +5260,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: PullMessages tev__PullMessagesFaultResponse //gsoap tev service method-fault-action: PullMessages http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessages/Fault/PullMessagesFaultResponse int __tev__PullMessages( - _tev__PullMessages* tev__PullMessages, ///< Input parameter - _tev__PullMessagesResponse &tev__PullMessagesResponse ///< Output parameter + _tev__PullMessages* tev__PullMessages, ///< Input parameter + _tev__PullMessagesResponse &tev__PullMessagesResponse ///< Output parameter ); /******************************************************************************\ @@ -5287,7 +5286,7 @@ command.
The UtcTime argument will be matched against the UtcTime attribute on a NotificationMessage. - + - SOAP document/literal style messaging @@ -5342,8 +5341,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-input-action: Seek http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/SeekRequest //gsoap tev service method-output-action: Seek http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/SeekResponse int __tev__Seek( - _tev__Seek* tev__Seek, ///< Input parameter - _tev__SeekResponse &tev__SeekResponse ///< Output parameter + _tev__Seek* tev__Seek, ///< Input parameter + _tev__SeekResponse &tev__SeekResponse ///< Output parameter ); /******************************************************************************\ @@ -5370,7 +5369,7 @@ which was returned in either the The property update is transmitted via the notification transportation of the notification interface. This method is mandatory. - + - SOAP document/literal style messaging @@ -5425,8 +5424,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-input-action: SetSynchronizationPoint http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/SetSynchronizationPointRequest //gsoap tev service method-output-action: SetSynchronizationPoint http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/SetSynchronizationPointResponse int __tev__SetSynchronizationPoint( - _tev__SetSynchronizationPoint* tev__SetSynchronizationPoint, ///< Input parameter - _tev__SetSynchronizationPointResponse&tev__SetSynchronizationPointResponse ///< Output parameter + _tev__SetSynchronizationPoint* tev__SetSynchronizationPoint, ///< Input parameter + _tev__SetSynchronizationPointResponse&tev__SetSynchronizationPointResponse ///< Output parameter ); /******************************************************************************\ @@ -5442,7 +5441,7 @@ The device shall provide the following Unsubscribe command for all SubscriptionM endpoints returned by the CreatePullPointSubscription command.
This command shall terminate the lifetime of a pull point. - + - SOAP document/literal style messaging @@ -5503,8 +5502,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: Unsubscribe wsrfr__ResourceUnknownFault //gsoap tev service method-fault: Unsubscribe wsnt__UnableToDestroySubscriptionFault int __tev__Unsubscribe( - _wsnt__Unsubscribe* wsnt__Unsubscribe, ///< Input parameter - _wsnt__UnsubscribeResponse &wsnt__UnsubscribeResponse ///< Output parameter + _wsnt__Unsubscribe* wsnt__Unsubscribe, ///< Input parameter + _wsnt__UnsubscribeResponse &wsnt__UnsubscribeResponse ///< Output parameter ); /******************************************************************************\ @@ -5572,8 +5571,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-input-action: GetServiceCapabilities http://www.onvif.org/ver10/events/wsdl/EventPortType/GetServiceCapabilitiesRequest //gsoap tev service method-output-action: GetServiceCapabilities http://www.onvif.org/ver10/events/wsdl/EventPortType/GetServiceCapabilitiesResponse int __tev__GetServiceCapabilities( - _tev__GetServiceCapabilities* tev__GetServiceCapabilities, ///< Input parameter - _tev__GetServiceCapabilitiesResponse&tev__GetServiceCapabilitiesResponse ///< Output parameter + _tev__GetServiceCapabilities* tev__GetServiceCapabilities, ///< Input parameter + _tev__GetServiceCapabilitiesResponse&tev__GetServiceCapabilitiesResponse ///< Output parameter ); /******************************************************************************\ @@ -5682,8 +5681,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: CreatePullPointSubscription wsnt__NotifyMessageNotSupportedFault //gsoap tev service method-fault: CreatePullPointSubscription wsnt__SubscribeCreationFailedFault int __tev__CreatePullPointSubscription( - _tev__CreatePullPointSubscription* tev__CreatePullPointSubscription, ///< Input parameter - _tev__CreatePullPointSubscriptionResponse&tev__CreatePullPointSubscriptionResponse ///< Output parameter + _tev__CreatePullPointSubscription* tev__CreatePullPointSubscription, ///< Input parameter + _tev__CreatePullPointSubscriptionResponse&tev__CreatePullPointSubscriptionResponse ///< Output parameter ); /******************************************************************************\ @@ -5757,8 +5756,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-input-action: GetEventProperties http://www.onvif.org/ver10/events/wsdl/EventPortType/GetEventPropertiesRequest //gsoap tev service method-output-action: GetEventProperties http://www.onvif.org/ver10/events/wsdl/EventPortType/GetEventPropertiesResponse int __tev__GetEventProperties( - _tev__GetEventProperties* tev__GetEventProperties, ///< Input parameter - _tev__GetEventPropertiesResponse &tev__GetEventPropertiesResponse ///< Output parameter + _tev__GetEventProperties* tev__GetEventProperties, ///< Input parameter + _tev__GetEventPropertiesResponse &tev__GetEventPropertiesResponse ///< Output parameter ); /******************************************************************************\ @@ -5828,8 +5827,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-input-action: AddEventBroker http://www.onvif.org/ver10/events/wsdl/EventPortType/AddEventBrokerRequest //gsoap tev service method-output-action: AddEventBroker http://www.onvif.org/ver10/events/wsdl/EventPortType/AddEventBrokerRequestResponse int __tev__AddEventBroker( - _tev__AddEventBroker* tev__AddEventBroker, ///< Input parameter - _tev__AddEventBrokerResponse &tev__AddEventBrokerResponse ///< Output parameter + _tev__AddEventBroker* tev__AddEventBroker, ///< Input parameter + _tev__AddEventBrokerResponse &tev__AddEventBrokerResponse ///< Output parameter ); /******************************************************************************\ @@ -5897,8 +5896,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-input-action: DeleteEventBroker http://www.onvif.org/ver10/events/wsdl/EventPortType/DeleteEventBrokerRequest //gsoap tev service method-output-action: DeleteEventBroker http://www.onvif.org/ver10/events/wsdl/EventPortType/DeleteEventBrokerRequestResponse int __tev__DeleteEventBroker( - _tev__DeleteEventBroker* tev__DeleteEventBroker, ///< Input parameter - _tev__DeleteEventBrokerResponse &tev__DeleteEventBrokerResponse ///< Output parameter + _tev__DeleteEventBroker* tev__DeleteEventBroker, ///< Input parameter + _tev__DeleteEventBrokerResponse &tev__DeleteEventBrokerResponse ///< Output parameter ); /******************************************************************************\ @@ -5966,8 +5965,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-input-action: GetEventBrokers http://www.onvif.org/ver10/events/wsdl/EventPortType/GetEventBrokersRequest //gsoap tev service method-output-action: GetEventBrokers http://www.onvif.org/ver10/events/wsdl/EventPortType/GetEventBrokersRequestResponse int __tev__GetEventBrokers( - _tev__GetEventBrokers* tev__GetEventBrokers, ///< Input parameter - _tev__GetEventBrokersResponse &tev__GetEventBrokersResponse ///< Output parameter + _tev__GetEventBrokers* tev__GetEventBrokers, ///< Input parameter + _tev__GetEventBrokersResponse &tev__GetEventBrokersResponse ///< Output parameter ); /******************************************************************************\ @@ -6039,8 +6038,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: Renew wsrfr__ResourceUnknownFault //gsoap tev service method-fault: Renew wsnt__UnacceptableTerminationTimeFault int __tev__Renew( - _wsnt__Renew* wsnt__Renew, ///< Input parameter - _wsnt__RenewResponse &wsnt__RenewResponse ///< Output parameter + _wsnt__Renew* wsnt__Renew, ///< Input parameter + _wsnt__RenewResponse &wsnt__RenewResponse ///< Output parameter ); /******************************************************************************\ @@ -6112,8 +6111,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: Unsubscribe_ wsrfr__ResourceUnknownFault //gsoap tev service method-fault: Unsubscribe_ wsnt__UnableToDestroySubscriptionFault int __tev__Unsubscribe_( - _wsnt__Unsubscribe* wsnt__Unsubscribe, ///< Input parameter - _wsnt__UnsubscribeResponse &wsnt__UnsubscribeResponse ///< Output parameter + _wsnt__Unsubscribe* wsnt__Unsubscribe, ///< Input parameter + _wsnt__UnsubscribeResponse &wsnt__UnsubscribeResponse ///< Output parameter ); /******************************************************************************\ @@ -6215,8 +6214,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: Subscribe wsnt__NotifyMessageNotSupportedFault //gsoap tev service method-fault: Subscribe wsnt__SubscribeCreationFailedFault int __tev__Subscribe( - _wsnt__Subscribe* wsnt__Subscribe, ///< Input parameter - _wsnt__SubscribeResponse &wsnt__SubscribeResponse ///< Output parameter + _wsnt__Subscribe* wsnt__Subscribe, ///< Input parameter + _wsnt__SubscribeResponse &wsnt__SubscribeResponse ///< Output parameter ); /******************************************************************************\ @@ -6300,8 +6299,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: GetCurrentMessage wsnt__NoCurrentMessageOnTopicFault //gsoap tev service method-fault: GetCurrentMessage wsnt__MultipleTopicsSpecifiedFault int __tev__GetCurrentMessage( - _wsnt__GetCurrentMessage* wsnt__GetCurrentMessage, ///< Input parameter - _wsnt__GetCurrentMessageResponse &wsnt__GetCurrentMessageResponse ///< Output parameter + _wsnt__GetCurrentMessage* wsnt__GetCurrentMessage, ///< Input parameter + _wsnt__GetCurrentMessageResponse &wsnt__GetCurrentMessageResponse ///< Output parameter ); /******************************************************************************\ @@ -6363,8 +6362,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-encoding: Notify literal //gsoap tev service method-input-action: Notify http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/Notify int __tev__Notify( - _wsnt__Notify* wsnt__Notify, ///< Input parameter - void ///< One-way message: no output parameter + _wsnt__Notify* wsnt__Notify, ///< Input parameter + void ///< One-way message: no output parameter ); /******************************************************************************\ @@ -6436,8 +6435,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: GetMessages wsrfr__ResourceUnknownFault //gsoap tev service method-fault: GetMessages wsnt__UnableToGetMessagesFault int __tev__GetMessages( - _wsnt__GetMessages* wsnt__GetMessages, ///< Input parameter - _wsnt__GetMessagesResponse &wsnt__GetMessagesResponse ///< Output parameter + _wsnt__GetMessages* wsnt__GetMessages, ///< Input parameter + _wsnt__GetMessagesResponse &wsnt__GetMessagesResponse ///< Output parameter ); /******************************************************************************\ @@ -6509,8 +6508,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: DestroyPullPoint wsrfr__ResourceUnknownFault //gsoap tev service method-fault: DestroyPullPoint wsnt__UnableToDestroyPullPointFault int __tev__DestroyPullPoint( - _wsnt__DestroyPullPoint* wsnt__DestroyPullPoint, ///< Input parameter - _wsnt__DestroyPullPointResponse &wsnt__DestroyPullPointResponse ///< Output parameter + _wsnt__DestroyPullPoint* wsnt__DestroyPullPoint, ///< Input parameter + _wsnt__DestroyPullPointResponse &wsnt__DestroyPullPointResponse ///< Output parameter ); /******************************************************************************\ @@ -6572,8 +6571,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-encoding: Notify_ literal //gsoap tev service method-input-action: Notify_ http://docs.oasis-open.org/wsn/bw-2/PullPoint/Notify int __tev__Notify_( - _wsnt__Notify* wsnt__Notify, ///< Input parameter - void ///< One-way message: no output parameter + _wsnt__Notify* wsnt__Notify, ///< Input parameter + void ///< One-way message: no output parameter ); /******************************************************************************\ @@ -6642,8 +6641,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-output-action: CreatePullPoint http://docs.oasis-open.org/wsn/bw-2/CreatePullPoint/CreatePullPointRequestResponse //gsoap tev service method-fault: CreatePullPoint wsnt__UnableToCreatePullPointFault int __tev__CreatePullPoint( - _wsnt__CreatePullPoint* wsnt__CreatePullPoint, ///< Input parameter - _wsnt__CreatePullPointResponse &wsnt__CreatePullPointResponse ///< Output parameter + _wsnt__CreatePullPoint* wsnt__CreatePullPoint, ///< Input parameter + _wsnt__CreatePullPointResponse &wsnt__CreatePullPointResponse ///< Output parameter ); /******************************************************************************\ @@ -6715,8 +6714,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: Renew_ wsrfr__ResourceUnknownFault //gsoap tev service method-fault: Renew_ wsnt__UnacceptableTerminationTimeFault int __tev__Renew_( - _wsnt__Renew* wsnt__Renew, ///< Input parameter - _wsnt__RenewResponse &wsnt__RenewResponse ///< Output parameter + _wsnt__Renew* wsnt__Renew, ///< Input parameter + _wsnt__RenewResponse &wsnt__RenewResponse ///< Output parameter ); /******************************************************************************\ @@ -6788,8 +6787,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: Unsubscribe__ wsrfr__ResourceUnknownFault //gsoap tev service method-fault: Unsubscribe__ wsnt__UnableToDestroySubscriptionFault int __tev__Unsubscribe__( - _wsnt__Unsubscribe* wsnt__Unsubscribe, ///< Input parameter - _wsnt__UnsubscribeResponse &wsnt__UnsubscribeResponse ///< Output parameter + _wsnt__Unsubscribe* wsnt__Unsubscribe, ///< Input parameter + _wsnt__UnsubscribeResponse &wsnt__UnsubscribeResponse ///< Output parameter ); /******************************************************************************\ @@ -6861,8 +6860,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: PauseSubscription wsrfr__ResourceUnknownFault //gsoap tev service method-fault: PauseSubscription wsnt__PauseFailedFault int __tev__PauseSubscription( - _wsnt__PauseSubscription* wsnt__PauseSubscription, ///< Input parameter - _wsnt__PauseSubscriptionResponse &wsnt__PauseSubscriptionResponse ///< Output parameter + _wsnt__PauseSubscription* wsnt__PauseSubscription, ///< Input parameter + _wsnt__PauseSubscriptionResponse &wsnt__PauseSubscriptionResponse ///< Output parameter ); /******************************************************************************\ @@ -6934,8 +6933,8 @@ Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-u //gsoap tev service method-fault: ResumeSubscription wsrfr__ResourceUnknownFault //gsoap tev service method-fault: ResumeSubscription wsnt__ResumeFailedFault int __tev__ResumeSubscription( - _wsnt__ResumeSubscription* wsnt__ResumeSubscription, ///< Input parameter - _wsnt__ResumeSubscriptionResponse &wsnt__ResumeSubscriptionResponse ///< Output parameter + _wsnt__ResumeSubscription* wsnt__ResumeSubscription, ///< Input parameter + _wsnt__ResumeSubscriptionResponse &wsnt__ResumeSubscriptionResponse ///< Output parameter ); /** @page PullPointSubscriptionBinding Binding "PullPointSubscriptionBinding" diff --git a/src/zm.cpp b/src/zm.cpp index e541b322f..a50be3af3 100644 --- a/src/zm.cpp +++ b/src/zm.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Core Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm.h" diff --git a/src/zm.h b/src/zm.h index 46d6edf08..435c6534f 100644 --- a/src/zm.h +++ b/src/zm.h @@ -1,21 +1,21 @@ // // ZoneMinder Core Interfaces, $Date$, $Revision$ // $Copyright$ -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_H diff --git a/src/zm_analysis_thread.cpp b/src/zm_analysis_thread.cpp index bca0ff4e4..9533dae0f 100644 --- a/src/zm_analysis_thread.cpp +++ b/src/zm_analysis_thread.cpp @@ -5,7 +5,7 @@ #include "zm_time.h" AnalysisThread::AnalysisThread(Monitor *monitor) : - monitor_(monitor), terminate_(false) { + monitor_(monitor), terminate_(false) { thread_ = std::thread(&AnalysisThread::Run, this); } diff --git a/src/zm_box.h b/src/zm_box.h index 12e44cb94..7e71f71e9 100644 --- a/src/zm_box.h +++ b/src/zm_box.h @@ -1,21 +1,21 @@ // // ZoneMinder Box Class Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_BOX_H #define ZM_BOX_H diff --git a/src/zm_buffer.cpp b/src/zm_buffer.cpp index 0f9d68a4b..85d415498 100644 --- a/src/zm_buffer.cpp +++ b/src/zm_buffer.cpp @@ -1,21 +1,21 @@ /* * ZoneMinder flexible memory class implementation, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #include "zm_buffer.h" diff --git a/src/zm_buffer.h b/src/zm_buffer.h index fddd2f3cc..a20c664b8 100644 --- a/src/zm_buffer.h +++ b/src/zm_buffer.h @@ -1,21 +1,21 @@ /* * ZoneMinder Flexible Memory Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #ifndef ZM_BUFFER_H #define ZM_BUFFER_H @@ -87,7 +87,7 @@ class Buffer { unsigned int consume(unsigned int count) { if (count > mSize) { Warning("Attempt to consume %d bytes of buffer, size is only %d bytes", - count, mSize); + count, mSize); count = mSize; } mHead += count; @@ -99,7 +99,7 @@ class Buffer { unsigned int shrink(unsigned int count) { if (count > mSize) { Warning("Attempt to shrink buffer by %d bytes, size is only %d bytes", - count, mSize); + count, mSize); count = mSize; } mSize -= count; @@ -117,7 +117,7 @@ class Buffer { unsigned char *extract(unsigned int pSize) { if (pSize > mSize) { Warning("Attempt to extract %d bytes of buffer, size is only %d bytes", - pSize, mSize); + pSize, mSize); pSize = mSize; } unsigned char *oldHead = mHead; diff --git a/src/zm_camera.cpp b/src/zm_camera.cpp index 0186f8045..ddece6000 100644 --- a/src/zm_camera.cpp +++ b/src/zm_camera.cpp @@ -22,52 +22,51 @@ #include "zm_monitor.h" Camera::Camera( - const Monitor *monitor, - SourceType p_type, - unsigned int p_width, - unsigned int p_height, - int p_colours, - int p_subpixelorder, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio - ) : - monitor(monitor), - type(p_type), - width(p_width), - height(p_height), - colours(p_colours), - subpixelorder(p_subpixelorder), - brightness(p_brightness), - hue(p_hue), - colour(p_colour), - contrast(p_contrast), - capture(p_capture), - record_audio(p_record_audio), - mVideoStreamId(-1), - mAudioStreamId(-1), - mVideoCodecContext(nullptr), - mAudioCodecContext(nullptr), - mVideoStream(nullptr), - mAudioStream(nullptr), - mFormatContext(nullptr), - mSecondFormatContext(nullptr), - mFirstVideoPTS(0), - mFirstAudioPTS(0), - mLastVideoPTS(0), - mLastAudioPTS(0), - bytes(0), - mIsPrimed(false) -{ + const Monitor *monitor, + SourceType p_type, + unsigned int p_width, + unsigned int p_height, + int p_colours, + int p_subpixelorder, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio +) : + monitor(monitor), + type(p_type), + width(p_width), + height(p_height), + colours(p_colours), + subpixelorder(p_subpixelorder), + brightness(p_brightness), + hue(p_hue), + colour(p_colour), + contrast(p_contrast), + capture(p_capture), + record_audio(p_record_audio), + mVideoStreamId(-1), + mAudioStreamId(-1), + mVideoCodecContext(nullptr), + mAudioCodecContext(nullptr), + mVideoStream(nullptr), + mAudioStream(nullptr), + mFormatContext(nullptr), + mSecondFormatContext(nullptr), + mFirstVideoPTS(0), + mFirstAudioPTS(0), + mLastVideoPTS(0), + mLastAudioPTS(0), + bytes(0), + mIsPrimed(false) { linesize = width * colours; pixels = width * height; imagesize = static_cast(height) * linesize; Debug(2, "New camera id: %d width: %d line size: %d height: %d colours: %d subpixelorder: %d capture: %d, size: %llu", - monitor->Id(), width, linesize, height, colours, subpixelorder, capture, imagesize); + monitor->Id(), width, linesize, height, colours, subpixelorder, capture, imagesize); } Camera::~Camera() { @@ -92,7 +91,7 @@ AVStream *Camera::getVideoStream() { Debug(1, "Allocating avstream"); mVideoStream = avformat_new_stream(mFormatContext, nullptr); if ( mVideoStream ) { - mVideoStream->time_base = (AVRational){1, 1000000}; // microseconds as base frame rate + mVideoStream->time_base = (AVRational) {1, 1000000}; // microseconds as base frame rate mVideoStream->codecpar->width = width; mVideoStream->codecpar->height = height; mVideoStream->codecpar->format = GetFFMPEGPixelFormat(colours, subpixelorder); diff --git a/src/zm_camera.h b/src/zm_camera.h index 490564c6a..c035fccc8 100644 --- a/src/zm_camera.h +++ b/src/zm_camera.h @@ -1,21 +1,21 @@ // // ZoneMinder Camera Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_CAMERA_H #define ZM_CAMERA_H @@ -34,7 +34,7 @@ class ZMPacket; // common attributes // class Camera { -protected: + protected: typedef enum { LOCAL_SRC, REMOTE_SRC, FILE_SRC, FFMPEG_SRC, LIBVLC_SRC, CURL_SRC, VNC_SRC } SourceType; const Monitor *monitor; @@ -67,21 +67,21 @@ protected: unsigned int bytes; bool mIsPrimed; -public: + public: Camera( - const Monitor* monitor, - SourceType p_type, - unsigned int p_width, - unsigned int p_height, - int p_colours, - int p_subpixelorder, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio - ); + const Monitor* monitor, + SourceType p_type, + unsigned int p_width, + unsigned int p_height, + int p_colours, + int p_subpixelorder, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio + ); virtual ~Camera(); SourceType Type() const { return type; } @@ -104,9 +104,11 @@ public: int getFrequency() { return mAudioStream ? mAudioStream->codecpar->sample_rate : -1; } int getChannels() { #if LIBAVUTIL_VERSION_CHECK(57, 28, 100, 28, 0) - return mAudioStream ? mAudioStream->codecpar->ch_layout.nb_channels : -1; } + return mAudioStream ? mAudioStream->codecpar->ch_layout.nb_channels : -1; + } #else - return mAudioStream ? mAudioStream->codecpar->channels : -1; } + return mAudioStream ? mAudioStream->codecpar->channels : -1; + } #endif virtual int Brightness( int/*p_brightness*/=-1 ) { return -1; } diff --git a/src/zm_comms.h b/src/zm_comms.h index 0114706a5..c866f6467 100644 --- a/src/zm_comms.h +++ b/src/zm_comms.h @@ -144,9 +144,9 @@ class SockAddrInet : public SockAddr { public: SockAddrInet() : SockAddr((sockaddr *) &mAddrIn) {} explicit SockAddrInet(const SockAddrInet &addr) - : SockAddr((const sockaddr *) &mAddrIn), mAddrIn(addr.mAddrIn) {} + : SockAddr((const sockaddr *) &mAddrIn), mAddrIn(addr.mAddrIn) {} explicit SockAddrInet(const sockaddr_in *addr) - : SockAddr((const sockaddr *) &mAddrIn), mAddrIn(*addr) {} + : SockAddr((const sockaddr *) &mAddrIn), mAddrIn(*addr) {} bool resolve(const char *host, const char *serv, const char *proto); bool resolve(const char *host, int port, const char *proto); @@ -167,9 +167,9 @@ class SockAddrUnix : public SockAddr { public: SockAddrUnix() : SockAddr((sockaddr *) &mAddrUn) {} SockAddrUnix(const SockAddrUnix &addr) - : SockAddr((const sockaddr *) &mAddrUn), mAddrUn(addr.mAddrUn) {} + : SockAddr((const sockaddr *) &mAddrUn), mAddrUn(addr.mAddrUn) {} explicit SockAddrUnix(const sockaddr_un *addr) - : SockAddr((const sockaddr *) &mAddrUn), mAddrUn(*addr) {} + : SockAddr((const sockaddr *) &mAddrUn), mAddrUn(*addr) {} bool resolve(const char *path, const char *proto); @@ -188,15 +188,15 @@ class Socket : public CommsBase { enum State { CLOSED, DISCONNECTED, LISTENING, CONNECTED }; Socket() : CommsBase(mSd, mSd), - mSd(-1), - mState(CLOSED), - mLocalAddr(nullptr), - mRemoteAddr(nullptr) {} + mSd(-1), + mState(CLOSED), + mLocalAddr(nullptr), + mRemoteAddr(nullptr) {} Socket(const Socket &socket, int newSd) : CommsBase(mSd, mSd), - mSd(newSd), - mState(CONNECTED), - mLocalAddr(nullptr), - mRemoteAddr(nullptr) { + mSd(newSd), + mState(CONNECTED), + mLocalAddr(nullptr), + mRemoteAddr(nullptr) { if (socket.mLocalAddr) mLocalAddr = SockAddr::newSockAddr(mLocalAddr); if (socket.mRemoteAddr) @@ -511,14 +511,14 @@ class TcpInetSocket : virtual public TcpSocket, virtual public InetSocket { public: TcpInetSocket() = default; TcpInetSocket(const TcpInetSocket &socket, int newSd) - : TcpSocket(socket, newSd) {} + : TcpSocket(socket, newSd) {} }; class TcpUnixSocket : virtual public TcpSocket, virtual public UnixSocket { public: TcpUnixSocket() = default; TcpUnixSocket(const TcpUnixSocket &socket, int newSd) - : TcpSocket(socket, newSd) {} + : TcpSocket(socket, newSd) {} }; class TcpInetClient : public TcpInetSocket { diff --git a/src/zm_config.cpp b/src/zm_config.cpp index beda5b49e..a37b7ce8c 100644 --- a/src/zm_config.cpp +++ b/src/zm_config.cpp @@ -1,17 +1,17 @@ // // ZoneMinder Configuration Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -27,8 +27,8 @@ #include #include -// Note that Error and Debug calls won't actually go anywhere unless you -// set the relevant ENV vars because the logger gets it's setting from the +// Note that Error and Debug calls won't actually go anywhere unless you +// set the relevant ENV vars because the logger gets it's setting from the // config. void zmLoadStaticConfig() { @@ -364,7 +364,7 @@ void Config::Load() { } void Config::Assign() { -ZM_CFG_ASSIGN_LIST + ZM_CFG_ASSIGN_LIST } const ConfigItem &Config::Item(int id) { @@ -379,12 +379,12 @@ const ConfigItem &Config::Item(int id) { } ConfigItem *item = items[id]; - + if ( !item ) { Error("Can't find config item %d", id); exit(-1); } - + return *item; } diff --git a/src/zm_config.h b/src/zm_config.h index e2ec9781a..e275a2769 100644 --- a/src/zm_config.h +++ b/src/zm_config.h @@ -74,7 +74,7 @@ struct StaticConfig { extern StaticConfig staticConfig; class ConfigItem { -private: + private: char *name; char *value; char *type; @@ -88,7 +88,7 @@ private: } cfg_value; mutable bool accessed; -public: + public: ConfigItem(const char *p_name, const char *p_value, const char *const p_type); ConfigItem(const ConfigItem &); ~ConfigItem(); @@ -118,14 +118,14 @@ public: }; class Config { -public: + public: ZM_CFG_DECLARE_LIST -private: + private: int n_items; ConfigItem **items; -public: + public: Config(); ~Config(); diff --git a/src/zm_crypt.cpp b/src/zm_crypt.cpp index 77075e9f3..29ce3ed29 100644 --- a/src/zm_crypt.cpp +++ b/src/zm_crypt.cpp @@ -33,15 +33,15 @@ std::pair verifyToken(const std::string &jwt_token_s Error("Error setting Algorithm for JWT decode"); return std::make_pair("", 0); } - + err = jwt_decode(&jwt, jwt_token_str.c_str(), - reinterpret_cast(key.c_str()), key.length()); + reinterpret_cast(key.c_str()), key.length()); if (err) { jwt_free(jwt); Error("Could not decode JWT"); return std::make_pair("", 0); } - + const char *c_type = jwt_get_grant(jwt, (const char*)"type"); if (!c_type) { jwt_free(jwt); @@ -62,14 +62,14 @@ std::pair verifyToken(const std::string &jwt_token_s username = std::string(c_username); Debug(1, "Got %s as user claim from token", username.c_str()); - + token_issued_at = (unsigned int)jwt_get_grant_int(jwt, "iat"); if (errno == ENOENT) { jwt_free(jwt); Error("IAT not found in claim. This should not happen"); return std::make_pair("", 0); } - + Debug(1, "Got IAT token=%u", token_issued_at); jwt_free(jwt); return std::make_pair(username, token_issued_at); @@ -82,9 +82,9 @@ std::pair verifyToken(const std::string &jwt_token_s // is it decodable? auto decoded = jwt::decode(jwt_token_str); auto verifier = jwt::verify() - .allow_algorithm(jwt::algorithm::hs256{ key }) - .with_issuer("ZoneMinder"); - + .allow_algorithm(jwt::algorithm::hs256{ key }) + .with_issuer("ZoneMinder"); + // signature verified? verifier.verify(decoded); @@ -120,8 +120,7 @@ std::pair verifyToken(const std::string &jwt_token_s catch (const std::exception &e) { Error("Unable to verify token: %s", e.what()); return std::make_pair("", 0); - } - catch (...) { + } catch (...) { Error("unknown exception"); return std::make_pair("", 0); } @@ -148,13 +147,13 @@ bool verifyPassword(const char *username, const char *input_password, const char Debug(1, "Computed password_hash: %s, stored password_hash: %s", hex_digest.c_str(), db_password_hash); password_correct = (strcmp(db_password_hash, hex_digest.c_str()) == 0); } else if ( - (db_password_hash[0] == '$') - && - (db_password_hash[1] == '2') - && - (db_password_hash[3] == '$') - ) { - // BCRYPT + (db_password_hash[0] == '$') + && + (db_password_hash[1] == '2') + && + (db_password_hash[3] == '$') + ) { + // BCRYPT Debug(1, "%s is using a bcrypt encoded password", username); BCrypt bcrypt; password_correct = bcrypt.validatePassword(std::string(input_password), std::string(db_password_hash)); @@ -164,23 +163,23 @@ bool verifyPassword(const char *username, const char *input_password, const char } else { Warning("%s is using a plain text (not recommended) or scheme not understood", username); password_correct = (strcmp(input_password, db_password_hash) == 0); - } - + } + return password_correct; } std::string generateKey(const int length) { - const std::string lookup = "0123456789ABCDEF"; + const std::string lookup = "0123456789ABCDEF"; - std::random_device rnd; - std::mt19937 rng(rnd()); - std::uniform_int_distribution<> genDigit(0,15); - std::string keyBuffer (length, '0'); - for ( int i = 0; i < length; i++ ) { - keyBuffer[i] = lookup[genDigit(rng)]; - } - return keyBuffer; + std::random_device rnd; + std::mt19937 rng(rnd()); + std::uniform_int_distribution<> genDigit(0,15); + std::string keyBuffer (length, '0'); + for ( int i = 0; i < length; i++ ) { + keyBuffer[i] = lookup[genDigit(rng)]; + } + return keyBuffer; } diff --git a/src/zm_crypt.h b/src/zm_crypt.h index 83ccc76bd..28e598979 100644 --- a/src/zm_crypt.h +++ b/src/zm_crypt.h @@ -1,21 +1,21 @@ // // ZoneMinder General Utility Functions, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_CRYPT_H #define ZM_CRYPT_H diff --git a/src/zm_db.cpp b/src/zm_db.cpp index d92809727..788fc7e63 100644 --- a/src/zm_db.cpp +++ b/src/zm_db.cpp @@ -32,7 +32,7 @@ bool zmDbConnected = false; bool zmDbConnect() { // For some reason having these lines causes memory corruption and crashing on newer debian/ubuntu - // But they really need to be here in order to prevent a double open of mysql + // But they really need to be here in order to prevent a double open of mysql if (zmDbConnected) { //Warning("Calling zmDbConnect when already connected"); return true; @@ -52,11 +52,11 @@ bool zmDbConnect() { std::string::size_type colonIndex = staticConfig.DB_HOST.find(":"); if ( colonIndex == std::string::npos ) { if ( !mysql_real_connect( - &dbconn, - staticConfig.DB_HOST.c_str(), - staticConfig.DB_USER.c_str(), - staticConfig.DB_PASS.c_str(), - nullptr, 0, nullptr, 0) ) { + &dbconn, + staticConfig.DB_HOST.c_str(), + staticConfig.DB_USER.c_str(), + staticConfig.DB_PASS.c_str(), + nullptr, 0, nullptr, 0) ) { Error("Can't connect to server: %s", mysql_error(&dbconn)); mysql_close(&dbconn); return false; @@ -66,24 +66,24 @@ bool zmDbConnect() { std::string dbPortOrSocket = staticConfig.DB_HOST.substr(colonIndex+1); if ( dbPortOrSocket[0] == '/' ) { if ( !mysql_real_connect( - &dbconn, - nullptr, - staticConfig.DB_USER.c_str(), - staticConfig.DB_PASS.c_str(), - nullptr, 0, dbPortOrSocket.c_str(), 0) ) { + &dbconn, + nullptr, + staticConfig.DB_USER.c_str(), + staticConfig.DB_PASS.c_str(), + nullptr, 0, dbPortOrSocket.c_str(), 0) ) { Error("Can't connect to server: %s", mysql_error(&dbconn)); mysql_close(&dbconn); return false; } } else { if ( !mysql_real_connect( - &dbconn, - dbHost.c_str(), - staticConfig.DB_USER.c_str(), - staticConfig.DB_PASS.c_str(), - nullptr, - atoi(dbPortOrSocket.c_str()), - nullptr, 0) ) { + &dbconn, + dbHost.c_str(), + staticConfig.DB_USER.c_str(), + staticConfig.DB_PASS.c_str(), + nullptr, + atoi(dbPortOrSocket.c_str()), + nullptr, 0) ) { Error("Can't connect to server: %s", mysql_error(&dbconn)); mysql_close(&dbconn); return false; @@ -272,8 +272,7 @@ zmDbRow::~zmDbRow() { } zmDbQueue::zmDbQueue() : - mTerminate(false) -{ + mTerminate(false) { mThread = std::thread(&zmDbQueue::process, this); } diff --git a/src/zm_db.h b/src/zm_db.h index d484cda64..5f1e75db5 100644 --- a/src/zm_db.h +++ b/src/zm_db.h @@ -1,21 +1,21 @@ // // ZoneMinder Core Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_DB_H #define ZM_DB_H @@ -29,13 +29,13 @@ #include class zmDbQueue { - private: + private: std::queue mQueue; std::thread mThread; std::mutex mMutex; std::condition_variable mCondition; bool mTerminate; - public: + public: zmDbQueue(); ~zmDbQueue(); void push(std::string &&sql); @@ -44,20 +44,20 @@ class zmDbQueue { }; class zmDbRow { - private: - MYSQL_RES *result_set; - MYSQL_ROW row; - public: - zmDbRow() : result_set(nullptr), row(nullptr) { }; - MYSQL_RES *fetch(const std::string &query); - zmDbRow(MYSQL_RES *, MYSQL_ROW *row); - ~zmDbRow(); + private: + MYSQL_RES *result_set; + MYSQL_ROW row; + public: + zmDbRow() : result_set(nullptr), row(nullptr) { }; + MYSQL_RES *fetch(const std::string &query); + zmDbRow(MYSQL_RES *, MYSQL_ROW *row); + ~zmDbRow(); - MYSQL_ROW mysql_row() const { return row; }; + MYSQL_ROW mysql_row() const { return row; }; - char *operator[](unsigned int index) const { - return row[index]; - } + char *operator[](unsigned int index) const { + return row[index]; + } }; extern MYSQL dbconn; diff --git a/src/zm_decoder_thread.cpp b/src/zm_decoder_thread.cpp index 5c1033985..256d82107 100644 --- a/src/zm_decoder_thread.cpp +++ b/src/zm_decoder_thread.cpp @@ -4,7 +4,7 @@ #include "zm_signal.h" DecoderThread::DecoderThread(Monitor *monitor) : - monitor_(monitor), terminate_(false) { + monitor_(monitor), terminate_(false) { thread_ = std::thread(&DecoderThread::Run, this); } diff --git a/src/zm_event.cpp b/src/zm_event.cpp index b9cf22b4a..fac6fda24 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -40,11 +40,11 @@ int Event::pre_alarm_count = 0; Event::PreAlarmData Event::pre_alarm_data[MAX_PRE_ALARM_FRAMES] = {}; Event::Event( - Monitor *p_monitor, - SystemTimePoint p_start_time, - const std::string &p_cause, - const StringSetMap &p_noteSetMap - ) : + Monitor *p_monitor, + SystemTimePoint p_start_time, + const std::string &p_cause, + const StringSetMap &p_noteSetMap +) : id(0), monitor(p_monitor), start_time(p_start_time), @@ -67,8 +67,7 @@ Event::Event( have_video_keyframe(false), //scheme save_jpegs(0), - terminate_(false) -{ + terminate_(false) { std::string notes; createNotes(notes); @@ -115,26 +114,26 @@ Event::Event( } std::string sql = stringtf( - "INSERT INTO `Events` " - "( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme`, `Latitude`, `Longitude` )" - " VALUES " - "( %d, %d, 'New Event', from_unixtime(%" PRId64 "), %u, %u, '%s', '%s', %d, %d, %d, '%s', %d, '%s', '%f', '%f' )", - monitor->Id(), - storage->Id(), - static_cast(std::chrono::system_clock::to_time_t(start_time)), - monitor->Width(), - monitor->Height(), - cause.c_str(), - notes.c_str(), - state_id, - monitor->getOrientation(), - 0, - video_incomplete_file.c_str(), - save_jpegs, - storage->SchemeString().c_str(), - monitor->Latitude(), - monitor->Longitude() - ); + "INSERT INTO `Events` " + "( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme`, `Latitude`, `Longitude` )" + " VALUES " + "( %d, %d, 'New Event', from_unixtime(%" PRId64 "), %u, %u, '%s', '%s', %d, %d, %d, '%s', %d, '%s', '%f', '%f' )", + monitor->Id(), + storage->Id(), + static_cast(std::chrono::system_clock::to_time_t(start_time)), + monitor->Width(), + monitor->Height(), + cause.c_str(), + notes.c_str(), + state_id, + monitor->getOrientation(), + 0, + video_incomplete_file.c_str(), + save_jpegs, + storage->SchemeString().c_str(), + monitor->Latitude(), + monitor->Longitude() + ); do { id = zmDbDoInsert(sql); } while (!id and !zm_terminate); @@ -177,24 +176,24 @@ Event::~Event() { if (frame_data.size()) WriteDbFrames(); std::string sql = stringtf( - "UPDATE Events SET Name='%s%" PRIu64 "', EndDateTime = from_unixtime(%ld), Length = %.2f, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d, DefaultVideo='%s' WHERE Id = %" PRIu64 " AND Name='New Event'", - monitor->Substitute(monitor->EventPrefix(), start_time).c_str(), id, std::chrono::system_clock::to_time_t(end_time), - delta_time.count(), - frames, alarm_frames, - tot_score, static_cast(alarm_frames ? (tot_score / alarm_frames) : 0), max_score, - video_file.c_str(), // defaults to "" - id); + "UPDATE Events SET Name='%s%" PRIu64 "', EndDateTime = from_unixtime(%ld), Length = %.2f, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d, DefaultVideo='%s' WHERE Id = %" PRIu64 " AND Name='New Event'", + monitor->Substitute(monitor->EventPrefix(), start_time).c_str(), id, std::chrono::system_clock::to_time_t(end_time), + delta_time.count(), + frames, alarm_frames, + tot_score, static_cast(alarm_frames ? (tot_score / alarm_frames) : 0), max_score, + video_file.c_str(), // defaults to "" + id); if (!zmDbDoUpdate(sql)) { // Name might have been changed during recording, so just do the update without changing the name. sql = stringtf( - "UPDATE Events SET EndDateTime = from_unixtime(%ld), Length = %.2f, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d, DefaultVideo='%s' WHERE Id = %" PRIu64, - std::chrono::system_clock::to_time_t(end_time), - delta_time.count(), - frames, alarm_frames, - tot_score, static_cast(alarm_frames ? (tot_score / alarm_frames) : 0), max_score, - video_file.c_str(), // defaults to "" - id); + "UPDATE Events SET EndDateTime = from_unixtime(%ld), Length = %.2f, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d, DefaultVideo='%s' WHERE Id = %" PRIu64, + std::chrono::system_clock::to_time_t(end_time), + delta_time.count(), + frames, alarm_frames, + tot_score, static_cast(alarm_frames ? (tot_score / alarm_frames) : 0), max_score, + video_file.c_str(), // defaults to "" + id); zmDbDoUpdate(sql); } // end if no changed rows due to Name change during recording } // Event::~Event() @@ -218,7 +217,7 @@ void Event::addNote(const char *cause, const std::string ¬e) { } bool Event::WriteFrameImage(Image *image, SystemTimePoint timestamp, const char *event_file, bool alarm_frame) const { - int thisquality = + int thisquality = (alarm_frame && (config.jpeg_alarm_file_quality > config.jpeg_file_quality)) ? config.jpeg_alarm_file_quality : 0; // quality to use, zero is default @@ -256,8 +255,8 @@ void Event::updateNotes(const StringSetMap &newNoteSetMap) { update = true; } else { for (StringSetMap::const_iterator newNoteSetMapIter = newNoteSetMap.begin(); - newNoteSetMapIter != newNoteSetMap.end(); - ++newNoteSetMapIter) { + newNoteSetMapIter != newNoteSetMap.end(); + ++newNoteSetMapIter) { const std::string &newNoteGroup = newNoteSetMapIter->first; const StringSet &newNoteSet = newNoteSetMapIter->second; //Info( "Got %d new strings", newNoteSet.size() ); @@ -271,8 +270,8 @@ void Event::updateNotes(const StringSetMap &newNoteSetMap) { StringSet ¬eSet = noteSetMapIter->second; //Debug(3, "Found note group %s, got %d strings", newNoteGroup.c_str(), newNoteSet.size()); for (StringSet::const_iterator newNoteSetIter = newNoteSet.begin(); - newNoteSetIter != newNoteSet.end(); - ++newNoteSetIter) { + newNoteSetIter != newNoteSet.end(); + ++newNoteSetIter) { const std::string &newNote = *newNoteSetIter; StringSet::iterator noteSetIter = noteSet.find(newNote); if (noteSetIter == noteSet.end()) { @@ -308,11 +307,11 @@ void Event::AddPacket(const std::shared_ptr&packet) { } void Event::AddPacket_(const std::shared_ptr&packet) { - have_video_keyframe = have_video_keyframe || - ( ( packet->codec_type == AVMEDIA_TYPE_VIDEO ) && - ( packet->keyframe || monitor->GetOptVideoWriter() == Monitor::ENCODE) ); + have_video_keyframe = have_video_keyframe || + ( ( packet->codec_type == AVMEDIA_TYPE_VIDEO ) && + ( packet->keyframe || monitor->GetOptVideoWriter() == Monitor::ENCODE) ); Debug(2, "have_video_keyframe %d codec_type %d == video? %d packet keyframe %d", - have_video_keyframe, packet->codec_type, (packet->codec_type == AVMEDIA_TYPE_VIDEO), packet->keyframe); + have_video_keyframe, packet->codec_type, (packet->codec_type == AVMEDIA_TYPE_VIDEO), packet->keyframe); ZM_DUMP_PACKET(packet->packet, "Adding to event"); if (videoStore) { @@ -333,9 +332,9 @@ void Event::AddPacket_(const std::shared_ptr&packet) { void Event::WriteDbFrames() { std::string frame_insert_sql = "INSERT INTO `Frames` (`EventId`, `FrameId`, `Type`, `TimeStamp`, `Delta`, `Score`) VALUES "; std::string stats_insert_sql = "INSERT INTO `Stats` (`EventId`, `FrameId`, `MonitorId`, `ZoneId`, " - "`PixelDiff`, `AlarmPixels`, `FilterPixels`, `BlobPixels`," - "`Blobs`,`MinBlobSize`, `MaxBlobSize`, " - "`MinX`, `MinY`, `MaxX`, `MaxY`,`Score`) VALUES "; + "`PixelDiff`, `AlarmPixels`, `FilterPixels`, `BlobPixels`," + "`Blobs`,`MinBlobSize`, `MaxBlobSize`, " + "`MinX`, `MinY`, `MaxX`, `MaxY`,`Score`) VALUES "; Debug(1, "Inserting %zu frames", frame_data.size()); while (frame_data.size()) { @@ -350,21 +349,21 @@ void Event::WriteDbFrames() { if (config.record_event_stats and frame->zone_stats.size()) { for (ZoneStats &stats : frame->zone_stats) { stats_insert_sql += stringtf("\n(%" PRIu64 ",%d,%u,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%u),", - id, frame->frame_id, - monitor->Id(), - stats.zone_id_, - stats.pixel_diff_, - stats.alarm_pixels_, - stats.alarm_filter_pixels_, - stats.alarm_blob_pixels_, - stats.alarm_blobs_, - stats.min_blob_size_, - stats.max_blob_size_, - stats.alarm_box_.Lo().x_, - stats.alarm_box_.Lo().y_, - stats.alarm_box_.Hi().x_, - stats.alarm_box_.Hi().y_, - stats.score_); + id, frame->frame_id, + monitor->Id(), + stats.zone_id_, + stats.pixel_diff_, + stats.alarm_pixels_, + stats.alarm_filter_pixels_, + stats.alarm_blob_pixels_, + stats.alarm_blobs_, + stats.min_blob_size_, + stats.max_blob_size_, + stats.alarm_box_.Lo().x_, + stats.alarm_box_.Lo().y_, + stats.alarm_box_.Hi().x_, + stats.alarm_box_.Hi().y_, + stats.score_); } // end foreach zone stats } // end if recording stats delete frame; @@ -391,19 +390,19 @@ void Event::AddFrame(const std::shared_ptr&packet) { bool write_to_db = false; FrameType frame_type = ( ( score > 0 ) ? ALARM : ( - ( - ( monitor_state == Monitor::IDLE ) - and - ( config.bulk_frame_interval > 1 ) - and - ( ! (frames % config.bulk_frame_interval) ) - ) ? BULK : NORMAL - ) ); + ( + ( monitor_state == Monitor::IDLE ) + and + ( config.bulk_frame_interval > 1 ) + and + ( ! (frames % config.bulk_frame_interval) ) + ) ? BULK : NORMAL + ) ); if (frame_type == ALARM) alarm_frames++; - Debug(1, "Have frame type %s from score(%d) state %d frames %d bulk frame interval %d and mod%d", - frame_type_names[frame_type], score, monitor_state, frames, config.bulk_frame_interval, (frames % config.bulk_frame_interval)); + Debug(1, "Have frame type %s from score(%d) state %d frames %d bulk frame interval %d and mod%d", + frame_type_names[frame_type], score, monitor_state, frames, config.bulk_frame_interval, (frames % config.bulk_frame_interval)); if (score < 0) score = 0; tot_score += score; @@ -459,12 +458,12 @@ void Event::AddFrame(const std::shared_ptr&packet) { } // end if has image bool db_frame = ( frame_type == BULK ) - or ( frame_type == ALARM ) - or ( frames == 1 ) - or ( score > max_score ) - or ( monitor_state == Monitor::ALERT ) - or ( monitor_state == Monitor::ALARM ) - or ( monitor_state == Monitor::PREALARM ); + or ( frame_type == ALARM ) + or ( frames == 1 ) + or ( score > max_score ) + or ( monitor_state == Monitor::ALERT ) + or ( monitor_state == Monitor::ALARM ) + or ( monitor_state == Monitor::PREALARM ); if (score > max_score) { max_score = score; @@ -495,14 +494,14 @@ void Event::AddFrame(const std::shared_ptr&packet) { last_db_frame = frames; std::string sql = stringtf( - "UPDATE Events SET Length = %.2f, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d WHERE Id = %" PRIu64, - FPSeconds(delta_time).count(), - frames, - alarm_frames, - tot_score, - static_cast(alarm_frames ? (tot_score / alarm_frames) : 0), - max_score, - id); + "UPDATE Events SET Length = %.2f, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d WHERE Id = %" PRIu64, + FPSeconds(delta_time).count(), + frames, + alarm_frames, + tot_score, + static_cast(alarm_frames ? (tot_score / alarm_frames) : 0), + max_score, + id); dbQueue.push(std::move(sql)); } else { Debug(1, "Not Adding %zu frames to DB because write_to_db:%d or frames > analysis fps %f or BULK", @@ -545,9 +544,9 @@ bool Event::SetPath(Storage *storage) { return false; } if (i == 2) - date_path = path; + date_path = path; } - time_path = stringtf("%02d/%02d/%02d", stime.tm_hour, stime.tm_min, stime.tm_sec); + time_path = stringtf("%02d/%02d/%02d", stime.tm_hour, stime.tm_min, stime.tm_sec); // Create event id symlink std::string id_file = stringtf("%s/.%" PRIu64, date_path.c_str(), id); @@ -557,8 +556,8 @@ bool Event::SetPath(Storage *storage) { } } else if (scheme == Storage::MEDIUM) { path += stringtf("/%04d-%02d-%02d", - stime.tm_year+1900, stime.tm_mon+1, stime.tm_mday - ); + stime.tm_year+1900, stime.tm_mon+1, stime.tm_mday + ); if (mkdir(path.c_str(), 0755) and (errno != EEXIST)) { Error("Can't mkdir %s: %s", path.c_str(), strerror(errno)); return false; @@ -582,7 +581,7 @@ bool Event::SetPath(Storage *storage) { } else { Error("Can't fopen %s: %s", id_file.c_str(), strerror(errno)); return false; - } + } } // deep storage or not return true; } // end bool Event::SetPath @@ -648,13 +647,13 @@ void Event::Run() { if (monitor->GetOptVideoWriter() != 0) { /* Save as video */ videoStore = new VideoStore( - video_incomplete_path.c_str(), - container.c_str(), - monitor->GetVideoStream(), - monitor->GetVideoCodecContext(), - ( monitor->RecordAudio() ? monitor->GetAudioStream() : nullptr ), - ( monitor->RecordAudio() ? monitor->GetAudioCodecContext() : nullptr ), - monitor ); + video_incomplete_path.c_str(), + container.c_str(), + monitor->GetVideoStream(), + monitor->GetVideoCodecContext(), + ( monitor->RecordAudio() ? monitor->GetAudioStream() : nullptr ), + ( monitor->RecordAudio() ? monitor->GetAudioCodecContext() : nullptr ), + monitor ); if (!videoStore->open()) { Warning("Failed to open videostore, turning on jpegs"); @@ -686,7 +685,7 @@ void Event::Run() { if (terminate_ or zm_terminate) break; packet_queue_condition.wait(lck); // Necessary because we don't hold the lock in the while condition - } + } if (!packet_queue.empty()) { packet = packet_queue.front(); packet_queue.pop(); diff --git a/src/zm_event.h b/src/zm_event.h index f2515b5c1..bc897403d 100644 --- a/src/zm_event.h +++ b/src/zm_event.h @@ -58,140 +58,140 @@ class Event { friend class EventStream; public: - typedef std::set StringSet; - typedef std::map StringSetMap; + typedef std::set StringSet; + typedef std::map StringSetMap; protected: - static const char * frame_type_names[3]; + static const char * frame_type_names[3]; - struct PreAlarmData { - Image *image; - struct timeval timestamp; - unsigned int score; - Image *alarm_frame; - }; - std::queue frame_data; + struct PreAlarmData { + Image *image; + struct timeval timestamp; + unsigned int score; + Image *alarm_frame; + }; + std::queue frame_data; - static int pre_alarm_count; - static PreAlarmData pre_alarm_data[MAX_PRE_ALARM_FRAMES]; + static int pre_alarm_count; + static PreAlarmData pre_alarm_data[MAX_PRE_ALARM_FRAMES]; - uint64_t id; - Monitor *monitor; - SystemTimePoint start_time; - SystemTimePoint end_time; - std::string cause; - StringSetMap noteSetMap; - int frames; - int alarm_frames; - bool alarm_frame_written; - int tot_score; - int max_score; - std::string path; - std::string snapshot_file; - bool snapshot_file_written; - std::string alarm_file; - VideoStore *videoStore; + uint64_t id; + Monitor *monitor; + SystemTimePoint start_time; + SystemTimePoint end_time; + std::string cause; + StringSetMap noteSetMap; + int frames; + int alarm_frames; + bool alarm_frame_written; + int tot_score; + int max_score; + std::string path; + std::string snapshot_file; + bool snapshot_file_written; + std::string alarm_file; + VideoStore *videoStore; - std::string container; - std::string codec; - std::string video_file; - std::string video_path; - std::string video_incomplete_file; - std::string video_incomplete_path; + std::string container; + std::string codec; + std::string video_file; + std::string video_path; + std::string video_incomplete_file; + std::string video_incomplete_path; - int last_db_frame; - bool have_video_keyframe; // a flag to tell us if we have had a video keyframe when writing an mp4. The first frame SHOULD be a video keyframe. - Storage::Schemes scheme; - int save_jpegs; + int last_db_frame; + bool have_video_keyframe; // a flag to tell us if we have had a video keyframe when writing an mp4. The first frame SHOULD be a video keyframe. + Storage::Schemes scheme; + int save_jpegs; - void createNotes(std::string ¬es); + void createNotes(std::string ¬es); - std::queue> packet_queue; - std::mutex packet_queue_mutex; - std::condition_variable packet_queue_condition; + std::queue> packet_queue; + std::mutex packet_queue_mutex; + std::condition_variable packet_queue_condition; - void Run(); + void Run(); - std::atomic terminate_; - std::thread thread_; + std::atomic terminate_; + std::thread thread_; public: - static bool OpenFrameSocket(int); - static bool ValidateFrameSocket(int); + static bool OpenFrameSocket(int); + static bool ValidateFrameSocket(int); - Event(Monitor *p_monitor, - SystemTimePoint p_start_time, - const std::string &p_cause, - const StringSetMap &p_noteSetMap); - ~Event(); + Event(Monitor *p_monitor, + SystemTimePoint p_start_time, + const std::string &p_cause, + const StringSetMap &p_noteSetMap); + ~Event(); - uint64_t Id() const { return id; } - const std::string &Cause() const { return cause; } - void addNote(const char *cause, const std::string ¬e); - int Frames() const { return frames; } - int AlarmFrames() const { return alarm_frames; } + uint64_t Id() const { return id; } + const std::string &Cause() const { return cause; } + void addNote(const char *cause, const std::string ¬e); + int Frames() const { return frames; } + int AlarmFrames() const { return alarm_frames; } - SystemTimePoint StartTime() const { return start_time; } - SystemTimePoint EndTime() const { return end_time; } - TimePoint::duration Duration() const { return end_time - start_time; }; + SystemTimePoint StartTime() const { return start_time; } + SystemTimePoint EndTime() const { return end_time; } + TimePoint::duration Duration() const { return end_time - start_time; }; - void AddPacket(const std::shared_ptr &p); - void AddPacket_(const std::shared_ptr &p); - bool WritePacket(const std::shared_ptr &p); - bool SendFrameImage(const Image *image, bool alarm_frame=false); - bool WriteFrameImage(Image *image, SystemTimePoint timestamp, const char *event_file, bool alarm_frame = false) const; + void AddPacket(const std::shared_ptr &p); + void AddPacket_(const std::shared_ptr &p); + bool WritePacket(const std::shared_ptr &p); + bool SendFrameImage(const Image *image, bool alarm_frame=false); + bool WriteFrameImage(Image *image, SystemTimePoint timestamp, const char *event_file, bool alarm_frame = false) const; - void updateNotes(const StringSetMap &stringSetMap); + void updateNotes(const StringSetMap &stringSetMap); - void AddFrame(const std::shared_ptr&packet); + void AddFrame(const std::shared_ptr&packet); - void Stop() { - { - std::unique_lock lck(packet_queue_mutex); - terminate_ = true; - } - packet_queue_condition.notify_all(); + void Stop() { + { + std::unique_lock lck(packet_queue_mutex); + terminate_ = true; } - bool Stopped() const { return terminate_; } + packet_queue_condition.notify_all(); + } + bool Stopped() const { return terminate_; } private: - void WriteDbFrames(); - bool SetPath(Storage *storage); + void WriteDbFrames(); + bool SetPath(Storage *storage); public: - static std::string getSubPath(tm time) { - std::string subpath = stringtf("%02d/%02d/%02d/%02d/%02d/%02d", - time.tm_year - 100, time.tm_mon + 1, time.tm_mday, - time.tm_hour, time.tm_min, time.tm_sec); - return subpath; - } - static std::string getSubPath(time_t *time) { - tm time_tm = {}; - localtime_r(time, &time_tm); - return Event::getSubPath(time_tm); - } + static std::string getSubPath(tm time) { + std::string subpath = stringtf("%02d/%02d/%02d/%02d/%02d/%02d", + time.tm_year - 100, time.tm_mon + 1, time.tm_mday, + time.tm_hour, time.tm_min, time.tm_sec); + return subpath; + } + static std::string getSubPath(time_t *time) { + tm time_tm = {}; + localtime_r(time, &time_tm); + return Event::getSubPath(time_tm); + } - const char* getEventFile() const { - return video_file.c_str(); - } + const char* getEventFile() const { + return video_file.c_str(); + } - static int PreAlarmCount() { - return pre_alarm_count; - } - static void EmptyPreAlarmFrames() { - pre_alarm_count = 0; - } - static void AddPreAlarmFrame( - Image *image, - SystemTimePoint timestamp, - int score=0, - Image *alarm_frame=nullptr - ) { - pre_alarm_count++; - } - void SavePreAlarmFrames() { - EmptyPreAlarmFrames(); - } - int MonitorId() const; + static int PreAlarmCount() { + return pre_alarm_count; + } + static void EmptyPreAlarmFrames() { + pre_alarm_count = 0; + } + static void AddPreAlarmFrame( + Image *image, + SystemTimePoint timestamp, + int score=0, + Image *alarm_frame=nullptr + ) { + pre_alarm_count++; + } + void SavePreAlarmFrames() { + EmptyPreAlarmFrames(); + } + int MonitorId() const; }; #endif // ZM_EVENT_H diff --git a/src/zm_eventstream.cpp b/src/zm_eventstream.cpp index bc501fd23..7f76cabe9 100644 --- a/src/zm_eventstream.cpp +++ b/src/zm_eventstream.cpp @@ -88,9 +88,9 @@ bool EventStream::loadInitialEventData(int monitor_id, SystemTimePoint event_tim } // bool EventStream::loadInitialEventData( int monitor_id, time_t event_time ) bool EventStream::loadInitialEventData( - uint64_t init_event_id, - int init_frame_id - ) { + uint64_t init_event_id, + int init_frame_id +) { loadEventData(init_event_id); if ( init_frame_id ) { @@ -111,10 +111,10 @@ bool EventStream::loadInitialEventData( bool EventStream::loadEventData(uint64_t event_id) { std::string sql = stringtf( - "SELECT `MonitorId`, `StorageId`, `Frames`, unix_timestamp( `StartDateTime` ) AS StartTimestamp, " - "unix_timestamp( `EndDateTime` ) AS EndTimestamp, " - "(SELECT max(`Delta`)-min(`Delta`) FROM `Frames` WHERE `EventId`=`Events`.`Id`) AS FramesDuration, " - "`DefaultVideo`, `Scheme`, `SaveJPEGs`, `Orientation`+0 FROM `Events` WHERE `Id` = %" PRIu64, event_id); + "SELECT `MonitorId`, `StorageId`, `Frames`, unix_timestamp( `StartDateTime` ) AS StartTimestamp, " + "unix_timestamp( `EndDateTime` ) AS EndTimestamp, " + "(SELECT max(`Delta`)-min(`Delta`) FROM `Frames` WHERE `EventId`=`Events`.`Id`) AS FramesDuration, " + "`DefaultVideo`, `Scheme`, `SaveJPEGs`, `Orientation`+0 FROM `Events` WHERE `Id` = %" PRIu64, event_id); MYSQL_RES *result = zmDbFetch(sql); if (!result) { @@ -142,7 +142,7 @@ bool EventStream::loadEventData(uint64_t event_id) { event_data->end_time = dbrow[4] ? SystemTimePoint(Seconds(atoi(dbrow[4]))) : std::chrono::system_clock::now(); event_data->duration = std::chrono::duration_cast(event_data->end_time - event_data->start_time); event_data->frames_duration = - std::chrono::duration_cast(dbrow[5] ? FPSeconds(atof(dbrow[5])) : FPSeconds(0.0)); + std::chrono::duration_cast(dbrow[5] ? FPSeconds(atof(dbrow[5])) : FPSeconds(0.0)); event_data->video_file = std::string(dbrow[6]); std::string scheme_str = std::string(dbrow[7]); if ( scheme_str == "Deep" ) { @@ -232,7 +232,7 @@ bool EventStream::loadEventData(uint64_t event_id) { if (event_data->frame_count < event_data->n_frames) { event_data->frame_count = event_data->n_frames; Warning("Event %" PRId64 " has more frames in the Frames table (%d) than in the Event record (%d)", - event_data->event_id, event_data->n_frames, event_data->frame_count); + event_data->event_id, event_data->n_frames, event_data->frame_count); } event_data->frames.clear(); event_data->frames.reserve(event_data->frame_count); @@ -253,20 +253,20 @@ bool EventStream::loadEventData(uint64_t event_id) { int id_diff = id - last_id; Microseconds delta = - std::chrono::duration_cast(id_diff ? (offset - last_offset) / id_diff : (offset - last_offset)); + std::chrono::duration_cast(id_diff ? (offset - last_offset) / id_diff : (offset - last_offset)); Debug(4, "New delta %f from id_diff %d = id %d - last_id %d offset %f - last)_offset %f", - FPSeconds(delta).count(), id_diff, id, last_id, FPSeconds(offset).count(), FPSeconds(last_offset).count()); + FPSeconds(delta).count(), id_diff, id, last_id, FPSeconds(offset).count(), FPSeconds(last_offset).count()); // Fill in data between bulk frames if (id_diff > 1) { for (int i = last_id + 1; i < id; i++) { auto frame = event_data->frames.emplace_back( - i, - last_timestamp + ((i - last_id) * delta), - std::chrono::duration_cast((last_frame->timestamp - event_data->start_time) + delta), - delta, - false - ); + i, + last_timestamp + ((i - last_id) * delta), + std::chrono::duration_cast((last_frame->timestamp - event_data->start_time) + delta), + delta, + false + ); last_frame = &frame; Debug(4, "Frame %d %d timestamp (%f s), offset (%f s) delta (%f s), in_db (%d)", i, frame.id, @@ -291,17 +291,17 @@ bool EventStream::loadEventData(uint64_t event_id) { if (event_data->end_time.time_since_epoch() != Seconds(0)) { Microseconds delta = (last_frame && (last_frame->delta > Microseconds(0))) - ? last_frame->delta - : Microseconds( static_cast(1000000 * base_fps / FPSeconds(event_data->duration).count()) ); + ? last_frame->delta + : Microseconds( static_cast(1000000 * base_fps / FPSeconds(event_data->duration).count()) ); if (!last_frame) { // There were no frames in db auto frame = event_data->frames.emplace_back( - 1, - event_data->start_time, - Microseconds(0), - Microseconds(0), - false - ); + 1, + event_data->start_time, + Microseconds(0), + Microseconds(0), + false + ); last_frame = &frame; last_id ++; last_timestamp = event_data->start_time; @@ -313,19 +313,19 @@ bool EventStream::loadEventData(uint64_t event_id) { last_id ++; auto frame = event_data->frames.emplace_back( - last_id, - last_timestamp, - last_frame->offset + delta, - delta, - false - ); + last_id, + last_timestamp, + last_frame->offset + delta, + delta, + false + ); last_frame = &frame; Debug(3, "Trailing Frame %d timestamp (%f s), offset (%f s), delta(%f s), in_db(%d)", - last_id, - FPSeconds(frame.timestamp.time_since_epoch()).count(), - FPSeconds(frame.offset).count(), - FPSeconds(frame.delta).count(), - frame.in_db); + last_id, + FPSeconds(frame.timestamp.time_since_epoch()).count(), + FPSeconds(frame.offset).count(), + FPSeconds(frame.delta).count(), + frame.in_db); event_data->frame_count ++; } // end while } // end if have endtime @@ -377,258 +377,252 @@ void EventStream::processCommand(const CmdMsg *msg) { Debug(2, "Got message, type %d, msg %d", msg->msg_type, msg->msg_data[0]); // Check for incoming command switch ((MsgCommand)msg->msg_data[0]) { - case CMD_PAUSE : - Debug(1, "Got PAUSE command"); - paused = true; - break; - case CMD_PLAY : - { - std::scoped_lock lck{mutex}; - Debug(1, "Got PLAY command"); - paused = false; + case CMD_PAUSE : + Debug(1, "Got PAUSE command"); + paused = true; + break; + case CMD_PLAY : { + std::scoped_lock lck{mutex}; + Debug(1, "Got PLAY command"); + paused = false; - // If we are in single event mode and at the last frame, replay the current event - if ( - (mode == MODE_SINGLE || mode == MODE_NONE) - && - (curr_frame_id == event_data->last_frame_id) - ) { - Debug(1, "Was in single or no replay mode, and at last frame, so jumping to 1st frame"); - curr_frame_id = 1; - } else { - Debug(1, "mode is %s, current frame is %d, frame count is %d, last frame id is %d", - StreamMode_Strings[(int) mode].c_str(), - curr_frame_id, - event_data->frame_count, - event_data->last_frame_id); - } + // If we are in single event mode and at the last frame, replay the current event + if ( + (mode == MODE_SINGLE || mode == MODE_NONE) + && + (curr_frame_id == event_data->last_frame_id) + ) { + Debug(1, "Was in single or no replay mode, and at last frame, so jumping to 1st frame"); + curr_frame_id = 1; + } else { + Debug(1, "mode is %s, current frame is %d, frame count is %d, last frame id is %d", + StreamMode_Strings[(int) mode].c_str(), + curr_frame_id, + event_data->frame_count, + event_data->last_frame_id); + } - replay_rate = ZM_RATE_BASE; - break; - } - case CMD_VARPLAY : - { - std::scoped_lock lck{mutex}; - Debug(1, "Got VARPLAY command"); - paused = false; - replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; - if (replay_rate > 50 * ZM_RATE_BASE) { - Warning("requested replay rate (%d) is too high. We only support up to 50x", replay_rate); - replay_rate = 50 * ZM_RATE_BASE; - } else if (replay_rate < -50*ZM_RATE_BASE) { - Warning("requested replay rate (%d) is too low. We only support up to -50x", replay_rate); - replay_rate = -50 * ZM_RATE_BASE; - } - break; - } - case CMD_STOP : - Debug(1, "Got STOP command"); - paused = false; - break; - case CMD_FASTFWD : - { - Debug(1, "Got FAST FWD command"); - std::scoped_lock lck{mutex}; - paused = false; - // Set play rate - switch (replay_rate) { - case 2 * ZM_RATE_BASE : - replay_rate = 5 * ZM_RATE_BASE; - break; - case 5 * ZM_RATE_BASE : - replay_rate = 10 * ZM_RATE_BASE; - break; - case 10 * ZM_RATE_BASE : - replay_rate = 25 * ZM_RATE_BASE; - break; - case 25 * ZM_RATE_BASE : - case 50 * ZM_RATE_BASE : - replay_rate = 50 * ZM_RATE_BASE; - break; - default : - Debug(1,"Defaulting replay_rate to 2*ZM_RATE_BASE because it is %d", replay_rate); - replay_rate = 2 * ZM_RATE_BASE; - break; - } - break; - } - case CMD_SLOWFWD : - { - std::scoped_lock lck{mutex}; - paused = true; - replay_rate = ZM_RATE_BASE; - step = 1; - if (curr_frame_id < event_data->last_frame_id) - curr_frame_id += 1; - Debug(1, "Got SLOWFWD command new frame id %d", curr_frame_id); - break; - } - case CMD_SLOWREV : - { - std::scoped_lock lck{mutex}; - paused = true; - replay_rate = ZM_RATE_BASE; - step = -1; - if (curr_frame_id > 1) curr_frame_id -= 1; - Debug(1, "Got SLOWREV command new frame id %d", curr_frame_id); - break; - } - case CMD_FASTREV : - Debug(1, "Got FAST REV command"); - paused = false; - // Set play rate - switch (replay_rate) { - case -1 * ZM_RATE_BASE : - replay_rate = -2 * ZM_RATE_BASE; - break; - case -2 * ZM_RATE_BASE : - replay_rate = -5 * ZM_RATE_BASE; - break; - case -5 * ZM_RATE_BASE : - replay_rate = -10 * ZM_RATE_BASE; - break; - case -10 * ZM_RATE_BASE : - replay_rate = -25 * ZM_RATE_BASE; - break; - case -25 * ZM_RATE_BASE : - case -50 * ZM_RATE_BASE : - replay_rate = -50 * ZM_RATE_BASE; - break; - default : - replay_rate = -1 * ZM_RATE_BASE; - break; - } - break; - case CMD_ZOOMIN : - x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; - y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; - Debug(1, "Got ZOOM IN command, to %d,%d", x, y); - zoom += 10; - send_frame = true; - if (paused) { - step = 1; - send_twice = true; - } - break; - case CMD_ZOOMOUT : - Debug(1, "Got ZOOM OUT command"); - zoom -= 10; - if (zoom < 100) zoom = 100; - send_frame = true; - if (paused) { - step = 1; - send_twice = true; - } - break; - case CMD_ZOOMSTOP : - Debug(1, "Got ZOOM STOP command"); - zoom = 100; - send_frame = true; - if (paused) { - step = 1; - send_twice = true; - } - break; - case CMD_PAN : - x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; - y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; - Debug(1, "Got PAN command, to %d,%d", x, y); - break; - case CMD_SCALE : - scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; - Debug(1, "Got SCALE command, to %d", scale); - break; - case CMD_PREV : - Debug(1, "Got PREV command"); - curr_frame_id = replay_rate >= 0 ? 1 : event_data->last_frame_id+1; - paused = false; - forceEventChange = true; - break; - case CMD_NEXT : - Debug(1, "Got NEXT command"); - curr_frame_id = replay_rate >= 0 ? event_data->last_frame_id+1 : 1; - paused = false; - forceEventChange = true; - break; - case CMD_SEEK : - { - double int_part = ((unsigned char) msg->msg_data[1] << 24) | ((unsigned char) msg->msg_data[2] << 16) - | ((unsigned char) msg->msg_data[3] << 8) | (unsigned char) msg->msg_data[4]; - double dec_part = ((unsigned char) msg->msg_data[5] << 24) | ((unsigned char) msg->msg_data[6] << 16) - | ((unsigned char) msg->msg_data[7] << 8) | (unsigned char) msg->msg_data[8]; + replay_rate = ZM_RATE_BASE; + break; + } + case CMD_VARPLAY : { + std::scoped_lock lck{mutex}; + Debug(1, "Got VARPLAY command"); + paused = false; + replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; + if (replay_rate > 50 * ZM_RATE_BASE) { + Warning("requested replay rate (%d) is too high. We only support up to 50x", replay_rate); + replay_rate = 50 * ZM_RATE_BASE; + } else if (replay_rate < -50*ZM_RATE_BASE) { + Warning("requested replay rate (%d) is too low. We only support up to -50x", replay_rate); + replay_rate = -50 * ZM_RATE_BASE; + } + break; + } + case CMD_STOP : + Debug(1, "Got STOP command"); + paused = false; + break; + case CMD_FASTFWD : { + Debug(1, "Got FAST FWD command"); + std::scoped_lock lck{mutex}; + paused = false; + // Set play rate + switch (replay_rate) { + case 2 * ZM_RATE_BASE : + replay_rate = 5 * ZM_RATE_BASE; + break; + case 5 * ZM_RATE_BASE : + replay_rate = 10 * ZM_RATE_BASE; + break; + case 10 * ZM_RATE_BASE : + replay_rate = 25 * ZM_RATE_BASE; + break; + case 25 * ZM_RATE_BASE : + case 50 * ZM_RATE_BASE : + replay_rate = 50 * ZM_RATE_BASE; + break; + default : + Debug(1,"Defaulting replay_rate to 2*ZM_RATE_BASE because it is %d", replay_rate); + replay_rate = 2 * ZM_RATE_BASE; + break; + } + break; + } + case CMD_SLOWFWD : { + std::scoped_lock lck{mutex}; + paused = true; + replay_rate = ZM_RATE_BASE; + step = 1; + if (curr_frame_id < event_data->last_frame_id) + curr_frame_id += 1; + Debug(1, "Got SLOWFWD command new frame id %d", curr_frame_id); + break; + } + case CMD_SLOWREV : { + std::scoped_lock lck{mutex}; + paused = true; + replay_rate = ZM_RATE_BASE; + step = -1; + if (curr_frame_id > 1) curr_frame_id -= 1; + Debug(1, "Got SLOWREV command new frame id %d", curr_frame_id); + break; + } + case CMD_FASTREV : + Debug(1, "Got FAST REV command"); + paused = false; + // Set play rate + switch (replay_rate) { + case -1 * ZM_RATE_BASE : + replay_rate = -2 * ZM_RATE_BASE; + break; + case -2 * ZM_RATE_BASE : + replay_rate = -5 * ZM_RATE_BASE; + break; + case -5 * ZM_RATE_BASE : + replay_rate = -10 * ZM_RATE_BASE; + break; + case -10 * ZM_RATE_BASE : + replay_rate = -25 * ZM_RATE_BASE; + break; + case -25 * ZM_RATE_BASE : + case -50 * ZM_RATE_BASE : + replay_rate = -50 * ZM_RATE_BASE; + break; + default : + replay_rate = -1 * ZM_RATE_BASE; + break; + } + break; + case CMD_ZOOMIN : + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug(1, "Got ZOOM IN command, to %d,%d", x, y); + zoom += 10; + send_frame = true; + if (paused) { + step = 1; + send_twice = true; + } + break; + case CMD_ZOOMOUT : + Debug(1, "Got ZOOM OUT command"); + zoom -= 10; + if (zoom < 100) zoom = 100; + send_frame = true; + if (paused) { + step = 1; + send_twice = true; + } + break; + case CMD_ZOOMSTOP : + Debug(1, "Got ZOOM STOP command"); + zoom = 100; + send_frame = true; + if (paused) { + step = 1; + send_twice = true; + } + break; + case CMD_PAN : + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug(1, "Got PAN command, to %d,%d", x, y); + break; + case CMD_SCALE : + scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + Debug(1, "Got SCALE command, to %d", scale); + break; + case CMD_PREV : + Debug(1, "Got PREV command"); + curr_frame_id = replay_rate >= 0 ? 1 : event_data->last_frame_id+1; + paused = false; + forceEventChange = true; + break; + case CMD_NEXT : + Debug(1, "Got NEXT command"); + curr_frame_id = replay_rate >= 0 ? event_data->last_frame_id+1 : 1; + paused = false; + forceEventChange = true; + break; + case CMD_SEEK : { + double int_part = ((unsigned char) msg->msg_data[1] << 24) | ((unsigned char) msg->msg_data[2] << 16) + | ((unsigned char) msg->msg_data[3] << 8) | (unsigned char) msg->msg_data[4]; + double dec_part = ((unsigned char) msg->msg_data[5] << 24) | ((unsigned char) msg->msg_data[6] << 16) + | ((unsigned char) msg->msg_data[7] << 8) | (unsigned char) msg->msg_data[8]; - FPSeconds offset = FPSeconds(int_part + dec_part / 1000000.0); - if (offset < Seconds(0)) { - Warning("Invalid offset, not seeking"); - break; - } else if (offset > event_data->duration) { - Warning("Invalid offset past end of event, seeking to end"); - offset = event_data->duration; - } + FPSeconds offset = FPSeconds(int_part + dec_part / 1000000.0); + if (offset < Seconds(0)) { + Warning("Invalid offset, not seeking"); + break; + } else if (offset > event_data->duration) { + Warning("Invalid offset past end of event, seeking to end"); + offset = event_data->duration; + } - std::scoped_lock lck{mutex}; - // This should get us close, but not all frames will have the same duration - curr_frame_id = (int) (event_data->frame_count * offset / event_data->duration) + 1; - if (curr_frame_id < 1) { - Debug(1, "curr_frame_id = %d, so setting to 1", curr_frame_id); - curr_frame_id = 1; - } else if (curr_frame_id > event_data->last_frame_id) { - curr_frame_id = event_data->last_frame_id; - } + std::scoped_lock lck{mutex}; + // This should get us close, but not all frames will have the same duration + curr_frame_id = (int) (event_data->frame_count * offset / event_data->duration) + 1; + if (curr_frame_id < 1) { + Debug(1, "curr_frame_id = %d, so setting to 1", curr_frame_id); + curr_frame_id = 1; + } else if (curr_frame_id > event_data->last_frame_id) { + curr_frame_id = event_data->last_frame_id; + } - // TODO Replace this with a binary search - if (event_data->frames[curr_frame_id - 1].offset > offset) { - Debug(1, "Searching for frame at %.6f, offset of frame %d is %.6f", + // TODO Replace this with a binary search + if (event_data->frames[curr_frame_id - 1].offset > offset) { + Debug(1, "Searching for frame at %.6f, offset of frame %d is %.6f", + FPSeconds(offset).count(), + curr_frame_id, + FPSeconds(event_data->frames[curr_frame_id - 1].offset).count() + ); + while ((curr_frame_id--) && (event_data->frames[curr_frame_id - 1].offset > offset)) { + Debug(1, "Searching for frame at %.6f, offset of frame %d is %.6f", FPSeconds(offset).count(), curr_frame_id, FPSeconds(event_data->frames[curr_frame_id - 1].offset).count() - ); - while ((curr_frame_id--) && (event_data->frames[curr_frame_id - 1].offset > offset)) { - Debug(1, "Searching for frame at %.6f, offset of frame %d is %.6f", - FPSeconds(offset).count(), - curr_frame_id, - FPSeconds(event_data->frames[curr_frame_id - 1].offset).count() - ); - } - } else if (event_data->frames[curr_frame_id - 1].offset < offset) { - while ((curr_frame_id++ < event_data->last_frame_id) && (event_data->frames[curr_frame_id - 1].offset < offset)) { - Debug(1, "Searching for frame at %.6f, offset of frame %d is %.6f", - FPSeconds(offset).count(), - curr_frame_id, - FPSeconds(event_data->frames[curr_frame_id - 1].offset).count() - ); - } - curr_frame_id--; - } - - if (curr_frame_id < 1) { - Debug(1, "curr_frame_id = %d, so setting to 1", curr_frame_id); - curr_frame_id = 1; - } else if (curr_frame_id > event_data->last_frame_id) { - curr_frame_id = event_data->last_frame_id; - } - - curr_stream_time = event_data->frames[curr_frame_id-1].timestamp; - Debug(1, "Got SEEK command, to %f s (new current frame id: %d offset %f s)", + ); + } + } else if (event_data->frames[curr_frame_id - 1].offset < offset) { + while ((curr_frame_id++ < event_data->last_frame_id) && (event_data->frames[curr_frame_id - 1].offset < offset)) { + Debug(1, "Searching for frame at %.6f, offset of frame %d is %.6f", FPSeconds(offset).count(), curr_frame_id, - FPSeconds(event_data->frames[curr_frame_id - 1].offset).count()); - if (paused) { - step = 1; // if we are paused, we won't send a frame except a keepalive. - send_twice = true; - } - send_frame = true; - break; + FPSeconds(event_data->frames[curr_frame_id - 1].offset).count() + ); } - case CMD_QUERY : - Debug(1, "Got QUERY command, sending STATUS"); - break; - case CMD_QUIT : - Info("User initiated exit - CMD_QUIT"); - break; - default : - // Do nothing, for now - break; + curr_frame_id--; + } + + if (curr_frame_id < 1) { + Debug(1, "curr_frame_id = %d, so setting to 1", curr_frame_id); + curr_frame_id = 1; + } else if (curr_frame_id > event_data->last_frame_id) { + curr_frame_id = event_data->last_frame_id; + } + + curr_stream_time = event_data->frames[curr_frame_id-1].timestamp; + Debug(1, "Got SEEK command, to %f s (new current frame id: %d offset %f s)", + FPSeconds(offset).count(), + curr_frame_id, + FPSeconds(event_data->frames[curr_frame_id - 1].offset).count()); + if (paused) { + step = 1; // if we are paused, we won't send a frame except a keepalive. + send_twice = true; + } + send_frame = true; + break; + } + case CMD_QUERY : + Debug(1, "Got QUERY command, sending STATUS"); + break; + case CMD_QUIT : + Info("User initiated exit - CMD_QUIT"); + break; + default : + // Do nothing, for now + break; } @@ -657,14 +651,14 @@ void EventStream::processCommand(const CmdMsg *msg) { status_data.scale = scale; status_data.paused = paused; Debug(2, "Event:%" PRIu64 ", Duration %f, Paused:%d, progress:%f Rate:%d, Zoom:%d Scale:%d", - status_data.event_id, - FPSeconds(status_data.duration).count(), - status_data.paused, - FPSeconds(status_data.progress).count(), - status_data.rate, - status_data.zoom, - status_data.scale - ); + status_data.event_id, + FPSeconds(status_data.duration).count(), + status_data.paused, + FPSeconds(status_data.progress).count(), + status_data.rate, + status_data.zoom, + status_data.scale + ); double fps = 1.0; if ((event_data->frame_count and event_data->duration != Seconds(0))) { fps = static_cast(event_data->frame_count) / FPSeconds(event_data->duration).count(); @@ -695,8 +689,8 @@ bool EventStream::checkEventLoaded() { if (curr_frame_id <= 0) { sql = stringtf( - "SELECT `Id` FROM `Events` WHERE `MonitorId` = %d AND `Id` < %" PRIu64 " ORDER BY `Id` DESC LIMIT 1", - event_data->monitor_id, event_data->event_id); + "SELECT `Id` FROM `Events` WHERE `MonitorId` = %d AND `Id` < %" PRIu64 " ORDER BY `Id` DESC LIMIT 1", + event_data->monitor_id, event_data->event_id); } else if (curr_frame_id > event_data->last_frame_id) { if (event_data->end_time.time_since_epoch() == Seconds(0)) { // We are viewing an in-process event, so just reload it. @@ -706,12 +700,12 @@ bool EventStream::checkEventLoaded() { return false; } sql = stringtf( - "SELECT `Id` FROM `Events` WHERE `MonitorId` = %d AND `Id` > %" PRIu64 " ORDER BY `Id` ASC LIMIT 1", - event_data->monitor_id, event_data->event_id); + "SELECT `Id` FROM `Events` WHERE `MonitorId` = %d AND `Id` > %" PRIu64 " ORDER BY `Id` ASC LIMIT 1", + event_data->monitor_id, event_data->event_id); } else { // No event change required Debug(4, "No event change required, as curr frame %d <=> event frames %d", - curr_frame_id, event_data->frame_count); + curr_frame_id, event_data->frame_count); return false; } @@ -798,7 +792,7 @@ bool EventStream::sendFrame(Microseconds delta_us) { if ( !vid_stream ) { vid_stream = new VideoStream("pipe:", format, bitrate, effective_fps, - send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height()); + send_image->Colours(), send_image->SubpixelOrder(), send_image->Width(), send_image->Height()); fprintf(stdout, "Content-type: %s\r\n\r\n", vid_stream->MimeType()); vid_stream->OpenStream(); } @@ -824,8 +818,8 @@ bool EventStream::sendFrame(Microseconds delta_us) { // Get the frame from the mp4 input const FrameData *frame_data = &event_data->frames[curr_frame_id-1]; AVFrame *frame = ffmpeg_input->get_frame( - ffmpeg_input->get_video_stream_id(), - FPSeconds(frame_data->offset).count()); + ffmpeg_input->get_video_stream_id(), + FPSeconds(frame_data->offset).count()); if (frame) { image = new Image(frame, monitor->Width(), monitor->Height()); } else { @@ -836,26 +830,26 @@ bool EventStream::sendFrame(Microseconds delta_us) { // when stored as an mp4, we just have the rotation as a flag in the headers // so we need to rotate it before outputting if ( - (monitor->GetOptVideoWriter() == Monitor::PASSTHROUGH) - and - (event_data->Orientation != Monitor::ROTATE_0) - ) { + (monitor->GetOptVideoWriter() == Monitor::PASSTHROUGH) + and + (event_data->Orientation != Monitor::ROTATE_0) + ) { Debug(2, "Rotating image %d", event_data->Orientation); switch ( event_data->Orientation ) { - case Monitor::ROTATE_0 : - // No action required - break; - case Monitor::ROTATE_90 : - case Monitor::ROTATE_180 : - case Monitor::ROTATE_270 : - image->Rotate((event_data->Orientation-1)*90); - break; - case Monitor::FLIP_HORI : - case Monitor::FLIP_VERT : - image->Flip(event_data->Orientation==Monitor::FLIP_HORI); - break; - default: - Error("Invalid Orientation: %d", event_data->Orientation); + case Monitor::ROTATE_0 : + // No action required + break; + case Monitor::ROTATE_90 : + case Monitor::ROTATE_180 : + case Monitor::ROTATE_270 : + image->Rotate((event_data->Orientation-1)*90); + break; + case Monitor::FLIP_HORI : + case Monitor::FLIP_VERT : + image->Flip(event_data->Orientation==Monitor::FLIP_HORI); + break; + default: + Error("Invalid Orientation: %d", event_data->Orientation); } } else { Debug(2, "Not Rotating image %d", event_data->Orientation); @@ -872,24 +866,24 @@ bool EventStream::sendFrame(Microseconds delta_us) { fprintf(stdout, "--" BOUNDARY "\r\n"); switch ( type ) { - case STREAM_JPEG : - send_image->EncodeJpeg(img_buffer, &img_buffer_size); - fputs("Content-Type: image/jpeg\r\n", stdout); - break; - case STREAM_ZIP : - unsigned long zip_buffer_size; - send_image->Zip(img_buffer, &zip_buffer_size); - img_buffer_size = zip_buffer_size; - fputs("Content-Type: image/x-rgbz\r\n", stdout); - break; - case STREAM_RAW : - img_buffer = send_image->Buffer(); - img_buffer_size = send_image->Size(); - fputs("Content-Type: image/x-rgb\r\n", stdout); - break; - default: - Fatal("Unexpected frame type %d", type); - break; + case STREAM_JPEG : + send_image->EncodeJpeg(img_buffer, &img_buffer_size); + fputs("Content-Type: image/jpeg\r\n", stdout); + break; + case STREAM_ZIP : + unsigned long zip_buffer_size; + send_image->Zip(img_buffer, &zip_buffer_size); + img_buffer_size = zip_buffer_size; + fputs("Content-Type: image/x-rgbz\r\n", stdout); + break; + case STREAM_RAW : + img_buffer = send_image->Buffer(); + img_buffer_size = send_image->Size(); + fputs("Content-Type: image/x-rgb\r\n", stdout); + break; + default: + Fatal("Unexpected frame type %d", type); + break; } int rc = send_buffer(img_buffer, img_buffer_size); delete image; @@ -932,7 +926,7 @@ void EventStream::runStream() { command_processor = std::thread(&EventStream::checkCommandQueue, this); } - // Has to go here, at the moment, for sendFrame(delta). + // Has to go here, at the moment, for sendFrame(delta). Microseconds delta = Microseconds(0); while (!zm_terminate) { @@ -951,7 +945,7 @@ void EventStream::runStream() { // so if it is 2, then we send every other frame, if is it 4 then every fourth frame, etc. //if ( (frame_mod == 1) || (((curr_frame_id-1)%frame_mod) == 0) ) { - send_frame = true; + send_frame = true; //} } else if (step != 0) { Debug(2, "Paused with step %d", step); @@ -975,8 +969,8 @@ void EventStream::runStream() { char frame_text[64]; snprintf(frame_text, sizeof(frame_text), "Time to %s event = %f s", - (replay_rate > 0 ? "next" : "previous"), - FPSeconds(time_to_event).count()); + (replay_rate > 0 ? "next" : "previous"), + FPSeconds(time_to_event).count()); if (!sendTextFrame(frame_text)) { zm_terminate = true; @@ -987,7 +981,7 @@ void EventStream::runStream() { // FIXME ICON But we are not paused. We are somehow still in the event? Milliseconds sleep_time = std::chrono::duration_cast( - (replay_rate > 0 ? 1 : -1) * ((1.0L * replay_rate * STREAM_PAUSE_WAIT) / ZM_RATE_BASE)); + (replay_rate > 0 ? 1 : -1) * ((1.0L * replay_rate * STREAM_PAUSE_WAIT) / ZM_RATE_BASE)); if (sleep_time == Seconds(0)) { sleep_time += STREAM_PAUSE_WAIT; } @@ -995,8 +989,8 @@ void EventStream::runStream() { curr_stream_time += sleep_time; time_to_event -= sleep_time; Debug(2, "Sleeping (%" PRIi64 " ms) because we are not at the next event yet, adding %" PRIi64 " ms", - static_cast(Milliseconds(STREAM_PAUSE_WAIT).count()), - static_cast(Milliseconds(sleep_time).count())); + static_cast(Milliseconds(STREAM_PAUSE_WAIT).count()), + static_cast(Milliseconds(sleep_time).count())); std::this_thread::sleep_for(STREAM_PAUSE_WAIT); continue; @@ -1026,7 +1020,7 @@ void EventStream::runStream() { // we incremented by replay_rate, so might have jumped past frame_count if ((mode == MODE_SINGLE) && ( (curr_frame_id < 1 ) || (curr_frame_id >= event_data->frame_count) - ) + ) ) { Debug(2, "Have mode==MODE_SINGLE and at end of event, looping back to start"); curr_frame_id = 1; @@ -1035,11 +1029,11 @@ void EventStream::runStream() { if (curr_frame_id <= event_data->frame_count) { const FrameData *next_frame_data = &event_data->frames[curr_frame_id-1]; Debug(3, "Have Frame %d %d timestamp (%f s), offset (%f s) delta (%f s), in_db (%d)", - curr_frame_id, next_frame_data->id, - FPSeconds(next_frame_data->timestamp.time_since_epoch()).count(), - FPSeconds(next_frame_data->offset).count(), - FPSeconds(next_frame_data->delta).count(), - next_frame_data->in_db); + curr_frame_id, next_frame_data->id, + FPSeconds(next_frame_data->timestamp.time_since_epoch()).count(), + FPSeconds(next_frame_data->offset).count(), + FPSeconds(next_frame_data->delta).count(), + next_frame_data->in_db); // frame_data->delta is the time since last frame as a float in seconds // but what if we are skipping frames? We need the distance from the last frame sent @@ -1047,34 +1041,34 @@ void EventStream::runStream() { delta = abs(next_frame_data->offset - last_frame_data->offset); Debug(2, "New delta: %fs from last frame offset %fs - next_frame_offset %fs", - FPSeconds(delta).count(), - FPSeconds(last_frame_data->offset).count(), - FPSeconds(next_frame_data->offset).count()); + FPSeconds(delta).count(), + FPSeconds(last_frame_data->offset).count(), + FPSeconds(next_frame_data->offset).count()); // if effective > base we should speed up frame delivery if (base_fps < effective_fps) { delta = std::chrono::duration_cast((delta * base_fps) / effective_fps); Debug(3, "delta %" PRIi64 " us = base_fps (%f) / effective_fps (%f)", - static_cast(std::chrono::duration_cast(delta).count()), - base_fps, - effective_fps); + static_cast(std::chrono::duration_cast(delta).count()), + base_fps, + effective_fps); // but must not exceed maxfps delta = std::max(delta, Microseconds(lround(Microseconds::period::den / maxfps))); Debug(3, "delta %" PRIi64 " us = base_fps (%f) / effective_fps (%f) from 30fps", - static_cast(std::chrono::duration_cast(delta).count()), - base_fps, - effective_fps); + static_cast(std::chrono::duration_cast(delta).count()), + base_fps, + effective_fps); } now = std::chrono::steady_clock::now(); TimePoint::duration elapsed = now - start; delta -= std::chrono::duration_cast(elapsed); // sending frames takes time, so remove it from the sleep time Debug(2, "New delta: %fs from last frame offset %fs - next_frame_offset %fs - elapsed %fs", - FPSeconds(delta).count(), - FPSeconds(last_frame_data->offset).count(), - FPSeconds(next_frame_data->offset).count(), - FPSeconds(elapsed).count() - ); + FPSeconds(delta).count(), + FPSeconds(last_frame_data->offset).count(), + FPSeconds(next_frame_data->offset).count(), + FPSeconds(elapsed).count() + ); } // end if not at end of event } else { // Paused @@ -1091,8 +1085,8 @@ void EventStream::runStream() { if (delta > Seconds(0)) { if (delta > MAX_SLEEP) { Debug(1, "Limiting sleep to %" PRIi64 " ms because calculated sleep is too long %" PRIi64, - static_cast(std::chrono::duration_cast(MAX_SLEEP).count()), - static_cast(std::chrono::duration_cast(delta).count())); + static_cast(std::chrono::duration_cast(MAX_SLEEP).count()), + static_cast(std::chrono::duration_cast(delta).count())); delta = MAX_SLEEP; } @@ -1112,18 +1106,18 @@ void EventStream::runStream() { // This doesn't make sense unless we have hit the end of the event. time_to_event = event_data->frames[0].timestamp - curr_stream_time; Debug(1, "replay rate (%d) time_to_event (%f s) = frame timestamp (%f s) - curr_stream_time (%f s)", - replay_rate, - FPSeconds(time_to_event).count(), - FPSeconds(event_data->frames[0].timestamp.time_since_epoch()).count(), - FPSeconds(curr_stream_time.time_since_epoch()).count()); + replay_rate, + FPSeconds(time_to_event).count(), + FPSeconds(event_data->frames[0].timestamp.time_since_epoch()).count(), + FPSeconds(curr_stream_time.time_since_epoch()).count()); } else if (replay_rate < 0) { time_to_event = curr_stream_time - event_data->frames[event_data->frame_count-1].timestamp; Debug(1, "replay rate (%d), time_to_event(%f s) = curr_stream_time (%f s) - frame timestamp (%f s)", - replay_rate, - FPSeconds(time_to_event).count(), - FPSeconds(curr_stream_time.time_since_epoch()).count(), - FPSeconds(event_data->frames[event_data->frame_count - 1].timestamp.time_since_epoch()).count()); + replay_rate, + FPSeconds(time_to_event).count(), + FPSeconds(curr_stream_time.time_since_epoch()).count(), + FPSeconds(event_data->frames[event_data->frame_count - 1].timestamp.time_since_epoch()).count()); } // end if forward or reverse } // end if checkEventLoaded } // end scope for lock @@ -1173,7 +1167,7 @@ bool EventStream::send_file(const std::string &filepath) { if (rc < 0) break; if (rc > 0) { remaining -= rc; - } + } } // end while remaining if (!remaining) { @@ -1182,7 +1176,7 @@ bool EventStream::send_file(const std::string &filepath) { return true; } Warning("Unable to send raw frame %d: %s %zu remaining", - curr_frame_id, strerror(errno), remaining); + curr_frame_id, strerror(errno), remaining); return false; } // end bool EventStream::send_file(const std::string &filepath) @@ -1201,8 +1195,8 @@ bool EventStream::send_buffer(uint8_t* buffer, int size) { } // end bool EventStream::send_buffer(uint8_t* buffer, int size) void EventStream::setStreamStart( - uint64_t init_event_id, - int init_frame_id=0) { + uint64_t init_event_id, + int init_frame_id=0) { loadInitialEventData(init_event_id, init_frame_id); } // end void EventStream::setStreamStart(init_event_id,init_frame_id=0) diff --git a/src/zm_eventstream.h b/src/zm_eventstream.h index 00f11441f..d85a12db5 100644 --- a/src/zm_eventstream.h +++ b/src/zm_eventstream.h @@ -1,21 +1,21 @@ // // ZoneMinder Core Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_EVENTSTREAM_H #define ZM_EVENTSTREAM_H @@ -35,98 +35,97 @@ extern "C" { #include class EventStream : public StreamBase { - public: - typedef enum { MODE_NONE, MODE_SINGLE, MODE_ALL, MODE_ALL_GAPLESS } StreamMode; - static const std::string StreamMode_Strings[4]; + public: + typedef enum { MODE_NONE, MODE_SINGLE, MODE_ALL, MODE_ALL_GAPLESS } StreamMode; + static const std::string StreamMode_Strings[4]; - protected: - struct FrameData { - unsigned int id; - SystemTimePoint timestamp; - Microseconds offset; // distance from event->starttime - Microseconds delta; // distance from last frame - bool in_db; - public: - FrameData(unsigned int p_id, SystemTimePoint p_timestamp, Microseconds p_offset, Microseconds p_delta, bool p_in_db) : - id(p_id), - timestamp(p_timestamp), - offset(p_offset), - delta(p_delta), - in_db(p_in_db) - { - } - }; - - struct EventData { - uint64_t event_id; - unsigned int monitor_id; - unsigned int storage_id; - int frame_count; // Value of Frames column in Event - int last_frame_id; // Highest frame id known about. Can be < frame_count in incomplete events - SystemTimePoint start_time; - SystemTimePoint end_time; - Microseconds duration; - Microseconds frames_duration; - std::string path; - int n_frames; // # of frame rows returned from database - std::vector frames; - std::string video_file; - Storage::Schemes scheme; - int SaveJPEGs; - Monitor::Orientation Orientation; - }; - - protected: - static constexpr Milliseconds STREAM_PAUSE_WAIT = Milliseconds(250); - - static const StreamMode DEFAULT_MODE = MODE_SINGLE; - - StreamMode mode; - bool forceEventChange; - - std::mutex mutex; - int curr_frame_id; - SystemTimePoint curr_stream_time; - bool send_frame; - TimePoint start; // clock time when started the event - - EventData *event_data; - - protected: - bool loadEventData(uint64_t event_id); - bool loadInitialEventData(uint64_t init_event_id, int init_frame_id); - bool loadInitialEventData(int monitor_id, SystemTimePoint event_time); - - bool checkEventLoaded(); - void processCommand(const CmdMsg *msg) override; - bool sendFrame(Microseconds delta); - - public: - EventStream() : - mode(DEFAULT_MODE), - forceEventChange(false), - curr_frame_id(0), - send_frame(false), - event_data(nullptr), - storage(nullptr), - ffmpeg_input(nullptr) - {} - - ~EventStream() { - delete event_data; - delete storage; - delete ffmpeg_input; + protected: + struct FrameData { + unsigned int id; + SystemTimePoint timestamp; + Microseconds offset; // distance from event->starttime + Microseconds delta; // distance from last frame + bool in_db; + public: + FrameData(unsigned int p_id, SystemTimePoint p_timestamp, Microseconds p_offset, Microseconds p_delta, bool p_in_db) : + id(p_id), + timestamp(p_timestamp), + offset(p_offset), + delta(p_delta), + in_db(p_in_db) { } - void setStreamStart(uint64_t init_event_id, int init_frame_id); - void setStreamStart(int monitor_id, time_t event_time); - void setStreamMode(StreamMode p_mode) { mode = p_mode; } - void runStream() override; - Image *getImage(); - private: - bool send_file(const std::string &filepath); - bool send_buffer(uint8_t * buffer, int size); - Storage *storage; - FFmpeg_Input *ffmpeg_input; + }; + + struct EventData { + uint64_t event_id; + unsigned int monitor_id; + unsigned int storage_id; + int frame_count; // Value of Frames column in Event + int last_frame_id; // Highest frame id known about. Can be < frame_count in incomplete events + SystemTimePoint start_time; + SystemTimePoint end_time; + Microseconds duration; + Microseconds frames_duration; + std::string path; + int n_frames; // # of frame rows returned from database + std::vector frames; + std::string video_file; + Storage::Schemes scheme; + int SaveJPEGs; + Monitor::Orientation Orientation; + }; + + protected: + static constexpr Milliseconds STREAM_PAUSE_WAIT = Milliseconds(250); + + static const StreamMode DEFAULT_MODE = MODE_SINGLE; + + StreamMode mode; + bool forceEventChange; + + std::mutex mutex; + int curr_frame_id; + SystemTimePoint curr_stream_time; + bool send_frame; + TimePoint start; // clock time when started the event + + EventData *event_data; + + protected: + bool loadEventData(uint64_t event_id); + bool loadInitialEventData(uint64_t init_event_id, int init_frame_id); + bool loadInitialEventData(int monitor_id, SystemTimePoint event_time); + + bool checkEventLoaded(); + void processCommand(const CmdMsg *msg) override; + bool sendFrame(Microseconds delta); + + public: + EventStream() : + mode(DEFAULT_MODE), + forceEventChange(false), + curr_frame_id(0), + send_frame(false), + event_data(nullptr), + storage(nullptr), + ffmpeg_input(nullptr) + {} + + ~EventStream() { + delete event_data; + delete storage; + delete ffmpeg_input; + } + void setStreamStart(uint64_t init_event_id, int init_frame_id); + void setStreamStart(int monitor_id, time_t event_time); + void setStreamMode(StreamMode p_mode) { mode = p_mode; } + void runStream() override; + Image *getImage(); + private: + bool send_file(const std::string &filepath); + bool send_buffer(uint8_t * buffer, int size); + Storage *storage; + FFmpeg_Input *ffmpeg_input; }; #endif // ZM_EVENTSTREAM_H diff --git a/src/zm_exception.cpp b/src/zm_exception.cpp index 993a56866..addb194b1 100644 --- a/src/zm_exception.cpp +++ b/src/zm_exception.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Exception Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_exception.h" diff --git a/src/zm_exception.h b/src/zm_exception.h index 1bceeed8a..64e381f5e 100644 --- a/src/zm_exception.h +++ b/src/zm_exception.h @@ -1,21 +1,21 @@ // // ZoneMinder Exception Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_EXCEPTION_H #define ZM_EXCEPTION_H @@ -23,18 +23,17 @@ #include class Exception { -protected: + protected: typedef enum { INFO, WARNING, ERROR, FATAL } Severity; -protected: + protected: std::string mMessage; Severity mSeverity; -public: + public: explicit Exception(const std::string &message, const Severity severity=ERROR) : mMessage(message), - mSeverity(severity) - { + mSeverity(severity) { } const std::string &getMessage() const { diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp index 58effa2f5..f9f2a1919 100644 --- a/src/zm_ffmpeg.cpp +++ b/src/zm_ffmpeg.cpp @@ -1,21 +1,21 @@ /* * ZoneMinder FFMPEG implementation, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #include "zm_ffmpeg.h" @@ -79,7 +79,7 @@ void FFMPEGInit() { if (!bInit) { if (logDebugging() && config.log_ffmpeg) { av_log_set_level(AV_LOG_DEBUG); - av_log_set_callback(log_libav_callback); + av_log_set_callback(log_libav_callback); Info("Enabling ffmpeg logs, as LOG_DEBUG+LOG_FFMPEG are enabled in options"); } else { Debug(1,"Not enabling ffmpeg logs, as LOG_FFMPEG and/or LOG_DEBUG is disabled in options, or this monitor is not part of your debug targets"); @@ -104,44 +104,44 @@ enum _AVPIXELFORMAT GetFFMPEGPixelFormat(unsigned int p_colours, unsigned p_subp Debug(8,"Colours: %d SubpixelOrder: %d",p_colours,p_subpixelorder); switch (p_colours) { - case ZM_COLOUR_RGB24: - if(p_subpixelorder == ZM_SUBPIX_ORDER_BGR) { - /* BGR subpixel order */ - pf = AV_PIX_FMT_BGR24; - } else { - /* Assume RGB subpixel order */ - pf = AV_PIX_FMT_RGB24; - } - break; - case ZM_COLOUR_RGB32: - if (p_subpixelorder == ZM_SUBPIX_ORDER_ARGB) { - /* ARGB subpixel order */ - pf = AV_PIX_FMT_ARGB; - } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ABGR) { - /* ABGR subpixel order */ - pf = AV_PIX_FMT_ABGR; - } else if (p_subpixelorder == ZM_SUBPIX_ORDER_BGRA) { - /* BGRA subpixel order */ - pf = AV_PIX_FMT_BGRA; - } else { - /* Assume RGBA subpixel order */ - pf = AV_PIX_FMT_RGBA; - } - break; - case ZM_COLOUR_GRAY8: - pf = AV_PIX_FMT_GRAY8; - break; - default: - Panic("Unexpected colours: %d", p_colours); - pf = AV_PIX_FMT_GRAY8; /* Just to shush gcc variable may be unused warning */ - break; + case ZM_COLOUR_RGB24: + if(p_subpixelorder == ZM_SUBPIX_ORDER_BGR) { + /* BGR subpixel order */ + pf = AV_PIX_FMT_BGR24; + } else { + /* Assume RGB subpixel order */ + pf = AV_PIX_FMT_RGB24; + } + break; + case ZM_COLOUR_RGB32: + if (p_subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + /* ARGB subpixel order */ + pf = AV_PIX_FMT_ARGB; + } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + /* ABGR subpixel order */ + pf = AV_PIX_FMT_ABGR; + } else if (p_subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* BGRA subpixel order */ + pf = AV_PIX_FMT_BGRA; + } else { + /* Assume RGBA subpixel order */ + pf = AV_PIX_FMT_RGBA; + } + break; + case ZM_COLOUR_GRAY8: + pf = AV_PIX_FMT_GRAY8; + break; + default: + Panic("Unexpected colours: %d", p_colours); + pf = AV_PIX_FMT_GRAY8; /* Just to shush gcc variable may be unused warning */ + break; } return pf; } #if LIBAVUTIL_VERSION_CHECK(56, 0, 0, 17, 100) -int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb){ +int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb) { int64_t a, b, this_thing; av_assert0(in_ts != AV_NOPTS_VALUE); @@ -180,65 +180,65 @@ static void zm_log_fps(double d, const char *postfix) { void zm_dump_codecpar(const AVCodecParameters *par) { Debug(1, "Dumping codecpar codec_type %d %s codec_id %d %s codec_tag %" PRIu32 - " width %d height %d bit_rate%" PRIu64 " bpcs %d bprs %d format%d %s" - " extradata:%d:%s profile %d level %d field order %d color_range %d" - " color_primaries %d color_trc %d color_space %d location %d video_delay %d", - static_cast(par->codec_type), - av_get_media_type_string(par->codec_type), - static_cast(par->codec_id), - avcodec_get_name(par->codec_id), - par->codec_tag, - par->width, - par->height, - par->bit_rate, - par->bits_per_coded_sample, - par->bits_per_raw_sample, - par->format, - (((AVPixelFormat)par->format == AV_PIX_FMT_NONE) ? "none" : av_get_pix_fmt_name((AVPixelFormat)par->format)), - par->extradata_size, ByteArrayToHexString(nonstd::span{ - par->extradata, - static_cast::size_type>(par->extradata_size) - }).c_str(), - par->profile, - par->level, - static_cast(par->field_order), - static_cast(par->color_range), - static_cast(par->color_primaries), - static_cast(par->color_trc), - static_cast(par->color_space), - static_cast(par->chroma_location), - static_cast(par->video_delay) - ); + " width %d height %d bit_rate%" PRIu64 " bpcs %d bprs %d format%d %s" + " extradata:%d:%s profile %d level %d field order %d color_range %d" + " color_primaries %d color_trc %d color_space %d location %d video_delay %d", + static_cast(par->codec_type), + av_get_media_type_string(par->codec_type), + static_cast(par->codec_id), + avcodec_get_name(par->codec_id), + par->codec_tag, + par->width, + par->height, + par->bit_rate, + par->bits_per_coded_sample, + par->bits_per_raw_sample, + par->format, + (((AVPixelFormat)par->format == AV_PIX_FMT_NONE) ? "none" : av_get_pix_fmt_name((AVPixelFormat)par->format)), + par->extradata_size, ByteArrayToHexString(nonstd::span { + par->extradata, + static_cast::size_type>(par->extradata_size) + }).c_str(), + par->profile, + par->level, + static_cast(par->field_order), + static_cast(par->color_range), + static_cast(par->color_primaries), + static_cast(par->color_trc), + static_cast(par->color_space), + static_cast(par->chroma_location), + static_cast(par->video_delay) + ); } void zm_dump_codec(const AVCodecContext *codec) { Debug(1, "Dumping codec_context codec_type %d %s codec_id %d %s width %d height %d timebase %d/%d format %s profile %d level %d " - "gop_size %d has_b_frames %d max_b_frames %d me_cmp %d me_range %d qmin %d qmax %d bit_rate %" PRId64 " extradata:%d:%s", - codec->codec_type, - av_get_media_type_string(codec->codec_type), - codec->codec_id, - avcodec_get_name(codec->codec_id), - codec->width, - codec->height, - codec->time_base.num, - codec->time_base.den, - (codec->pix_fmt == AV_PIX_FMT_NONE ? "none" : av_get_pix_fmt_name(codec->pix_fmt)), - codec->profile, - codec->level, - codec->gop_size, - codec->has_b_frames, - codec->max_b_frames, - codec->me_cmp, - codec->me_range, - codec->qmin, - codec->qmax, - codec->bit_rate, - codec->extradata_size, - ByteArrayToHexString(nonstd::span{ - codec->extradata, - static_cast::size_type>(codec->extradata_size) - }).c_str() - ); + "gop_size %d has_b_frames %d max_b_frames %d me_cmp %d me_range %d qmin %d qmax %d bit_rate %" PRId64 " extradata:%d:%s", + codec->codec_type, + av_get_media_type_string(codec->codec_type), + codec->codec_id, + avcodec_get_name(codec->codec_id), + codec->width, + codec->height, + codec->time_base.num, + codec->time_base.den, + (codec->pix_fmt == AV_PIX_FMT_NONE ? "none" : av_get_pix_fmt_name(codec->pix_fmt)), + codec->profile, + codec->level, + codec->gop_size, + codec->has_b_frames, + codec->max_b_frames, + codec->me_cmp, + codec->me_range, + codec->qmin, + codec->qmax, + codec->bit_rate, + codec->extradata_size, + ByteArrayToHexString(nonstd::span { + codec->extradata, + static_cast::size_type>(codec->extradata_size) + }).c_str() + ); } /* "user interface" functions */ @@ -258,30 +258,30 @@ void zm_dump_stream_format(AVFormatContext *ic, int i, int index, int is_output) if (lang) Debug(1, "language (%s)", lang->value); Debug(1, "frame_size:%d stream timebase: %d/%d", - codec->frame_size, - st->time_base.num, st->time_base.den - ); + codec->frame_size, + st->time_base.num, st->time_base.den + ); Debug(1, "codec: %s %s", - avcodec_get_name(st->codecpar->codec_id), - av_get_media_type_string(st->codecpar->codec_type) - ); + avcodec_get_name(st->codecpar->codec_id), + av_get_media_type_string(st->codecpar->codec_type) + ); if (st->sample_aspect_ratio.num && // default av_cmp_q(st->sample_aspect_ratio, codec->sample_aspect_ratio) - ) { + ) { AVRational display_aspect_ratio; av_reduce(&display_aspect_ratio.num, - &display_aspect_ratio.den, - codec->width * (int64_t)st->sample_aspect_ratio.num, - codec->height * (int64_t)st->sample_aspect_ratio.den, - 1024 * 1024); + &display_aspect_ratio.den, + codec->width * (int64_t)st->sample_aspect_ratio.num, + codec->height * (int64_t)st->sample_aspect_ratio.den, + 1024 * 1024); Debug(1, ", SAR %d:%d DAR %d:%d", - st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, - display_aspect_ratio.num, display_aspect_ratio.den); + st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, + display_aspect_ratio.num, display_aspect_ratio.den); } else { Debug(1, ", SAR %d:%d ", - st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); + st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); } if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { @@ -295,10 +295,10 @@ void zm_dump_stream_format(AVFormatContext *ic, int i, int index, int is_output) } else if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { #if LIBAVUTIL_VERSION_CHECK(57, 28, 100, 28, 0) Debug(1, "profile %d channels %d sample_rate %d", - codec->profile, codec->ch_layout.nb_channels, codec->sample_rate); + codec->profile, codec->ch_layout.nb_channels, codec->sample_rate); #else Debug(1, "profile %d channels %d sample_rate %d", - codec->profile, codec->channels, codec->sample_rate); + codec->profile, codec->channels, codec->sample_rate); #endif } else { Debug(1, "Unknown codec type %d", codec->codec_type); @@ -345,17 +345,17 @@ int check_sample_fmt(const AVCodec *codec, enum AVSampleFormat sample_fmt) { enum AVPixelFormat fix_deprecated_pix_fmt(enum AVPixelFormat fmt) { // Fix deprecated formats switch ( fmt ) { - case AV_PIX_FMT_YUVJ422P : - return AV_PIX_FMT_YUV422P; - case AV_PIX_FMT_YUVJ444P : - return AV_PIX_FMT_YUV444P; - case AV_PIX_FMT_YUVJ440P : - return AV_PIX_FMT_YUV440P; - case AV_PIX_FMT_NONE : - case AV_PIX_FMT_YUVJ420P : - return AV_PIX_FMT_YUV420P; - default: - return fmt; + case AV_PIX_FMT_YUVJ422P : + return AV_PIX_FMT_YUV422P; + case AV_PIX_FMT_YUVJ444P : + return AV_PIX_FMT_YUV444P; + case AV_PIX_FMT_YUVJ440P : + return AV_PIX_FMT_YUV440P; + case AV_PIX_FMT_NONE : + case AV_PIX_FMT_YUVJ420P : + return AV_PIX_FMT_YUV420P; + default: + return fmt; } } @@ -399,11 +399,11 @@ int zm_send_packet_receive_frame(AVCodecContext *context, AVFrame *frame, AVPack return packet.size; } else if (pkt_ret != 0 && pkt_ret != AVERROR(EAGAIN)) { Error("Could not send packet (error %d = %s)", pkt_ret, - av_make_error_string(pkt_ret).c_str()); + av_make_error_string(pkt_ret).c_str()); return pkt_ret; } else if (frm_ret != 0 && frm_ret != AVERROR(EAGAIN)) { Error("Could not receive frame (error %d = %s)", frm_ret, - av_make_error_string(frm_ret).c_str()); + av_make_error_string(frm_ret).c_str()); return frm_ret; } @@ -459,14 +459,14 @@ int zm_resample_audio(SwrContext *resample_ctx, AVFrame *in_frame, AVFrame *out_ // Resample the in_frame into the audioSampleBuffer until we process the whole // decoded data. Note: pts does not survive resampling or converting Debug(2, "Converting %d to %d samples using swresample", - in_frame->nb_samples, out_frame->nb_samples); + in_frame->nb_samples, out_frame->nb_samples); } else { Debug(2, "Sending NULL frame to flush resampler"); } int ret = swr_convert_frame(resample_ctx, out_frame, in_frame); if (ret < 0) { Error("Could not resample frame (error '%s')", - av_make_error_string(ret).c_str()); + av_make_error_string(ret).c_str()); return 0; } Debug(3, "swr_get_delay %" PRIi64, swr_get_delay(resample_ctx, out_frame->sample_rate)); @@ -482,14 +482,14 @@ int zm_add_samples_to_fifo(AVAudioFifo *fifo, AVFrame *frame) { int ret = av_audio_fifo_realloc(fifo, av_audio_fifo_size(fifo) + frame->nb_samples); if (ret < 0) { Error("Could not reallocate FIFO to %d samples", - av_audio_fifo_size(fifo) + frame->nb_samples); + av_audio_fifo_size(fifo) + frame->nb_samples); return 0; } /** Store the new samples in the FIFO buffer. */ ret = av_audio_fifo_write(fifo, (void **)frame->data, frame->nb_samples); if (ret < frame->nb_samples) { Error("Could not write data to FIFO. %d written, expecting %d. Reason %s", - ret, frame->nb_samples, av_make_error_string(ret).c_str()); + ret, frame->nb_samples, av_make_error_string(ret).c_str()); return 0; } return 1; @@ -499,7 +499,7 @@ int zm_get_samples_from_fifo(AVAudioFifo *fifo, AVFrame *frame) { // AAC requires 1024 samples per encode. Our input tends to be something else, so need to buffer them. if (frame->nb_samples > av_audio_fifo_size(fifo)) { Debug(1, "Not enough samples in fifo for AAC codec frame_size %d > fifo size %d", - frame->nb_samples, av_audio_fifo_size(fifo)); + frame->nb_samples, av_audio_fifo_size(fifo)); return 0; } diff --git a/src/zm_ffmpeg.h b/src/zm_ffmpeg.h index 6d983ce0f..f264aee38 100644 --- a/src/zm_ffmpeg.h +++ b/src/zm_ffmpeg.h @@ -1,17 +1,17 @@ /* * ZoneMinder FFMPEG Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -38,14 +38,14 @@ extern "C" { #include #include #if HAVE_LIBAVUTIL_HWCONTEXT_H - #include +#include #endif -/* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg - * The original source is vlc (in modules/codec/avcodec/avcommon_compat.h) - * a is the major version - * b and c the minor and micro versions of libav - * d and e the minor and micro versions of FFmpeg */ + /* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg + * The original source is vlc (in modules/codec/avcodec/avcommon_compat.h) + * a is the major version + * b and c the minor and micro versions of libav + * d and e the minor and micro versions of FFmpeg */ #define LIBAVUTIL_VERSION_CHECK(a, b, c, d, e) \ ( (LIBAVUTIL_VERSION_MICRO < 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(a, b, c) ) || \ (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(a, d, e) ) ) @@ -55,12 +55,12 @@ extern "C" { // AVCODEC #include -/* - * LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg - * The original source is vlc (in modules/codec/avcodec/avcommon_compat.h) - * a is the major version - * b and c the minor and micro versions of libav - * d and e the minor and micro versions of FFmpeg */ + /* + * LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg + * The original source is vlc (in modules/codec/avcodec/avcommon_compat.h) + * a is the major version + * b and c the minor and micro versions of libav + * d and e the minor and micro versions of FFmpeg */ #define LIBAVCODEC_VERSION_CHECK(a, b, c, d, e) \ ( (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(a, b, c) ) || \ (LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(a, d, e) ) ) @@ -70,11 +70,11 @@ extern "C" { // AVFORMAT #include -/* LIBAVFORMAT_VERSION_CHECK checks for the right version of libav and FFmpeg - * The original source is vlc (in modules/codec/avcodec/avcommon_compat.h) - * a is the major version - * b and c the minor and micro versions of libav - * d and e the minor and micro versions of FFmpeg */ + /* LIBAVFORMAT_VERSION_CHECK checks for the right version of libav and FFmpeg + * The original source is vlc (in modules/codec/avcodec/avcommon_compat.h) + * a is the major version + * b and c the minor and micro versions of libav + * d and e the minor and micro versions of FFmpeg */ #define LIBAVFORMAT_VERSION_CHECK(a, b, c, d, e) \ ( (LIBAVFORMAT_VERSION_MICRO < 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(a, b, c) ) || \ (LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(a, d, e) ) ) @@ -82,10 +82,10 @@ extern "C" { // SWSCALE #include -/* LIBSWSCALE_VERSION_CHECK checks for the right version of libav and FFmpeg - * a is the major version - * b and c the minor and micro versions of libav - * d and e the minor and micro versions of FFmpeg */ + /* LIBSWSCALE_VERSION_CHECK checks for the right version of libav and FFmpeg + * a is the major version + * b and c the minor and micro versions of libav + * d and e the minor and micro versions of FFmpeg */ #define LIBSWSCALE_VERSION_CHECK(a, b, c, d, e) \ ( (LIBSWSCALE_VERSION_MICRO < 100 && LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(a, b, c) ) || \ (LIBSWSCALE_VERSION_MICRO >= 100 && LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(a, d, e) ) ) @@ -109,14 +109,14 @@ enum _AVPIXELFORMAT GetFFMPEGPixelFormat(unsigned int p_colours, unsigned p_subp * C++ friendly version of av_err2str taken from http://libav-users.943685.n4.nabble.com/Libav-user-g-4-7-2-fails-to-compile-av-err2str-td4656417.html. * Newer g++ versions fail with "error: taking address of temporary array" when using native libav version. */ - inline static const std::string av_make_error_string(int errnum) { - static char errbuf[AV_ERROR_MAX_STRING_SIZE]; - av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); - return (std::string)errbuf; - } +inline static const std::string av_make_error_string(int errnum) { + static char errbuf[AV_ERROR_MAX_STRING_SIZE]; + av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); + return (std::string)errbuf; +} - #undef av_err2str - #define av_err2str(errnum) av_make_error_string(errnum).c_str() +#undef av_err2str +#define av_err2str(errnum) av_make_error_string(errnum).c_str() #ifndef av_rescale_delta /** @@ -133,11 +133,10 @@ int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int * @param amax maximum value of the clip range * @return clipped value */ -static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax) -{ - if (a < amin) return amin; - else if (a > amax) return amax; - else return a; +static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax) { + if (a < amin) return amin; + else if (a > amax) return amax; + else return a; } #define av_clip64 av_clip64_c @@ -253,56 +252,44 @@ int zm_resample_get_delay(SwrContext *resample_ctx, int time_base); int zm_add_samples_to_fifo(AVAudioFifo *fifo, AVFrame *frame); int zm_get_samples_from_fifo(AVAudioFifo *fifo, AVFrame *frame); -struct zm_free_av_packet -{ - void operator()(AVPacket *pkt) const - { - av_packet_free(&pkt); - } +struct zm_free_av_packet { + void operator()(AVPacket *pkt) const { + av_packet_free(&pkt); + } }; using av_packet_ptr = std::unique_ptr; -struct av_packet_guard -{ - av_packet_guard() : packet{nullptr} - { - } - explicit av_packet_guard(const av_packet_ptr& p) : packet{p.get()} - { - } - explicit av_packet_guard(AVPacket *p) : packet{p} - { - } - ~av_packet_guard() - { - if (packet) - av_packet_unref(packet); - } +struct av_packet_guard { + av_packet_guard() : packet{nullptr} { + } + explicit av_packet_guard(const av_packet_ptr& p) : packet{p.get()} { + } + explicit av_packet_guard(AVPacket *p) : packet{p} { + } + ~av_packet_guard() { + if (packet) + av_packet_unref(packet); + } - void acquire(const av_packet_ptr& p) - { - packet = p.get(); - } - void acquire(AVPacket *p) - { - packet = p; - } - void release() - { - packet = nullptr; - } + void acquire(const av_packet_ptr& p) { + packet = p.get(); + } + void acquire(AVPacket *p) { + packet = p; + } + void release() { + packet = nullptr; + } -private: - AVPacket *packet; + private: + AVPacket *packet; }; -struct zm_free_av_frame -{ - void operator()(AVFrame *frame) const - { - av_frame_free(&frame); - } +struct zm_free_av_frame { + void operator()(AVFrame *frame) const { + av_frame_free(&frame); + } }; using av_frame_ptr = std::unique_ptr; diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 2505c73d3..57c2eb367 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -36,8 +36,8 @@ TimePoint start_read_time; #if LIBAVCODEC_VERSION_CHECK(57, 89, 0, 89, 0) static enum AVPixelFormat hw_pix_fmt; static enum AVPixelFormat get_hw_format( - AVCodecContext *ctx, - const enum AVPixelFormat *pix_fmts + AVCodecContext *ctx, + const enum AVPixelFormat *pix_fmts ) { const enum AVPixelFormat *p; @@ -47,36 +47,36 @@ static enum AVPixelFormat get_hw_format( } Error("Failed to get HW surface format for %s.", - av_get_pix_fmt_name(hw_pix_fmt)); + av_get_pix_fmt_name(hw_pix_fmt)); for ( p = pix_fmts; *p != -1; p++ ) Error("Available HW surface format was %s.", - av_get_pix_fmt_name(*p)); + av_get_pix_fmt_name(*p)); return AV_PIX_FMT_NONE; } #if !LIBAVUTIL_VERSION_CHECK(56, 22, 0, 14, 0) static enum AVPixelFormat find_fmt_by_hw_type(const enum AVHWDeviceType type) { switch (type) { - case AV_HWDEVICE_TYPE_VAAPI: - return AV_PIX_FMT_VAAPI; - case AV_HWDEVICE_TYPE_DXVA2: - return AV_PIX_FMT_DXVA2_VLD; - case AV_HWDEVICE_TYPE_D3D11VA: - return AV_PIX_FMT_D3D11; - case AV_HWDEVICE_TYPE_VDPAU: - return AV_PIX_FMT_VDPAU; - case AV_HWDEVICE_TYPE_CUDA: - return AV_PIX_FMT_CUDA; - case AV_HWDEVICE_TYPE_QSV: - return AV_PIX_FMT_VAAPI; + case AV_HWDEVICE_TYPE_VAAPI: + return AV_PIX_FMT_VAAPI; + case AV_HWDEVICE_TYPE_DXVA2: + return AV_PIX_FMT_DXVA2_VLD; + case AV_HWDEVICE_TYPE_D3D11VA: + return AV_PIX_FMT_D3D11; + case AV_HWDEVICE_TYPE_VDPAU: + return AV_PIX_FMT_VDPAU; + case AV_HWDEVICE_TYPE_CUDA: + return AV_PIX_FMT_CUDA; + case AV_HWDEVICE_TYPE_QSV: + return AV_PIX_FMT_VAAPI; #ifdef AV_HWDEVICE_TYPE_MMAL - case AV_HWDEVICE_TYPE_MMAL: - return AV_PIX_FMT_MMAL; + case AV_HWDEVICE_TYPE_MMAL: + return AV_PIX_FMT_MMAL; #endif - case AV_HWDEVICE_TYPE_VIDEOTOOLBOX: - return AV_PIX_FMT_VIDEOTOOLBOX; - default: - return AV_PIX_FMT_NONE; + case AV_HWDEVICE_TYPE_VIDEOTOOLBOX: + return AV_PIX_FMT_VIDEOTOOLBOX; + default: + return AV_PIX_FMT_NONE; } } #endif @@ -84,38 +84,38 @@ static enum AVPixelFormat find_fmt_by_hw_type(const enum AVHWDeviceType type) { #endif FfmpegCamera::FfmpegCamera( - const Monitor *monitor, - const std::string &p_path, - const std::string &p_second_path, - const std::string &p_user, - const std::string &p_pass, - const std::string &p_method, - const std::string &p_options, - int p_width, - int p_height, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio, - const std::string &p_hwaccel_name, - const std::string &p_hwaccel_device) : + const Monitor *monitor, + const std::string &p_path, + const std::string &p_second_path, + const std::string &p_user, + const std::string &p_pass, + const std::string &p_method, + const std::string &p_options, + int p_width, + int p_height, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio, + const std::string &p_hwaccel_name, + const std::string &p_hwaccel_device) : Camera( - monitor, - FFMPEG_SRC, - p_width, - p_height, - p_colours, - ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), - p_brightness, - p_contrast, - p_hue, - p_colour, - p_capture, - p_record_audio - ), + monitor, + FFMPEG_SRC, + p_width, + p_height, + p_colours, + ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), + p_brightness, + p_contrast, + p_hue, + p_colour, + p_capture, + p_record_audio + ), mPath(p_path), mSecondPath(p_second_path), mUser(p_user), @@ -130,8 +130,7 @@ FfmpegCamera::FfmpegCamera( mConvertContext(nullptr), error_count(0), stream_width(0), - stream_height(0) -{ + stream_height(0) { mMaskedPath = remove_authentication(mPath); mMaskedSecondPath = remove_authentication(mSecondPath); if ( capture ) { @@ -192,52 +191,52 @@ int FfmpegCamera::Capture(std::shared_ptr &zm_packet) { int64_t lastPTS; if ( mSecondFormatContext and - ( - av_rescale_q(mLastAudioPTS, mAudioStream->time_base, AV_TIME_BASE_Q) - < - av_rescale_q(mLastVideoPTS, mVideoStream->time_base, AV_TIME_BASE_Q) - ) ) { + ( + av_rescale_q(mLastAudioPTS, mAudioStream->time_base, AV_TIME_BASE_Q) + < + av_rescale_q(mLastVideoPTS, mVideoStream->time_base, AV_TIME_BASE_Q) + ) ) { // if audio stream is behind video stream, then read from audio, otherwise video formatContextPtr = mSecondFormatContext; lastPTS = mLastAudioPTS; Debug(4, "Using audio input because audio PTS %" PRId64 " < video PTS %" PRId64, - av_rescale_q(mLastAudioPTS, mAudioStream->time_base, AV_TIME_BASE_Q), - av_rescale_q(mLastVideoPTS, mVideoStream->time_base, AV_TIME_BASE_Q) - ); + av_rescale_q(mLastAudioPTS, mAudioStream->time_base, AV_TIME_BASE_Q), + av_rescale_q(mLastVideoPTS, mVideoStream->time_base, AV_TIME_BASE_Q) + ); if ((ret = av_read_frame(formatContextPtr, packet.get())) < 0) { if ( - // Check if EOF. - (ret == AVERROR_EOF || (formatContextPtr->pb && formatContextPtr->pb->eof_reached)) || - // Check for Connection failure. - (ret == -110) - ) { + // Check if EOF. + (ret == AVERROR_EOF || (formatContextPtr->pb && formatContextPtr->pb->eof_reached)) || + // Check for Connection failure. + (ret == -110) + ) { Info("Unable to read packet from stream %d: error %d \"%s\".", - packet->stream_index, ret, av_make_error_string(ret).c_str()); + packet->stream_index, ret, av_make_error_string(ret).c_str()); } else { Error("Unable to read packet from stream %d: error %d \"%s\".", - packet->stream_index, ret, av_make_error_string(ret).c_str()); + packet->stream_index, ret, av_make_error_string(ret).c_str()); } return -1; } } else { formatContextPtr = mFormatContext; Debug(4, "Using video input because %" PRId64 " >= %" PRId64, - (mAudioStream?av_rescale_q(mLastAudioPTS, mAudioStream->time_base, AV_TIME_BASE_Q):0), - av_rescale_q(mLastVideoPTS, mVideoStream->time_base, AV_TIME_BASE_Q) - ); + (mAudioStream?av_rescale_q(mLastAudioPTS, mAudioStream->time_base, AV_TIME_BASE_Q):0), + av_rescale_q(mLastVideoPTS, mVideoStream->time_base, AV_TIME_BASE_Q) + ); if ((ret = av_read_frame(formatContextPtr, packet.get())) < 0) { if ( - // Check if EOF. - (ret == AVERROR_EOF || (formatContextPtr->pb && formatContextPtr->pb->eof_reached)) || - // Check for Connection failure. - (ret == -110) - ) { + // Check if EOF. + (ret == AVERROR_EOF || (formatContextPtr->pb && formatContextPtr->pb->eof_reached)) || + // Check for Connection failure. + (ret == -110) + ) { Info("Unable to read packet from stream %d: error %d \"%s\".", - packet->stream_index, ret, av_make_error_string(ret).c_str()); + packet->stream_index, ret, av_make_error_string(ret).c_str()); } else { Error("Unable to read packet from stream %d: error %d \"%s\".", - packet->stream_index, ret, av_make_error_string(ret).c_str()); + packet->stream_index, ret, av_make_error_string(ret).c_str()); } return -1; } @@ -264,7 +263,7 @@ int FfmpegCamera::Capture(std::shared_ptr &zm_packet) { double pts_time = static_cast(av_rescale_q(packet->pts, stream->time_base, AV_TIME_BASE_Q)) / AV_TIME_BASE; double last_pts_time = static_cast(av_rescale_q(lastPTS, stream->time_base, AV_TIME_BASE_Q)) / AV_TIME_BASE; logPrintf(Logger::WARNING + monitor->Importance(), "Stream pts jumped back in time too far. pts %.2f - last pts %.2f = %.2f > 40seconds", - pts_time, last_pts_time, pts_time - last_pts_time); + pts_time, last_pts_time, pts_time - last_pts_time); if (error_count > 5) return -1; error_count += 1; @@ -310,7 +309,7 @@ int FfmpegCamera::OpenFfmpeg() { #if LIBAVFORMAT_VERSION_CHECK(59, 16, 100, 16, 100) const #endif - AVInputFormat *input_format = nullptr; + AVInputFormat *input_format = nullptr; // Handle options AVDictionary *opts = nullptr; if (!mOptions.empty()) { @@ -365,8 +364,8 @@ int FfmpegCamera::OpenFfmpeg() { ret = avformat_open_input(&mFormatContext, mPath.c_str(), input_format, &opts); if (ret != 0) { logPrintf(Logger::ERROR + monitor->Importance(), - "Unable to open input %s due to: %s", mMaskedPath.c_str(), - av_make_error_string(ret).c_str()); + "Unable to open input %s due to: %s", mMaskedPath.c_str(), + av_make_error_string(ret).c_str()); avformat_close_input(&mFormatContext); mFormatContext = nullptr; av_dict_free(&opts); @@ -382,7 +381,7 @@ int FfmpegCamera::OpenFfmpeg() { ret = avformat_find_stream_info(mFormatContext, nullptr); if (ret < 0) { Error("Unable to find stream info from %s due to: %s", - mMaskedPath.c_str(), av_make_error_string(ret).c_str()); + mMaskedPath.c_str(), av_make_error_string(ret).c_str()); avformat_close_input(&mFormatContext); return -1; } @@ -420,7 +419,7 @@ int FfmpegCamera::OpenFfmpeg() { } Debug(3, "Found video stream at index %d, audio stream at index %d", - mVideoStreamId, mAudioStreamId); + mVideoStreamId, mAudioStreamId); const AVCodec *mVideoCodec = nullptr; if (!monitor->DecoderName().empty() and (monitor->DecoderName() != "auto")) { @@ -452,7 +451,7 @@ int FfmpegCamera::OpenFfmpeg() { if (use_hwaccel && (hwaccel_name != "")) { #if HAVE_LIBAVUTIL_HWCONTEXT_H // 3.2 doesn't seem to have all the bits in place, so let's require 3.4 and up - #if LIBAVCODEC_VERSION_CHECK(57, 107, 0, 107, 0) +#if LIBAVCODEC_VERSION_CHECK(57, 107, 0, 107, 0) // Print out available types enum AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE; while ((type = av_hwdevice_iterate_types(type)) != AV_HWDEVICE_TYPE_NONE) @@ -466,44 +465,44 @@ int FfmpegCamera::OpenFfmpeg() { Debug(1, "Found hwdevice %s", av_hwdevice_get_type_name(type)); } - #if LIBAVUTIL_VERSION_CHECK(56, 22, 0, 14, 0) +#if LIBAVUTIL_VERSION_CHECK(56, 22, 0, 14, 0) // Get hw_pix_fmt for (int i = 0;; i++) { const AVCodecHWConfig *config = avcodec_get_hw_config(mVideoCodec, i); if (!config) { Debug(1, "Decoder %s does not support config %d.", - mVideoCodec->name, i); + mVideoCodec->name, i); break; } if ((config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX) && (config->device_type == type) - ) { + ) { hw_pix_fmt = config->pix_fmt; Debug(1, "Decoder %s does support our type %s.", - mVideoCodec->name, av_hwdevice_get_type_name(type)); + mVideoCodec->name, av_hwdevice_get_type_name(type)); //break; } else { Debug(1, "Decoder %s hwConfig doesn't match our type: %s != %s, pix_fmt %s.", - mVideoCodec->name, - av_hwdevice_get_type_name(type), - av_hwdevice_get_type_name(config->device_type), - av_get_pix_fmt_name(config->pix_fmt) - ); + mVideoCodec->name, + av_hwdevice_get_type_name(type), + av_hwdevice_get_type_name(config->device_type), + av_get_pix_fmt_name(config->pix_fmt) + ); } } // end foreach hwconfig - #else +#else hw_pix_fmt = find_fmt_by_hw_type(type); - #endif +#endif if (hw_pix_fmt != AV_PIX_FMT_NONE) { Debug(1, "Selected hw_pix_fmt %d %s", - hw_pix_fmt, av_get_pix_fmt_name(hw_pix_fmt)); + hw_pix_fmt, av_get_pix_fmt_name(hw_pix_fmt)); - mVideoCodecContext->hwaccel_flags |= AV_HWACCEL_FLAG_IGNORE_LEVEL; - //if (!lavc_param->check_hw_profile) - mVideoCodecContext->hwaccel_flags |= AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH; + mVideoCodecContext->hwaccel_flags |= AV_HWACCEL_FLAG_IGNORE_LEVEL; + //if (!lavc_param->check_hw_profile) + mVideoCodecContext->hwaccel_flags |= AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH; ret = av_hwdevice_ctx_create(&hw_device_ctx, type, - (hwaccel_device != "" ? hwaccel_device.c_str() : nullptr), nullptr, 0); + (hwaccel_device != "" ? hwaccel_device.c_str() : nullptr), nullptr, 0); if (ret < 0 and hwaccel_device != "") { ret = av_hwdevice_ctx_create(&hw_device_ctx, type, nullptr, nullptr, 0); } @@ -518,9 +517,9 @@ int FfmpegCamera::OpenFfmpeg() { } else { Debug(1, "Failed to find suitable hw_pix_fmt."); } - #else +#else Debug(1, "AVCodec not new enough for hwaccel"); - #endif +#endif #else Warning("HWAccel support not compiled in."); #endif @@ -585,12 +584,12 @@ int FfmpegCamera::OpenFfmpeg() { } // end if have audio stream if ( - ((unsigned int)mVideoCodecContext->width != width) - || - ((unsigned int)mVideoCodecContext->height != height) - ) { + ((unsigned int)mVideoCodecContext->width != width) + || + ((unsigned int)mVideoCodecContext->height != height) + ) { Debug(1, "Monitor dimensions are %dx%d but camera is sending %dx%d", - width, height, mVideoCodecContext->width, mVideoCodecContext->height); + width, height, mVideoCodecContext->width, mVideoCodecContext->height); } mIsPrimed = true; diff --git a/src/zm_ffmpeg_camera.h b/src/zm_ffmpeg_camera.h index c29af4127..bf7536bad 100644 --- a/src/zm_ffmpeg_camera.h +++ b/src/zm_ffmpeg_camera.h @@ -1,21 +1,21 @@ // // ZoneMinder Ffmpeg Class Interface, $Date: 2008-07-25 10:33:23 +0100 (Fri, 25 Jul 2008) $, $Revision: 2611 $ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_FFMPEG_CAMERA_H #define ZM_FFMPEG_CAMERA_H @@ -28,7 +28,7 @@ class FFmpeg_Input; #if HAVE_LIBAVUTIL_HWCONTEXT_H typedef struct DecodeContext { - AVBufferRef *hw_device_ref; + AVBufferRef *hw_device_ref; } DecodeContext; #endif // @@ -36,77 +36,77 @@ typedef struct DecodeContext { // accessed using ffmpeg multimedia framework // class FfmpegCamera : public Camera { - protected: - std::string mPath; - std::string mMaskedPath; - std::string mSecondPath; - std::string mUser; - std::string mPass; - std::string mMaskedSecondPath; - std::string mMethod; - std::string mOptions; + protected: + std::string mPath; + std::string mMaskedPath; + std::string mSecondPath; + std::string mUser; + std::string mPass; + std::string mMaskedSecondPath; + std::string mMethod; + std::string mOptions; - std::string encoder_options; - std::string hwaccel_name; - std::string hwaccel_device; + std::string encoder_options; + std::string hwaccel_name; + std::string hwaccel_device; - std::unique_ptr mSecondInput; + std::unique_ptr mSecondInput; - int frameCount; + int frameCount; - _AVPIXELFORMAT imagePixFormat; + _AVPIXELFORMAT imagePixFormat; - bool use_hwaccel; //will default to on if hwaccel specified, will get turned off if there is a failure + bool use_hwaccel; //will default to on if hwaccel specified, will get turned off if there is a failure #if HAVE_LIBAVUTIL_HWCONTEXT_H - AVBufferRef *hw_device_ctx = nullptr; + AVBufferRef *hw_device_ctx = nullptr; #endif - // Used to store the incoming packet, it will get copied when queued. - // We only ever need one at a time, so instead of constantly allocating - // and freeing this structure, we will just make it a member of the object. - av_packet_ptr packet; + // Used to store the incoming packet, it will get copied when queued. + // We only ever need one at a time, so instead of constantly allocating + // and freeing this structure, we will just make it a member of the object. + av_packet_ptr packet; - int OpenFfmpeg(); - int Close() override; + int OpenFfmpeg(); + int Close() override; - struct SwsContext *mConvertContext; + struct SwsContext *mConvertContext; - int error_count; - int stream_width; /* What the camera is actually sending */ - int stream_height; + int error_count; + int stream_width; /* What the camera is actually sending */ + int stream_height; - public: - FfmpegCamera( - const Monitor *monitor, - const std::string &p_path, - const std::string &p_second_path, - const std::string &p_user, - const std::string &p_pass, - const std::string &p_method, - const std::string &p_options, - int p_width, - int p_height, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio, - const std::string &p_hwaccel_name, - const std::string &p_hwaccel_device - ); - ~FfmpegCamera(); + public: + FfmpegCamera( + const Monitor *monitor, + const std::string &p_path, + const std::string &p_second_path, + const std::string &p_user, + const std::string &p_pass, + const std::string &p_method, + const std::string &p_options, + int p_width, + int p_height, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio, + const std::string &p_hwaccel_name, + const std::string &p_hwaccel_device + ); + ~FfmpegCamera(); - const std::string &Path() const { return mPath; } - const std::string &Options() const { return mOptions; } - const std::string &Method() const { return mMethod; } + const std::string &Path() const { return mPath; } + const std::string &Options() const { return mOptions; } + const std::string &Method() const { return mMethod; } - int PrimeCapture() override; - int PreCapture() override; - int Capture(std::shared_ptr &p) override; - int PostCapture() override; - private: - static int FfmpegInterruptCallback(void*ctx); + int PrimeCapture() override; + int PreCapture() override; + int Capture(std::shared_ptr &p) override; + int PostCapture() override; + private: + static int FfmpegInterruptCallback(void*ctx); }; #endif // ZM_FFMPEG_CAMERA_H diff --git a/src/zm_ffmpeg_input.cpp b/src/zm_ffmpeg_input.cpp index fb59881eb..2f18158cd 100644 --- a/src/zm_ffmpeg_input.cpp +++ b/src/zm_ffmpeg_input.cpp @@ -9,7 +9,7 @@ FFmpeg_Input::FFmpeg_Input() { audio_stream_id = -1; FFMPEGInit(); streams = nullptr; - last_seek_request = -1; + last_seek_request = -1; } FFmpeg_Input::~FFmpeg_Input() { @@ -21,11 +21,11 @@ FFmpeg_Input::~FFmpeg_Input() { /* Takes streams provided from elsewhere. They might not come from the same source * but we will treat them as if they are. */ int FFmpeg_Input::Open( - const AVStream * video_in_stream, - const AVCodecContext * video_in_ctx, - const AVStream * audio_in_stream, - const AVCodecContext * audio_in_ctx - ) { + const AVStream * video_in_stream, + const AVCodecContext * video_in_ctx, + const AVStream * audio_in_stream, + const AVCodecContext * audio_in_ctx +) { int max_stream_index = video_stream_id = video_in_stream->index; if (audio_in_stream) { @@ -43,7 +43,7 @@ int FFmpeg_Input::Open(const char *filepath) { error = avformat_open_input(&input_format_context, filepath, nullptr, nullptr); if ( error < 0 ) { Error("Could not open input file '%s' (error '%s')", - filepath, av_make_error_string(error).c_str()); + filepath, av_make_error_string(error).c_str()); input_format_context = nullptr; return error; } @@ -51,9 +51,9 @@ int FFmpeg_Input::Open(const char *filepath) { /** Get information on the input file (number of streams etc.). */ if ( (error = avformat_find_stream_info(input_format_context, nullptr)) < 0 ) { Error( - "Could not open find stream info (error '%s')", - av_make_error_string(error).c_str() - ); + "Could not open find stream info (error '%s')", + av_make_error_string(error).c_str() + ); avformat_close_input(&input_format_context); return error; } @@ -98,7 +98,7 @@ int FFmpeg_Input::Open(const char *filepath) { error = avcodec_open2(streams[i].context, streams[i].codec, nullptr); if (error < 0) { Error("Could not open input codec (error '%s')", - av_make_error_string(error).c_str()); + av_make_error_string(error).c_str()); avcodec_free_context(&streams[i].context); avformat_close_input(&input_format_context); input_format_context = nullptr; @@ -151,16 +151,16 @@ AVFrame *FFmpeg_Input::get_frame(int stream_id) { int ret = av_read_frame(input_format_context, packet.get()); if (ret < 0) { if ( - // Check if EOF. - (ret == AVERROR_EOF || (input_format_context->pb && input_format_context->pb->eof_reached)) || - // Check for Connection failure. - (ret == -110) - ) { + // Check if EOF. + (ret == AVERROR_EOF || (input_format_context->pb && input_format_context->pb->eof_reached)) || + // Check for Connection failure. + (ret == -110) + ) { Info("av_read_frame returned %s.", av_make_error_string(ret).c_str()); return nullptr; } Error("Unable to read packet from stream %d: error %d \"%s\".", - packet->stream_index, ret, av_make_error_string(ret).c_str()); + packet->stream_index, ret, av_make_error_string(ret).c_str()); return nullptr; } ZM_DUMP_STREAM_PACKET(input_format_context->streams[packet->stream_index], packet, "Received packet"); @@ -182,7 +182,7 @@ AVFrame *FFmpeg_Input::get_frame(int stream_id) { ret = zm_send_packet_receive_frame(context, frame.get(), *packet); if ( ret < 0 ) { Error("Unable to decode frame at frame %d: %d %s, continuing", - streams[packet->stream_index].frame_count, ret, av_make_error_string(ret).c_str()); + streams[packet->stream_index].frame_count, ret, av_make_error_string(ret).c_str()); frame = nullptr; continue; } else { @@ -231,18 +231,18 @@ AVFrame *FFmpeg_Input::get_frame(int stream_id, double at) { } } // end if ! frame - if ( - (last_seek_request >= 0) - && - (last_seek_request > seek_target) - && - (frame->pts > seek_target) - ) { + if ( + (last_seek_request >= 0) + && + (last_seek_request > seek_target) + && + (frame->pts > seek_target) + ) { zm_dump_frame(frame, "frame->pts > seek_target, seek backwards"); - // our frame must be beyond our seek target. so go backwards to before it - if (( ret = av_seek_frame(input_format_context, stream_id, seek_target, - AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_FRAME - ) ) < 0) { + // our frame must be beyond our seek target. so go backwards to before it + if (( ret = av_seek_frame(input_format_context, stream_id, seek_target, + AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_FRAME + ) ) < 0) { Error("Unable to seek in stream %d", ret); return nullptr; } @@ -258,7 +258,7 @@ AVFrame *FFmpeg_Input::get_frame(int stream_id, double at) { return frame.get(); } // end if frame->pts > seek_target - last_seek_request = seek_target; + last_seek_request = seek_target; // Normally it is likely just the next packet. Need a heuristic for seeking, something like duration * keyframe interval #if LIBAVCODEC_VERSION_CHECK(60, 3, 0, 3, 0) @@ -269,8 +269,8 @@ AVFrame *FFmpeg_Input::get_frame(int stream_id, double at) { { Debug(1, "Jumping ahead"); if (( ret = av_seek_frame(input_format_context, stream_id, seek_target, - AVSEEK_FLAG_FRAME - ) ) < 0) { + AVSEEK_FLAG_FRAME + ) ) < 0) { Error("Unable to seek in stream %d", ret); return nullptr; } @@ -279,8 +279,8 @@ AVFrame *FFmpeg_Input::get_frame(int stream_id, double at) { zm_dump_frame(frame, "got"); if (frame->pts > seek_target) { if (( ret = av_seek_frame(input_format_context, stream_id, seek_target, - AVSEEK_FLAG_FRAME|AVSEEK_FLAG_BACKWARD - ) ) < 0) { + AVSEEK_FLAG_FRAME|AVSEEK_FLAG_BACKWARD + ) ) < 0) { Error("Unable to seek in stream %d", ret); return nullptr; } @@ -291,20 +291,20 @@ AVFrame *FFmpeg_Input::get_frame(int stream_id, double at) { // Seeking seems to typically seek to a keyframe, so then we have to decode until we get the frame we want. if (frame->pts <= seek_target) { Debug(1, "Frame pts %" PRId64 " + duration %" PRId64 "= %" PRId64 " <=? %" PRId64, - frame->pts, + frame->pts, #if LIBAVCODEC_VERSION_CHECK(60, 3, 0, 3, 0) - frame->duration, frame->pts + frame->duration, + frame->duration, frame->pts + frame->duration, #else - frame->pkt_duration, frame->pts + frame->pkt_duration, + frame->pkt_duration, frame->pts + frame->pkt_duration, #endif - seek_target); + seek_target); while (frame && (frame->pts + #if LIBAVCODEC_VERSION_CHECK(60, 3, 0, 3, 0) - frame->duration + frame->duration #else - frame->pkt_duration + frame->pkt_duration #endif - < seek_target)) { + < seek_target)) { if (is_video_stream(input_format_context->streams[stream_id])) { zm_dump_video_frame(frame, "pts <= seek_target"); } else { diff --git a/src/zm_ffmpeg_input.h b/src/zm_ffmpeg_input.h index 238c7f850..e970d6418 100644 --- a/src/zm_ffmpeg_input.h +++ b/src/zm_ffmpeg_input.h @@ -12,48 +12,48 @@ extern "C" { class FFmpeg_Input { - public: - FFmpeg_Input(); - ~FFmpeg_Input(); + public: + FFmpeg_Input(); + ~FFmpeg_Input(); - int Open(const char *filename ); - int Open( - const AVStream *, - const AVCodecContext *, - const AVStream *, - const AVCodecContext *); - int Close(); - AVFrame *get_frame(int stream_id=-1); - AVFrame *get_frame(int stream_id, double at); - int get_video_stream_id() const { - return video_stream_id; - } - int get_audio_stream_id() const { - return audio_stream_id; - } - AVStream *get_video_stream() { - return ( video_stream_id >= 0 ) ? input_format_context->streams[video_stream_id] : nullptr; - } - AVStream *get_audio_stream() { - return ( audio_stream_id >= 0 ) ? input_format_context->streams[audio_stream_id] : nullptr; - } - AVFormatContext *get_format_context() { return input_format_context; }; - AVCodecContext *get_video_codec_context() { return ( video_stream_id >= 0 ) ? streams[video_stream_id].context : nullptr; }; - AVCodecContext *get_audio_codec_context() { return ( audio_stream_id >= 0 ) ? streams[audio_stream_id].context : nullptr; }; + int Open(const char *filename ); + int Open( + const AVStream *, + const AVCodecContext *, + const AVStream *, + const AVCodecContext *); + int Close(); + AVFrame *get_frame(int stream_id=-1); + AVFrame *get_frame(int stream_id, double at); + int get_video_stream_id() const { + return video_stream_id; + } + int get_audio_stream_id() const { + return audio_stream_id; + } + AVStream *get_video_stream() { + return ( video_stream_id >= 0 ) ? input_format_context->streams[video_stream_id] : nullptr; + } + AVStream *get_audio_stream() { + return ( audio_stream_id >= 0 ) ? input_format_context->streams[audio_stream_id] : nullptr; + } + AVFormatContext *get_format_context() { return input_format_context; }; + AVCodecContext *get_video_codec_context() { return ( video_stream_id >= 0 ) ? streams[video_stream_id].context : nullptr; }; + AVCodecContext *get_audio_codec_context() { return ( audio_stream_id >= 0 ) ? streams[audio_stream_id].context : nullptr; }; - private: - typedef struct { - AVCodecContext *context; - const AVCodec *codec; - int frame_count; - } stream; + private: + typedef struct { + AVCodecContext *context; + const AVCodec *codec; + int frame_count; + } stream; - stream *streams; - int video_stream_id; - int audio_stream_id; - AVFormatContext *input_format_context; - av_frame_ptr frame; - int64_t last_seek_request; + stream *streams; + int video_stream_id; + int audio_stream_id; + AVFormatContext *input_format_context; + av_frame_ptr frame; + int64_t last_seek_request; }; #endif diff --git a/src/zm_ffmpeg_output.cpp b/src/zm_ffmpeg_output.cpp index e039bf4b4..d0a242e68 100644 --- a/src/zm_ffmpeg_output.cpp +++ b/src/zm_ffmpeg_output.cpp @@ -21,15 +21,15 @@ int FFmpeg_Output::Open( const char *filepath ) { if ( (error = avformat_open_input( &input_format_context, filepath, NULL, NULL)) < 0 ) { Error("Could not open input file '%s' (error '%s')\n", - filepath, av_make_error_string(error).c_str() ); + filepath, av_make_error_string(error).c_str() ); input_format_context = NULL; return error; - } + } /** Get information on the input file (number of streams etc.). */ if ( (error = avformat_find_stream_info(input_format_context, NULL)) < 0 ) { Error( "Could not open find stream info (error '%s')\n", - av_make_error_string(error).c_str() ); + av_make_error_string(error).c_str() ); avformat_close_input(&input_format_context); return error; } @@ -65,7 +65,7 @@ int FFmpeg_Output::Open( const char *filepath ) { if ((error = avcodec_open2( streams[i].context, streams[i].codec, NULL)) < 0) { Error( "Could not open input codec (error '%s')\n", - av_make_error_string(error).c_str() ); + av_make_error_string(error).c_str() ); avcodec_free_context( &streams[i].context ); avformat_close_input(&input_format_context); return error; @@ -103,11 +103,11 @@ AVFrame *FFmpeg_Output::get_frame( int stream_id ) { if ( ret < 0 ) { av_strerror(ret, errbuf, AV_ERROR_MAX_STRING_SIZE); if ( - // Check if EOF. - (ret == AVERROR_EOF || (input_format_context->pb && input_format_context->pb->eof_reached)) || - // Check for Connection failure. - (ret == -110) - ) { + // Check if EOF. + (ret == AVERROR_EOF || (input_format_context->pb && input_format_context->pb->eof_reached)) || + // Check for Connection failure. + (ret == -110) + ) { Info( "av_read_frame returned %s.", errbuf ); return NULL; } @@ -122,45 +122,45 @@ AVFrame *FFmpeg_Output::get_frame( int stream_id ) { AVCodecContext *context = streams[packet->stream_index].context; - ret = avcodec_send_packet( context, packet.get() ); - if ( ret < 0 ) { - av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE ); - Error( "Unable to send packet at frame %d: %s, continuing", streams[packet->stream_index].frame_count, errbuf ); - continue; - } else { - Debug(1, "Success getting a packet"); - } - -#if HAVE_AVUTIL_HWCONTEXT_H - if ( hwaccel ) { - ret = avcodec_receive_frame( context, hwFrame ); - if ( ret < 0 ) { - av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE ); - Error( "Unable to receive frame %d: %s, continuing", streams[packet->stream_index].frame_count, errbuf ); - continue; - } - ret = av_hwframe_transfer_data(frame, hwFrame, 0); - if (ret < 0) { - av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE ); - Error( "Unable to transfer frame at frame %d: %s, continuing", streams[packet->stream_index].frame_count, errbuf ); - continue; - } - } else { -#endif - Debug(1,"Getting a frame?"); - ret = avcodec_receive_frame( context, frame.get() ); + ret = avcodec_send_packet( context, packet.get() ); if ( ret < 0 ) { av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE ); Error( "Unable to send packet at frame %d: %s, continuing", streams[packet->stream_index].frame_count, errbuf ); continue; + } else { + Debug(1, "Success getting a packet"); } #if HAVE_AVUTIL_HWCONTEXT_H - } + if ( hwaccel ) { + ret = avcodec_receive_frame( context, hwFrame ); + if ( ret < 0 ) { + av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE ); + Error( "Unable to receive frame %d: %s, continuing", streams[packet->stream_index].frame_count, errbuf ); + continue; + } + ret = av_hwframe_transfer_data(frame, hwFrame, 0); + if (ret < 0) { + av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE ); + Error( "Unable to transfer frame at frame %d: %s, continuing", streams[packet->stream_index].frame_count, errbuf ); + continue; + } + } else { +#endif + Debug(1,"Getting a frame?"); + ret = avcodec_receive_frame( context, frame.get() ); + if ( ret < 0 ) { + av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE ); + Error( "Unable to send packet at frame %d: %s, continuing", streams[packet->stream_index].frame_count, errbuf ); + continue; + } + +#if HAVE_AVUTIL_HWCONTEXT_H + } #endif - frameComplete = 1; - } // end if it's the right stream + frameComplete = 1; + } // end if it's the right stream } // end while ! frameComplete return frame.get(); diff --git a/src/zm_ffmpeg_output.h b/src/zm_ffmpeg_output.h index abeffa942..7bae7a039 100644 --- a/src/zm_ffmpeg_output.h +++ b/src/zm_ffmpeg_output.h @@ -9,33 +9,33 @@ extern "C" { class FFmpeg_Output { - public: - FFmpeg_Output(); - ~FFmpeg_Output(); + public: + FFmpeg_Output(); + ~FFmpeg_Output(); - int Open( const char *filename ); - int Close(); - AVFrame *put_frame( int stream_id=-1 ); - AVFrame *put_packet( int stream_id=-1 ); - int get_video_stream_id() { - return video_stream_id; - } - int get_audio_stream_id() { - return audio_stream_id; - } + int Open( const char *filename ); + int Close(); + AVFrame *put_frame( int stream_id=-1 ); + AVFrame *put_packet( int stream_id=-1 ); + int get_video_stream_id() { + return video_stream_id; + } + int get_audio_stream_id() { + return audio_stream_id; + } - private: - typedef struct { - AVCodecContext *context; - AVCodec *codec; - int frame_count; - } stream; + private: + typedef struct { + AVCodecContext *context; + AVCodec *codec; + int frame_count; + } stream; - stream streams[2]; - int video_stream_id; - int audio_stream_id; - AVFormatContext *input_format_context; - av_frame_ptr frame; + stream streams[2]; + int video_stream_id; + int audio_stream_id; + AVFormatContext *input_format_context; + av_frame_ptr frame; }; #endif diff --git a/src/zm_fifo.h b/src/zm_fifo.h index 65f344678..b2d4aa775 100644 --- a/src/zm_fifo.h +++ b/src/zm_fifo.h @@ -26,35 +26,35 @@ class Monitor; class Fifo { private: - std::string path; - bool on_blocking_abort; - FILE *outfile; - int raw_fd; + std::string path; + bool on_blocking_abort; + FILE *outfile; + int raw_fd; public: static void file_create_if_missing(const std::string &path, bool is_fifo, bool delete_fake_fifo = true); static void fifo_create_if_missing(const std::string &path, bool delete_fake_fifo = true); - Fifo() : - on_blocking_abort(true), - outfile(nullptr), - raw_fd(-1) - {} - Fifo(const char *p_path, bool p_on_blocking_abort) : - path(p_path), - on_blocking_abort(p_on_blocking_abort), - outfile(nullptr), - raw_fd(-1) - {} - ~Fifo(); + Fifo() : + on_blocking_abort(true), + outfile(nullptr), + raw_fd(-1) + {} + Fifo(const char *p_path, bool p_on_blocking_abort) : + path(p_path), + on_blocking_abort(p_on_blocking_abort), + outfile(nullptr), + raw_fd(-1) + {} + ~Fifo(); - static bool writePacket(const std::string &filename, const ZMPacket &packet); - static bool write(const std::string &filename, uint8_t *data, size_t size); + static bool writePacket(const std::string &filename, const ZMPacket &packet); + static bool write(const std::string &filename, uint8_t *data, size_t size); - bool open(); - bool close(); + bool open(); + bool close(); - bool writePacket(const ZMPacket &packet); - bool write(uint8_t *data, size_t size, int64_t pts); + bool writePacket(const ZMPacket &packet); + bool write(uint8_t *data, size_t size, int64_t pts); }; #endif // ZM_FIFO_H diff --git a/src/zm_fifo_debug.cpp b/src/zm_fifo_debug.cpp index 0beaeb6b1..e493a423e 100644 --- a/src/zm_fifo_debug.cpp +++ b/src/zm_fifo_debug.cpp @@ -60,13 +60,13 @@ int zmFifoDbgInit(Monitor *monitor) { } void zmFifoDbgOutput( - int hex, - const char * const file, - const int line, - const int level, - const char *fstring, - ... - ) { + int hex, + const char * const file, + const int line, + const int level, + const char *fstring, + ... +) { char dbg_string[8192]; int str_size = sizeof(dbg_string); diff --git a/src/zm_fifo_debug.h b/src/zm_fifo_debug.h index 08f4c4fb5..9d32a2391 100644 --- a/src/zm_fifo_debug.h +++ b/src/zm_fifo_debug.h @@ -31,12 +31,12 @@ class Monitor; #define FifoDebug(level, params...) #endif void zmFifoDbgOutput( - int hex, - const char * const file, - const int line, - const int level, - const char *fstring, - ...) __attribute__((format(printf, 5, 6))); + int hex, + const char * const file, + const int line, + const int level, + const char *fstring, + ...) __attribute__((format(printf, 5, 6))); int zmFifoDbgInit(Monitor * monitor); #endif // ZM_FIFO_DEBUG_H diff --git a/src/zm_fifo_stream.cpp b/src/zm_fifo_stream.cpp index cc232110e..45c394a4a 100644 --- a/src/zm_fifo_stream.cpp +++ b/src/zm_fifo_stream.cpp @@ -41,7 +41,7 @@ bool FifoStream::sendRAWFrames() { return false; } if ( fwrite(buffer, bytes_read, 1, stdout) != 1 ) { - if ( !zm_terminate ) + if ( !zm_terminate ) Error("Problem during writing: %s", strerror(errno)); close(fd); return false; @@ -61,8 +61,8 @@ bool FifoStream::sendMJEGFrames() { } total_read = 0; while ( - (bytes_read = read(fd, buffer+total_read, ZM_MAX_IMAGE_SIZE-total_read)) - ) { + (bytes_read = read(fd, buffer+total_read, ZM_MAX_IMAGE_SIZE-total_read)) + ) { if ( bytes_read < 0 ) { Error("Problem during reading: %s", strerror(errno)); close(fd); @@ -76,10 +76,10 @@ bool FifoStream::sendMJEGFrames() { return true; if ( fprintf(stdout, - "--" BOUNDARY "\r\n" - "Content-Type: image/jpeg\r\n" - "Content-Length: %d\r\n\r\n", - total_read) < 0 ) { + "--" BOUNDARY "\r\n" + "Content-Type: image/jpeg\r\n" + "Content-Length: %d\r\n\r\n", + total_read) < 0 ) { Error("Problem during writing: %s", strerror(errno)); return false; } diff --git a/src/zm_fifo_stream.h b/src/zm_fifo_stream.h index 332275771..c5cfe54e7 100644 --- a/src/zm_fifo_stream.h +++ b/src/zm_fifo_stream.h @@ -25,27 +25,27 @@ class Monitor; class FifoStream : public StreamBase { private: - std::string stream_path; - int total_read; - int bytes_read; + std::string stream_path; + int total_read; + int bytes_read; protected: - typedef enum { UNKNOWN, MJPEG, RAW } StreamType; - StreamType stream_type; - bool sendMJEGFrames(); - bool sendRAWFrames(); - void processCommand(const CmdMsg *msg) override {} + typedef enum { UNKNOWN, MJPEG, RAW } StreamType; + StreamType stream_type; + bool sendMJEGFrames(); + bool sendRAWFrames(); + void processCommand(const CmdMsg *msg) override {} public: - FifoStream() : - StreamBase(), - total_read(0), - bytes_read(0), - stream_type(UNKNOWN) - {} + FifoStream() : + StreamBase(), + total_read(0), + bytes_read(0), + stream_type(UNKNOWN) + {} - void setStreamStart(const std::string &path); - void setStreamStart(int monitor_id, const char * format); - void runStream() override; + void setStreamStart(const std::string &path); + void setStreamStart(int monitor_id, const char * format); + void runStream() override; }; #endif // ZM_FIFO_STREAM_H diff --git a/src/zm_file_camera.cpp b/src/zm_file_camera.cpp index 05d639da0..5df52272a 100644 --- a/src/zm_file_camera.cpp +++ b/src/zm_file_camera.cpp @@ -23,17 +23,17 @@ #include FileCamera::FileCamera( - const Monitor *monitor, - const char *p_path, - int p_width, - int p_height, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio) + const Monitor *monitor, + const char *p_path, + int p_width, + int p_height, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio) : Camera( monitor, FILE_SRC, @@ -47,8 +47,7 @@ FileCamera::FileCamera( p_colour, p_capture, p_record_audio), - path(p_path) -{ + path(p_path) { if (capture) { Initialise(); } diff --git a/src/zm_file_camera.h b/src/zm_file_camera.h index 7579ca98d..13d39621e 100644 --- a/src/zm_file_camera.h +++ b/src/zm_file_camera.h @@ -1,21 +1,21 @@ // // ZoneMinder File Camera Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_FILE_CAMERA_H #define ZM_FILE_CAMERA_H diff --git a/src/zm_font.cpp b/src/zm_font.cpp index 43a26283a..e02f339d6 100644 --- a/src/zm_font.cpp +++ b/src/zm_font.cpp @@ -29,7 +29,7 @@ constexpr uint8 FontVariant::kMaxCharWidth; FontVariant::FontVariant() : char_height_(0), char_width_(0), char_padding_(0), codepoint_count_(0) {} FontVariant::FontVariant(uint16 char_height, uint16 char_width, uint8 char_padding, std::vector bitmap) - : char_height_(char_height), char_width_(char_width), char_padding_(char_padding), bitmap_(std::move(bitmap)) { + : char_height_(char_height), char_width_(char_width), char_padding_(char_padding), bitmap_(std::move(bitmap)) { if (char_height_ > kMaxCharHeight) { throw std::invalid_argument("char_height > kMaxCharHeight"); } @@ -107,7 +107,7 @@ FontLoadError ZmFont::LoadFontFile(const std::string &loc) { font_file.read(reinterpret_cast(bitmap.data()), static_cast(bitmap_bytes)); variants_[i] = - {bitmap_header.char_height, bitmap_header.char_width, bitmap_header.char_padding, std::move(bitmap)}; + {bitmap_header.char_height, bitmap_header.char_width, bitmap_header.char_padding, std::move(bitmap)}; } if (font_file.fail()) { diff --git a/src/zm_frame.cpp b/src/zm_frame.cpp index aadd20f8d..2001694fe 100644 --- a/src/zm_frame.cpp +++ b/src/zm_frame.cpp @@ -7,10 +7,10 @@ Frame::Frame(event_id_t p_event_id, Microseconds p_delta, int p_score, std::vector p_stats) - : event_id(p_event_id), - frame_id(p_frame_id), - type(p_type), - timestamp(p_timestamp), - delta(p_delta), - score(p_score), - zone_stats(std::move(p_stats)) {} + : event_id(p_event_id), + frame_id(p_frame_id), + type(p_type), + timestamp(p_timestamp), + delta(p_delta), + score(p_score), + zone_stats(std::move(p_stats)) {} diff --git a/src/zm_frame.h b/src/zm_frame.h index 77c7a0398..7501898d6 100644 --- a/src/zm_frame.h +++ b/src/zm_frame.h @@ -1,21 +1,21 @@ // // ZoneMinder Frame Class Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_FRAME_H #define ZM_FRAME_H @@ -43,7 +43,7 @@ class Frame { Microseconds p_delta, int p_score, std::vector p_stats - ); + ); event_id_t event_id; int frame_id; diff --git a/src/zm_group.cpp b/src/zm_group.cpp index 0702aeb21..c8b9fc56f 100644 --- a/src/zm_group.cpp +++ b/src/zm_group.cpp @@ -1,17 +1,17 @@ /* * ZoneMinder regular expression class implementation, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -27,14 +27,15 @@ Group::Group() : id(0), parent_id(0), name("Default") { - Warning("Instantiating default Group Object. Should not happen."); + Warning("Instantiating default Group Object. Should not happen."); } // The order of columns is: Id, ParentId, Name Group::Group(const MYSQL_ROW &dbrow) { - unsigned int index = 0; - id = atoi(dbrow[index++]); - parent_id = dbrow[index] ? atoi(dbrow[index]): 0; index++; + unsigned int index = 0; + id = atoi(dbrow[index++]); + parent_id = dbrow[index] ? atoi(dbrow[index]): 0; + index++; name = dbrow[index++]; } @@ -92,10 +93,10 @@ std::vector Group::MonitorIds() { std::vector child_monitor_ids = child.MonitorIds(); if (!child_monitor_ids.empty()) { monitor_ids.insert( - monitor_ids.end(), - std::make_move_iterator(child_monitor_ids.begin()), - std::make_move_iterator(child_monitor_ids.end()) - ); + monitor_ids.end(), + std::make_move_iterator(child_monitor_ids.begin()), + std::make_move_iterator(child_monitor_ids.end()) + ); } } // end foreach child mysql_free_result(result); diff --git a/src/zm_group.h b/src/zm_group.h index 87f874b6b..c39d71069 100644 --- a/src/zm_group.h +++ b/src/zm_group.h @@ -1,21 +1,21 @@ /* * ZoneMinder Group Class Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ +*/ #ifndef ZM_GROUP_H #define ZM_GROUP_H diff --git a/src/zm_group_permission.cpp b/src/zm_group_permission.cpp index cf6c379e6..7a5e200c8 100644 --- a/src/zm_group_permission.cpp +++ b/src/zm_group_permission.cpp @@ -57,7 +57,7 @@ Group_Permission::Permission Group_Permission::getPermission(int monitor_id) { } for (auto i = monitor_ids.begin(); - i != monitor_ids.end(); ++i ) { + i != monitor_ids.end(); ++i ) { if ( *i == monitor_id ) { return permission; } diff --git a/src/zm_group_permission.h b/src/zm_group_permission.h index a83b7c720..a57bc13ff 100644 --- a/src/zm_group_permission.h +++ b/src/zm_group_permission.h @@ -1,21 +1,21 @@ /* * ZoneMinder Group_Permission Class Interface * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ @@ -45,7 +45,8 @@ class Group_Permission { Group_Permission(const Group_Permission &gp) { Copy(gp); } void Copy(const Group_Permission &u); Group_Permission& operator=(const Group_Permission &gp) { - Copy(gp); return *this; + Copy(gp); + return *this; } int Id() const { return id; } diff --git a/src/zm_image.cpp b/src/zm_image.cpp index 75604635b..26e69644c 100644 --- a/src/zm_image.cpp +++ b/src/zm_image.cpp @@ -116,27 +116,26 @@ void Image::update_function_pointers() { // This constructor is not used anywhere Image::Image() : - delta8_rgb(&std_delta8_rgb), - delta8_bgr(&std_delta8_bgr), - delta8_rgba(&std_delta8_rgba), - delta8_bgra(&std_delta8_bgra), - delta8_argb(&std_delta8_argb), - delta8_abgr(&std_delta8_abgr), - delta8_gray8(&std_delta8_gray8), - blend(&std_blend), - width(0), - linesize(0), - height(0), - pixels(0), - colours(0), - padding(0), - size(0), - subpixelorder(0), - allocation(0), - buffer(nullptr), - buffertype(ZM_BUFTYPE_DONTFREE), - holdbuffer(0) -{ + delta8_rgb(&std_delta8_rgb), + delta8_bgr(&std_delta8_bgr), + delta8_rgba(&std_delta8_rgba), + delta8_bgra(&std_delta8_bgra), + delta8_argb(&std_delta8_argb), + delta8_abgr(&std_delta8_abgr), + delta8_gray8(&std_delta8_gray8), + blend(&std_blend), + width(0), + linesize(0), + height(0), + pixels(0), + colours(0), + padding(0), + size(0), + subpixelorder(0), + allocation(0), + buffer(nullptr), + buffertype(ZM_BUFTYPE_DONTFREE), + holdbuffer(0) { if (!initialised) Initialise(); // Update blend to fast function determined by Initialise, I'm sure this can be improve. @@ -170,8 +169,7 @@ Image::Image(int p_width, int p_height, int p_colours, int p_subpixelorder, uint padding(p_padding), subpixelorder(p_subpixelorder), buffer(p_buffer), - holdbuffer(0) -{ + holdbuffer(0) { if (!initialised) Initialise(); @@ -195,8 +193,8 @@ Image::Image(int p_width, int p_height, int p_colours, int p_subpixelorder, uint linesize = FFALIGN(av_image_get_linesize(imagePixFormat, width, 0), 32); Debug(4, "line size: %d =? %d width %d Size %d ?= %d", linesize, - av_image_get_linesize(imagePixFormat, width, 0), - width, linesize * height + padding, size); + av_image_get_linesize(imagePixFormat, width, 0), + width, linesize * height + padding, size); AllocImgBuffer(size); } @@ -211,8 +209,7 @@ Image::Image(int p_width, int p_linesize, int p_height, int p_colours, int p_sub colours(p_colours), padding(p_padding), subpixelorder(p_subpixelorder), - buffer(p_buffer) -{ + buffer(p_buffer) { if ( !initialised ) Initialise(); pixels = width*height; @@ -241,8 +238,7 @@ Image::Image(const AVFrame *frame, int p_width, int p_height) : subpixelorder(ZM_SUBPIX_ORDER_RGBA), imagePixFormat(AV_PIX_FMT_RGBA), buffer(0), - holdbuffer(0) -{ + holdbuffer(0) { width = (p_width == -1 ? frame->width : p_width); height = (p_height == -1 ? frame->height : p_height); pixels = width * height; @@ -264,14 +260,14 @@ static void dont_free(void *opaque, uint8_t *data) { int Image::PopulateFrame(AVFrame *frame) { Debug(1, "PopulateFrame: width %d height %d linesize %d colours %d imagesize %d %s", - width, height, linesize, colours, size, - av_get_pix_fmt_name(imagePixFormat) - ); + width, height, linesize, colours, size, + av_get_pix_fmt_name(imagePixFormat) + ); AVBufferRef *ref = av_buffer_create(buffer, size, - dont_free, /* Free callback */ - nullptr, /* opaque */ - 0 /* flags */ - ); + dont_free, /* Free callback */ + nullptr, /* opaque */ + 0 /* flags */ + ); if (!ref) { Warning("Failed to create av_buffer"); } @@ -279,13 +275,13 @@ int Image::PopulateFrame(AVFrame *frame) { // From what I've read, we should align the linesizes to 32bit so that ffmpeg can use SIMD instructions too. int rc_size = av_image_fill_arrays( - frame->data, frame->linesize, - buffer, imagePixFormat, width, height, - 32 //alignment - ); + frame->data, frame->linesize, + buffer, imagePixFormat, width, height, + 32 //alignment + ); if (rc_size < 0) { Error("Problem setting up data pointers into image %s", - av_make_error_string(rc_size).c_str()); + av_make_error_string(rc_size).c_str()); return rc_size; } @@ -307,12 +303,12 @@ bool Image::Assign(const AVFrame *frame) { return false; } sws_convert_context = sws_getCachedContext( - sws_convert_context, - frame->width, frame->height, (AVPixelFormat)frame->format, - width, height, format, - SWS_BICUBIC, - //SWS_POINT | SWS_BITEXACT, - nullptr, nullptr, nullptr); + sws_convert_context, + frame->width, frame->height, (AVPixelFormat)frame->format, + width, height, format, + SWS_BICUBIC, + //SWS_POINT | SWS_BITEXACT, + nullptr, nullptr, nullptr); if (sws_convert_context == nullptr) { Error("Unable to create conversion context"); return false; @@ -329,14 +325,14 @@ bool Image::Assign(const AVFrame *frame, SwsContext *convert_context, AVFrame *t Debug(1, "Assign src linesize: %d, dest linesize: %d", frame->linesize[0], temp_frame->linesize[0]); int ret = sws_scale(convert_context, - frame->data, frame->linesize, 0, frame->height, - temp_frame->data, temp_frame->linesize); + frame->data, frame->linesize, 0, frame->height, + temp_frame->data, temp_frame->linesize); if (ret < 0) { AVPixelFormat format = (AVPixelFormat)AVPixFormat(); Error("Unable to convert raw format %u %s %ux%u to target format %u %s %ux%u: %s", - frame->format, av_get_pix_fmt_name(static_cast(frame->format)), frame->width, frame->height, - format, av_get_pix_fmt_name(format), width, height, - av_make_error_string(ret).c_str()); + frame->format, av_get_pix_fmt_name(static_cast(frame->format)), frame->width, frame->height, + format, av_get_pix_fmt_name(format), width, height, + av_make_error_string(ret).c_str()); return false; } zm_dump_video_frame(temp_frame, "dest frame after convert"); @@ -603,16 +599,16 @@ void Image::Initialise() { /* Requests a writeable buffer to the image. This is safer than buffer() because this way we can guarantee that a buffer of required size exists */ uint8_t* Image::WriteBuffer( - const unsigned int p_width, - const unsigned int p_height, - const unsigned int p_colours, - const unsigned int p_subpixelorder) { + const unsigned int p_width, + const unsigned int p_height, + const unsigned int p_colours, + const unsigned int p_subpixelorder) { if ( p_colours != ZM_COLOUR_GRAY8 - && - p_colours != ZM_COLOUR_RGB24 - && - p_colours != ZM_COLOUR_RGB32 ) { + && + p_colours != ZM_COLOUR_RGB24 + && + p_colours != ZM_COLOUR_RGB32 ) { Error("WriteBuffer called with unexpected colours: %d", p_colours); return nullptr; } @@ -657,13 +653,13 @@ uint8_t* Image::WriteBuffer( The goal is to reduce the amount of memory copying and increase efficiency and buffer reusing. */ void Image::AssignDirect( - const unsigned int p_width, - const unsigned int p_height, - const unsigned int p_colours, - const unsigned int p_subpixelorder, - uint8_t *new_buffer, - const size_t buffer_size, - const int p_buffertype) { + const unsigned int p_width, + const unsigned int p_height, + const unsigned int p_colours, + const unsigned int p_subpixelorder, + uint8_t *new_buffer, + const size_t buffer_size, + const int p_buffertype) { if ( new_buffer == nullptr ) { Error("Attempt to directly assign buffer from a NULL pointer"); @@ -684,7 +680,7 @@ void Image::AssignDirect( if ( buffer_size < new_buffer_size ) { Error("Attempt to directly assign buffer from an undersized buffer of size: %zu, needed %dx%d*%d colours = %zu", - buffer_size, p_width, p_height, p_colours, new_buffer_size); + buffer_size, p_width, p_height, p_colours, new_buffer_size); return; } @@ -719,12 +715,12 @@ void Image::AssignDirect( } // end void Image::AssignDirect void Image::Assign( - const unsigned int p_width, - const unsigned int p_height, - const unsigned int p_colours, - const unsigned int p_subpixelorder, - const uint8_t* new_buffer, - const size_t buffer_size) { + const unsigned int p_width, + const unsigned int p_height, + const unsigned int p_colours, + const unsigned int p_subpixelorder, + const uint8_t* new_buffer, + const size_t buffer_size) { if ( new_buffer == nullptr ) { Error("Attempt to assign buffer from a NULL pointer"); @@ -783,18 +779,18 @@ void Image::Assign(const Image &image) { } if ( image.colours != ZM_COLOUR_GRAY8 - && - image.colours != ZM_COLOUR_RGB24 - && - image.colours != ZM_COLOUR_RGB32 ) { + && + image.colours != ZM_COLOUR_RGB24 + && + image.colours != ZM_COLOUR_RGB32 ) { Error("Attempt to assign image with unexpected colours per pixel: %d", image.colours); return; } if ( !buffer - || image.width != width || image.height != height - || image.colours != colours || image.subpixelorder != subpixelorder - ) { + || image.width != width || image.height != height + || image.colours != colours || image.subpixelorder != subpixelorder + ) { if ( holdbuffer && buffer ) { if ( new_size > allocation ) { @@ -836,11 +832,11 @@ void Image::Assign(const Image &image) { } Image *Image::HighlightEdges( - Rgb colour, - unsigned int p_colours, - unsigned int p_subpixelorder, - const Box *limits - ) { + Rgb colour, + unsigned int p_colours, + unsigned int p_subpixelorder, + const Box *limits +) { if ( colours != ZM_COLOUR_GRAY8 ) { Panic("Attempt to highlight image edges when colours = %d", colours); } @@ -1026,57 +1022,57 @@ bool Image::ReadJpeg(const std::string &filename, unsigned int p_colours, unsign } switch (p_colours) { - case ZM_COLOUR_GRAY8: - readjpg_dcinfo->out_color_space = JCS_GRAYSCALE; - new_colours = ZM_COLOUR_GRAY8; - new_subpixelorder = ZM_SUBPIX_ORDER_NONE; - break; - case ZM_COLOUR_RGB32: + case ZM_COLOUR_GRAY8: + readjpg_dcinfo->out_color_space = JCS_GRAYSCALE; + new_colours = ZM_COLOUR_GRAY8; + new_subpixelorder = ZM_SUBPIX_ORDER_NONE; + break; + case ZM_COLOUR_RGB32: #ifdef JCS_EXTENSIONS - new_colours = ZM_COLOUR_RGB32; - if (p_subpixelorder == ZM_SUBPIX_ORDER_BGRA) { - readjpg_dcinfo->out_color_space = JCS_EXT_BGRX; - new_subpixelorder = ZM_SUBPIX_ORDER_BGRA; - } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ARGB) { - readjpg_dcinfo->out_color_space = JCS_EXT_XRGB; - new_subpixelorder = ZM_SUBPIX_ORDER_ARGB; - } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ABGR) { - readjpg_dcinfo->out_color_space = JCS_EXT_XBGR; - new_subpixelorder = ZM_SUBPIX_ORDER_ABGR; - } else { - /* Assume RGBA */ - readjpg_dcinfo->out_color_space = JCS_EXT_RGBX; - new_subpixelorder = ZM_SUBPIX_ORDER_RGBA; - } - break; + new_colours = ZM_COLOUR_RGB32; + if (p_subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + readjpg_dcinfo->out_color_space = JCS_EXT_BGRX; + new_subpixelorder = ZM_SUBPIX_ORDER_BGRA; + } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + readjpg_dcinfo->out_color_space = JCS_EXT_XRGB; + new_subpixelorder = ZM_SUBPIX_ORDER_ARGB; + } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + readjpg_dcinfo->out_color_space = JCS_EXT_XBGR; + new_subpixelorder = ZM_SUBPIX_ORDER_ABGR; + } else { + /* Assume RGBA */ + readjpg_dcinfo->out_color_space = JCS_EXT_RGBX; + new_subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } + break; #else - Warning("libjpeg-turbo is required for reading a JPEG directly into a RGB32 buffer, reading into a RGB24 buffer instead."); + Warning("libjpeg-turbo is required for reading a JPEG directly into a RGB32 buffer, reading into a RGB24 buffer instead."); #endif - case ZM_COLOUR_RGB24: - default: - new_colours = ZM_COLOUR_RGB24; - if (p_subpixelorder == ZM_SUBPIX_ORDER_BGR) { + case ZM_COLOUR_RGB24: + default: + new_colours = ZM_COLOUR_RGB24; + if (p_subpixelorder == ZM_SUBPIX_ORDER_BGR) { #ifdef JCS_EXTENSIONS - readjpg_dcinfo->out_color_space = JCS_EXT_BGR; - new_subpixelorder = ZM_SUBPIX_ORDER_BGR; + readjpg_dcinfo->out_color_space = JCS_EXT_BGR; + new_subpixelorder = ZM_SUBPIX_ORDER_BGR; #else - Warning("libjpeg-turbo is required for reading a JPEG directly into a BGR24 buffer, reading into a RGB24 buffer instead."); - cinfo->out_color_space = JCS_RGB; - new_subpixelorder = ZM_SUBPIX_ORDER_RGB; + Warning("libjpeg-turbo is required for reading a JPEG directly into a BGR24 buffer, reading into a RGB24 buffer instead."); + cinfo->out_color_space = JCS_RGB; + new_subpixelorder = ZM_SUBPIX_ORDER_RGB; #endif - } else { - /* Assume RGB */ - /* -#ifdef JCS_EXTENSIONS -cinfo->out_color_space = JCS_EXT_RGB; -#else -cinfo->out_color_space = JCS_RGB; -#endif - */ - readjpg_dcinfo->out_color_space = JCS_RGB; - new_subpixelorder = ZM_SUBPIX_ORDER_RGB; - } - break; + } else { + /* Assume RGB */ + /* + #ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_RGB; + #else + cinfo->out_color_space = JCS_RGB; + #endif + */ + readjpg_dcinfo->out_color_space = JCS_RGB; + new_subpixelorder = ZM_SUBPIX_ORDER_RGB; + } + break; } // end switch p_colours if (WriteBuffer(new_width, new_height, new_colours, new_subpixelorder) == nullptr) { @@ -1190,63 +1186,63 @@ bool Image::WriteJpeg(const std::string &filename, cinfo->image_height = height; switch (colours) { - case ZM_COLOUR_GRAY8: - cinfo->input_components = 1; - cinfo->in_color_space = JCS_GRAYSCALE; - break; - case ZM_COLOUR_RGB32: + case ZM_COLOUR_GRAY8: + cinfo->input_components = 1; + cinfo->in_color_space = JCS_GRAYSCALE; + break; + case ZM_COLOUR_RGB32: #ifdef JCS_EXTENSIONS - cinfo->input_components = 4; - if (subpixelorder == ZM_SUBPIX_ORDER_RGBA) { - cinfo->in_color_space = JCS_EXT_RGBX; - } else if (subpixelorder == ZM_SUBPIX_ORDER_BGRA) { - cinfo->in_color_space = JCS_EXT_BGRX; - } else if (subpixelorder == ZM_SUBPIX_ORDER_ARGB) { - cinfo->in_color_space = JCS_EXT_XRGB; - } else if (subpixelorder == ZM_SUBPIX_ORDER_ABGR) { - cinfo->in_color_space = JCS_EXT_XBGR; - } else { - Warning("Unknown subpixelorder %d", subpixelorder); - /* Assume RGBA */ - cinfo->in_color_space = JCS_EXT_RGBX; - } - break; + cinfo->input_components = 4; + if (subpixelorder == ZM_SUBPIX_ORDER_RGBA) { + cinfo->in_color_space = JCS_EXT_RGBX; + } else if (subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + cinfo->in_color_space = JCS_EXT_BGRX; + } else if (subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + cinfo->in_color_space = JCS_EXT_XRGB; + } else if (subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + cinfo->in_color_space = JCS_EXT_XBGR; + } else { + Warning("Unknown subpixelorder %d", subpixelorder); + /* Assume RGBA */ + cinfo->in_color_space = JCS_EXT_RGBX; + } + break; #else - Error("libjpeg-turbo is required for JPEG encoding directly from RGB32 source"); + Error("libjpeg-turbo is required for JPEG encoding directly from RGB32 source"); + jpeg_abort_compress(cinfo); + fl.l_type = F_UNLCK; + fcntl(raw_fd, F_SETLK, &fl); + fclose(outfile); + return false; +#endif + case ZM_COLOUR_RGB24: + default: + cinfo->input_components = 3; + if (subpixelorder == ZM_SUBPIX_ORDER_BGR) { +#ifdef JCS_EXTENSIONS + cinfo->in_color_space = JCS_EXT_BGR; +#else + Error("libjpeg-turbo is required for JPEG encoding directly from BGR24 source"); jpeg_abort_compress(cinfo); fl.l_type = F_UNLCK; fcntl(raw_fd, F_SETLK, &fl); fclose(outfile); return false; #endif - case ZM_COLOUR_RGB24: - default: - cinfo->input_components = 3; - if (subpixelorder == ZM_SUBPIX_ORDER_BGR) { -#ifdef JCS_EXTENSIONS - cinfo->in_color_space = JCS_EXT_BGR; -#else - Error("libjpeg-turbo is required for JPEG encoding directly from BGR24 source"); - jpeg_abort_compress(cinfo); - fl.l_type = F_UNLCK; - fcntl(raw_fd, F_SETLK, &fl); - fclose(outfile); - return false; -#endif - } else if (subpixelorder == ZM_SUBPIX_ORDER_YUV420P) { - cinfo->in_color_space = JCS_YCbCr; - } else { - /* Assume RGB */ - /* -#ifdef JCS_EXTENSIONS -cinfo->out_color_space = JCS_EXT_RGB; -#else -cinfo->out_color_space = JCS_RGB; -#endif -*/ - cinfo->in_color_space = JCS_RGB; - } - break; + } else if (subpixelorder == ZM_SUBPIX_ORDER_YUV420P) { + cinfo->in_color_space = JCS_YCbCr; + } else { + /* Assume RGB */ + /* + #ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_RGB; + #else + cinfo->out_color_space = JCS_RGB; + #endif + */ + cinfo->in_color_space = JCS_RGB; + } + break; } // end switch(colours) jpeg_set_defaults(cinfo); @@ -1278,12 +1274,13 @@ cinfo->out_color_space = JCS_RGB; snprintf(msbuf, sizeof msbuf, "%06d", static_cast(ts_usec.count())); unsigned char exiftimes[82] = { - 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x69, 0x87, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x03, 0x90, 0x02, 0x00, 0x14, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x91, 0x92, - 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x00}; + 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x69, 0x87, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x03, 0x90, 0x02, 0x00, 0x14, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x91, 0x92, + 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00 + }; memcpy(&exiftimes[EXIFTIMES_OFFSET], timebuf, EXIFTIMES_LEN); memcpy(&exiftimes[EXIFTIMES_MS_OFFSET], msbuf, EXIFTIMES_MS_LEN); jpeg_write_marker(cinfo, EXIF_CODE, (const JOCTET *) exiftimes, sizeof(exiftimes)); @@ -1324,8 +1321,7 @@ cinfo->out_color_space = JCS_RGB; return true; } -bool Image::DecodeJpeg(const JOCTET *inbuffer, int inbuffer_size, unsigned int p_colours, unsigned int p_subpixelorder) -{ +bool Image::DecodeJpeg(const JOCTET *inbuffer, int inbuffer_size, unsigned int p_colours, unsigned int p_subpixelorder) { unsigned int new_width, new_height, new_colours, new_subpixelorder; if (!decodejpg_dcinfo) { @@ -1366,57 +1362,57 @@ bool Image::DecodeJpeg(const JOCTET *inbuffer, int inbuffer_size, unsigned int p } switch (p_colours) { - case ZM_COLOUR_GRAY8: - decodejpg_dcinfo->out_color_space = JCS_GRAYSCALE; - new_colours = ZM_COLOUR_GRAY8; - new_subpixelorder = ZM_SUBPIX_ORDER_NONE; - break; - case ZM_COLOUR_RGB32: + case ZM_COLOUR_GRAY8: + decodejpg_dcinfo->out_color_space = JCS_GRAYSCALE; + new_colours = ZM_COLOUR_GRAY8; + new_subpixelorder = ZM_SUBPIX_ORDER_NONE; + break; + case ZM_COLOUR_RGB32: #ifdef JCS_EXTENSIONS - new_colours = ZM_COLOUR_RGB32; - if (p_subpixelorder == ZM_SUBPIX_ORDER_BGRA) { - decodejpg_dcinfo->out_color_space = JCS_EXT_BGRX; - new_subpixelorder = ZM_SUBPIX_ORDER_BGRA; - } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ARGB) { - decodejpg_dcinfo->out_color_space = JCS_EXT_XRGB; - new_subpixelorder = ZM_SUBPIX_ORDER_ARGB; - } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ABGR) { - decodejpg_dcinfo->out_color_space = JCS_EXT_XBGR; - new_subpixelorder = ZM_SUBPIX_ORDER_ABGR; - } else { - /* Assume RGBA */ - decodejpg_dcinfo->out_color_space = JCS_EXT_RGBX; - new_subpixelorder = ZM_SUBPIX_ORDER_RGBA; - } - break; + new_colours = ZM_COLOUR_RGB32; + if (p_subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + decodejpg_dcinfo->out_color_space = JCS_EXT_BGRX; + new_subpixelorder = ZM_SUBPIX_ORDER_BGRA; + } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + decodejpg_dcinfo->out_color_space = JCS_EXT_XRGB; + new_subpixelorder = ZM_SUBPIX_ORDER_ARGB; + } else if (p_subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + decodejpg_dcinfo->out_color_space = JCS_EXT_XBGR; + new_subpixelorder = ZM_SUBPIX_ORDER_ABGR; + } else { + /* Assume RGBA */ + decodejpg_dcinfo->out_color_space = JCS_EXT_RGBX; + new_subpixelorder = ZM_SUBPIX_ORDER_RGBA; + } + break; #else - Warning("libjpeg-turbo is required for reading a JPEG directly into a RGB32 buffer, reading into a RGB24 buffer instead."); + Warning("libjpeg-turbo is required for reading a JPEG directly into a RGB32 buffer, reading into a RGB24 buffer instead."); #endif - case ZM_COLOUR_RGB24: - default: - new_colours = ZM_COLOUR_RGB24; - if (p_subpixelorder == ZM_SUBPIX_ORDER_BGR) { + case ZM_COLOUR_RGB24: + default: + new_colours = ZM_COLOUR_RGB24; + if (p_subpixelorder == ZM_SUBPIX_ORDER_BGR) { #ifdef JCS_EXTENSIONS - decodejpg_dcinfo->out_color_space = JCS_EXT_BGR; - new_subpixelorder = ZM_SUBPIX_ORDER_BGR; + decodejpg_dcinfo->out_color_space = JCS_EXT_BGR; + new_subpixelorder = ZM_SUBPIX_ORDER_BGR; #else - Warning("libjpeg-turbo is required for reading a JPEG directly into a BGR24 buffer, reading into a RGB24 buffer instead."); - cinfo->out_color_space = JCS_RGB; - new_subpixelorder = ZM_SUBPIX_ORDER_RGB; + Warning("libjpeg-turbo is required for reading a JPEG directly into a BGR24 buffer, reading into a RGB24 buffer instead."); + cinfo->out_color_space = JCS_RGB; + new_subpixelorder = ZM_SUBPIX_ORDER_RGB; #endif - } else { - /* Assume RGB */ - /* -#ifdef JCS_EXTENSIONS -cinfo->out_color_space = JCS_EXT_RGB; -#else -cinfo->out_color_space = JCS_RGB; -#endif - */ - decodejpg_dcinfo->out_color_space = JCS_RGB; - new_subpixelorder = ZM_SUBPIX_ORDER_RGB; - } - break; + } else { + /* Assume RGB */ + /* + #ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_RGB; + #else + cinfo->out_color_space = JCS_RGB; + #endif + */ + decodejpg_dcinfo->out_color_space = JCS_RGB; + new_subpixelorder = ZM_SUBPIX_ORDER_RGB; + } + break; } // end switch if (WriteBuffer(new_width, new_height, new_colours, new_subpixelorder) == nullptr) { @@ -1465,55 +1461,55 @@ bool Image::EncodeJpeg(JOCTET *outbuffer, int *outbuffer_size, int quality_overr cinfo->image_height = height; switch ( colours ) { - case ZM_COLOUR_GRAY8: - cinfo->input_components = 1; - cinfo->in_color_space = JCS_GRAYSCALE; - break; - case ZM_COLOUR_RGB32: + case ZM_COLOUR_GRAY8: + cinfo->input_components = 1; + cinfo->in_color_space = JCS_GRAYSCALE; + break; + case ZM_COLOUR_RGB32: #ifdef JCS_EXTENSIONS - cinfo->input_components = 4; - if ( subpixelorder == ZM_SUBPIX_ORDER_RGBA ) { - cinfo->in_color_space = JCS_EXT_RGBX; - } else if ( subpixelorder == ZM_SUBPIX_ORDER_BGRA ) { - cinfo->in_color_space = JCS_EXT_BGRX; - } else if ( subpixelorder == ZM_SUBPIX_ORDER_ARGB ) { - cinfo->in_color_space = JCS_EXT_XRGB; - } else if ( subpixelorder == ZM_SUBPIX_ORDER_ABGR ) { - cinfo->in_color_space = JCS_EXT_XBGR; - } else { - Warning("unknown subpixelorder %d", subpixelorder); - /* Assume RGBA */ - cinfo->in_color_space = JCS_EXT_RGBX; - } - break; + cinfo->input_components = 4; + if ( subpixelorder == ZM_SUBPIX_ORDER_RGBA ) { + cinfo->in_color_space = JCS_EXT_RGBX; + } else if ( subpixelorder == ZM_SUBPIX_ORDER_BGRA ) { + cinfo->in_color_space = JCS_EXT_BGRX; + } else if ( subpixelorder == ZM_SUBPIX_ORDER_ARGB ) { + cinfo->in_color_space = JCS_EXT_XRGB; + } else if ( subpixelorder == ZM_SUBPIX_ORDER_ABGR ) { + cinfo->in_color_space = JCS_EXT_XBGR; + } else { + Warning("unknown subpixelorder %d", subpixelorder); + /* Assume RGBA */ + cinfo->in_color_space = JCS_EXT_RGBX; + } + break; #else - Error("libjpeg-turbo is required for JPEG encoding directly from RGB32 source"); - jpeg_abort_compress(cinfo); - return false; + Error("libjpeg-turbo is required for JPEG encoding directly from RGB32 source"); + jpeg_abort_compress(cinfo); + return false; #endif - case ZM_COLOUR_RGB24: - default: - cinfo->input_components = 3; - if ( subpixelorder == ZM_SUBPIX_ORDER_BGR ) { + case ZM_COLOUR_RGB24: + default: + cinfo->input_components = 3; + if ( subpixelorder == ZM_SUBPIX_ORDER_BGR ) { #ifdef JCS_EXTENSIONS - cinfo->in_color_space = JCS_EXT_BGR; + cinfo->in_color_space = JCS_EXT_BGR; #else - Error("libjpeg-turbo is required for JPEG encoding directly from BGR24 source"); - jpeg_abort_compress(cinfo); - return false; + Error("libjpeg-turbo is required for JPEG encoding directly from BGR24 source"); + jpeg_abort_compress(cinfo); + return false; #endif - } else { - /* Assume RGB */ - /* -#ifdef JCS_EXTENSIONS -cinfo->out_color_space = JCS_EXT_RGB; -#else -cinfo->out_color_space = JCS_RGB; -#endif - */ - cinfo->in_color_space = JCS_RGB; - } - break; + } else { + /* Assume RGB */ + /* + #ifdef JCS_EXTENSIONS + cinfo->out_color_space = JCS_EXT_RGB; + #else + cinfo->out_color_space = JCS_RGB; + #endif + */ + cinfo->in_color_space = JCS_RGB; + } + break; } // end switch jpeg_set_defaults(cinfo); @@ -1568,7 +1564,7 @@ bool Image::Crop( unsigned int lo_x, unsigned int lo_y, unsigned int hi_x, unsig } if ( hi_x > (width-1) || ( hi_y > (height-1) ) ) { Error("Attempting to crop outside image, %d,%d -> %d,%d not in %d,%d", - lo_x, lo_y, hi_x, hi_y, width-1, height-1); + lo_x, lo_y, hi_x, hi_y, width-1, height-1); return false; } if ( (new_width == width) && (new_height == height) ) { @@ -1598,12 +1594,12 @@ bool Image::Crop(const Box &limits) { void Image::Overlay( const Image &image ) { if ( !(width == image.width && height == image.height) ) { Panic("Attempt to overlay different sized images, expected %dx%d, got %dx%d", - width, height, image.width, image.height); + width, height, image.width, image.height); } if ( colours == image.colours && subpixelorder != image.subpixelorder ) { Warning("Attempt to overlay images of same format but with different subpixel order %d != %d.", - subpixelorder, image.subpixelorder); + subpixelorder, image.subpixelorder); } /* Grayscale on top of grayscale - complete */ @@ -1763,17 +1759,17 @@ void Image::Overlay( const Image &image ) { void Image::Overlay( const Image &image, const unsigned int lo_x, const unsigned int lo_y ) { if ( !(width < image.width || height < image.height) ) { Panic("Attempt to overlay image too big for destination, %dx%d > %dx%d", - image.width, image.height, width, height ); + image.width, image.height, width, height ); } if ( !(width < (lo_x+image.width) || height < (lo_y+image.height)) ) { Panic("Attempt to overlay image outside of destination bounds, %dx%d @ %dx%d > %dx%d", - image.width, image.height, lo_x, lo_y, width, height ); + image.width, image.height, lo_x, lo_y, width, height ); } if ( !(colours == image.colours) ) { Panic("Attempt to partial overlay differently coloured images, expected %d, got %d", - colours, image.colours); + colours, image.colours); } unsigned int hi_x = (lo_x+image.width)-1; @@ -1812,12 +1808,12 @@ void Image::Overlay( const Image &image, const unsigned int lo_x, const unsigned void Image::Blend( const Image &image, int transparency ) { if ( !( - width == image.width && height == image.height - && colours == image.colours - && subpixelorder == image.subpixelorder - ) ) { + width == image.width && height == image.height + && colours == image.colours + && subpixelorder == image.subpixelorder + ) ) { Panic("Attempt to blend different sized images, expected %dx%dx%d %d, got %dx%dx%d %d", - width, height, colours, subpixelorder, image.width, image.height, image.colours, image.subpixelorder ); + width, height, colours, subpixelorder, image.width, image.height, image.colours, image.subpixelorder ); } if ( transparency <= 0 ) @@ -1855,7 +1851,7 @@ Image *Image::Merge(unsigned int n_images, Image *images[]) { for ( unsigned int i = 1; i < n_images; i++ ) { if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) { Panic("Attempt to merge different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", - width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); + width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); } } @@ -1884,7 +1880,7 @@ Image *Image::Merge(unsigned int n_images, Image *images[], double weight) { for ( unsigned int i = 1; i < n_images; i++ ) { if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) { Panic("Attempt to merge different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", - width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); + width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); } } @@ -1913,7 +1909,7 @@ Image *Image::Highlight( unsigned int n_images, Image *images[], const Rgb thres for ( unsigned int i = 1; i < n_images; i++ ) { if ( !(width == images[i]->width && height == images[i]->height && colours == images[i]->colours) ) { Panic( "Attempt to highlight different sized images, expected %dx%dx%d, got %dx%dx%d, for image %d", - width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); + width, height, colours, images[i]->width, images[i]->height, images[i]->colours, i ); } } @@ -1928,9 +1924,9 @@ Image *Image::Highlight( unsigned int n_images, Image *images[], const Rgb thres for ( unsigned int j = 0; j < n_images; j++ ) { uint8_t *psrc = images[j]->buffer+c; - unsigned int diff = ((*psrc)-ref_colour_rgb) > 0 ? (*psrc)-ref_colour_rgb : ref_colour_rgb - (*psrc); + unsigned int diff = ((*psrc)-ref_colour_rgb) > 0 ? (*psrc)-ref_colour_rgb : ref_colour_rgb - (*psrc); - if (diff >= RGB_VAL(threshold,c)) { + if (diff >= RGB_VAL(threshold,c)) { count++; } psrc += colours; @@ -1946,7 +1942,7 @@ Image *Image::Highlight( unsigned int n_images, Image *images[], const Rgb thres void Image::Delta(const Image &image, Image* targetimage) const { if ( !(width == image.width && height == image.height && colours == image.colours && subpixelorder == image.subpixelorder) ) { Panic( "Attempt to get delta of different sized images, expected %dx%dx%d %d, got %dx%dx%d %d", - width, height, colours, subpixelorder, image.width, image.height, image.colours, image.subpixelorder); + width, height, colours, subpixelorder, image.width, image.height, image.colours, image.subpixelorder); } uint8_t *pdiff = targetimage->WriteBuffer(width, height, ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE); @@ -1960,36 +1956,36 @@ void Image::Delta(const Image &image, Image* targetimage) const { #endif switch ( colours ) { - case ZM_COLOUR_RGB24: - if ( subpixelorder == ZM_SUBPIX_ORDER_BGR ) { - /* BGR subpixel order */ - (*delta8_bgr)(buffer, image.buffer, pdiff, pixels); - } else { - /* Assume RGB subpixel order */ - (*delta8_rgb)(buffer, image.buffer, pdiff, pixels); - } - break; - case ZM_COLOUR_RGB32: - if ( subpixelorder == ZM_SUBPIX_ORDER_ARGB ) { - /* ARGB subpixel order */ - (*delta8_argb)(buffer, image.buffer, pdiff, pixels); - } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { - /* ABGR subpixel order */ - (*delta8_abgr)(buffer, image.buffer, pdiff, pixels); - } else if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { - /* BGRA subpixel order */ - (*delta8_bgra)(buffer, image.buffer, pdiff, pixels); - } else { - /* Assume RGBA subpixel order */ - (*delta8_rgba)(buffer, image.buffer, pdiff, pixels); - } - break; - case ZM_COLOUR_GRAY8: - (*delta8_gray8)(buffer, image.buffer, pdiff, pixels); - break; - default: - Panic("Delta called with unexpected colours: %d",colours); - break; + case ZM_COLOUR_RGB24: + if ( subpixelorder == ZM_SUBPIX_ORDER_BGR ) { + /* BGR subpixel order */ + (*delta8_bgr)(buffer, image.buffer, pdiff, pixels); + } else { + /* Assume RGB subpixel order */ + (*delta8_rgb)(buffer, image.buffer, pdiff, pixels); + } + break; + case ZM_COLOUR_RGB32: + if ( subpixelorder == ZM_SUBPIX_ORDER_ARGB ) { + /* ARGB subpixel order */ + (*delta8_argb)(buffer, image.buffer, pdiff, pixels); + } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + /* ABGR subpixel order */ + (*delta8_abgr)(buffer, image.buffer, pdiff, pixels); + } else if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* BGRA subpixel order */ + (*delta8_bgra)(buffer, image.buffer, pdiff, pixels); + } else { + /* Assume RGBA subpixel order */ + (*delta8_rgba)(buffer, image.buffer, pdiff, pixels); + } + break; + case ZM_COLOUR_GRAY8: + (*delta8_gray8)(buffer, image.buffer, pdiff, pixels); + break; + default: + Panic("Delta called with unexpected colours: %d",colours); + break; } #ifdef ZM_IMAGE_PROFILING @@ -2078,11 +2074,11 @@ void Image::MaskPrivacy( const unsigned char *p_bitmask, const Rgb pixel_colour https://lemire.me/blog/2018/02/21/iterating-over-set-bits-quickly/ */ void Image::Annotate( - const std::string &text, - const Vector2 &coord, - const uint8 size, - const Rgb fg_colour, - const Rgb bg_colour) { + const std::string &text, + const Vector2 &coord, + const uint8 size, + const Rgb fg_colour, + const Rgb bg_colour) { annotation_ = text; const Rgb fg_rgb_col = rgb_convert(fg_colour, subpixelorder); @@ -2281,77 +2277,77 @@ void Image::DeColourise() { if ( colours == ZM_COLOUR_RGB32 && config.cpu_extensions && sse_version >= 35 ) { /* Use SSSE3 functions */ switch (subpixelorder) { - case ZM_SUBPIX_ORDER_BGRA: - ssse3_convert_bgra_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_ARGB: - ssse3_convert_argb_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_ABGR: - ssse3_convert_abgr_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_RGBA: - default: - ssse3_convert_rgba_gray8(buffer,buffer,pixels); - break; + case ZM_SUBPIX_ORDER_BGRA: + ssse3_convert_bgra_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_ARGB: + ssse3_convert_argb_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_ABGR: + ssse3_convert_abgr_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_RGBA: + default: + ssse3_convert_rgba_gray8(buffer,buffer,pixels); + break; } } else { /* Use standard functions */ if ( colours == ZM_COLOUR_RGB32 ) { if ( pixels % 16 ) { switch (subpixelorder) { - case ZM_SUBPIX_ORDER_BGRA: - std_convert_bgra_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_ARGB: - std_convert_argb_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_ABGR: - std_convert_abgr_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_RGBA: - default: - std_convert_rgba_gray8(buffer,buffer,pixels); - break; + case ZM_SUBPIX_ORDER_BGRA: + std_convert_bgra_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_ARGB: + std_convert_argb_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_ABGR: + std_convert_abgr_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_RGBA: + default: + std_convert_rgba_gray8(buffer,buffer,pixels); + break; } } else { switch (subpixelorder) { - case ZM_SUBPIX_ORDER_BGRA: - fast_convert_bgra_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_ARGB: - fast_convert_argb_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_ABGR: - fast_convert_abgr_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_RGBA: - default: - fast_convert_rgba_gray8(buffer,buffer,pixels); - break; + case ZM_SUBPIX_ORDER_BGRA: + fast_convert_bgra_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_ARGB: + fast_convert_argb_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_ABGR: + fast_convert_abgr_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_RGBA: + default: + fast_convert_rgba_gray8(buffer,buffer,pixels); + break; } } // end if pixels % 16 to use loop unrolled functions } else { /* Assume RGB24 */ if ( pixels % 12 ) { switch (subpixelorder) { - case ZM_SUBPIX_ORDER_BGR: - std_convert_bgr_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_RGB: - default: - std_convert_rgb_gray8(buffer,buffer,pixels); - break; + case ZM_SUBPIX_ORDER_BGR: + std_convert_bgr_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_RGB: + default: + std_convert_rgb_gray8(buffer,buffer,pixels); + break; } } else { switch (subpixelorder) { - case ZM_SUBPIX_ORDER_BGR: - fast_convert_bgr_gray8(buffer,buffer,pixels); - break; - case ZM_SUBPIX_ORDER_RGB: - default: - fast_convert_rgb_gray8(buffer,buffer,pixels); - break; + case ZM_SUBPIX_ORDER_BGR: + fast_convert_bgr_gray8(buffer,buffer,pixels); + break; + case ZM_SUBPIX_ORDER_RGB: + default: + fast_convert_rgb_gray8(buffer,buffer,pixels); + break; } } // end if pixels % 12 to use loop unrolled functions } @@ -2387,7 +2383,7 @@ void Image::Fill( Rgb colour, const Box *limits ) { BLUE_PTR_RGBA(p) = BLUE_VAL_RGBA(colour); } } - } else if ( colours == ZM_COLOUR_RGB32 ) /* RGB32 */ { + } else if ( colours == ZM_COLOUR_RGB32 ) { /* RGB32 */ for ( unsigned int y = lo_y; y <= (unsigned int)hi_y; y++ ) { Rgb *p = (Rgb*)&buffer[((y*width)+lo_x)<<2]; @@ -2435,7 +2431,7 @@ void Image::Fill( Rgb colour, int density, const Box *limits ) { } } } - } else if ( colours == ZM_COLOUR_RGB32 ) /* RGB32 */ { + } else if ( colours == ZM_COLOUR_RGB32 ) { /* RGB32 */ for ( unsigned int y = lo_y; y <= hi_y; y++ ) { Rgb* p = (Rgb*)&buffer[((y*width)+lo_x)<<2]; @@ -2649,111 +2645,108 @@ void Image::Rotate(int angle) { uint8_t* rotate_buffer = AllocBuffer(size); switch ( angle ) { - case 90 : - { - new_height = width; - new_width = height; + case 90 : { + new_height = width; + new_width = height; - unsigned int line_bytes = new_width*colours; - unsigned char *s_ptr = buffer; + unsigned int line_bytes = new_width*colours; + unsigned char *s_ptr = buffer; - if ( colours == ZM_COLOUR_GRAY8 ) { - for ( unsigned int i = new_width; i > 0; i-- ) { - unsigned char *d_ptr = rotate_buffer+(i-1); - for ( unsigned int j = new_height; j > 0; j-- ) { - *d_ptr = *s_ptr++; - d_ptr += line_bytes; - } - } - } else if ( colours == ZM_COLOUR_RGB32 ) { - Rgb* s_rptr = (Rgb*)s_ptr; - for ( unsigned int i = new_width; i; i-- ) { - Rgb* d_rptr = (Rgb*)(rotate_buffer+((i-1)<<2)); - for ( unsigned int j = new_height; j; j-- ) { - *d_rptr = *s_rptr++; - d_rptr += new_width; - } - } - } else /* Assume RGB24 */ { - for ( unsigned int i = new_width; i; i-- ) { - unsigned char *d_ptr = rotate_buffer+((i-1)*3); - for ( unsigned int j = new_height; j; j-- ) { - *d_ptr = *s_ptr++; - *(d_ptr+1) = *s_ptr++; - *(d_ptr+2) = *s_ptr++; - d_ptr += line_bytes; - } - } + if ( colours == ZM_COLOUR_GRAY8 ) { + for ( unsigned int i = new_width; i > 0; i-- ) { + unsigned char *d_ptr = rotate_buffer+(i-1); + for ( unsigned int j = new_height; j > 0; j-- ) { + *d_ptr = *s_ptr++; + d_ptr += line_bytes; } - break; } - case 180 : - { - unsigned char *s_ptr = buffer+size; - unsigned char *d_ptr = rotate_buffer; - - if ( colours == ZM_COLOUR_GRAY8 ) { - while( s_ptr > buffer ) { - s_ptr--; - *d_ptr++ = *s_ptr; - } - } else if ( colours == ZM_COLOUR_RGB32 ) { - Rgb* s_rptr = (Rgb*)s_ptr; - Rgb* d_rptr = (Rgb*)d_ptr; - while( s_rptr > (Rgb*)buffer ) { - s_rptr--; - *d_rptr++ = *s_rptr; - } - } else /* Assume RGB24 */ { - while( s_ptr > buffer ) { - s_ptr -= 3; - *d_ptr++ = *s_ptr; - *d_ptr++ = *(s_ptr+1); - *d_ptr++ = *(s_ptr+2); - } + } else if ( colours == ZM_COLOUR_RGB32 ) { + Rgb* s_rptr = (Rgb*)s_ptr; + for ( unsigned int i = new_width; i; i-- ) { + Rgb* d_rptr = (Rgb*)(rotate_buffer+((i-1)<<2)); + for ( unsigned int j = new_height; j; j-- ) { + *d_rptr = *s_rptr++; + d_rptr += new_width; } - break; } - case 270 : - { - new_height = width; - new_width = height; - - unsigned int line_bytes = new_width*colours; - unsigned char *s_ptr = buffer+size; - - if ( colours == ZM_COLOUR_GRAY8 ) { - for ( unsigned int i = new_width; i > 0; i-- ) { - unsigned char *d_ptr = rotate_buffer+(i-1); - for ( unsigned int j = new_height; j > 0; j-- ) { - s_ptr--; - *d_ptr = *s_ptr; - d_ptr += line_bytes; - } - } - } else if ( colours == ZM_COLOUR_RGB32 ) { - Rgb* s_rptr = (Rgb*)s_ptr; - for ( unsigned int i = new_width; i > 0; i-- ) { - Rgb* d_rptr = (Rgb*)(rotate_buffer+((i-1)<<2)); - for ( unsigned int j = new_height; j > 0; j-- ) { - s_rptr--; - *d_rptr = *s_rptr; - d_rptr += new_width; - } - } - } else /* Assume RGB24 */ { - for ( unsigned int i = new_width; i > 0; i-- ) { - unsigned char *d_ptr = rotate_buffer+((i-1)*3); - for ( unsigned int j = new_height; j > 0; j-- ) { - *(d_ptr+2) = *(--s_ptr); - *(d_ptr+1) = *(--s_ptr); - *d_ptr = *(--s_ptr); - d_ptr += line_bytes; - } - } + } else { /* Assume RGB24 */ + for ( unsigned int i = new_width; i; i-- ) { + unsigned char *d_ptr = rotate_buffer+((i-1)*3); + for ( unsigned int j = new_height; j; j-- ) { + *d_ptr = *s_ptr++; + *(d_ptr+1) = *s_ptr++; + *(d_ptr+2) = *s_ptr++; + d_ptr += line_bytes; } - break; } + } + break; + } + case 180 : { + unsigned char *s_ptr = buffer+size; + unsigned char *d_ptr = rotate_buffer; + + if ( colours == ZM_COLOUR_GRAY8 ) { + while( s_ptr > buffer ) { + s_ptr--; + *d_ptr++ = *s_ptr; + } + } else if ( colours == ZM_COLOUR_RGB32 ) { + Rgb* s_rptr = (Rgb*)s_ptr; + Rgb* d_rptr = (Rgb*)d_ptr; + while( s_rptr > (Rgb*)buffer ) { + s_rptr--; + *d_rptr++ = *s_rptr; + } + } else { /* Assume RGB24 */ + while( s_ptr > buffer ) { + s_ptr -= 3; + *d_ptr++ = *s_ptr; + *d_ptr++ = *(s_ptr+1); + *d_ptr++ = *(s_ptr+2); + } + } + break; + } + case 270 : { + new_height = width; + new_width = height; + + unsigned int line_bytes = new_width*colours; + unsigned char *s_ptr = buffer+size; + + if ( colours == ZM_COLOUR_GRAY8 ) { + for ( unsigned int i = new_width; i > 0; i-- ) { + unsigned char *d_ptr = rotate_buffer+(i-1); + for ( unsigned int j = new_height; j > 0; j-- ) { + s_ptr--; + *d_ptr = *s_ptr; + d_ptr += line_bytes; + } + } + } else if ( colours == ZM_COLOUR_RGB32 ) { + Rgb* s_rptr = (Rgb*)s_ptr; + for ( unsigned int i = new_width; i > 0; i-- ) { + Rgb* d_rptr = (Rgb*)(rotate_buffer+((i-1)<<2)); + for ( unsigned int j = new_height; j > 0; j-- ) { + s_rptr--; + *d_rptr = *s_rptr; + d_rptr += new_width; + } + } + } else { /* Assume RGB24 */ + for ( unsigned int i = new_width; i > 0; i-- ) { + unsigned char *d_ptr = rotate_buffer+((i-1)*3); + for ( unsigned int j = new_height; j > 0; j-- ) { + *(d_ptr+2) = *(--s_ptr); + *(d_ptr+1) = *(--s_ptr); + *d_ptr = *(--s_ptr); + d_ptr += line_bytes; + } + } + } + break; + } } AssignDirect(new_width, new_height, colours, subpixelorder, rotate_buffer, size, ZM_BUFTYPE_ZM); @@ -2790,7 +2783,7 @@ void Image::Flip( bool leftright ) { } s_rptr += width * 2; } - } else /* Assume RGB24 */ { + } else { /* Assume RGB24 */ while( d_ptr < max_d_ptr ) { for ( unsigned int j = 0; j < width; j++ ) { s_ptr -= 3; @@ -2827,13 +2820,13 @@ void Image::Scale(const unsigned int new_width, const unsigned int new_height) { SWScale swscale; swscale.init(); swscale.Convert( buffer, allocation, - scale_buffer, - scale_buffer_size, - format, format, - width, - height, - new_width, - new_height); + scale_buffer, + scale_buffer_size, + format, format, + width, + height, + new_width, + new_height); AssignDirect(new_width, new_height, colours, subpixelorder, scale_buffer, scale_buffer_size, ZM_BUFTYPE_ZM); } @@ -3153,48 +3146,44 @@ void Image::Deinterlace_Blend_CustomRatio(int divider) { } -void Image::Deinterlace_4Field(const Image* next_image, unsigned int threshold) -{ - if ( !(width == next_image->width && height == next_image->height && colours == next_image->colours && subpixelorder == next_image->subpixelorder) ) - { +void Image::Deinterlace_4Field(const Image* next_image, unsigned int threshold) { + if ( !(width == next_image->width && height == next_image->height && colours == next_image->colours && subpixelorder == next_image->subpixelorder) ) { Panic( "Attempt to deinterlace different sized images, expected %dx%dx%d %d, got %dx%dx%d %d", width, height, colours, subpixelorder, next_image->width, next_image->height, next_image->colours, next_image->subpixelorder); } switch(colours) { - case ZM_COLOUR_RGB24: - { - if(subpixelorder == ZM_SUBPIX_ORDER_BGR) { - /* BGR subpixel order */ - std_deinterlace_4field_bgr(buffer, next_image->buffer, threshold, width, height); - } else { - /* Assume RGB subpixel order */ - std_deinterlace_4field_rgb(buffer, next_image->buffer, threshold, width, height); - } - break; - } - case ZM_COLOUR_RGB32: - { - if(subpixelorder == ZM_SUBPIX_ORDER_ARGB) { - /* ARGB subpixel order */ - (*fptr_deinterlace_4field_argb)(buffer, next_image->buffer, threshold, width, height); - } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { - /* ABGR subpixel order */ - (*fptr_deinterlace_4field_abgr)(buffer, next_image->buffer, threshold, width, height); - } else if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { - /* BGRA subpixel order */ - (*fptr_deinterlace_4field_bgra)(buffer, next_image->buffer, threshold, width, height); - } else { - /* Assume RGBA subpixel order */ - (*fptr_deinterlace_4field_rgba)(buffer, next_image->buffer, threshold, width, height); - } - break; - } - case ZM_COLOUR_GRAY8: - (*fptr_deinterlace_4field_gray8)(buffer, next_image->buffer, threshold, width, height); - break; - default: - Panic("Deinterlace_4Field called with unexpected colours: %d",colours); - break; + case ZM_COLOUR_RGB24: { + if(subpixelorder == ZM_SUBPIX_ORDER_BGR) { + /* BGR subpixel order */ + std_deinterlace_4field_bgr(buffer, next_image->buffer, threshold, width, height); + } else { + /* Assume RGB subpixel order */ + std_deinterlace_4field_rgb(buffer, next_image->buffer, threshold, width, height); + } + break; + } + case ZM_COLOUR_RGB32: { + if(subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + /* ARGB subpixel order */ + (*fptr_deinterlace_4field_argb)(buffer, next_image->buffer, threshold, width, height); + } else if(subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + /* ABGR subpixel order */ + (*fptr_deinterlace_4field_abgr)(buffer, next_image->buffer, threshold, width, height); + } else if(subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* BGRA subpixel order */ + (*fptr_deinterlace_4field_bgra)(buffer, next_image->buffer, threshold, width, height); + } else { + /* Assume RGBA subpixel order */ + (*fptr_deinterlace_4field_rgba)(buffer, next_image->buffer, threshold, width, height); + } + break; + } + case ZM_COLOUR_GRAY8: + (*fptr_deinterlace_4field_gray8)(buffer, next_image->buffer, threshold, width, height); + break; + default: + Panic("Deinterlace_4Field called with unexpected colours: %d",colours); + break; } } @@ -3243,29 +3232,29 @@ void sse2_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, u } __asm__ __volatile__( - "movd %4, %%xmm3\n\t" - "movd %5, %%xmm4\n\t" - "pshufd $0x0, %%xmm3, %%xmm3\n\t" - "sub $0x10, %0\n\t" - "sub $0x10, %1\n\t" - "sub $0x10, %2\n\t" - "sse2_fastblend_iter:\n\t" - "movdqa (%0,%3),%%xmm0\n\t" - "movdqa %%xmm0,%%xmm2\n\t" - "movdqa (%1,%3),%%xmm1\n\t" - "psrlq %%xmm4,%%xmm0\n\t" - "psrlq %%xmm4,%%xmm1\n\t" - "pand %%xmm3,%%xmm1\n\t" - "pand %%xmm3,%%xmm0\n\t" - "psubb %%xmm0,%%xmm1\n\t" - "paddb %%xmm2,%%xmm1\n\t" - "movntdq %%xmm1,(%2,%3)\n\t" - "sub $0x10, %3\n\t" - "jnz sse2_fastblend_iter\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count), "m" (clearmask), "m" (divider) - : "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "cc", "memory" - ); + "movd %4, %%xmm3\n\t" + "movd %5, %%xmm4\n\t" + "pshufd $0x0, %%xmm3, %%xmm3\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x10, %2\n\t" + "sse2_fastblend_iter:\n\t" + "movdqa (%0,%3),%%xmm0\n\t" + "movdqa %%xmm0,%%xmm2\n\t" + "movdqa (%1,%3),%%xmm1\n\t" + "psrlq %%xmm4,%%xmm0\n\t" + "psrlq %%xmm4,%%xmm1\n\t" + "pand %%xmm3,%%xmm1\n\t" + "pand %%xmm3,%%xmm0\n\t" + "psubb %%xmm0,%%xmm1\n\t" + "paddb %%xmm2,%%xmm1\n\t" + "movntdq %%xmm1,(%2,%3)\n\t" + "sub $0x10, %3\n\t" + "jnz sse2_fastblend_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "m" (clearmask), "m" (divider) + : "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -3374,35 +3363,35 @@ void neon32_armv7_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* r /* Q12(D24,D25) = divider */ __asm__ __volatile__ ( - "mov r12, %4\n\t" - "vdup.8 q12, r12\n\t" - "neon32_armv7_fastblend_iter%=:\n\t" - "vldm %0!, {q0,q1,q2,q3}\n\t" - "vldm %1!, {q4,q5,q6,q7}\n\t" - "pld [%0, #256]\n\t" - "pld [%1, #256]\n\t" - "vrshl.u8 q8, q0, q12\n\t" - "vrshl.u8 q9, q1, q12\n\t" - "vrshl.u8 q10, q2, q12\n\t" - "vrshl.u8 q11, q3, q12\n\t" - "vrshl.u8 q4, q4, q12\n\t" - "vrshl.u8 q5, q5, q12\n\t" - "vrshl.u8 q6, q6, q12\n\t" - "vrshl.u8 q7, q7, q12\n\t" - "vsub.i8 q4, q4, q8\n\t" - "vsub.i8 q5, q5, q9\n\t" - "vsub.i8 q6, q6, q10\n\t" - "vsub.i8 q7, q7, q11\n\t" - "vadd.i8 q4, q4, q0\n\t" - "vadd.i8 q5, q5, q1\n\t" - "vadd.i8 q6, q6, q2\n\t" - "vadd.i8 q7, q7, q3\n\t" - "vstm %2!, {q4,q5,q6,q7}\n\t" - "subs %3, %3, #64\n\t" - "bne neon32_armv7_fastblend_iter%=\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count), "r" (divider) - : "%r12", "%q0", "%q1", "%q2", "%q3", "%q4", "%q5", "%q6", "%q7", "%q8", "%q9", "%q10", "%q11", "%q12", "cc", "memory" + "mov r12, %4\n\t" + "vdup.8 q12, r12\n\t" + "neon32_armv7_fastblend_iter%=:\n\t" + "vldm %0!, {q0,q1,q2,q3}\n\t" + "vldm %1!, {q4,q5,q6,q7}\n\t" + "pld [%0, #256]\n\t" + "pld [%1, #256]\n\t" + "vrshl.u8 q8, q0, q12\n\t" + "vrshl.u8 q9, q1, q12\n\t" + "vrshl.u8 q10, q2, q12\n\t" + "vrshl.u8 q11, q3, q12\n\t" + "vrshl.u8 q4, q4, q12\n\t" + "vrshl.u8 q5, q5, q12\n\t" + "vrshl.u8 q6, q6, q12\n\t" + "vrshl.u8 q7, q7, q12\n\t" + "vsub.i8 q4, q4, q8\n\t" + "vsub.i8 q5, q5, q9\n\t" + "vsub.i8 q6, q6, q10\n\t" + "vsub.i8 q7, q7, q11\n\t" + "vadd.i8 q4, q4, q0\n\t" + "vadd.i8 q5, q5, q1\n\t" + "vadd.i8 q6, q6, q2\n\t" + "vadd.i8 q7, q7, q3\n\t" + "vstm %2!, {q4,q5,q6,q7}\n\t" + "subs %3, %3, #64\n\t" + "bne neon32_armv7_fastblend_iter%=\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "r" (divider) + : "%r12", "%q0", "%q1", "%q2", "%q3", "%q4", "%q5", "%q6", "%q7", "%q8", "%q9", "%q10", "%q11", "%q12", "cc", "memory" ); #else Panic("Neon function called on a non-ARM platform or Neon code is absent"); @@ -3455,39 +3444,39 @@ __attribute__((noinline)) void neon64_armv8_fastblend(const uint8_t* col1, const /* V28 = divider */ __asm__ __volatile__ ( - "mov x12, %4\n\t" - "dup v28.16b, w12\n\t" - "neon64_armv8_fastblend_iter%=:\n\t" - "ldp q16, q17, [%0], #32\n\t" - "ldp q18, q19, [%0], #32\n\t" - "ldp q20, q21, [%1], #32\n\t" - "ldp q22, q23, [%1], #32\n\t" - "prfm pldl1keep, [%0, #256]\n\t" - "prfm pldl1keep, [%1, #256]\n\t" - "urshl v24.16b, v16.16b, v28.16b\n\t" - "urshl v25.16b, v17.16b, v28.16b\n\t" - "urshl v26.16b, v18.16b, v28.16b\n\t" - "urshl v27.16b, v19.16b, v28.16b\n\t" - "urshl v20.16b, v20.16b, v28.16b\n\t" - "urshl v21.16b, v21.16b, v28.16b\n\t" - "urshl v22.16b, v22.16b, v28.16b\n\t" - "urshl v23.16b, v23.16b, v28.16b\n\t" - "sub v20.16b, v20.16b, v24.16b\n\t" - "sub v21.16b, v21.16b, v25.16b\n\t" - "sub v22.16b, v22.16b, v26.16b\n\t" - "sub v23.16b, v23.16b, v27.16b\n\t" - "add v20.16b, v20.16b, v16.16b\n\t" - "add v21.16b, v21.16b, v17.16b\n\t" - "add v22.16b, v22.16b, v18.16b\n\t" - "add v23.16b, v23.16b, v19.16b\n\t" - "stp q20, q21, [%2], #32\n\t" - "stp q22, q23, [%2], #32\n\t" - "subs %3, %3, #64\n\t" - "bne neon64_armv8_fastblend_iter%=\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count), "r" (divider) - : "%x12", "%v16", "%v17", "%v18", "%v19", "%v20", "%v21", "%v22", "%v23", "%v24", "%v25", "%v26", "%v27", "%v28", "cc", "memory" -); + "mov x12, %4\n\t" + "dup v28.16b, w12\n\t" + "neon64_armv8_fastblend_iter%=:\n\t" + "ldp q16, q17, [%0], #32\n\t" + "ldp q18, q19, [%0], #32\n\t" + "ldp q20, q21, [%1], #32\n\t" + "ldp q22, q23, [%1], #32\n\t" + "prfm pldl1keep, [%0, #256]\n\t" + "prfm pldl1keep, [%1, #256]\n\t" + "urshl v24.16b, v16.16b, v28.16b\n\t" + "urshl v25.16b, v17.16b, v28.16b\n\t" + "urshl v26.16b, v18.16b, v28.16b\n\t" + "urshl v27.16b, v19.16b, v28.16b\n\t" + "urshl v20.16b, v20.16b, v28.16b\n\t" + "urshl v21.16b, v21.16b, v28.16b\n\t" + "urshl v22.16b, v22.16b, v28.16b\n\t" + "urshl v23.16b, v23.16b, v28.16b\n\t" + "sub v20.16b, v20.16b, v24.16b\n\t" + "sub v21.16b, v21.16b, v25.16b\n\t" + "sub v22.16b, v22.16b, v26.16b\n\t" + "sub v23.16b, v23.16b, v27.16b\n\t" + "add v20.16b, v20.16b, v16.16b\n\t" + "add v21.16b, v21.16b, v17.16b\n\t" + "add v22.16b, v22.16b, v18.16b\n\t" + "add v23.16b, v23.16b, v19.16b\n\t" + "stp q20, q21, [%2], #32\n\t" + "stp q22, q23, [%2], #32\n\t" + "subs %3, %3, #64\n\t" + "bne neon64_armv8_fastblend_iter%=\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "r" (divider) + : "%x12", "%v16", "%v17", "%v18", "%v19", "%v20", "%v21", "%v22", "%v23", "%v24", "%v25", "%v26", "%v27", "%v28", "cc", "memory" + ); #else Panic("Neon function called on a non-ARM platform or Neon code is absent"); #endif @@ -3843,21 +3832,21 @@ void neon32_armv7_delta8_gray8(const uint8_t* col1, const uint8_t* col2, uint8_t /* Q7(D14,D15) = col2+48 */ __asm__ __volatile__ ( - "neon32_armv7_delta8_gray8_iter%=:\n\t" - "vldm %0!, {q0,q1,q2,q3}\n\t" - "vldm %1!, {q4,q5,q6,q7}\n\t" - "pld [%0, #512]\n\t" - "pld [%1, #512]\n\t" - "vabd.u8 q0, q0, q4\n\t" - "vabd.u8 q1, q1, q5\n\t" - "vabd.u8 q2, q2, q6\n\t" - "vabd.u8 q3, q3, q7\n\t" - "vstm %2!, {q0,q1,q2,q3}\n\t" - "subs %3, %3, #64\n\t" - "bne neon32_armv7_delta8_gray8_iter%=\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count) - : "%q0", "%q1", "%q2", "%q3", "%q4", "%q5", "%q6", "%q7", "cc", "memory" + "neon32_armv7_delta8_gray8_iter%=:\n\t" + "vldm %0!, {q0,q1,q2,q3}\n\t" + "vldm %1!, {q4,q5,q6,q7}\n\t" + "pld [%0, #512]\n\t" + "pld [%1, #512]\n\t" + "vabd.u8 q0, q0, q4\n\t" + "vabd.u8 q1, q1, q5\n\t" + "vabd.u8 q2, q2, q6\n\t" + "vabd.u8 q3, q3, q7\n\t" + "vstm %2!, {q0,q1,q2,q3}\n\t" + "subs %3, %3, #64\n\t" + "bne neon32_armv7_delta8_gray8_iter%=\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%q0", "%q1", "%q2", "%q3", "%q4", "%q5", "%q6", "%q7", "cc", "memory" ); #else Panic("Neon function called on a non-ARM platform or Neon code is absent"); @@ -3878,24 +3867,24 @@ __attribute__((noinline)) void neon64_armv8_delta8_gray8(const uint8_t* col1, co /* V23 = col2+48 */ __asm__ __volatile__ ( - "neon64_armv8_delta8_gray8_iter%=:\n\t" - "ldp q16, q17, [%0], #32\n\t" - "ldp q18, q19, [%0], #32\n\t" - "ldp q20, q21, [%1], #32\n\t" - "ldp q22, q23, [%1], #32\n\t" - "prfm pldl1keep, [%0, #512]\n\t" - "prfm pldl1keep, [%1, #512]\n\t" - "uabd v16.16b, v16.16b, v20.16b\n\t" - "uabd v17.16b, v17.16b, v21.16b\n\t" - "uabd v18.16b, v18.16b, v22.16b\n\t" - "uabd v19.16b, v19.16b, v23.16b\n\t" - "stp q16, q17, [%2], #32\n\t" - "stp q18, q19, [%2], #32\n\t" - "subs %3, %3, #64\n\t" - "bne neon64_armv8_delta8_gray8_iter%=\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count) - : "%v16", "%v17", "%v18", "%v19", "%v20", "%v21", "%v22", "%v23", "cc", "memory" + "neon64_armv8_delta8_gray8_iter%=:\n\t" + "ldp q16, q17, [%0], #32\n\t" + "ldp q18, q19, [%0], #32\n\t" + "ldp q20, q21, [%1], #32\n\t" + "ldp q22, q23, [%1], #32\n\t" + "prfm pldl1keep, [%0, #512]\n\t" + "prfm pldl1keep, [%1, #512]\n\t" + "uabd v16.16b, v16.16b, v20.16b\n\t" + "uabd v17.16b, v17.16b, v21.16b\n\t" + "uabd v18.16b, v18.16b, v22.16b\n\t" + "uabd v19.16b, v19.16b, v23.16b\n\t" + "stp q16, q17, [%2], #32\n\t" + "stp q18, q19, [%2], #32\n\t" + "subs %3, %3, #64\n\t" + "bne neon64_armv8_delta8_gray8_iter%=\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%v16", "%v17", "%v18", "%v19", "%v20", "%v21", "%v22", "%v23", "cc", "memory" ); #else Panic("Neon function called on a non-ARM platform or Neon code is absent"); @@ -3920,39 +3909,39 @@ void neon32_armv7_delta8_rgb32(const uint8_t* col1, const uint8_t* col2, uint8_t /* Q8(D16,D17) = multiplier */ __asm__ __volatile__ ( - "mov r12, %4\n\t" - "vdup.32 q8, r12\n\t" - "neon32_armv7_delta8_rgb32_iter%=:\n\t" - "vldm %0!, {q0,q1,q2,q3}\n\t" - "vldm %1!, {q4,q5,q6,q7}\n\t" - "pld [%0, #256]\n\t" - "pld [%1, #256]\n\t" - "vabd.u8 q0, q0, q4\n\t" - "vabd.u8 q1, q1, q5\n\t" - "vabd.u8 q2, q2, q6\n\t" - "vabd.u8 q3, q3, q7\n\t" - "vrshr.u8 q0, q0, #3\n\t" - "vrshr.u8 q1, q1, #3\n\t" - "vrshr.u8 q2, q2, #3\n\t" - "vrshr.u8 q3, q3, #3\n\t" - "vmul.i8 q0, q0, q8\n\t" - "vmul.i8 q1, q1, q8\n\t" - "vmul.i8 q2, q2, q8\n\t" - "vmul.i8 q3, q3, q8\n\t" - "vpadd.i8 d0, d0, d1\n\t" - "vpadd.i8 d2, d2, d3\n\t" - "vpadd.i8 d4, d4, d5\n\t" - "vpadd.i8 d6, d6, d7\n\t" - "vpadd.i8 d0, d0, d0\n\t" - "vpadd.i8 d1, d2, d2\n\t" - "vpadd.i8 d2, d4, d4\n\t" - "vpadd.i8 d3, d6, d6\n\t" - "vst4.32 {d0[0],d1[0],d2[0],d3[0]}, [%2]!\n\t" - "subs %3, %3, #16\n\t" - "bne neon32_armv7_delta8_rgb32_iter%=\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count), "r" (multiplier) - : "%r12", "%q0", "%q1", "%q2", "%q3", "%q4", "%q5", "%q6", "%q7", "%q8", "cc", "memory" + "mov r12, %4\n\t" + "vdup.32 q8, r12\n\t" + "neon32_armv7_delta8_rgb32_iter%=:\n\t" + "vldm %0!, {q0,q1,q2,q3}\n\t" + "vldm %1!, {q4,q5,q6,q7}\n\t" + "pld [%0, #256]\n\t" + "pld [%1, #256]\n\t" + "vabd.u8 q0, q0, q4\n\t" + "vabd.u8 q1, q1, q5\n\t" + "vabd.u8 q2, q2, q6\n\t" + "vabd.u8 q3, q3, q7\n\t" + "vrshr.u8 q0, q0, #3\n\t" + "vrshr.u8 q1, q1, #3\n\t" + "vrshr.u8 q2, q2, #3\n\t" + "vrshr.u8 q3, q3, #3\n\t" + "vmul.i8 q0, q0, q8\n\t" + "vmul.i8 q1, q1, q8\n\t" + "vmul.i8 q2, q2, q8\n\t" + "vmul.i8 q3, q3, q8\n\t" + "vpadd.i8 d0, d0, d1\n\t" + "vpadd.i8 d2, d2, d3\n\t" + "vpadd.i8 d4, d4, d5\n\t" + "vpadd.i8 d6, d6, d7\n\t" + "vpadd.i8 d0, d0, d0\n\t" + "vpadd.i8 d1, d2, d2\n\t" + "vpadd.i8 d2, d4, d4\n\t" + "vpadd.i8 d3, d6, d6\n\t" + "vst4.32 {d0[0],d1[0],d2[0],d3[0]}, [%2]!\n\t" + "subs %3, %3, #16\n\t" + "bne neon32_armv7_delta8_rgb32_iter%=\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "r" (multiplier) + : "%r12", "%q0", "%q1", "%q2", "%q3", "%q4", "%q5", "%q6", "%q7", "%q8", "cc", "memory" ); #else Panic("Neon function called on a non-ARM platform or Neon code is absent"); @@ -3974,41 +3963,41 @@ __attribute__((noinline)) void neon64_armv8_delta8_rgb32(const uint8_t* col1, co /* V24 = multiplier */ __asm__ __volatile__ ( - "mov x12, %4\n\t" - "dup v24.4s, w12\n\t" - "neon64_armv8_delta8_rgb32_iter%=:\n\t" - "ldp q16, q17, [%0], #32\n\t" - "ldp q18, q19, [%0], #32\n\t" - "ldp q20, q21, [%1], #32\n\t" - "ldp q22, q23, [%1], #32\n\t" - "prfm pldl1keep, [%0, #256]\n\t" - "prfm pldl1keep, [%1, #256]\n\t" - "uabd v16.16b, v16.16b, v20.16b\n\t" - "uabd v17.16b, v17.16b, v21.16b\n\t" - "uabd v18.16b, v18.16b, v22.16b\n\t" - "uabd v19.16b, v19.16b, v23.16b\n\t" - "urshr v16.16b, v16.16b, #3\n\t" - "urshr v17.16b, v17.16b, #3\n\t" - "urshr v18.16b, v18.16b, #3\n\t" - "urshr v19.16b, v19.16b, #3\n\t" - "mul v16.16b, v16.16b, v24.16b\n\t" - "mul v17.16b, v17.16b, v24.16b\n\t" - "mul v18.16b, v18.16b, v24.16b\n\t" - "mul v19.16b, v19.16b, v24.16b\n\t" - "addp v16.16b, v16.16b, v16.16b\n\t" - "addp v17.16b, v17.16b, v17.16b\n\t" - "addp v18.16b, v18.16b, v18.16b\n\t" - "addp v19.16b, v19.16b, v19.16b\n\t" - "addp v16.16b, v16.16b, v16.16b\n\t" - "addp v17.16b, v17.16b, v17.16b\n\t" - "addp v18.16b, v18.16b, v18.16b\n\t" - "addp v19.16b, v19.16b, v19.16b\n\t" - "st4 {v16.s, v17.s, v18.s, v19.s}[0], [%2], #16\n\t" - "subs %3, %3, #16\n\t" - "bne neon64_armv8_delta8_rgb32_iter%=\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count), "r" (multiplier) - : "%x12", "%v16", "%v17", "%v18", "%v19", "%v20", "%v21", "%v22", "%v23", "%v24", "cc", "memory" + "mov x12, %4\n\t" + "dup v24.4s, w12\n\t" + "neon64_armv8_delta8_rgb32_iter%=:\n\t" + "ldp q16, q17, [%0], #32\n\t" + "ldp q18, q19, [%0], #32\n\t" + "ldp q20, q21, [%1], #32\n\t" + "ldp q22, q23, [%1], #32\n\t" + "prfm pldl1keep, [%0, #256]\n\t" + "prfm pldl1keep, [%1, #256]\n\t" + "uabd v16.16b, v16.16b, v20.16b\n\t" + "uabd v17.16b, v17.16b, v21.16b\n\t" + "uabd v18.16b, v18.16b, v22.16b\n\t" + "uabd v19.16b, v19.16b, v23.16b\n\t" + "urshr v16.16b, v16.16b, #3\n\t" + "urshr v17.16b, v17.16b, #3\n\t" + "urshr v18.16b, v18.16b, #3\n\t" + "urshr v19.16b, v19.16b, #3\n\t" + "mul v16.16b, v16.16b, v24.16b\n\t" + "mul v17.16b, v17.16b, v24.16b\n\t" + "mul v18.16b, v18.16b, v24.16b\n\t" + "mul v19.16b, v19.16b, v24.16b\n\t" + "addp v16.16b, v16.16b, v16.16b\n\t" + "addp v17.16b, v17.16b, v17.16b\n\t" + "addp v18.16b, v18.16b, v18.16b\n\t" + "addp v19.16b, v19.16b, v19.16b\n\t" + "addp v16.16b, v16.16b, v16.16b\n\t" + "addp v17.16b, v17.16b, v17.16b\n\t" + "addp v18.16b, v18.16b, v18.16b\n\t" + "addp v19.16b, v19.16b, v19.16b\n\t" + "st4 {v16.s, v17.s, v18.s, v19.s}[0], [%2], #16\n\t" + "subs %3, %3, #16\n\t" + "bne neon64_armv8_delta8_rgb32_iter%=\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "r" (multiplier) + : "%x12", "%v16", "%v17", "%v18", "%v19", "%v20", "%v21", "%v22", "%v23", "%v24", "cc", "memory" ); #else Panic("Neon function called on a non-ARM platform or Neon code is absent"); @@ -4063,24 +4052,24 @@ void sse2_delta8_gray8(const uint8_t* col1, const uint8_t* col2, uint8_t* result #if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) __asm__ __volatile__ ( - "sub $0x10, %0\n\t" - "sub $0x10, %1\n\t" - "sub $0x10, %2\n\t" - "sse2_delta8_gray8_iter:\n\t" - "movdqa (%0,%3), %%xmm1\n\t" - "movdqa (%1,%3), %%xmm2\n\t" - "movdqa %%xmm1, %%xmm3\n\t" - "movdqa %%xmm2, %%xmm4\n\t" - "pmaxub %%xmm1, %%xmm2\n\t" - "pminub %%xmm3, %%xmm4\n\t" - "psubb %%xmm4, %%xmm2\n\t" - "movntdq %%xmm2, (%2,%3)\n\t" - "sub $0x10, %3\n\t" - "jnz sse2_delta8_gray8_iter\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count) - : "%xmm1", "%xmm2", "%xmm3", "%xmm4", "cc", "memory" - ); + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x10, %2\n\t" + "sse2_delta8_gray8_iter:\n\t" + "movdqa (%0,%3), %%xmm1\n\t" + "movdqa (%1,%3), %%xmm2\n\t" + "movdqa %%xmm1, %%xmm3\n\t" + "movdqa %%xmm2, %%xmm4\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm3, %%xmm4\n\t" + "psubb %%xmm4, %%xmm2\n\t" + "movntdq %%xmm2, (%2,%3)\n\t" + "sub $0x10, %3\n\t" + "jnz sse2_delta8_gray8_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%xmm1", "%xmm2", "%xmm3", "%xmm4", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -4094,51 +4083,51 @@ void sse2_delta8_rgba(const uint8_t* col1, const uint8_t* col2, uint8_t* result, #if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) __asm__ __volatile__ ( - "mov $0x1F1F1F1F, %%eax\n\t" - "movd %%eax, %%xmm4\n\t" - "pshufd $0x0, %%xmm4, %%xmm4\n\t" - "mov $0xff, %%eax\n\t" - "movd %%eax, %%xmm0\n\t" - "pshufd $0x0, %%xmm0, %%xmm0\n\t" - "sub $0x10, %0\n\t" - "sub $0x10, %1\n\t" - "sub $0x4, %2\n\t" - "sse2_delta8_rgba_iter:\n\t" - "movdqa (%0,%3,4), %%xmm1\n\t" - "movdqa (%1,%3,4), %%xmm2\n\t" - "psrlq $0x3, %%xmm1\n\t" - "psrlq $0x3, %%xmm2\n\t" - "pand %%xmm4, %%xmm1\n\t" - "pand %%xmm4, %%xmm2\n\t" - "movdqa %%xmm1, %%xmm5\n\t" - "movdqa %%xmm2, %%xmm6\n\t" - "pmaxub %%xmm1, %%xmm2\n\t" - "pminub %%xmm5, %%xmm6\n\t" - "psubb %%xmm6, %%xmm2\n\t" - "movdqa %%xmm2, %%xmm3\n\t" - "psrld $0x8, %%xmm2\n\t" - "pand %%xmm0, %%xmm2\n\t" - "movdqa %%xmm2, %%xmm1\n\t" - "pslld $0x2, %%xmm2\n\t" - "paddd %%xmm1, %%xmm2\n\t" - "movdqa %%xmm3, %%xmm1\n\t" - "pand %%xmm0, %%xmm1\n\t" - "paddd %%xmm1, %%xmm1\n\t" - "paddd %%xmm2, %%xmm1\n\t" - "movdqa %%xmm3, %%xmm2\n\t" - "psrld $0x10, %%xmm2\n\t" - "pand %%xmm0, %%xmm2\n\t" - "paddd %%xmm2, %%xmm1\n\t" - "packssdw %%xmm1, %%xmm1\n\t" - "packuswb %%xmm1, %%xmm1\n\t" - "movd %%xmm1, %%eax\n\t" - "movnti %%eax, (%2,%3)\n\t" - "sub $0x4, %3\n\t" - "jnz sse2_delta8_rgba_iter\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count) - : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" - ); + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "sse2_delta8_rgba_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" + "movdqa %%xmm2, %%xmm6\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm5, %%xmm6\n\t" + "psubb %%xmm6, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm3\n\t" + "psrld $0x8, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm1, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "packssdw %%xmm1, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz sse2_delta8_rgba_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -4152,51 +4141,51 @@ void sse2_delta8_bgra(const uint8_t* col1, const uint8_t* col2, uint8_t* result, #if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) __asm__ __volatile__ ( - "mov $0x1F1F1F1F, %%eax\n\t" - "movd %%eax, %%xmm4\n\t" - "pshufd $0x0, %%xmm4, %%xmm4\n\t" - "mov $0xff, %%eax\n\t" - "movd %%eax, %%xmm0\n\t" - "pshufd $0x0, %%xmm0, %%xmm0\n\t" - "sub $0x10, %0\n\t" - "sub $0x10, %1\n\t" - "sub $0x4, %2\n\t" - "sse2_delta8_bgra_iter:\n\t" - "movdqa (%0,%3,4), %%xmm1\n\t" - "movdqa (%1,%3,4), %%xmm2\n\t" - "psrlq $0x3, %%xmm1\n\t" - "psrlq $0x3, %%xmm2\n\t" - "pand %%xmm4, %%xmm1\n\t" - "pand %%xmm4, %%xmm2\n\t" - "movdqa %%xmm1, %%xmm5\n\t" - "movdqa %%xmm2, %%xmm6\n\t" - "pmaxub %%xmm1, %%xmm2\n\t" - "pminub %%xmm5, %%xmm6\n\t" - "psubb %%xmm6, %%xmm2\n\t" - "movdqa %%xmm2, %%xmm3\n\t" - "psrld $0x8, %%xmm2\n\t" - "pand %%xmm0, %%xmm2\n\t" - "movdqa %%xmm2, %%xmm1\n\t" - "pslld $0x2, %%xmm2\n\t" - "paddd %%xmm1, %%xmm2\n\t" - "movdqa %%xmm3, %%xmm1\n\t" - "pand %%xmm0, %%xmm1\n\t" - "paddd %%xmm2, %%xmm1\n\t" - "movdqa %%xmm3, %%xmm2\n\t" - "psrld $0x10, %%xmm2\n\t" - "pand %%xmm0, %%xmm2\n\t" - "paddd %%xmm2, %%xmm2\n\t" - "paddd %%xmm2, %%xmm1\n\t" - "packssdw %%xmm1, %%xmm1\n\t" - "packuswb %%xmm1, %%xmm1\n\t" - "movd %%xmm1, %%eax\n\t" - "movnti %%eax, (%2,%3)\n\t" - "sub $0x4, %3\n\t" - "jnz sse2_delta8_bgra_iter\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count) - : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" - ); + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "sse2_delta8_bgra_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" + "movdqa %%xmm2, %%xmm6\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm5, %%xmm6\n\t" + "psubb %%xmm6, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm3\n\t" + "psrld $0x8, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "packssdw %%xmm1, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz sse2_delta8_bgra_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -4210,52 +4199,52 @@ void sse2_delta8_argb(const uint8_t* col1, const uint8_t* col2, uint8_t* result, #if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) __asm__ __volatile__ ( - "mov $0x1F1F1F1F, %%eax\n\t" - "movd %%eax, %%xmm4\n\t" - "pshufd $0x0, %%xmm4, %%xmm4\n\t" - "mov $0xff, %%eax\n\t" - "movd %%eax, %%xmm0\n\t" - "pshufd $0x0, %%xmm0, %%xmm0\n\t" - "sub $0x10, %0\n\t" - "sub $0x10, %1\n\t" - "sub $0x4, %2\n\t" - "sse2_delta8_argb_iter:\n\t" - "movdqa (%0,%3,4), %%xmm1\n\t" - "movdqa (%1,%3,4), %%xmm2\n\t" - "psrlq $0x3, %%xmm1\n\t" - "psrlq $0x3, %%xmm2\n\t" - "pand %%xmm4, %%xmm1\n\t" - "pand %%xmm4, %%xmm2\n\t" - "movdqa %%xmm1, %%xmm5\n\t" - "movdqa %%xmm2, %%xmm6\n\t" - "pmaxub %%xmm1, %%xmm2\n\t" - "pminub %%xmm5, %%xmm6\n\t" - "psubb %%xmm6, %%xmm2\n\t" - "movdqa %%xmm2, %%xmm3\n\t" - "psrld $0x10, %%xmm2\n\t" - "pand %%xmm0, %%xmm2\n\t" - "movdqa %%xmm2, %%xmm1\n\t" - "pslld $0x2, %%xmm2\n\t" - "paddd %%xmm1, %%xmm2\n\t" - "movdqa %%xmm3, %%xmm1\n\t" - "psrld $0x8, %%xmm1\n\t" - "pand %%xmm0, %%xmm1\n\t" - "paddd %%xmm1, %%xmm1\n\t" - "paddd %%xmm2, %%xmm1\n\t" - "movdqa %%xmm3, %%xmm2\n\t" - "psrld $0x18, %%xmm2\n\t" - "pand %%xmm0, %%xmm2\n\t" - "paddd %%xmm2, %%xmm1\n\t" - "packssdw %%xmm1, %%xmm1\n\t" - "packuswb %%xmm1, %%xmm1\n\t" - "movd %%xmm1, %%eax\n\t" - "movnti %%eax, (%2,%3)\n\t" - "sub $0x4, %3\n\t" - "jnz sse2_delta8_argb_iter\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count) - : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" - ); + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "sse2_delta8_argb_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" + "movdqa %%xmm2, %%xmm6\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm5, %%xmm6\n\t" + "psubb %%xmm6, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm3\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "psrld $0x8, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm1, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x18, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "packssdw %%xmm1, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz sse2_delta8_argb_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -4269,52 +4258,52 @@ void sse2_delta8_abgr(const uint8_t* col1, const uint8_t* col2, uint8_t* result, #if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE)) __asm__ __volatile__ ( - "mov $0x1F1F1F1F, %%eax\n\t" - "movd %%eax, %%xmm4\n\t" - "pshufd $0x0, %%xmm4, %%xmm4\n\t" - "mov $0xff, %%eax\n\t" - "movd %%eax, %%xmm0\n\t" - "pshufd $0x0, %%xmm0, %%xmm0\n\t" - "sub $0x10, %0\n\t" - "sub $0x10, %1\n\t" - "sub $0x4, %2\n\t" - "sse2_delta8_abgr_iter:\n\t" - "movdqa (%0,%3,4), %%xmm1\n\t" - "movdqa (%1,%3,4), %%xmm2\n\t" - "psrlq $0x3, %%xmm1\n\t" - "psrlq $0x3, %%xmm2\n\t" - "pand %%xmm4, %%xmm1\n\t" - "pand %%xmm4, %%xmm2\n\t" - "movdqa %%xmm1, %%xmm5\n\t" - "movdqa %%xmm2, %%xmm6\n\t" - "pmaxub %%xmm1, %%xmm2\n\t" - "pminub %%xmm5, %%xmm6\n\t" - "psubb %%xmm6, %%xmm2\n\t" - "movdqa %%xmm2, %%xmm3\n\t" - "psrld $0x10, %%xmm2\n\t" - "pand %%xmm0, %%xmm2\n\t" - "movdqa %%xmm2, %%xmm1\n\t" - "pslld $0x2, %%xmm2\n\t" - "paddd %%xmm1, %%xmm2\n\t" - "movdqa %%xmm3, %%xmm1\n\t" - "psrld $0x8, %%xmm1\n\t" - "pand %%xmm0, %%xmm1\n\t" - "paddd %%xmm2, %%xmm1\n\t" - "movdqa %%xmm3, %%xmm2\n\t" - "psrld $0x18, %%xmm2\n\t" - "pand %%xmm0, %%xmm2\n\t" - "paddd %%xmm2, %%xmm2\n\t" - "paddd %%xmm2, %%xmm1\n\t" - "packssdw %%xmm1, %%xmm1\n\t" - "packuswb %%xmm1, %%xmm1\n\t" - "movd %%xmm1, %%eax\n\t" - "movnti %%eax, (%2,%3)\n\t" - "sub $0x4, %3\n\t" - "jnz sse2_delta8_abgr_iter\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count) - : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" - ); + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov $0xff, %%eax\n\t" + "movd %%eax, %%xmm0\n\t" + "pshufd $0x0, %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "sse2_delta8_abgr_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "movdqa %%xmm1, %%xmm5\n\t" + "movdqa %%xmm2, %%xmm6\n\t" + "pmaxub %%xmm1, %%xmm2\n\t" + "pminub %%xmm5, %%xmm6\n\t" + "psubb %%xmm6, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm3\n\t" + "psrld $0x10, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "movdqa %%xmm2, %%xmm1\n\t" + "pslld $0x2, %%xmm2\n\t" + "paddd %%xmm1, %%xmm2\n\t" + "movdqa %%xmm3, %%xmm1\n\t" + "psrld $0x8, %%xmm1\n\t" + "pand %%xmm0, %%xmm1\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "movdqa %%xmm3, %%xmm2\n\t" + "psrld $0x18, %%xmm2\n\t" + "pand %%xmm0, %%xmm2\n\t" + "paddd %%xmm2, %%xmm2\n\t" + "paddd %%xmm2, %%xmm1\n\t" + "packssdw %%xmm1, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz sse2_delta8_abgr_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -4334,36 +4323,36 @@ void ssse3_delta8_rgb32(const uint8_t* col1, const uint8_t* col2, uint8_t* resul /* XMM4 - divide mask */ __asm__ __volatile__ ( - "mov $0x1F1F1F1F, %%eax\n\t" - "movd %%eax, %%xmm4\n\t" - "pshufd $0x0, %%xmm4, %%xmm4\n\t" - "mov %4, %%eax\n\t" - "movd %%eax, %%xmm3\n\t" - "pshufd $0x0, %%xmm3, %%xmm3\n\t" - "pxor %%xmm0, %%xmm0\n\t" - "sub $0x10, %0\n\t" - "sub $0x10, %1\n\t" - "sub $0x4, %2\n\t" - "ssse3_delta8_rgb32_iter:\n\t" - "movdqa (%0,%3,4), %%xmm1\n\t" - "movdqa (%1,%3,4), %%xmm2\n\t" - "psrlq $0x3, %%xmm1\n\t" - "psrlq $0x3, %%xmm2\n\t" - "pand %%xmm4, %%xmm1\n\t" - "pand %%xmm4, %%xmm2\n\t" - "psubb %%xmm2, %%xmm1\n\t" - "pabsb %%xmm1, %%xmm1\n\t" - "pmaddubsw %%xmm3, %%xmm1\n\t" - "phaddw %%xmm0, %%xmm1\n\t" - "packuswb %%xmm1, %%xmm1\n\t" - "movd %%xmm1, %%eax\n\t" - "movnti %%eax, (%2,%3)\n\t" - "sub $0x4, %3\n\t" - "jnz ssse3_delta8_rgb32_iter\n\t" - : - : "r" (col1), "r" (col2), "r" (result), "r" (count), "g" (multiplier) - : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "cc", "memory" - ); + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov %4, %%eax\n\t" + "movd %%eax, %%xmm3\n\t" + "pshufd $0x0, %%xmm3, %%xmm3\n\t" + "pxor %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x10, %1\n\t" + "sub $0x4, %2\n\t" + "ssse3_delta8_rgb32_iter:\n\t" + "movdqa (%0,%3,4), %%xmm1\n\t" + "movdqa (%1,%3,4), %%xmm2\n\t" + "psrlq $0x3, %%xmm1\n\t" + "psrlq $0x3, %%xmm2\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pand %%xmm4, %%xmm2\n\t" + "psubb %%xmm2, %%xmm1\n\t" + "pabsb %%xmm1, %%xmm1\n\t" + "pmaddubsw %%xmm3, %%xmm1\n\t" + "phaddw %%xmm0, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%2,%3)\n\t" + "sub $0x4, %3\n\t" + "jnz ssse3_delta8_rgb32_iter\n\t" + : + : "r" (col1), "r" (col2), "r" (result), "r" (count), "g" (multiplier) + : "%eax", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -4696,30 +4685,30 @@ void ssse3_convert_rgb32_gray8(const uint8_t* col1, uint8_t* result, unsigned lo /* XMM4 - divide mask */ __asm__ __volatile__ ( - "mov $0x1F1F1F1F, %%eax\n\t" - "movd %%eax, %%xmm4\n\t" - "pshufd $0x0, %%xmm4, %%xmm4\n\t" - "mov %3, %%eax\n\t" - "movd %%eax, %%xmm3\n\t" - "pshufd $0x0, %%xmm3, %%xmm3\n\t" - "pxor %%xmm0, %%xmm0\n\t" - "sub $0x10, %0\n\t" - "sub $0x4, %1\n\t" - "ssse3_convert_rgb32_gray8_iter:\n\t" - "movdqa (%0,%2,4), %%xmm1\n\t" - "psrlq $0x3, %%xmm1\n\t" - "pand %%xmm4, %%xmm1\n\t" - "pmaddubsw %%xmm3, %%xmm1\n\t" - "phaddw %%xmm0, %%xmm1\n\t" - "packuswb %%xmm1, %%xmm1\n\t" - "movd %%xmm1, %%eax\n\t" - "movnti %%eax, (%1,%2)\n\t" - "sub $0x4, %2\n\t" - "jnz ssse3_convert_rgb32_gray8_iter\n\t" - : - : "r" (col1), "r" (result), "r" (count), "g" (multiplier) - : "%eax", "%xmm0", "%xmm1", "%xmm3", "%xmm4", "cc", "memory" - ); + "mov $0x1F1F1F1F, %%eax\n\t" + "movd %%eax, %%xmm4\n\t" + "pshufd $0x0, %%xmm4, %%xmm4\n\t" + "mov %3, %%eax\n\t" + "movd %%eax, %%xmm3\n\t" + "pshufd $0x0, %%xmm3, %%xmm3\n\t" + "pxor %%xmm0, %%xmm0\n\t" + "sub $0x10, %0\n\t" + "sub $0x4, %1\n\t" + "ssse3_convert_rgb32_gray8_iter:\n\t" + "movdqa (%0,%2,4), %%xmm1\n\t" + "psrlq $0x3, %%xmm1\n\t" + "pand %%xmm4, %%xmm1\n\t" + "pmaddubsw %%xmm3, %%xmm1\n\t" + "phaddw %%xmm0, %%xmm1\n\t" + "packuswb %%xmm1, %%xmm1\n\t" + "movd %%xmm1, %%eax\n\t" + "movnti %%eax, (%1,%2)\n\t" + "sub $0x4, %2\n\t" + "jnz ssse3_convert_rgb32_gray8_iter\n\t" + : + : "r" (col1), "r" (result), "r" (count), "g" (multiplier) + : "%eax", "%xmm0", "%xmm1", "%xmm3", "%xmm4", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -4766,28 +4755,28 @@ void ssse3_convert_yuyv_gray8(const uint8_t* col1, uint8_t* result, unsigned lon /* XMM7 - unused */ __asm__ __volatile__ ( - "movdqa %4, %%xmm3\n\t" - "movdqa %5, %%xmm4\n\t" - "algo_ssse3_convert_yuyv_gray8:\n\t" - "movdqa (%0), %%xmm0\n\t" - "pshufb %%xmm3, %%xmm0\n\t" - "movdqa 0x10(%0), %%xmm1\n\t" - "pshufb %%xmm4, %%xmm1\n\t" - "por %%xmm1, %%xmm0\n\t" - "movntdq %%xmm0, (%1)\n\t" - "add $0x10, %3\n\t" - "add $0x10, %1\n\t" - "add $0x20, %0\n\t" - "cmp %2, %3\n\t" - "jb algo_ssse3_convert_yuyv_gray8\n\t" - : + "movdqa %4, %%xmm3\n\t" + "movdqa %5, %%xmm4\n\t" + "algo_ssse3_convert_yuyv_gray8:\n\t" + "movdqa (%0), %%xmm0\n\t" + "pshufb %%xmm3, %%xmm0\n\t" + "movdqa 0x10(%0), %%xmm1\n\t" + "pshufb %%xmm4, %%xmm1\n\t" + "por %%xmm1, %%xmm0\n\t" + "movntdq %%xmm0, (%1)\n\t" + "add $0x10, %3\n\t" + "add $0x10, %1\n\t" + "add $0x20, %0\n\t" + "cmp %2, %3\n\t" + "jb algo_ssse3_convert_yuyv_gray8\n\t" + : #if (defined(_DEBUG) && !defined(__x86_64__)) /* Use one less register to allow compilation to success on 32bit with omit frame pointer disabled */ - : "r" (col1), "r" (result), "m" (count), "r" (i), "m" (*movemask1), "m" (*movemask2) + : "r" (col1), "r" (result), "m" (count), "r" (i), "m" (*movemask1), "m" (*movemask2) #else - : "r" (col1), "r" (result), "r" (count), "r" (i), "m" (*movemask1), "m" (*movemask2) + : "r" (col1), "r" (result), "r" (count), "r" (i), "m" (*movemask1), "m" (*movemask2) #endif - : "%xmm3", "%xmm4", "cc", "memory" - ); + : "%xmm3", "%xmm4", "cc", "memory" + ); #else Panic("SSE function called on a non x86\\x86-64 platform"); #endif @@ -5350,7 +5339,7 @@ AVPixelFormat Image::AVPixFormat() const { if ( colours == ZM_COLOUR_RGB32 ) { return AV_PIX_FMT_RGBA; } else if ( colours == ZM_COLOUR_RGB24 ) { - if ( subpixelorder == ZM_SUBPIX_ORDER_BGR){ + if ( subpixelorder == ZM_SUBPIX_ORDER_BGR) { return AV_PIX_FMT_BGR24; } else { return AV_PIX_FMT_RGB24; diff --git a/src/zm_image.h b/src/zm_image.h index 97bfacfee..566e2477b 100644 --- a/src/zm_image.h +++ b/src/zm_image.h @@ -1,21 +1,21 @@ // // ZoneMinder Image Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_IMAGE_H #define ZM_IMAGE_H @@ -36,7 +36,7 @@ class Box; class Polygon; #define ZM_BUFTYPE_DONTFREE 0 -#define ZM_BUFTYPE_MALLOC 1 +#define ZM_BUFTYPE_MALLOC 1 #define ZM_BUFTYPE_NEW 2 #define ZM_BUFTYPE_AVMALLOC 3 #define ZM_BUFTYPE_ZM 4 @@ -51,178 +51,178 @@ extern imgbufcpy_fptr_t fptr_imgbufcpy; /* Should be called from Image class functions */ inline static uint8_t* AllocBuffer(size_t p_bufsize) { - uint8_t* buffer = (uint8_t*)zm_mallocaligned(64, p_bufsize); - if ( buffer == nullptr ) - Fatal("Memory allocation failed: %s", strerror(errno)); - - return buffer; + uint8_t* buffer = (uint8_t*)zm_mallocaligned(64, p_bufsize); + if ( buffer == nullptr ) + Fatal("Memory allocation failed: %s", strerror(errno)); + + return buffer; } inline static void DumpBuffer(uint8_t* buffer, int buffertype) { - if ( buffer && (buffertype != ZM_BUFTYPE_DONTFREE) ) { + if ( buffer && (buffertype != ZM_BUFTYPE_DONTFREE) ) { if ( buffertype == ZM_BUFTYPE_ZM ) { zm_freealigned(buffer); } else if ( buffertype == ZM_BUFTYPE_MALLOC ) { free(buffer); } else if ( buffertype == ZM_BUFTYPE_NEW ) { delete buffer; - /*else if(buffertype == ZM_BUFTYPE_AVMALLOC) - av_free(buffer); - */ + /*else if(buffertype == ZM_BUFTYPE_AVMALLOC) + av_free(buffer); + */ } else { Error("Unknown buffer type in DumpBuffer(%d)", buffertype); - } - } + } + } } // -// This is image class, and represents a frame captured from a +// This is image class, and represents a frame captured from a // camera in raw form. // class Image { - private: - delta_fptr_t delta8_rgb; - delta_fptr_t delta8_bgr; - delta_fptr_t delta8_rgba; - delta_fptr_t delta8_bgra; - delta_fptr_t delta8_argb; - delta_fptr_t delta8_abgr; - delta_fptr_t delta8_gray8; + private: + delta_fptr_t delta8_rgb; + delta_fptr_t delta8_bgr; + delta_fptr_t delta8_rgba; + delta_fptr_t delta8_bgra; + delta_fptr_t delta8_argb; + delta_fptr_t delta8_abgr; + delta_fptr_t delta8_gray8; - // Per object function pointer that we can set once we know the image dimensions - blend_fptr_t blend; + // Per object function pointer that we can set once we know the image dimensions + blend_fptr_t blend; - void update_function_pointers(); + void update_function_pointers(); - protected: - inline void AllocImgBuffer(size_t p_bufsize) { - if ( buffer ) - DumpImgBuffer(); + protected: + inline void AllocImgBuffer(size_t p_bufsize) { + if ( buffer ) + DumpImgBuffer(); - buffer = AllocBuffer(p_bufsize); - buffertype = ZM_BUFTYPE_ZM; - allocation = p_bufsize; - } + buffer = AllocBuffer(p_bufsize); + buffertype = ZM_BUFTYPE_ZM; + allocation = p_bufsize; + } - public: - enum { ZM_CHAR_HEIGHT=11, ZM_CHAR_WIDTH=6 }; - enum { LINE_HEIGHT=ZM_CHAR_HEIGHT+0 }; + public: + enum { ZM_CHAR_HEIGHT=11, ZM_CHAR_WIDTH=6 }; + enum { LINE_HEIGHT=ZM_CHAR_HEIGHT+0 }; - protected: - static bool initialised; - static unsigned char *abs_table; - static unsigned char *y_r_table; - static unsigned char *y_g_table; - static unsigned char *y_b_table; - static jpeg_compress_struct *writejpg_ccinfo[101]; - static jpeg_compress_struct *encodejpg_ccinfo[101]; - static jpeg_decompress_struct *readjpg_dcinfo; - static jpeg_decompress_struct *decodejpg_dcinfo; - static struct zm_error_mgr jpg_err; + protected: + static bool initialised; + static unsigned char *abs_table; + static unsigned char *y_r_table; + static unsigned char *y_g_table; + static unsigned char *y_b_table; + static jpeg_compress_struct *writejpg_ccinfo[101]; + static jpeg_compress_struct *encodejpg_ccinfo[101]; + static jpeg_decompress_struct *readjpg_dcinfo; + static jpeg_decompress_struct *decodejpg_dcinfo; + static struct zm_error_mgr jpg_err; - unsigned int width; - unsigned int linesize; - unsigned int height; - unsigned int pixels; - unsigned int colours; - unsigned int padding; - unsigned int size; - unsigned int subpixelorder; - unsigned long allocation; - _AVPIXELFORMAT imagePixFormat; - uint8_t *buffer; - int buffertype; /* 0=not ours, no need to call free(), 1=malloc() buffer, 2=new buffer */ - int holdbuffer; /* Hold the buffer instead of replacing it with new one */ - std::string annotation_; - std::string filename_; + unsigned int width; + unsigned int linesize; + unsigned int height; + unsigned int pixels; + unsigned int colours; + unsigned int padding; + unsigned int size; + unsigned int subpixelorder; + unsigned long allocation; + _AVPIXELFORMAT imagePixFormat; + uint8_t *buffer; + int buffertype; /* 0=not ours, no need to call free(), 1=malloc() buffer, 2=new buffer */ + int holdbuffer; /* Hold the buffer instead of replacing it with new one */ + std::string annotation_; + std::string filename_; - public: - Image(); - explicit Image(const std::string &filename); - Image(int p_width, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer=0, unsigned int padding=0); - Image(int p_width, int p_linesize, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer=0, unsigned int padding=0); - explicit Image(const Image &p_image); - explicit Image(const AVFrame *frame, int p_width=-1, int p_height=-1); + public: + Image(); + explicit Image(const std::string &filename); + Image(int p_width, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer=0, unsigned int padding=0); + Image(int p_width, int p_linesize, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer=0, unsigned int padding=0); + explicit Image(const Image &p_image); + explicit Image(const AVFrame *frame, int p_width=-1, int p_height=-1); - ~Image(); + ~Image(); - static void Initialise(); - static void Deinitialise(); + static void Initialise(); + static void Deinitialise(); - inline void DumpImgBuffer() { - if (buffertype != ZM_BUFTYPE_DONTFREE) - DumpBuffer(buffer, buffertype); - buffertype = ZM_BUFTYPE_DONTFREE; - buffer = nullptr; - allocation = 0; - } - inline unsigned int Width() const { return width; } - inline unsigned int LineSize() const { return linesize; } - inline unsigned int Height() const { return height; } - inline unsigned int Pixels() const { return pixels; } - inline unsigned int Colours() const { return colours; } - inline unsigned int SubpixelOrder() const { return subpixelorder; } - inline unsigned int Size() const { return size; } - std::string Filename() const { return filename_; } + inline void DumpImgBuffer() { + if (buffertype != ZM_BUFTYPE_DONTFREE) + DumpBuffer(buffer, buffertype); + buffertype = ZM_BUFTYPE_DONTFREE; + buffer = nullptr; + allocation = 0; + } + inline unsigned int Width() const { return width; } + inline unsigned int LineSize() const { return linesize; } + inline unsigned int Height() const { return height; } + inline unsigned int Pixels() const { return pixels; } + inline unsigned int Colours() const { return colours; } + inline unsigned int SubpixelOrder() const { return subpixelorder; } + inline unsigned int Size() const { return size; } + std::string Filename() const { return filename_; } - AVPixelFormat AVPixFormat() const; + AVPixelFormat AVPixFormat() const; - inline uint8_t* Buffer() { return buffer; } - inline const uint8_t* Buffer() const { return buffer; } - inline uint8_t* Buffer(unsigned int x, unsigned int y=0) { return &buffer[(y*linesize) + x*colours]; } - inline const uint8_t* Buffer(unsigned int x, unsigned int y=0) const { return &buffer[(y*linesize) + x*colours]; } + inline uint8_t* Buffer() { return buffer; } + inline const uint8_t* Buffer() const { return buffer; } + inline uint8_t* Buffer(unsigned int x, unsigned int y=0) { return &buffer[(y*linesize) + x*colours]; } + inline const uint8_t* Buffer(unsigned int x, unsigned int y=0) const { return &buffer[(y*linesize) + x*colours]; } - /* Request writeable buffer */ - uint8_t* WriteBuffer(const unsigned int p_width, const unsigned int p_height, const unsigned int p_colours, const unsigned int p_subpixelorder); - // Is only acceptable on a pre-allocated buffer - uint8_t* WriteBuffer() { return holdbuffer ? buffer : nullptr; }; + /* Request writeable buffer */ + uint8_t* WriteBuffer(const unsigned int p_width, const unsigned int p_height, const unsigned int p_colours, const unsigned int p_subpixelorder); + // Is only acceptable on a pre-allocated buffer + uint8_t* WriteBuffer() { return holdbuffer ? buffer : nullptr; }; - inline int IsBufferHeld() const { return holdbuffer; } - inline void HoldBuffer(int tohold) { holdbuffer = tohold; } + inline int IsBufferHeld() const { return holdbuffer; } + inline void HoldBuffer(int tohold) { holdbuffer = tohold; } - inline void Empty() { - if ( !holdbuffer ) - DumpImgBuffer(); + inline void Empty() { + if ( !holdbuffer ) + DumpImgBuffer(); - width = linesize = height = colours = size = pixels = subpixelorder = 0; - } + width = linesize = height = colours = size = pixels = subpixelorder = 0; + } - void Assign( - unsigned int p_width, - unsigned int p_height, - unsigned int p_colours, - unsigned int p_subpixelorder, - const uint8_t* new_buffer, - const size_t buffer_size); - void Assign(const Image &image); - bool Assign(const AVFrame *frame); - bool Assign(const AVFrame *frame, SwsContext *convert_context, AVFrame *temp_frame); - void AssignDirect( - const unsigned int p_width, - const unsigned int p_height, - const unsigned int p_colours, - const unsigned int p_subpixelorder, - uint8_t *new_buffer, - const size_t buffer_size, - const int p_buffertype); + void Assign( + unsigned int p_width, + unsigned int p_height, + unsigned int p_colours, + unsigned int p_subpixelorder, + const uint8_t* new_buffer, + const size_t buffer_size); + void Assign(const Image &image); + bool Assign(const AVFrame *frame); + bool Assign(const AVFrame *frame, SwsContext *convert_context, AVFrame *temp_frame); + void AssignDirect( + const unsigned int p_width, + const unsigned int p_height, + const unsigned int p_colours, + const unsigned int p_subpixelorder, + uint8_t *new_buffer, + const size_t buffer_size, + const int p_buffertype); - int PopulateFrame(AVFrame *frame); + int PopulateFrame(AVFrame *frame); - inline void CopyBuffer(const Image &image) { - Assign(image); - } - inline Image &operator=(const Image &image) { - Assign(image); - return *this; - } - inline Image &operator=(const unsigned char *new_buffer) { - (*fptr_imgbufcpy)(buffer, new_buffer, size); - return *this; - } + inline void CopyBuffer(const Image &image) { + Assign(image); + } + inline Image &operator=(const Image &image) { + Assign(image); + return *this; + } + inline Image &operator=(const unsigned char *new_buffer) { + (*fptr_imgbufcpy)(buffer, new_buffer, size); + return *this; + } - bool ReadRaw(const std::string &filename); - bool WriteRaw(const std::string &filename) const; + bool ReadRaw(const std::string &filename); + bool WriteRaw(const std::string &filename) const; bool ReadJpeg(const std::string &filename, unsigned int p_colours, unsigned int p_subpixelorder); @@ -236,56 +236,56 @@ class Image { SystemTimePoint timestamp, bool on_blocking_abort) const; - bool DecodeJpeg(const JOCTET *inbuffer, int inbuffer_size, unsigned int p_colours, unsigned int p_subpixelorder); - bool EncodeJpeg(JOCTET *outbuffer, int *outbuffer_size, int quality_override=0) const; + bool DecodeJpeg(const JOCTET *inbuffer, int inbuffer_size, unsigned int p_colours, unsigned int p_subpixelorder); + bool EncodeJpeg(JOCTET *outbuffer, int *outbuffer_size, int quality_override=0) const; #if HAVE_ZLIB_H - bool Unzip(const Bytef *inbuffer, unsigned long inbuffer_size); - bool Zip(Bytef *outbuffer, unsigned long *outbuffer_size, int compression_level=Z_BEST_SPEED) const; + bool Unzip(const Bytef *inbuffer, unsigned long inbuffer_size); + bool Zip(Bytef *outbuffer, unsigned long *outbuffer_size, int compression_level=Z_BEST_SPEED) const; #endif // HAVE_ZLIB_H - bool Crop(unsigned int lo_x, unsigned int lo_y, unsigned int hi_x, unsigned int hi_y); - bool Crop(const Box &limits); + bool Crop(unsigned int lo_x, unsigned int lo_y, unsigned int hi_x, unsigned int hi_y); + bool Crop(const Box &limits); - void Overlay(const Image &image); - void Overlay(const Image &image, unsigned int x, unsigned int y); - void Blend(const Image &image, int transparency=12); - static Image *Merge( unsigned int n_images, Image *images[] ); - static Image *Merge( unsigned int n_images, Image *images[], double weight ); - static Image *Highlight(unsigned int n_images, Image *images[], Rgb threshold = kRGBBlack, Rgb ref_colour = kRGBRed); - //Image *Delta( const Image &image ) const; - void Delta( const Image &image, Image* targetimage) const; + void Overlay(const Image &image); + void Overlay(const Image &image, unsigned int x, unsigned int y); + void Blend(const Image &image, int transparency=12); + static Image *Merge( unsigned int n_images, Image *images[] ); + static Image *Merge( unsigned int n_images, Image *images[], double weight ); + static Image *Highlight(unsigned int n_images, Image *images[], Rgb threshold = kRGBBlack, Rgb ref_colour = kRGBRed); + //Image *Delta( const Image &image ) const; + void Delta( const Image &image, Image* targetimage) const; - const Vector2 centreCoord(const char *text, const int size) const; - void MaskPrivacy( const unsigned char *p_bitmask, const Rgb pixel_colour=0x00222222 ); - void Annotate(const std::string &text, + const Vector2 centreCoord(const char *text, const int size) const; + void MaskPrivacy( const unsigned char *p_bitmask, const Rgb pixel_colour=0x00222222 ); + void Annotate(const std::string &text, const Vector2 &coord, uint8 size = 1, Rgb fg_colour = kRGBWhite, Rgb bg_colour = kRGBBlack); - Image *HighlightEdges( Rgb colour, unsigned int p_colours, unsigned int p_subpixelorder, const Box *limits=0 ); - //Image *HighlightEdges( Rgb colour, const Polygon &polygon ); - void Timestamp(const char *label, SystemTimePoint when, const Vector2 &coord, int label_size); - void Colourise(const unsigned int p_reqcolours, const unsigned int p_reqsubpixelorder); - void DeColourise(); + Image *HighlightEdges( Rgb colour, unsigned int p_colours, unsigned int p_subpixelorder, const Box *limits=0 ); + //Image *HighlightEdges( Rgb colour, const Polygon &polygon ); + void Timestamp(const char *label, SystemTimePoint when, const Vector2 &coord, int label_size); + void Colourise(const unsigned int p_reqcolours, const unsigned int p_reqsubpixelorder); + void DeColourise(); - void Clear() { memset( buffer, 0, size ); } - void Fill( Rgb colour, const Box *limits=0 ); - void Fill( Rgb colour, int density, const Box *limits=0 ); - void Outline( Rgb colour, const Polygon &polygon ); - void Fill(Rgb colour, const Polygon &polygon) { Fill(colour, 1, polygon); }; - void Fill(Rgb colour, int density, const Polygon &polygon); + void Clear() { memset( buffer, 0, size ); } + void Fill( Rgb colour, const Box *limits=0 ); + void Fill( Rgb colour, int density, const Box *limits=0 ); + void Outline( Rgb colour, const Polygon &polygon ); + void Fill(Rgb colour, const Polygon &polygon) { Fill(colour, 1, polygon); }; + void Fill(Rgb colour, int density, const Polygon &polygon); - void Rotate( int angle ); - void Flip( bool leftright ); - void Scale( unsigned int factor ); - void Scale(unsigned int x, unsigned int y); + void Rotate( int angle ); + void Flip( bool leftright ); + void Scale( unsigned int factor ); + void Scale(unsigned int x, unsigned int y); - void Deinterlace_Discard(); - void Deinterlace_Linear(); - void Deinterlace_Blend(); - void Deinterlace_Blend_CustomRatio(int divider); - void Deinterlace_4Field(const Image* next_image, unsigned int threshold); + void Deinterlace_Discard(); + void Deinterlace_Linear(); + void Deinterlace_Blend(); + void Deinterlace_Blend_CustomRatio(int divider); + void Deinterlace_4Field(const Image* next_image, unsigned int threshold); }; // Scan-line polygon fill algorithm diff --git a/src/zm_image_analyser.cpp b/src/zm_image_analyser.cpp index 8f03160d9..16f11d75c 100644 --- a/src/zm_image_analyser.cpp +++ b/src/zm_image_analyser.cpp @@ -5,8 +5,7 @@ /*!\fn ImageAnalyser::ImageAnalyser(const ImageAnalyser& source) * \param source is the object to copy */ -ImageAnalyser::ImageAnalyser(const ImageAnalyser& source) -{ +ImageAnalyser::ImageAnalyser(const ImageAnalyser& source) { m_Detectors = source.m_Detectors; } @@ -15,19 +14,17 @@ ImageAnalyser::ImageAnalyser(const ImageAnalyser& source) /*!\fn ImageAnalyser::operator=(const ImageAnalyser& source) * \param source is the object to copy */ -ImageAnalyser& ImageAnalyser::operator=(const ImageAnalyser& source) -{ +ImageAnalyser& ImageAnalyser::operator=(const ImageAnalyser& source) { m_Detectors = source.m_Detectors; return *this; } -ImageAnalyser::~ImageAnalyser() -{ +ImageAnalyser::~ImageAnalyser() { for(DetectorsList::reverse_iterator It = m_Detectors.rbegin(); - It != m_Detectors.rend(); - ++It) + It != m_Detectors.rend(); + ++It) delete *It; } @@ -40,18 +37,15 @@ ImageAnalyser::~ImageAnalyser() * \param noteSetMap is the map of events descriptions * \param det_cause is a string describing detection cause */ -int ImageAnalyser::DoDetection(const Image &comp_image, Zone** zones, int n_numZones, Event::StringSetMap noteSetMap, std::string& det_cause) -{ +int ImageAnalyser::DoDetection(const Image &comp_image, Zone** zones, int n_numZones, Event::StringSetMap noteSetMap, std::string& det_cause) { Event::StringSet zoneSet; int score = 0; for(DetectorsList::iterator It = m_Detectors.begin(); - It != m_Detectors.end(); - ++It) - { + It != m_Detectors.end(); + ++It) { int detect_score = (*It)->Detect(comp_image, zones, n_numZones, zoneSet); - if (detect_score) - { + if (detect_score) { score += detect_score; noteSetMap[(*It)->getDetectionCause()] = zoneSet; if (det_cause.length()) diff --git a/src/zm_image_analyser.h b/src/zm_image_analyser.h index c853c82a3..0f7fe6ee7 100644 --- a/src/zm_image_analyser.h +++ b/src/zm_image_analyser.h @@ -21,8 +21,8 @@ using namespace std; //! Class for handling image detection. class ImageAnalyser { - public: - + public: + //!Default constructor. ImageAnalyser() {}; @@ -35,7 +35,7 @@ class ImageAnalyser { //! Overloaded operator=. ImageAnalyser& operator=(const ImageAnalyser& source); -private: + private: }; diff --git a/src/zm_jpeg.cpp b/src/zm_jpeg.cpp index a71bef48e..0c205c72d 100644 --- a/src/zm_jpeg.cpp +++ b/src/zm_jpeg.cpp @@ -1,21 +1,21 @@ /* * ZoneMinder JPEG memory encoding/decoding, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #include "zm_jpeg.h" @@ -26,416 +26,420 @@ extern "C" { #define MAX_JPEG_ERRS 25 -static int jpeg_err_count = 0; + static int jpeg_err_count = 0; -void zm_jpeg_error_silent(j_common_ptr cinfo) { - zm_error_ptr zmerr = (zm_error_ptr)cinfo->err; - longjmp(zmerr->setjmp_buffer, 1); -} - -void zm_jpeg_emit_silence(j_common_ptr cinfo, int msg_level) { -} - -void zm_jpeg_error_exit(j_common_ptr cinfo) { - zm_error_ptr zmerr = (zm_error_ptr) cinfo->err; - - char buffer[JMSG_LENGTH_MAX]; - zmerr->pub.format_message(cinfo, buffer); - - Error("%s", buffer); - if (++jpeg_err_count == MAX_JPEG_ERRS) { - Fatal("Maximum number (%d) of JPEG errors reached, exiting", jpeg_err_count); + void zm_jpeg_error_silent(j_common_ptr cinfo) { + zm_error_ptr zmerr = (zm_error_ptr)cinfo->err; + longjmp(zmerr->setjmp_buffer, 1); } - longjmp(zmerr->setjmp_buffer, 1); -} + void zm_jpeg_emit_silence(j_common_ptr cinfo, int msg_level) { + } -void zm_jpeg_emit_message(j_common_ptr cinfo, int msg_level) { - char buffer[JMSG_LENGTH_MAX]; - zm_error_ptr zmerr = (zm_error_ptr) cinfo->err; + void zm_jpeg_error_exit(j_common_ptr cinfo) { + zm_error_ptr zmerr = (zm_error_ptr) cinfo->err; - if (msg_level < 0) { - /* It's a warning message. Since corrupt files may generate many warnings, - * the policy implemented here is to show only the first warning, - * unless trace_level >= 3. - */ - if (zmerr->pub.num_warnings == 0 || zmerr->pub.trace_level >= 3) { - zmerr->pub.format_message(cinfo, buffer); - if (!strstr(buffer, "Corrupt JPEG data:")) - Warning("%s", buffer); + char buffer[JMSG_LENGTH_MAX]; + zmerr->pub.format_message(cinfo, buffer); + + Error("%s", buffer); + if (++jpeg_err_count == MAX_JPEG_ERRS) { + Fatal("Maximum number (%d) of JPEG errors reached, exiting", jpeg_err_count); } - /* Always count warnings in num_warnings. */ - zmerr->pub.num_warnings++; - } else { - /* It's a trace message. Show it if trace_level >= msg_level. */ - if (zmerr->pub.trace_level >= msg_level) { - zmerr->pub.format_message(cinfo, buffer); - Debug(msg_level, "%s", buffer); + + longjmp(zmerr->setjmp_buffer, 1); + } + + void zm_jpeg_emit_message(j_common_ptr cinfo, int msg_level) { + char buffer[JMSG_LENGTH_MAX]; + zm_error_ptr zmerr = (zm_error_ptr) cinfo->err; + + if (msg_level < 0) { + /* It's a warning message. Since corrupt files may generate many warnings, + * the policy implemented here is to show only the first warning, + * unless trace_level >= 3. + */ + if (zmerr->pub.num_warnings == 0 || zmerr->pub.trace_level >= 3) { + zmerr->pub.format_message(cinfo, buffer); + if (!strstr(buffer, "Corrupt JPEG data:")) + Warning("%s", buffer); + } + /* Always count warnings in num_warnings. */ + zmerr->pub.num_warnings++; + } else { + /* It's a trace message. Show it if trace_level >= msg_level. */ + if (zmerr->pub.trace_level >= msg_level) { + zmerr->pub.format_message(cinfo, buffer); + Debug(msg_level, "%s", buffer); + } } } -} -/* Expanded data destination object for memory */ + /* Expanded data destination object for memory */ -typedef struct { - struct jpeg_destination_mgr pub; /* public fields */ + typedef struct { + struct jpeg_destination_mgr pub; /* public fields */ - JOCTET *outbuffer; /* target buffer */ - int *outbuffer_size; - JOCTET *buffer; /* start of buffer */ -} mem_destination_mgr; + JOCTET *outbuffer; /* target buffer */ + int *outbuffer_size; + JOCTET *buffer; /* start of buffer */ + } mem_destination_mgr; -typedef mem_destination_mgr * mem_dest_ptr; + typedef mem_destination_mgr * mem_dest_ptr; #define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ -/* - * Initialize destination --- called by jpeg_start_compress - * before any data is actually written. - */ - -static void init_destination (j_compress_ptr cinfo) { - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - - /* Allocate the output buffer --- it will be released when done with image */ - dest->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; - - *(dest->outbuffer_size) = 0; -} - -/* - * Empty the output buffer --- called whenever buffer fills up. - * - * In typical applications, this should write the entire output buffer - * (ignoring the current state of next_output_byte & free_in_buffer), - * reset the pointer & count to the start of the buffer, and return TRUE - * indicating that the buffer has been dumped. - * - * In applications that need to be able to suspend compression due to output - * overrun, a FALSE return indicates that the buffer cannot be emptied now. - * In this situation, the compressor will return to its caller (possibly with - * an indication that it has not accepted all the supplied scanlines). The - * application should resume compression after it has made more room in the - * output buffer. Note that there are substantial restrictions on the use of - * suspension --- see the documentation. - * - * When suspending, the compressor will back up to a convenient restart point - * (typically the start of the current MCU). next_output_byte & free_in_buffer - * indicate where the restart point will be if the current call returns FALSE. - * Data beyond this point will be regenerated after resumption, so do not - * write it out when emptying the buffer externally. - */ - -static boolean empty_output_buffer(j_compress_ptr cinfo) { - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - - memcpy(dest->outbuffer+*(dest->outbuffer_size), dest->buffer, OUTPUT_BUF_SIZE); - *(dest->outbuffer_size) += OUTPUT_BUF_SIZE; - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; - - return TRUE; -} - -/* - * Terminate destination --- called by jpeg_finish_compress - * after all data has been written. Usually needs to flush buffer. - * - * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding - * application must deal with any cleanup that should happen even - * for error exit. - */ - -static void term_destination(j_compress_ptr cinfo) { - mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; - size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; - - if ( datacount > 0 ) { - memcpy(dest->outbuffer+*(dest->outbuffer_size), dest->buffer, datacount); - *(dest->outbuffer_size) += datacount; - } -} - - -/* - * Prepare for output to a stdio stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing compression. - */ - -void zm_jpeg_mem_dest(j_compress_ptr cinfo, JOCTET *outbuffer, int *outbuffer_size) { - mem_dest_ptr dest; - - /* The destination object is made permanent so that multiple JPEG images - * can be written to the same file without re-executing jpeg_stdio_dest. - * This makes it dangerous to use this manager and a different destination - * manager serially with the same JPEG object, because their private object - * sizes may be different. Caveat programmer. + /* + * Initialize destination --- called by jpeg_start_compress + * before any data is actually written. */ - if ( cinfo->dest == nullptr ) { - /* first time for this JPEG object? */ - cinfo->dest = (struct jpeg_destination_mgr *)(*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(mem_destination_mgr)); + + static void init_destination (j_compress_ptr cinfo) { + mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; + + /* Allocate the output buffer --- it will be released when done with image */ + dest->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; + + *(dest->outbuffer_size) = 0; } - dest = (mem_dest_ptr) cinfo->dest; - dest->pub.init_destination = init_destination; - dest->pub.empty_output_buffer = empty_output_buffer; - dest->pub.term_destination = term_destination; - dest->outbuffer = outbuffer; - dest->outbuffer_size = outbuffer_size; -} + /* + * Empty the output buffer --- called whenever buffer fills up. + * + * In typical applications, this should write the entire output buffer + * (ignoring the current state of next_output_byte & free_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been dumped. + * + * In applications that need to be able to suspend compression due to output + * overrun, a FALSE return indicates that the buffer cannot be emptied now. + * In this situation, the compressor will return to its caller (possibly with + * an indication that it has not accepted all the supplied scanlines). The + * application should resume compression after it has made more room in the + * output buffer. Note that there are substantial restrictions on the use of + * suspension --- see the documentation. + * + * When suspending, the compressor will back up to a convenient restart point + * (typically the start of the current MCU). next_output_byte & free_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point will be regenerated after resumption, so do not + * write it out when emptying the buffer externally. + */ -/* Expanded data source object for memory input */ + static boolean empty_output_buffer(j_compress_ptr cinfo) { + mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; -typedef struct { - struct jpeg_source_mgr pub; /* public fields */ + memcpy(dest->outbuffer+*(dest->outbuffer_size), dest->buffer, OUTPUT_BUF_SIZE); + *(dest->outbuffer_size) += OUTPUT_BUF_SIZE; - JOCTET * inbuffer; /* source stream */ - int inbuffer_size; - int inbuffer_size_hwm; /* High water mark */ + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; - JOCTET * buffer; /* start of buffer */ - boolean start_of_data; /* have we gotten any data yet? */ -} mem_source_mgr; + return TRUE; + } -typedef mem_source_mgr * mem_src_ptr; + /* + * Terminate destination --- called by jpeg_finish_compress + * after all data has been written. Usually needs to flush buffer. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + + static void term_destination(j_compress_ptr cinfo) { + mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; + size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; + + if ( datacount > 0 ) { + memcpy(dest->outbuffer+*(dest->outbuffer_size), dest->buffer, datacount); + *(dest->outbuffer_size) += datacount; + } + } + + + /* + * Prepare for output to a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing compression. + */ + + void zm_jpeg_mem_dest(j_compress_ptr cinfo, JOCTET *outbuffer, int *outbuffer_size) { + mem_dest_ptr dest; + + /* The destination object is made permanent so that multiple JPEG images + * can be written to the same file without re-executing jpeg_stdio_dest. + * This makes it dangerous to use this manager and a different destination + * manager serially with the same JPEG object, because their private object + * sizes may be different. Caveat programmer. + */ + if ( cinfo->dest == nullptr ) { + /* first time for this JPEG object? */ + cinfo->dest = (struct jpeg_destination_mgr *)(*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(mem_destination_mgr)); + } + + dest = (mem_dest_ptr) cinfo->dest; + dest->pub.init_destination = init_destination; + dest->pub.empty_output_buffer = empty_output_buffer; + dest->pub.term_destination = term_destination; + dest->outbuffer = outbuffer; + dest->outbuffer_size = outbuffer_size; + } + + /* Expanded data source object for memory input */ + + typedef struct { + struct jpeg_source_mgr pub; /* public fields */ + + JOCTET * inbuffer; /* source stream */ + int inbuffer_size; + int inbuffer_size_hwm; /* High water mark */ + + JOCTET * buffer; /* start of buffer */ + boolean start_of_data; /* have we gotten any data yet? */ + } mem_source_mgr; + + typedef mem_source_mgr * mem_src_ptr; #define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ -/* - * Initialize source --- called by jpeg_read_header - * before any data is actually read. - */ - -static void init_source (j_decompress_ptr cinfo) { - mem_src_ptr src = (mem_src_ptr) cinfo->src; - - /* We reset the empty-input-file flag for each image, - * but we don't clear the input buffer. - * This is correct behavior for reading a series of images from one source. + /* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. */ - src->start_of_data = TRUE; - src->pub.bytes_in_buffer = 0; -} + static void init_source (j_decompress_ptr cinfo) { + mem_src_ptr src = (mem_src_ptr) cinfo->src; -/* - * Fill the input buffer --- called whenever buffer is emptied. - * - * In typical applications, this should read fresh data into the buffer - * (ignoring the current state of next_input_byte & bytes_in_buffer), - * reset the pointer & count to the start of the buffer, and return TRUE - * indicating that the buffer has been reloaded. It is not necessary to - * fill the buffer entirely, only to obtain at least one more byte. - * - * There is no such thing as an EOF return. If the end of the file has been - * reached, the routine has a choice of ERREXIT() or inserting fake data into - * the buffer. In most cases, generating a warning message and inserting a - * fake EOI marker is the best course of action --- this will allow the - * decompressor to output however much of the image is there. However, - * the resulting error message is misleading if the real problem is an empty - * input file, so we handle that case specially. - * - * In applications that need to be able to suspend compression due to input - * not being available yet, a FALSE return indicates that no more data can be - * obtained right now, but more may be forthcoming later. In this situation, - * the decompressor will return to its caller (with an indication of the - * number of scanlines it has read, if any). The application should resume - * decompression after it has loaded more data into the input buffer. Note - * that there are substantial restrictions on the use of suspension --- see - * the documentation. - * - * When suspending, the decompressor will back up to a convenient restart point - * (typically the start of the current MCU). next_input_byte & bytes_in_buffer - * indicate where the restart point will be if the current call returns FALSE. - * Data beyond this point must be rescanned after resumption, so move it to - * the front of the buffer rather than discarding it. - */ - -static boolean fill_input_buffer (j_decompress_ptr cinfo) { - mem_src_ptr src = (mem_src_ptr) cinfo->src; - size_t nbytes; - - memcpy(src->buffer, src->inbuffer, (size_t) src->inbuffer_size); - nbytes = src->inbuffer_size; - - if ( nbytes == 0 ) { - if ( src->start_of_data ) /* Treat empty input file as fatal error */ - ERREXIT(cinfo, JERR_INPUT_EMPTY); - WARNMS(cinfo, JWRN_JPEG_EOF); - /* Insert a fake EOI marker */ - src->buffer[0] = (JOCTET) 0xFF; - src->buffer[1] = (JOCTET) JPEG_EOI; - nbytes = 2; + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. + */ + src->start_of_data = TRUE; + src->pub.bytes_in_buffer = 0; } - src->pub.next_input_byte = src->buffer; - src->pub.bytes_in_buffer = nbytes; - src->start_of_data = FALSE; - return TRUE; -} - -/* - * Skip data --- used to skip over a potentially large amount of - * uninteresting data (such as an APPn marker). - * - * Writers of suspendable-input applications must note that skip_input_data - * is not granted the right to give a suspension return. If the skip extends - * beyond the data currently in the buffer, the buffer can be marked empty so - * that the next read will cause a fill_input_buffer call that can suspend. - * Arranging for additional bytes to be discarded before reloading the input - * buffer is the application writer's problem. - */ - -static void skip_input_data(j_decompress_ptr cinfo, long num_bytes) { - mem_src_ptr src = (mem_src_ptr) cinfo->src; - - /* Just a dumb implementation for now. Could use fseek() except - * it doesn't work on pipes. Not clear that being smart is worth - * any trouble anyway --- large skips are infrequent. + /* + * Fill the input buffer --- called whenever buffer is emptied. + * + * In typical applications, this should read fresh data into the buffer + * (ignoring the current state of next_input_byte & bytes_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been reloaded. It is not necessary to + * fill the buffer entirely, only to obtain at least one more byte. + * + * There is no such thing as an EOF return. If the end of the file has been + * reached, the routine has a choice of ERREXIT() or inserting fake data into + * the buffer. In most cases, generating a warning message and inserting a + * fake EOI marker is the best course of action --- this will allow the + * decompressor to output however much of the image is there. However, + * the resulting error message is misleading if the real problem is an empty + * input file, so we handle that case specially. + * + * In applications that need to be able to suspend compression due to input + * not being available yet, a FALSE return indicates that no more data can be + * obtained right now, but more may be forthcoming later. In this situation, + * the decompressor will return to its caller (with an indication of the + * number of scanlines it has read, if any). The application should resume + * decompression after it has loaded more data into the input buffer. Note + * that there are substantial restrictions on the use of suspension --- see + * the documentation. + * + * When suspending, the decompressor will back up to a convenient restart point + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point must be rescanned after resumption, so move it to + * the front of the buffer rather than discarding it. */ - if ( num_bytes > 0 ) { - while ( num_bytes > (long) src->pub.bytes_in_buffer ) { - num_bytes -= (long) src->pub.bytes_in_buffer; - (void) fill_input_buffer(cinfo); - /* note we assume that fill_input_buffer will never return FALSE, - * so suspension need not be handled. - */ + + static boolean fill_input_buffer (j_decompress_ptr cinfo) { + mem_src_ptr src = (mem_src_ptr) cinfo->src; + size_t nbytes; + + memcpy(src->buffer, src->inbuffer, (size_t) src->inbuffer_size); + nbytes = src->inbuffer_size; + + if ( nbytes == 0 ) { + if ( src->start_of_data ) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; } - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_data = FALSE; + + return TRUE; } -} -/* - * Terminate source --- called by jpeg_finish_decompress - * after all data has been read. Often a no-op. - * - * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding - * application must deal with any cleanup that should happen even - * for error exit. - */ - -static void term_source(j_decompress_ptr cinfo) { - /* no work necessary here */ -} - -/* - * Prepare for input from a memory stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing decompression. - */ - -void zm_jpeg_mem_src(j_decompress_ptr cinfo, const JOCTET *inbuffer, int inbuffer_size) { - mem_src_ptr src; - - /* The source object and input buffer are made permanent so that a series - * of JPEG images can be read from the same file by calling zm_jpeg_mem_src - * only before the first one. (If we discarded the buffer at the end of - * one image, we'd likely lose the start of the next one.) - * This makes it unsafe to use this manager and a different source - * manager serially with the same JPEG object. Caveat programmer. + /* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. */ - if ( cinfo->src == nullptr ) { + + static void skip_input_data(j_decompress_ptr cinfo, long num_bytes) { + mem_src_ptr src = (mem_src_ptr) cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if ( num_bytes > 0 ) { + while ( num_bytes > (long) src->pub.bytes_in_buffer ) { + num_bytes -= (long) src->pub.bytes_in_buffer; + (void) fill_input_buffer(cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; + } + } + + /* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. Often a no-op. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + + static void term_source(j_decompress_ptr cinfo) { + /* no work necessary here */ + } + + /* + * Prepare for input from a memory stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ + + void zm_jpeg_mem_src(j_decompress_ptr cinfo, const JOCTET *inbuffer, int inbuffer_size) { + mem_src_ptr src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling zm_jpeg_mem_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if ( cinfo->src == nullptr ) { /* first time for this JPEG object? */ - cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(mem_source_mgr)); - src = (mem_src_ptr) cinfo->src; - src->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, inbuffer_size * SIZEOF(JOCTET)); - src->inbuffer_size_hwm = inbuffer_size; - } else { - src = (mem_src_ptr) cinfo->src; - if ( src->inbuffer_size_hwm < inbuffer_size ) { + cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(mem_source_mgr)); + src = (mem_src_ptr) cinfo->src; src->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, inbuffer_size * SIZEOF(JOCTET)); src->inbuffer_size_hwm = inbuffer_size; + } else { + src = (mem_src_ptr) cinfo->src; + if ( src->inbuffer_size_hwm < inbuffer_size ) { + src->buffer = (JOCTET *)(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, inbuffer_size * SIZEOF(JOCTET)); + src->inbuffer_size_hwm = inbuffer_size; + } } + + src = (mem_src_ptr) cinfo->src; + src->pub.init_source = init_source; + src->pub.fill_input_buffer = fill_input_buffer; + src->pub.skip_input_data = skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = term_source; + src->inbuffer = (JOCTET *)inbuffer; + src->inbuffer_size = inbuffer_size; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = nullptr; /* until buffer loaded */ } - src = (mem_src_ptr) cinfo->src; - src->pub.init_source = init_source; - src->pub.fill_input_buffer = fill_input_buffer; - src->pub.skip_input_data = skip_input_data; - src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ - src->pub.term_source = term_source; - src->inbuffer = (JOCTET *)inbuffer; - src->inbuffer_size = inbuffer_size; - src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ - src->pub.next_input_byte = nullptr; /* until buffer loaded */ -} + void zm_use_std_huff_tables(j_decompress_ptr cinfo) { + /* JPEG standard Huffman tables (cf. JPEG standard section K.3) */ + /* IMPORTANT: these are only valid for 8-bit data precision! */ + static const JHUFF_TBL dclumin = { + { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + FALSE + }; + static const JHUFF_TBL dcchrome = { + { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + FALSE + }; + static const JHUFF_TBL aclumin = { + { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }, + { + 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, + 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, + 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, + 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, + 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, + 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, + 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, + 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, + 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa + }, + FALSE + }; + static const JHUFF_TBL acchrome = { + { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }, + { + 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, + 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, + 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, + 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, + 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, + 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, + 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, + 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, + 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, + 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa + }, + FALSE + }; -void zm_use_std_huff_tables(j_decompress_ptr cinfo) { - /* JPEG standard Huffman tables (cf. JPEG standard section K.3) */ - /* IMPORTANT: these are only valid for 8-bit data precision! */ - static const JHUFF_TBL dclumin = { - { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, - FALSE - }; - static const JHUFF_TBL dcchrome = { - { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, - FALSE - }; - static const JHUFF_TBL aclumin = { - { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }, - { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, - 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, - 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, - 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, - 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, - 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, - 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, - 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, - 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, - 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, - 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, - 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, - 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, - 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, - 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa }, - FALSE - }; - static const JHUFF_TBL acchrome = { - { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }, - { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, - 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, - 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, - 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, - 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, - 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, - 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, - 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, - 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, - 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, - 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, - 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, - 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa }, - FALSE - }; - - cinfo->dc_huff_tbl_ptrs[0] = (JHUFF_TBL*)&dclumin; - cinfo->dc_huff_tbl_ptrs[1] = (JHUFF_TBL*)&dcchrome; - cinfo->ac_huff_tbl_ptrs[0] = (JHUFF_TBL*)&aclumin; - cinfo->ac_huff_tbl_ptrs[1] = (JHUFF_TBL*)&acchrome; -} + cinfo->dc_huff_tbl_ptrs[0] = (JHUFF_TBL*)&dclumin; + cinfo->dc_huff_tbl_ptrs[1] = (JHUFF_TBL*)&dcchrome; + cinfo->ac_huff_tbl_ptrs[0] = (JHUFF_TBL*)&aclumin; + cinfo->ac_huff_tbl_ptrs[1] = (JHUFF_TBL*)&acchrome; + } } diff --git a/src/zm_jpeg.h b/src/zm_jpeg.h index acf47f809..e024a34f0 100644 --- a/src/zm_jpeg.h +++ b/src/zm_jpeg.h @@ -1,17 +1,17 @@ /* * ZoneMinder Jpeg Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -28,23 +28,22 @@ extern "C" { -/* Stuff for overridden error handlers */ -struct zm_error_mgr -{ - struct jpeg_error_mgr pub; - jmp_buf setjmp_buffer; -}; + /* Stuff for overridden error handlers */ + struct zm_error_mgr { + struct jpeg_error_mgr pub; + jmp_buf setjmp_buffer; + }; -typedef struct zm_error_mgr *zm_error_ptr; + typedef struct zm_error_mgr *zm_error_ptr; -void zm_jpeg_error_silent( j_common_ptr cinfo ); -void zm_jpeg_emit_silence( j_common_ptr cinfo, int msg_level ); -void zm_jpeg_error_exit( j_common_ptr cinfo ); -void zm_jpeg_emit_message( j_common_ptr cinfo, int msg_level ); + void zm_jpeg_error_silent( j_common_ptr cinfo ); + void zm_jpeg_emit_silence( j_common_ptr cinfo, int msg_level ); + void zm_jpeg_error_exit( j_common_ptr cinfo ); + void zm_jpeg_emit_message( j_common_ptr cinfo, int msg_level ); // Prototypes for memory compress/decompression object */ -void zm_jpeg_mem_src(j_decompress_ptr cinfo, const JOCTET *inbuffer, int inbuffer_size ); -void zm_jpeg_mem_dest(j_compress_ptr cinfo, JOCTET *outbuffer, int *outbuffer_size ); + void zm_jpeg_mem_src(j_decompress_ptr cinfo, const JOCTET *inbuffer, int inbuffer_size ); + void zm_jpeg_mem_dest(j_compress_ptr cinfo, JOCTET *outbuffer, int *outbuffer_size ); -void zm_use_std_huff_tables( j_decompress_ptr cinfo ); + void zm_use_std_huff_tables( j_decompress_ptr cinfo ); } diff --git a/src/zm_libvlc_camera.cpp b/src/zm_libvlc_camera.cpp index e875ec20d..a61931cb0 100644 --- a/src/zm_libvlc_camera.cpp +++ b/src/zm_libvlc_camera.cpp @@ -1,17 +1,17 @@ /* * ZoneMinder Libvlc Camera Class Implementation, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -27,24 +27,24 @@ static void *libvlc_lib = nullptr; static void (*libvlc_media_player_release_f)(libvlc_media_player_t* ) = nullptr; static void (*libvlc_media_release_f)(libvlc_media_t* ) = nullptr; -static void (*libvlc_release_f)(libvlc_instance_t* ) = nullptr; +static void (*libvlc_release_f)(libvlc_instance_t* ) = nullptr; static void (*libvlc_media_player_stop_f)(libvlc_media_player_t* ) = nullptr; static libvlc_instance_t* (*libvlc_new_f)(int, const char* const *) = nullptr; static void (*libvlc_log_set_f)(libvlc_instance_t*, libvlc_log_cb, void *) = nullptr; static libvlc_media_t* (*libvlc_media_new_location_f)(libvlc_instance_t*, const char*) = nullptr; static libvlc_media_player_t* (*libvlc_media_player_new_from_media_f)(libvlc_media_t*) = nullptr; -static void (*libvlc_video_set_format_f)(libvlc_media_player_t*, const char*, unsigned, unsigned, unsigned) = nullptr; +static void (*libvlc_video_set_format_f)(libvlc_media_player_t*, const char*, unsigned, unsigned, unsigned) = nullptr; static void (*libvlc_video_set_callbacks_f)(libvlc_media_player_t*, libvlc_video_lock_cb, libvlc_video_unlock_cb, libvlc_video_display_cb, void*) = nullptr; static int (*libvlc_media_player_play_f)(libvlc_media_player_t *) = nullptr; static const char* (*libvlc_errmsg_f)(void) = nullptr; -static const char* (*libvlc_get_version_f)(void) = nullptr; +static const char* (*libvlc_get_version_f)(void) = nullptr; void bind_libvlc_symbols() { if(libvlc_lib != nullptr) // Safe-check return; - + libvlc_lib = dlopen("libvlc.so", RTLD_LAZY | RTLD_GLOBAL); - if(!libvlc_lib){ + if(!libvlc_lib) { Error("Error loading libvlc: %s", dlerror()); return; } @@ -63,7 +63,7 @@ void bind_libvlc_symbols() { *(void**) (&libvlc_errmsg_f) = dlsym(libvlc_lib, "libvlc_errmsg"); *(void**) (&libvlc_get_version_f) = dlsym(libvlc_lib, "libvlc_get_version"); } -// Do all the buffer checking work here to avoid unnecessary locking +// Do all the buffer checking work here to avoid unnecessary locking void* LibvlcLockBuffer(void* opaque, void** planes) { LibvlcPrivateData* data = reinterpret_cast(opaque); data->mutex.lock(); @@ -102,42 +102,41 @@ void LibvlcUnlockBuffer(void* opaque, void* picture, void *const *planes) { } LibvlcCamera::LibvlcCamera( - const Monitor *monitor, - const std::string &p_path, - const std::string &p_user, - const std::string &p_pass, - const std::string &p_method, - const std::string &p_options, - int p_width, - int p_height, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio - ) : + const Monitor *monitor, + const std::string &p_path, + const std::string &p_user, + const std::string &p_pass, + const std::string &p_method, + const std::string &p_options, + int p_width, + int p_height, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio +) : Camera( - monitor, - LIBVLC_SRC, - p_width, - p_height, - p_colours, - ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), - p_brightness, - p_contrast, - p_hue, - p_colour, - p_capture, - p_record_audio - ), + monitor, + LIBVLC_SRC, + p_width, + p_height, + p_colours, + ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), + p_brightness, + p_contrast, + p_hue, + p_colour, + p_capture, + p_record_audio + ), mPath(p_path), mUser(UriEncode(p_user)), mPass(UriEncode(p_pass)), mMethod(p_method), - mOptions(p_options) -{ + mOptions(p_options) { mLibvlcInstance = nullptr; mLibvlcMedia = nullptr; mLibvlcMediaPlayer = nullptr; @@ -206,7 +205,7 @@ void LibvlcCamera::Terminate() { zm_freealigned(mLibvlcData.buffer); mLibvlcData.buffer = nullptr; } - + if ( mLibvlcData.prevBuffer ) { zm_freealigned(mLibvlcData.prevBuffer); mLibvlcData.prevBuffer = nullptr; @@ -287,16 +286,16 @@ int LibvlcCamera::PrimeCapture() { } -int LibvlcCamera::PreCapture() { +int LibvlcCamera::PreCapture() { return 0; } // Should not return -1 as cancels capture. Always wait for image if available. -int LibvlcCamera::Capture(std::shared_ptr &zm_packet) { +int LibvlcCamera::Capture(std::shared_ptr &zm_packet) { // newImage is a mutex/condition based flag to tell us when there is an image available { std::unique_lock lck(mLibvlcData.newImageMutex); - mLibvlcData.newImageCv.wait(lck, [&]{ return mLibvlcData.newImage || zm_terminate; }); + mLibvlcData.newImageCv.wait(lck, [&] { return mLibvlcData.newImage || zm_terminate; }); mLibvlcData.newImage = false; } diff --git a/src/zm_libvlc_camera.h b/src/zm_libvlc_camera.h index 62af6f632..8d925bc22 100644 --- a/src/zm_libvlc_camera.h +++ b/src/zm_libvlc_camera.h @@ -1,21 +1,21 @@ /* * ZoneMinder Libvlc Camera Class Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #ifndef ZM_LIBVLC_CAMERA_H #define ZM_LIBVLC_CAMERA_H @@ -45,9 +45,9 @@ struct LibvlcPrivateData { }; class LibvlcCamera : public Camera { - private: + private: static void log_callback( void *ptr, int level, const libvlc_log_t *ctx, const char *format, va_list vargs ); -protected: + protected: std::string mPath; std::string mUser; std::string mPass; @@ -63,7 +63,7 @@ protected: libvlc_media_t *mLibvlcMedia; libvlc_media_player_t *mLibvlcMediaPlayer; -public: + public: LibvlcCamera( const Monitor *monitor, const std::string &path, const std::string &user,const std::string &pass, const std::string &p_method, const std::string &p_options, int p_width, int p_height, int p_colours, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture, bool p_record_audio ); ~LibvlcCamera(); diff --git a/src/zm_libvnc_camera.cpp b/src/zm_libvnc_camera.cpp index 9e63183bc..cef92f96e 100644 --- a/src/zm_libvnc_camera.cpp +++ b/src/zm_libvnc_camera.cpp @@ -20,7 +20,7 @@ static rfbBool (*HandleRFBServerMessage_f)(rfbClient*) = nullptr; void bind_libvnc_symbols() { if (libvnc_lib != nullptr) // Safe-check return; - + libvnc_lib = dlopen("libvncclient.so", RTLD_LAZY | RTLD_GLOBAL); if (!libvnc_lib) { Error("Error loading libvncclient.so: %s", dlerror()); @@ -40,7 +40,7 @@ static void GotFrameBufferUpdateCallback(rfbClient *rfb, int x, int y, int w, in VncPrivateData *data = (VncPrivateData *)(*rfbClientGetClientData_f)(rfb, &TAG_0); data->buffer = rfb->frameBuffer; Debug(1, "GotFrameBufferUpdateallback x:%d y:%d w%d h:%d width: %d, height: %d, buffer %p", - x,y,w,h, rfb->width, rfb->height, rfb->frameBuffer); + x,y,w,h, rfb->width, rfb->height, rfb->frameBuffer); } static char* GetPasswordCallback(rfbClient* cl) { @@ -48,9 +48,9 @@ static char* GetPasswordCallback(rfbClient* cl) { return strdup((const char *)(*rfbClientGetClientData_f)(cl, &TAG_1)); } -static rfbCredential* GetCredentialsCallback(rfbClient* cl, int credentialType){ +static rfbCredential* GetCredentialsCallback(rfbClient* cl, int credentialType) { if (credentialType != rfbCredentialTypeUser) { - Debug(1, "credentialType != rfbCredentialTypeUser"); + Debug(1, "credentialType != rfbCredentialTypeUser"); return nullptr; } rfbCredential *c = (rfbCredential *)malloc(sizeof(rfbCredential)); @@ -73,47 +73,46 @@ static rfbBool resize(rfbClient* client) { // libVNC doesn't do alignment or padding in each line //SWScale::GetBufferSize(AV_PIX_FMT_RGBA, client->width, client->height); client->frameBuffer = (uint8_t *)av_malloc(bufferSize); - Debug(1, "Allocing new frame buffer %dx%d = %d", client->width, client->height, bufferSize); + Debug(1, "Allocing new frame buffer %dx%d = %d", client->width, client->height, bufferSize); return TRUE; } VncCamera::VncCamera( - const Monitor *monitor, - const std::string &host, - const std::string &port, - const std::string &user, - const std::string &pass, - int p_width, - int p_height, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio ) : - Camera( - monitor, - VNC_SRC, - p_width, - p_height, - p_colours, - ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), - p_brightness, - p_contrast, - p_hue, - p_colour, - p_capture, - p_record_audio - ), - mRfb(nullptr), - mVncData({}), - mHost(host), - mPort(port), - mUser(user), - mPass(pass) -{ + const Monitor *monitor, + const std::string &host, + const std::string &port, + const std::string &user, + const std::string &pass, + int p_width, + int p_height, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio ) : + Camera( + monitor, + VNC_SRC, + p_width, + p_height, + p_colours, + ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), + p_brightness, + p_contrast, + p_hue, + p_colour, + p_capture, + p_record_audio + ), + mRfb(nullptr), + mVncData({}), + mHost(host), + mPort(port), + mUser(user), +mPass(pass) { if (colours == ZM_COLOUR_RGB32) { subpixelorder = ZM_SUBPIX_ORDER_RGBA; mImgPixFmt = AV_PIX_FMT_RGBA; @@ -169,22 +168,22 @@ int VncCamera::PrimeCapture() { if (mRfb->serverHost) free(mRfb->serverHost); mRfb->serverHost = strdup(mHost.c_str()); mRfb->serverPort = atoi(mPort.c_str()); - if (!mRfb->serverPort) { - Debug(1, "Defaulting to port 5900"); - mRfb->serverPort = 5900; - } + if (!mRfb->serverPort) { + Debug(1, "Defaulting to port 5900"); + mRfb->serverPort = 5900; + } - } else { - Debug(1, "mRfb already exists?"); + } else { + Debug(1, "mRfb already exists?"); } if (!(*rfbInitClient_f)(mRfb, 0, nullptr)) { /* IF rfbInitClient fails, it calls rdbClientCleanup which will free mRfb */ mRfb = nullptr; - return -1; + return -1; } if (((unsigned int)mRfb->width != width) or ((unsigned int)mRfb->height != height)) { Warning("Specified dimensions do not match screen size monitor: (%dx%d) != vnc: (%dx%d)", - width, height, mRfb->width, mRfb->height); + width, height, mRfb->width, mRfb->height); } getVideoStream(); @@ -219,27 +218,27 @@ int VncCamera::Capture(std::shared_ptr &zm_packet) { uint8_t *directbuffer = zm_packet->image->WriteBuffer(width, height, colours, subpixelorder); Debug(1, "scale src %p, %d, dest %p %d %d %dx%d %dx%d", mVncData.buffer, - mRfb->si.framebufferWidth * mRfb->si.framebufferHeight * 4, - directbuffer, - width * height * colours, - mImgPixFmt, - mRfb->si.framebufferWidth, - mRfb->si.framebufferHeight, - width, - height); + mRfb->si.framebufferWidth * mRfb->si.framebufferHeight * 4, + directbuffer, + width * height * colours, + mImgPixFmt, + mRfb->si.framebufferWidth, + mRfb->si.framebufferHeight, + width, + height); int rc = scale.Convert( - mVncData.buffer, - mRfb->si.framebufferWidth * mRfb->si.framebufferHeight * 4, - //SWScale::GetBufferSize(AV_PIX_FMT_RGBA, mRfb->si.framebufferWidth, mRfb->si.framebufferHeight), - directbuffer, - width * height * colours, - AV_PIX_FMT_RGBA, - mImgPixFmt, - mRfb->si.framebufferWidth, - mRfb->si.framebufferHeight, - width, - height); + mVncData.buffer, + mRfb->si.framebufferWidth * mRfb->si.framebufferHeight * 4, + //SWScale::GetBufferSize(AV_PIX_FMT_RGBA, mRfb->si.framebufferWidth, mRfb->si.framebufferHeight), + directbuffer, + width * height * colours, + AV_PIX_FMT_RGBA, + mImgPixFmt, + mRfb->si.framebufferWidth, + mRfb->si.framebufferHeight, + width, + height); return rc == 0 ? 1 : rc; } diff --git a/src/zm_libvnc_camera.h b/src/zm_libvnc_camera.h index 59c531e83..d7db03d7f 100644 --- a/src/zm_libvnc_camera.h +++ b/src/zm_libvnc_camera.h @@ -19,12 +19,12 @@ // Used by vnc callbacks struct VncPrivateData { uint8_t *buffer; - uint8_t width; + uint8_t width; uint8_t height; }; class VncCamera : public Camera { -protected: + protected: rfbClient *mRfb; VncPrivateData mVncData; SWScale scale; @@ -33,23 +33,23 @@ protected: std::string mPort; std::string mUser; std::string mPass; -public: + public: VncCamera( - const Monitor *monitor, - const std::string &host, - const std::string &port, - const std::string &user, - const std::string &pass, - int p_width, - int p_height, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio); - + const Monitor *monitor, + const std::string &host, + const std::string &port, + const std::string &user, + const std::string &pass, + int p_width, + int p_height, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio); + ~VncCamera(); int PreCapture() override; diff --git a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp index 5b31a89fc..008d824da 100644 --- a/src/zm_local_camera.cpp +++ b/src/zm_local_camera.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Local Camera Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_local_camera.h" @@ -48,128 +48,127 @@ static int vidioctl(int fd, int request, void *arg) { static _AVPIXELFORMAT getFfPixFormatFromV4lPalette(int v4l_version, int palette) { _AVPIXELFORMAT pixFormat = AV_PIX_FMT_NONE; - + switch (palette) { #if defined(V4L2_PIX_FMT_RGB444) && defined(AV_PIX_FMT_RGB444) - case V4L2_PIX_FMT_RGB444 : - pixFormat = AV_PIX_FMT_RGB444; - break; + case V4L2_PIX_FMT_RGB444 : + pixFormat = AV_PIX_FMT_RGB444; + break; #endif // V4L2_PIX_FMT_RGB444 - case V4L2_PIX_FMT_RGB555 : - pixFormat = AV_PIX_FMT_RGB555; - break; - case V4L2_PIX_FMT_RGB565 : - pixFormat = AV_PIX_FMT_RGB565; - break; - case V4L2_PIX_FMT_BGR24 : - pixFormat = AV_PIX_FMT_BGR24; - break; - case V4L2_PIX_FMT_RGB24 : - pixFormat = AV_PIX_FMT_RGB24; - break; - case V4L2_PIX_FMT_BGR32 : - pixFormat = AV_PIX_FMT_BGRA; - break; - case V4L2_PIX_FMT_RGB32 : - pixFormat = AV_PIX_FMT_ARGB; - break; - case V4L2_PIX_FMT_GREY : - pixFormat = AV_PIX_FMT_GRAY8; - break; - case V4L2_PIX_FMT_YUYV : - pixFormat = AV_PIX_FMT_YUYV422; - break; - case V4L2_PIX_FMT_YUV422P : - pixFormat = AV_PIX_FMT_YUV422P; - break; - case V4L2_PIX_FMT_YUV411P : - pixFormat = AV_PIX_FMT_YUV411P; - break; + case V4L2_PIX_FMT_RGB555 : + pixFormat = AV_PIX_FMT_RGB555; + break; + case V4L2_PIX_FMT_RGB565 : + pixFormat = AV_PIX_FMT_RGB565; + break; + case V4L2_PIX_FMT_BGR24 : + pixFormat = AV_PIX_FMT_BGR24; + break; + case V4L2_PIX_FMT_RGB24 : + pixFormat = AV_PIX_FMT_RGB24; + break; + case V4L2_PIX_FMT_BGR32 : + pixFormat = AV_PIX_FMT_BGRA; + break; + case V4L2_PIX_FMT_RGB32 : + pixFormat = AV_PIX_FMT_ARGB; + break; + case V4L2_PIX_FMT_GREY : + pixFormat = AV_PIX_FMT_GRAY8; + break; + case V4L2_PIX_FMT_YUYV : + pixFormat = AV_PIX_FMT_YUYV422; + break; + case V4L2_PIX_FMT_YUV422P : + pixFormat = AV_PIX_FMT_YUV422P; + break; + case V4L2_PIX_FMT_YUV411P : + pixFormat = AV_PIX_FMT_YUV411P; + break; #ifdef V4L2_PIX_FMT_YUV444 - case V4L2_PIX_FMT_YUV444 : - pixFormat = AV_PIX_FMT_YUV444P; - break; + case V4L2_PIX_FMT_YUV444 : + pixFormat = AV_PIX_FMT_YUV444P; + break; #endif // V4L2_PIX_FMT_YUV444 - case V4L2_PIX_FMT_YUV410 : - pixFormat = AV_PIX_FMT_YUV410P; - break; - case V4L2_PIX_FMT_YUV420 : - pixFormat = AV_PIX_FMT_YUV420P; - break; - case V4L2_PIX_FMT_JPEG : - case V4L2_PIX_FMT_MJPEG : - pixFormat = AV_PIX_FMT_YUVJ444P; - break; - case V4L2_PIX_FMT_UYVY : - pixFormat = AV_PIX_FMT_UYVY422; - break; - // These don't seem to have ffmpeg equivalents - // See if you can match any of the ones in the default clause below!? - case V4L2_PIX_FMT_RGB332 : - case V4L2_PIX_FMT_RGB555X : - case V4L2_PIX_FMT_RGB565X : - //case V4L2_PIX_FMT_Y16 : - //case V4L2_PIX_FMT_PAL8 : - case V4L2_PIX_FMT_YVU410 : - case V4L2_PIX_FMT_YVU420 : - case V4L2_PIX_FMT_Y41P : - //case V4L2_PIX_FMT_YUV555 : - //case V4L2_PIX_FMT_YUV565 : - //case V4L2_PIX_FMT_YUV32 : - case V4L2_PIX_FMT_NV12 : - case V4L2_PIX_FMT_NV21 : - case V4L2_PIX_FMT_YYUV : - case V4L2_PIX_FMT_HI240 : - case V4L2_PIX_FMT_HM12 : - //case V4L2_PIX_FMT_SBGGR8 : - //case V4L2_PIX_FMT_SGBRG8 : - //case V4L2_PIX_FMT_SBGGR16 : - case V4L2_PIX_FMT_DV : - case V4L2_PIX_FMT_MPEG : - case V4L2_PIX_FMT_WNVA : - case V4L2_PIX_FMT_SN9C10X : - case V4L2_PIX_FMT_PWC1 : - case V4L2_PIX_FMT_PWC2 : - case V4L2_PIX_FMT_ET61X251 : - //case V4L2_PIX_FMT_SPCA501 : - //case V4L2_PIX_FMT_SPCA505 : - //case V4L2_PIX_FMT_SPCA508 : - //case V4L2_PIX_FMT_SPCA561 : - //case V4L2_PIX_FMT_PAC207 : - //case V4L2_PIX_FMT_PJPG : - //case V4L2_PIX_FMT_YVYU : - default : - { - Fatal("Can't find swscale format for palette %d", palette); - break; + case V4L2_PIX_FMT_YUV410 : + pixFormat = AV_PIX_FMT_YUV410P; + break; + case V4L2_PIX_FMT_YUV420 : + pixFormat = AV_PIX_FMT_YUV420P; + break; + case V4L2_PIX_FMT_JPEG : + case V4L2_PIX_FMT_MJPEG : + pixFormat = AV_PIX_FMT_YUVJ444P; + break; + case V4L2_PIX_FMT_UYVY : + pixFormat = AV_PIX_FMT_UYVY422; + break; + // These don't seem to have ffmpeg equivalents + // See if you can match any of the ones in the default clause below!? + case V4L2_PIX_FMT_RGB332 : + case V4L2_PIX_FMT_RGB555X : + case V4L2_PIX_FMT_RGB565X : + //case V4L2_PIX_FMT_Y16 : + //case V4L2_PIX_FMT_PAL8 : + case V4L2_PIX_FMT_YVU410 : + case V4L2_PIX_FMT_YVU420 : + case V4L2_PIX_FMT_Y41P : + //case V4L2_PIX_FMT_YUV555 : + //case V4L2_PIX_FMT_YUV565 : + //case V4L2_PIX_FMT_YUV32 : + case V4L2_PIX_FMT_NV12 : + case V4L2_PIX_FMT_NV21 : + case V4L2_PIX_FMT_YYUV : + case V4L2_PIX_FMT_HI240 : + case V4L2_PIX_FMT_HM12 : + //case V4L2_PIX_FMT_SBGGR8 : + //case V4L2_PIX_FMT_SGBRG8 : + //case V4L2_PIX_FMT_SBGGR16 : + case V4L2_PIX_FMT_DV : + case V4L2_PIX_FMT_MPEG : + case V4L2_PIX_FMT_WNVA : + case V4L2_PIX_FMT_SN9C10X : + case V4L2_PIX_FMT_PWC1 : + case V4L2_PIX_FMT_PWC2 : + case V4L2_PIX_FMT_ET61X251 : + //case V4L2_PIX_FMT_SPCA501 : + //case V4L2_PIX_FMT_SPCA505 : + //case V4L2_PIX_FMT_SPCA508 : + //case V4L2_PIX_FMT_SPCA561 : + //case V4L2_PIX_FMT_PAC207 : + //case V4L2_PIX_FMT_PJPG : + //case V4L2_PIX_FMT_YVYU : + default : { + Fatal("Can't find swscale format for palette %d", palette); + break; #if 0 - // These are all spare and may match some of the above - pixFormat = AV_PIX_FMT_YUVJ420P; - pixFormat = AV_PIX_FMT_YUVJ422P; - pixFormat = AV_PIX_FMT_UYVY422; - pixFormat = AV_PIX_FMT_UYYVYY411; - pixFormat = AV_PIX_FMT_BGR565; - pixFormat = AV_PIX_FMT_BGR555; - pixFormat = AV_PIX_FMT_BGR8; - pixFormat = AV_PIX_FMT_BGR4; - pixFormat = AV_PIX_FMT_BGR4_BYTE; - pixFormat = AV_PIX_FMT_RGB8; - pixFormat = AV_PIX_FMT_RGB4; - pixFormat = AV_PIX_FMT_RGB4_BYTE; - pixFormat = AV_PIX_FMT_NV12; - pixFormat = AV_PIX_FMT_NV21; - pixFormat = AV_PIX_FMT_RGB32_1; - pixFormat = AV_PIX_FMT_BGR32_1; - pixFormat = AV_PIX_FMT_GRAY16BE; - pixFormat = AV_PIX_FMT_GRAY16LE; - pixFormat = AV_PIX_FMT_YUV440P; - pixFormat = AV_PIX_FMT_YUVJ440P; - pixFormat = AV_PIX_FMT_YUVA420P; - //pixFormat = AV_PIX_FMT_VDPAU_H264; - //pixFormat = AV_PIX_FMT_VDPAU_MPEG1; - //pixFormat = AV_PIX_FMT_VDPAU_MPEG2; + // These are all spare and may match some of the above + pixFormat = AV_PIX_FMT_YUVJ420P; + pixFormat = AV_PIX_FMT_YUVJ422P; + pixFormat = AV_PIX_FMT_UYVY422; + pixFormat = AV_PIX_FMT_UYYVYY411; + pixFormat = AV_PIX_FMT_BGR565; + pixFormat = AV_PIX_FMT_BGR555; + pixFormat = AV_PIX_FMT_BGR8; + pixFormat = AV_PIX_FMT_BGR4; + pixFormat = AV_PIX_FMT_BGR4_BYTE; + pixFormat = AV_PIX_FMT_RGB8; + pixFormat = AV_PIX_FMT_RGB4; + pixFormat = AV_PIX_FMT_RGB4_BYTE; + pixFormat = AV_PIX_FMT_NV12; + pixFormat = AV_PIX_FMT_NV21; + pixFormat = AV_PIX_FMT_RGB32_1; + pixFormat = AV_PIX_FMT_BGR32_1; + pixFormat = AV_PIX_FMT_GRAY16BE; + pixFormat = AV_PIX_FMT_GRAY16LE; + pixFormat = AV_PIX_FMT_YUV440P; + pixFormat = AV_PIX_FMT_YUVJ440P; + pixFormat = AV_PIX_FMT_YUVA420P; + //pixFormat = AV_PIX_FMT_VDPAU_H264; + //pixFormat = AV_PIX_FMT_VDPAU_MPEG1; + //pixFormat = AV_PIX_FMT_VDPAU_MPEG2; #endif - } + } } // end switch palette return pixFormat; @@ -242,14 +241,13 @@ LocalCamera::LocalCamera( bool p_capture, bool p_record_audio, unsigned int p_extras) : - Camera(monitor, LOCAL_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture, p_record_audio), + Camera(monitor, LOCAL_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture, p_record_audio), device(p_device), channel(p_channel), standard(p_standard), palette(p_palette), channel_index(0), - extras(p_extras) -{ + extras(p_extras) { // If we are the first, or only, input on this device then // do the initial opening etc device_prime = (camera_count++ == 0); @@ -349,12 +347,12 @@ LocalCamera::LocalCamera( } else { if (capture) { Info( - "No direct match for the selected palette (%d) and target colorspace (%02u). Format conversion is required, performance penalty expected", - capturePixFormat, - colours); + "No direct match for the selected palette (%d) and target colorspace (%02u). Format conversion is required, performance penalty expected", + capturePixFormat, + colours); } /* Try using swscale for the conversion */ - conversion_type = 1; + conversion_type = 1; Debug(2, "Using swscale for image conversion"); if (colours == ZM_COLOUR_RGB32) { subpixelorder = ZM_SUBPIX_ORDER_RGBA; @@ -448,9 +446,9 @@ LocalCamera::LocalCamera( } imgConversionContext = sws_getContext( - width, height, capturePixFormat, - width, height, imagePixFormat, SWS_BICUBIC, - nullptr, nullptr, nullptr); + width, height, capturePixFormat, + width, height, imagePixFormat, SWS_BICUBIC, + nullptr, nullptr, nullptr); if (!imgConversionContext) { Fatal("Unable to initialise image scaling context"); @@ -484,7 +482,7 @@ void LocalCamera::Initialise() { if ((vid_fd = open(device.c_str(), O_RDWR, 0)) < 0) Fatal("Failed to open video device %s: %s", device.c_str(), strerror(errno)); - struct stat st; + struct stat st; if (stat(device.c_str(), &st) < 0) Fatal("Failed to stat video device %s: %s", device.c_str(), strerror(errno)); @@ -512,28 +510,28 @@ void LocalCamera::Initialise() { Fatal("Failed to get video format: %s", strerror(errno)); Debug(4, - " v4l2_data.fmt.type = %08x\n" - " v4l2_data.fmt.fmt.pix.width = %d\n" - " v4l2_data.fmt.fmt.pix.height = %d\n" - " v4l2_data.fmt.fmt.pix.pixelformat = %08x\n" - " v4l2_data.fmt.fmt.pix.field = %08x\n" - " v4l2_data.fmt.fmt.pix.bytesperline = %d\n" - " v4l2_data.fmt.fmt.pix.sizeimage = %d\n" - " v4l2_data.fmt.fmt.pix.colorspace = %08x\n" - " v4l2_data.fmt.fmt.pix.priv = %08x\n" - , v4l2_data.fmt.type - , v4l2_data.fmt.fmt.pix.width - , v4l2_data.fmt.fmt.pix.height - , v4l2_data.fmt.fmt.pix.pixelformat - , v4l2_data.fmt.fmt.pix.field - , v4l2_data.fmt.fmt.pix.bytesperline - , v4l2_data.fmt.fmt.pix.sizeimage - , v4l2_data.fmt.fmt.pix.colorspace - , v4l2_data.fmt.fmt.pix.priv - ); + " v4l2_data.fmt.type = %08x\n" + " v4l2_data.fmt.fmt.pix.width = %d\n" + " v4l2_data.fmt.fmt.pix.height = %d\n" + " v4l2_data.fmt.fmt.pix.pixelformat = %08x\n" + " v4l2_data.fmt.fmt.pix.field = %08x\n" + " v4l2_data.fmt.fmt.pix.bytesperline = %d\n" + " v4l2_data.fmt.fmt.pix.sizeimage = %d\n" + " v4l2_data.fmt.fmt.pix.colorspace = %08x\n" + " v4l2_data.fmt.fmt.pix.priv = %08x\n" + , v4l2_data.fmt.type + , v4l2_data.fmt.fmt.pix.width + , v4l2_data.fmt.fmt.pix.height + , v4l2_data.fmt.fmt.pix.pixelformat + , v4l2_data.fmt.fmt.pix.field + , v4l2_data.fmt.fmt.pix.bytesperline + , v4l2_data.fmt.fmt.pix.sizeimage + , v4l2_data.fmt.fmt.pix.colorspace + , v4l2_data.fmt.fmt.pix.priv + ); v4l2_data.fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - v4l2_data.fmt.fmt.pix.width = width; + v4l2_data.fmt.fmt.pix.width = width; v4l2_data.fmt.fmt.pix.height = height; v4l2_data.fmt.fmt.pix.pixelformat = palette; @@ -547,7 +545,7 @@ void LocalCamera::Initialise() { Fatal("Failed to set video format: %s", strerror(errno)); } } - } else { + } else { if (vidioctl(vid_fd, VIDIOC_S_FMT, &v4l2_data.fmt) < 0) { Error("Failed to set video format: %s", strerror(errno)); } @@ -555,25 +553,25 @@ void LocalCamera::Initialise() { /* Note VIDIOC_S_FMT may change width and height. */ Debug(4, - " v4l2_data.fmt.type = %08x\n" - " v4l2_data.fmt.fmt.pix.width = %d\n" - " v4l2_data.fmt.fmt.pix.height = %d\n" - " v4l2_data.fmt.fmt.pix.pixelformat = %08x\n" - " v4l2_data.fmt.fmt.pix.field = %08x\n" - " v4l2_data.fmt.fmt.pix.bytesperline = %d\n" - " v4l2_data.fmt.fmt.pix.sizeimage = %d\n" - " v4l2_data.fmt.fmt.pix.colorspace = %08x\n" - " v4l2_data.fmt.fmt.pix.priv = %08x\n" - , v4l2_data.fmt.type - , v4l2_data.fmt.fmt.pix.width - , v4l2_data.fmt.fmt.pix.height - , v4l2_data.fmt.fmt.pix.pixelformat - , v4l2_data.fmt.fmt.pix.field - , v4l2_data.fmt.fmt.pix.bytesperline - , v4l2_data.fmt.fmt.pix.sizeimage - , v4l2_data.fmt.fmt.pix.colorspace - , v4l2_data.fmt.fmt.pix.priv - ); + " v4l2_data.fmt.type = %08x\n" + " v4l2_data.fmt.fmt.pix.width = %d\n" + " v4l2_data.fmt.fmt.pix.height = %d\n" + " v4l2_data.fmt.fmt.pix.pixelformat = %08x\n" + " v4l2_data.fmt.fmt.pix.field = %08x\n" + " v4l2_data.fmt.fmt.pix.bytesperline = %d\n" + " v4l2_data.fmt.fmt.pix.sizeimage = %d\n" + " v4l2_data.fmt.fmt.pix.colorspace = %08x\n" + " v4l2_data.fmt.fmt.pix.priv = %08x\n" + , v4l2_data.fmt.type + , v4l2_data.fmt.fmt.pix.width + , v4l2_data.fmt.fmt.pix.height + , v4l2_data.fmt.fmt.pix.pixelformat + , v4l2_data.fmt.fmt.pix.field + , v4l2_data.fmt.fmt.pix.bytesperline + , v4l2_data.fmt.fmt.pix.sizeimage + , v4l2_data.fmt.fmt.pix.colorspace + , v4l2_data.fmt.fmt.pix.priv + ); if (v4l2_data.fmt.fmt.pix.width != width) { Warning("Failed to set requested width"); @@ -616,7 +614,7 @@ void LocalCamera::Initialise() { Debug(3,"Failed to get updated JPEG compression options: %s", strerror(errno)); } else { Debug(4, "JPEG quality: %d, markers: %#x", - jpeg_comp.quality, jpeg_comp.jpeg_markers); + jpeg_comp.quality, jpeg_comp.jpeg_markers); } } } @@ -627,7 +625,7 @@ void LocalCamera::Initialise() { memset(&v4l2_data.reqbufs, 0, sizeof(v4l2_data.reqbufs)); if (channel_count > 1) { Debug(3, "Channel count is %d", channel_count); - if (v4l_multi_buffer){ + if (v4l_multi_buffer) { v4l2_data.reqbufs.count = 2*channel_count; } else { v4l2_data.reqbufs.count = 1; @@ -652,7 +650,7 @@ void LocalCamera::Initialise() { Fatal("Insufficient buffer memory %d on video device", v4l2_data.reqbufs.count); Debug(3, "Setting up data buffers: Channels %d MultiBuffer %d Buffers: %d", - channel_count, v4l_multi_buffer, v4l2_data.reqbufs.count); + channel_count, v4l_multi_buffer, v4l2_data.reqbufs.count); v4l2_data.buffers = new V4L2MappedBuffer[v4l2_data.reqbufs.count]; capturePictures = new av_frame_ptr[v4l2_data.reqbufs.count]; @@ -676,7 +674,7 @@ void LocalCamera::Initialise() { if (v4l2_data.buffers[i].start == MAP_FAILED) Fatal("Can't map video buffer %u (%u bytes) to memory: %s(%d)", - i, vid_buf.length, strerror(errno), errno); + i, vid_buf.length, strerror(errno), errno); capturePictures[i] = av_frame_ptr{zm_av_frame_alloc()}; @@ -684,13 +682,13 @@ void LocalCamera::Initialise() { Fatal("Could not allocate picture"); av_image_fill_arrays( - capturePictures[i]->data, - capturePictures[i]->linesize, - (uint8_t*)v4l2_data.buffers[i].start, - capturePixFormat, - v4l2_data.fmt.fmt.pix.width, - v4l2_data.fmt.fmt.pix.height, - 1); + capturePictures[i]->data, + capturePictures[i]->linesize, + (uint8_t*)v4l2_data.buffers[i].start, + capturePixFormat, + v4l2_data.fmt.fmt.pix.width, + v4l2_data.fmt.fmt.pix.height, + 1); } // end foreach request buf Debug(3, "Configuring video source"); @@ -759,7 +757,7 @@ uint32_t LocalCamera::AutoSelectFormat(int p_colours) { /* Open the device */ if ( (enum_fd = open(device.c_str(), O_RDWR, 0)) < 0 ) { Error("Automatic format selection failed to open video device %s: %s", - device.c_str(), strerror(errno)); + device.c_str(), strerror(errno)); return selected_palette; } @@ -784,7 +782,7 @@ uint32_t LocalCamera::AutoSelectFormat(int p_colours) { static_cast((fmt_fcc[nIndex] >> 8) & 0xff), static_cast((fmt_fcc[nIndex]) & 0xff), nIndex); - + /* Proceed to the next index */ memset(&fmtinfo, 0, sizeof(fmtinfo)); fmtinfo.index = ++nIndex; @@ -850,10 +848,10 @@ uint32_t LocalCamera::AutoSelectFormat(int p_colours) { (test) ? (prefix yesString " " capability "\n") : (prefix noString " " capability "\n") bool LocalCamera::GetCurrentSettings( - const std::string& device, - char *output, - int version, - bool verbose) { + const std::string& device, + char *output, + int version, + bool verbose) { output[0] = 0; char *output_ptr = output; @@ -904,40 +902,40 @@ bool LocalCamera::GetCurrentSettings( if ( verbose ) { output_ptr += sprintf(output_ptr, "General Capabilities\n" - " Driver: %s\n" - " Card: %s\n" - " Bus: %s\n" - " Version: %u.%u.%u\n" - " Type: 0x%x\n%s%s%s%s%s%s%s%s%s%s%s%s%s%s", - vid_cap.driver, vid_cap.card, vid_cap.bus_info, - (vid_cap.version>>16)&0xff, (vid_cap.version>>8)&0xff, vid_cap.version&0xff, - vid_cap.capabilities, - capString(vid_cap.capabilities&V4L2_CAP_VIDEO_CAPTURE, " ", "Supports", "Does not support", "video capture (X)"), - capString(vid_cap.capabilities&V4L2_CAP_VIDEO_OUTPUT, " ", "Supports", "Does not support", "video output"), - capString(vid_cap.capabilities&V4L2_CAP_VIDEO_OVERLAY, " ", "Supports", "Does not support", "frame buffer overlay"), - capString(vid_cap.capabilities&V4L2_CAP_VBI_CAPTURE, " ", "Supports", "Does not support", "VBI capture"), - capString(vid_cap.capabilities&V4L2_CAP_VBI_OUTPUT, " ", "Supports", "Does not support", "VBI output"), - capString(vid_cap.capabilities&V4L2_CAP_SLICED_VBI_CAPTURE, " ", "Supports", "Does not support", "sliced VBI capture"), - capString(vid_cap.capabilities&V4L2_CAP_SLICED_VBI_OUTPUT, " ", "Supports", "Does not support", "sliced VBI output"), + " Driver: %s\n" + " Card: %s\n" + " Bus: %s\n" + " Version: %u.%u.%u\n" + " Type: 0x%x\n%s%s%s%s%s%s%s%s%s%s%s%s%s%s", + vid_cap.driver, vid_cap.card, vid_cap.bus_info, + (vid_cap.version>>16)&0xff, (vid_cap.version>>8)&0xff, vid_cap.version&0xff, + vid_cap.capabilities, + capString(vid_cap.capabilities&V4L2_CAP_VIDEO_CAPTURE, " ", "Supports", "Does not support", "video capture (X)"), + capString(vid_cap.capabilities&V4L2_CAP_VIDEO_OUTPUT, " ", "Supports", "Does not support", "video output"), + capString(vid_cap.capabilities&V4L2_CAP_VIDEO_OVERLAY, " ", "Supports", "Does not support", "frame buffer overlay"), + capString(vid_cap.capabilities&V4L2_CAP_VBI_CAPTURE, " ", "Supports", "Does not support", "VBI capture"), + capString(vid_cap.capabilities&V4L2_CAP_VBI_OUTPUT, " ", "Supports", "Does not support", "VBI output"), + capString(vid_cap.capabilities&V4L2_CAP_SLICED_VBI_CAPTURE, " ", "Supports", "Does not support", "sliced VBI capture"), + capString(vid_cap.capabilities&V4L2_CAP_SLICED_VBI_OUTPUT, " ", "Supports", "Does not support", "sliced VBI output"), #ifdef V4L2_CAP_VIDEO_OUTPUT_OVERLAY - capString(vid_cap.capabilities&V4L2_CAP_VIDEO_OUTPUT_OVERLAY, " ", "Supports", "Does not support", "video output overlay"), + capString(vid_cap.capabilities&V4L2_CAP_VIDEO_OUTPUT_OVERLAY, " ", "Supports", "Does not support", "video output overlay"), #else // V4L2_CAP_VIDEO_OUTPUT_OVERLAY - "", + "", #endif // V4L2_CAP_VIDEO_OUTPUT_OVERLAY - capString(vid_cap.capabilities&V4L2_CAP_TUNER, " ", "Has", "Does not have", "tuner"), - capString(vid_cap.capabilities&V4L2_CAP_AUDIO, " ", "Has", "Does not have", "audio in and/or out"), - capString(vid_cap.capabilities&V4L2_CAP_RADIO, " ", "Has", "Does not have", "radio"), - capString(vid_cap.capabilities&V4L2_CAP_READWRITE, " ", "Supports", "Does not support", "read/write i/o (X)"), - capString(vid_cap.capabilities&V4L2_CAP_ASYNCIO, " ", "Supports", "Does not support", "async i/o"), - capString(vid_cap.capabilities&V4L2_CAP_STREAMING, " ", "Supports", "Does not support", "streaming i/o (X)") - ); + capString(vid_cap.capabilities&V4L2_CAP_TUNER, " ", "Has", "Does not have", "tuner"), + capString(vid_cap.capabilities&V4L2_CAP_AUDIO, " ", "Has", "Does not have", "audio in and/or out"), + capString(vid_cap.capabilities&V4L2_CAP_RADIO, " ", "Has", "Does not have", "radio"), + capString(vid_cap.capabilities&V4L2_CAP_READWRITE, " ", "Supports", "Does not support", "read/write i/o (X)"), + capString(vid_cap.capabilities&V4L2_CAP_ASYNCIO, " ", "Supports", "Does not support", "async i/o"), + capString(vid_cap.capabilities&V4L2_CAP_STREAMING, " ", "Supports", "Does not support", "streaming i/o (X)") + ); } else { output_ptr += sprintf(output_ptr, "D:%s|C:%s|B:%s|V:%u.%u.%u|T:0x%x|" - , vid_cap.driver - , vid_cap.card - , vid_cap.bus_info - , (vid_cap.version>>16)&0xff, (vid_cap.version>>8)&0xff, vid_cap.version&0xff - , vid_cap.capabilities); + , vid_cap.driver + , vid_cap.card + , vid_cap.bus_info + , (vid_cap.version>>16)&0xff, (vid_cap.version>>8)&0xff, vid_cap.version&0xff + , vid_cap.capabilities); } output_ptr += sprintf(output_ptr, verbose ? " Standards:\n" : "S:"); @@ -992,26 +990,26 @@ bool LocalCamera::GetCurrentSettings( } if ( verbose ) output_ptr += sprintf( - output_ptr, - " %s (0x%02x%02x%02x%02x)\n", - format.description, - (format.pixelformat >> 24) & 0xff, - (format.pixelformat >> 16) & 0xff, - (format.pixelformat >> 8) & 0xff, - format.pixelformat & 0xff); + output_ptr, + " %s (0x%02x%02x%02x%02x)\n", + format.description, + (format.pixelformat >> 24) & 0xff, + (format.pixelformat >> 16) & 0xff, + (format.pixelformat >> 8) & 0xff, + format.pixelformat & 0xff); else output_ptr += sprintf( - output_ptr, - "0x%02x%02x%02x%02x/", - (format.pixelformat >> 24) & 0xff, - (format.pixelformat >> 16) & 0xff, - (format.pixelformat >> 8) & 0xff, - format.pixelformat & 0xff); + output_ptr, + "0x%02x%02x%02x%02x/", + (format.pixelformat >> 24) & 0xff, + (format.pixelformat >> 16) & 0xff, + (format.pixelformat >> 8) & 0xff, + format.pixelformat & 0xff); } while ( formatIndex++ >= 0 ); if ( !verbose ) *(output_ptr-1) = '|'; - else + else output_ptr += sprintf(output_ptr, "Crop Capabilities\n"); v4l2_cropcap cropcap = {}; @@ -1021,7 +1019,7 @@ bool LocalCamera::GetCurrentSettings( if ( errno != EINVAL ) { /* Failed querying crop capability, write error to the log and continue as if crop is not supported */ Error("Failed to query crop capabilities for %s: %d, %s", - device.c_str(), errno, strerror(errno)); + device.c_str(), errno, strerror(errno)); } if ( verbose ) { @@ -1033,7 +1031,7 @@ bool LocalCamera::GetCurrentSettings( } else { v4l2_crop crop = {}; - crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if ( vidioctl(vid_fd, VIDIOC_G_CROP, &crop) < 0 ) { if ( errno != EINVAL ) { @@ -1045,18 +1043,18 @@ bool LocalCamera::GetCurrentSettings( output_ptr += sprintf(output_ptr, " Cropping is not supported\n"); } else { /* Send fake crop bounds to not confuse things parsing this, such as monitor probe */ - output_ptr += sprintf(output_ptr, "B:%dx%d|",0,0); + output_ptr += sprintf(output_ptr, "B:%dx%d|",0,0); } } else { /* Cropping supported */ if ( verbose ) { output_ptr += sprintf(output_ptr, - " Bounds: %d x %d\n" - " Default: %d x %d\n" - " Current: %d x %d\n" - , cropcap.bounds.width, cropcap.bounds.height - , cropcap.defrect.width, cropcap.defrect.height - , crop.c.width, crop.c.height); + " Bounds: %d x %d\n" + " Default: %d x %d\n" + " Current: %d x %d\n" + , cropcap.bounds.width, cropcap.bounds.height + , cropcap.defrect.width, cropcap.defrect.height + , crop.c.width, crop.c.height); } else { output_ptr += sprintf(output_ptr, "B:%dx%d|", cropcap.bounds.width, cropcap.bounds.height); } @@ -1072,9 +1070,9 @@ bool LocalCamera::GetCurrentSettings( if ( vidioctl(vid_fd, VIDIOC_ENUMINPUT, &input) < 0 ) { if ( errno == EINVAL ) { break; - } + } Error("Failed to enumerate input for %s %d: %d %s", - device.c_str(), input.index, errno, strerror(errno)); + device.c_str(), input.index, errno, strerror(errno)); if ( verbose ) output_ptr += sprintf(output_ptr, "Error, failed to enumerate input %d: %s\n", input.index, strerror(errno)); else @@ -1114,35 +1112,35 @@ bool LocalCamera::GetCurrentSettings( if ( verbose ) { output_ptr += sprintf( output, - " Input %d\n" - " Name: %s\n" - " Type: %s\n" - " Audioset: %08x\n" - " Standards: 0x%" PRIx64"\n" - , input.index - , input.name - , input.type==V4L2_INPUT_TYPE_TUNER?"Tuner":(input.type==V4L2_INPUT_TYPE_CAMERA?"Camera":"Unknown") - , input.audioset - , static_cast(input.std)); + " Input %d\n" + " Name: %s\n" + " Type: %s\n" + " Audioset: %08x\n" + " Standards: 0x%" PRIx64"\n" + , input.index + , input.name + , input.type==V4L2_INPUT_TYPE_TUNER?"Tuner":(input.type==V4L2_INPUT_TYPE_CAMERA?"Camera":"Unknown") + , input.audioset + , static_cast(input.std)); } else { output_ptr += sprintf( output_ptr, "i%d:%s|i%dT:%s|i%dS:%" PRIx64 "|" - , input.index, input.name - , input.index, input.type==V4L2_INPUT_TYPE_TUNER?"Tuner":(input.type==V4L2_INPUT_TYPE_CAMERA?"Camera":"Unknown") - , input.index, static_cast(input.std)); + , input.index, input.name + , input.index, input.type==V4L2_INPUT_TYPE_TUNER?"Tuner":(input.type==V4L2_INPUT_TYPE_CAMERA?"Camera":"Unknown") + , input.index, static_cast(input.std)); } if ( verbose ) { output_ptr += sprintf( output_ptr, " %s %s %s %s" - , capString(input.status&V4L2_IN_ST_NO_POWER, "Power ", "off", "on", " (X)") - , capString(input.status&V4L2_IN_ST_NO_SIGNAL, "Signal ", "not detected", "detected", " (X)") - , capString(input.status&V4L2_IN_ST_NO_COLOR, "Colour Signal ", "not detected", "detected", "") - , capString(input.status&V4L2_IN_ST_NO_H_LOCK, "Horizontal Lock ", "not detected", "detected", "")); + , capString(input.status&V4L2_IN_ST_NO_POWER, "Power ", "off", "on", " (X)") + , capString(input.status&V4L2_IN_ST_NO_SIGNAL, "Signal ", "not detected", "detected", " (X)") + , capString(input.status&V4L2_IN_ST_NO_COLOR, "Colour Signal ", "not detected", "detected", "") + , capString(input.status&V4L2_IN_ST_NO_H_LOCK, "Horizontal Lock ", "not detected", "detected", "")); } else { output_ptr += sprintf( output_ptr, "i%dSP:%d|i%dSS:%d|i%dSC:%d|i%dHP:%d|" - , input.index, (input.status&V4L2_IN_ST_NO_POWER)?0:1 - , input.index, (input.status&V4L2_IN_ST_NO_SIGNAL)?0:1 - , input.index, (input.status&V4L2_IN_ST_NO_COLOR)?0:1 - , input.index, (input.status&V4L2_IN_ST_NO_H_LOCK)?0:1 ); + , input.index, (input.status&V4L2_IN_ST_NO_POWER)?0:1 + , input.index, (input.status&V4L2_IN_ST_NO_SIGNAL)?0:1 + , input.index, (input.status&V4L2_IN_ST_NO_COLOR)?0:1 + , input.index, (input.status&V4L2_IN_ST_NO_H_LOCK)?0:1 ); } } while ( inputIndex++ >= 0 ); if ( !verbose ) @@ -1253,7 +1251,7 @@ int LocalCamera::Capture(std::shared_ptr &zm_packet) { if (captures_per_frame <= 0) { captures_per_frame = 1; Warning("Invalid Captures Per Frame setting: %d", captures_per_frame); - } + } // Do the capture, unless we are the second or subsequent camera on a channel, in which case just reuse the buffer if (channel_prime) { @@ -1296,10 +1294,10 @@ int LocalCamera::Capture(std::shared_ptr &zm_packet) { if ((v4l2_data.fmt.fmt.pix.width * v4l2_data.fmt.fmt.pix.height) > (width * height)) { Fatal("Captured image dimensions larger than image buffer: V4L2: %dx%d monitor: %dx%d", - v4l2_data.fmt.fmt.pix.width, v4l2_data.fmt.fmt.pix.height, width, height); + v4l2_data.fmt.fmt.pix.width, v4l2_data.fmt.fmt.pix.height, width, height); } else if ((v4l2_data.fmt.fmt.pix.width * v4l2_data.fmt.fmt.pix.height) != (width * height)) { Error("Captured image dimensions differ: V4L2: %dx%d monitor: %dx%d", - v4l2_data.fmt.fmt.pix.width, v4l2_data.fmt.fmt.pix.height, width, height); + v4l2_data.fmt.fmt.pix.width, v4l2_data.fmt.fmt.pix.height, width, height); } if (channel_count > 1) { @@ -1324,7 +1322,7 @@ int LocalCamera::Capture(std::shared_ptr &zm_packet) { } else { Error("Unable to requeue buffer due to not v4l2_data"); } - } /* prime capture */ + } /* prime capture */ if (!zm_packet->image) { Debug(4, "Allocating image"); @@ -1344,18 +1342,18 @@ int LocalCamera::Capture(std::shared_ptr &zm_packet) { Debug(9, "Calling sws_scale to perform the conversion"); /* Use swscale to convert the image directly into the shared memory */ av_image_fill_arrays(tmpPicture->data, - tmpPicture->linesize, directbuffer, - imagePixFormat, width, height, 1); + tmpPicture->linesize, directbuffer, + imagePixFormat, width, height, 1); sws_scale( - imgConversionContext, - capturePictures[capture_frame]->data, - capturePictures[capture_frame]->linesize, - 0, - height, - tmpPicture->data, - tmpPicture->linesize - ); + imgConversionContext, + capturePictures[capture_frame]->data, + capturePictures[capture_frame]->linesize, + 0, + height, + tmpPicture->data, + tmpPicture->linesize + ); } else if (conversion_type == 2) { Debug(9, "Calling the conversion function"); /* Call the image conversion function and convert directly into the shared memory */ diff --git a/src/zm_local_camera.h b/src/zm_local_camera.h index 16ebe8b4b..7e48398d3 100644 --- a/src/zm_local_camera.h +++ b/src/zm_local_camera.h @@ -1,21 +1,21 @@ // // ZoneMinder Local Camera Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_LOCAL_CAMERA_H #define ZM_LOCAL_CAMERA_H @@ -32,22 +32,22 @@ // via a video interface. // class LocalCamera : public Camera { -protected: - struct V4L2MappedBuffer { - void *start; - size_t length; - }; + protected: + struct V4L2MappedBuffer { + void *start; + size_t length; + }; - struct V4L2Data { - v4l2_cropcap cropcap; - v4l2_crop crop; - v4l2_format fmt; - v4l2_requestbuffers reqbufs; - V4L2MappedBuffer *buffers; - v4l2_buffer *bufptr; - }; + struct V4L2Data { + v4l2_cropcap cropcap; + v4l2_crop crop; + v4l2_format fmt; + v4l2_requestbuffers reqbufs; + V4L2MappedBuffer *buffers; + v4l2_buffer *bufptr; + }; -protected: + protected: std::string device; int channel; int standard; @@ -56,10 +56,10 @@ protected: bool channel_prime; int channel_index; unsigned int extras; - + unsigned int conversion_type; /* 0 = no conversion needed, 1 = use libswscale, 2 = zm internal conversion, 3 = jpeg decoding */ convert_fptr_t conversion_fptr; /* Pointer to conversion function used */ - + uint32_t AutoSelectFormat(int p_colours); static int camera_count; @@ -81,7 +81,7 @@ protected: static LocalCamera *last_camera; -public: + public: LocalCamera( const Monitor *monitor, const std::string &device, diff --git a/src/zm_logger.cpp b/src/zm_logger.cpp index 7150f390f..afce22abf 100644 --- a/src/zm_logger.cpp +++ b/src/zm_logger.cpp @@ -1,21 +1,21 @@ /* * ZoneMinder Logger Implementation, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #include "zm_logger.h" @@ -223,14 +223,14 @@ void Logger::initialise(const std::string &id, const Options &options) { mInitialised = true; Debug(1, "LogOpts: level=%s effective=%s, screen=%s, database=%s, logfile=%s->%s, syslog=%s", - smCodes[mLevel].c_str(), - smCodes[mEffectiveLevel].c_str(), - smCodes[mTerminalLevel].c_str(), - smCodes[mDatabaseLevel].c_str(), - smCodes[mFileLevel].c_str(), - mLogFile.c_str(), - smCodes[mSyslogLevel].c_str() - ); + smCodes[mLevel].c_str(), + smCodes[mEffectiveLevel].c_str(), + smCodes[mTerminalLevel].c_str(), + smCodes[mDatabaseLevel].c_str(), + smCodes[mFileLevel].c_str(), + mLogFile.c_str(), + smCodes[mSyslogLevel].c_str() + ); } void Logger::terminate() { @@ -420,7 +420,7 @@ void Logger::logPrint(bool hex, const char *filepath, int line, int level, const if (level > mEffectiveLevel) return; if (level < PANIC || level > DEBUG9) Panic("Invalid logger level %d", level); - + log_mutex.lock(); // Can we save some cycles by having these as members and not allocate them on the fly? I think so. char timeString[64]; @@ -434,7 +434,7 @@ void Logger::logPrint(bool hex, const char *filepath, int line, int level, const SystemTimePoint now = std::chrono::system_clock::now(); time_t now_sec = std::chrono::system_clock::to_time_t(now); Microseconds now_frac = std::chrono::duration_cast( - now.time_since_epoch() - std::chrono::duration_cast(now.time_since_epoch())); + now.time_since_epoch() - std::chrono::duration_cast(now.time_since_epoch())); char *timePtr = timeString; tm now_tm = {}; @@ -449,29 +449,29 @@ void Logger::logPrint(bool hex, const char *filepath, int line, int level, const if ( tid < 0 ) // Thread/Process id #else - #ifdef HAVE_SYSCALL - #ifdef __FreeBSD_kernel__ - if ((syscall(SYS_thr_self, &tid)) < 0) // Thread/Process id +#ifdef HAVE_SYSCALL +#ifdef __FreeBSD_kernel__ + if ((syscall(SYS_thr_self, &tid)) < 0) // Thread/Process id - # else - // SOLARIS doesn't have SYS_gettid; don't assume - #ifdef SYS_gettid - if ((tid = syscall(SYS_gettid)) < 0) // Thread/Process id - #endif // SYS_gettid - #endif - #endif // HAVE_SYSCALL +# else + // SOLARIS doesn't have SYS_gettid; don't assume +#ifdef SYS_gettid + if ((tid = syscall(SYS_gettid)) < 0) // Thread/Process id +#endif // SYS_gettid +#endif +#endif // HAVE_SYSCALL #endif tid = getpid(); // Process id char *logPtr = logString; logPtr += snprintf(logPtr, sizeof(logString), "%s %s[%d].%s-%s/%d [", - timeString, - mId.c_str(), - tid, - classString, - file, - line - ); + timeString, + mId.c_str(), + tid, + classString, + file, + line + ); char *syslogStart = logPtr; va_start(argPtr, fstring); @@ -526,12 +526,12 @@ void Logger::logPrint(bool hex, const char *filepath, int line, int level, const std::string escapedString = zmDbEscapeString({syslogStart, syslogEnd}); std::string sql_string = stringtf( - "INSERT INTO `Logs` " - "( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` )" - " VALUES " - "( %ld.%06" PRIi64 ", '%s', %d, %d, %d, '%s', '%s', '%s', %d )", - now_sec, static_cast(now_frac.count()), mId.c_str(), staticConfig.SERVER_ID, tid, level, classString, - escapedString.c_str(), file, line); + "INSERT INTO `Logs` " + "( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` )" + " VALUES " + "( %ld.%06" PRIi64 ", '%s', %d, %d, %d, '%s', '%s', '%s', %d )", + now_sec, static_cast(now_frac.count()), mId.c_str(), staticConfig.SERVER_ID, tid, level, classString, + escapedString.c_str(), file, line); dbQueue.push(std::move(sql_string)); } else { puts("Db is closed"); diff --git a/src/zm_logger.h b/src/zm_logger.h index 702b7c74d..d7d8862d3 100644 --- a/src/zm_logger.h +++ b/src/zm_logger.h @@ -1,21 +1,21 @@ /* * ZoneMinder Logger Interface * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #ifndef ZM_LOGGER_H #define ZM_LOGGER_H @@ -68,13 +68,13 @@ class Logger { std::string mLogFile; Options( - Level terminalLevel = NOOPT, - Level databaseLevel = NOOPT, - Level fileLevel = NOOPT, - Level syslogLevel = NOOPT, - const std::string &logPath = ".", - const std::string &logFile = "" - ) : + Level terminalLevel = NOOPT, + Level databaseLevel = NOOPT, + Level fileLevel = NOOPT, + Level syslogLevel = NOOPT, + const std::string &logPath = ".", + const std::string &logFile = "" + ) : mTerminalLevel(terminalLevel), mDatabaseLevel(databaseLevel), mFileLevel(fileLevel), @@ -130,8 +130,8 @@ class Logger { bool boolEnv(const std::string &name, bool defaultValue = false); int intEnv(const std::string &name, bool defaultValue = 0); std::string strEnv( - const std::string &name, - const std::string &defaultValue = ""); + const std::string &name, + const std::string &defaultValue = ""); char *getTargettedEnv(const std::string &name); void loadEnv(); @@ -184,9 +184,9 @@ class Logger { }; void logInit( - const char *name, - const Logger::Options &options = Logger::Options() - ); + const char *name, + const Logger::Options &options = Logger::Options() +); void logTerm(); inline const std::string &logId() { return Logger::fetch()->id(); diff --git a/src/zm_mem_utils.h b/src/zm_mem_utils.h index 72fb2b9aa..f5f9864c0 100644 --- a/src/zm_mem_utils.h +++ b/src/zm_mem_utils.h @@ -1,21 +1,21 @@ // // ZoneMinder Memory Utilities, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_MEM_UTILS_H #define ZM_MEM_UTILS_H @@ -27,23 +27,23 @@ inline void* zm_mallocaligned(unsigned int reqalignment, size_t reqsize) { #if HAVE_POSIX_MEMALIGN if ( posix_memalign((void**)&retptr, reqalignment, reqsize) != 0 ) return nullptr; - + return retptr; #else uint8_t* alloc; retptr = (uint8_t*)malloc(reqsize+reqalignment+sizeof(void*)); - + if ( retptr == nullptr ) return nullptr; - + alloc = retptr + sizeof(void*); - + if ( ((long)alloc % reqalignment) != 0 ) alloc = alloc + (reqalignment - ((long)alloc % reqalignment)); - + /* Store a pointer before to the start of the block, just before returned aligned memory */ *(void**)(alloc - sizeof(void*)) = retptr; - + return alloc; #endif } diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 1c7944616..9896cedb2 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -71,48 +71,47 @@ #ifdef WITH_GSOAP // Workaround for the gsoap library on RHEL -struct Namespace namespaces[] = -{ - {NULL, NULL, NULL, NULL} // end of table +struct Namespace namespaces[] = { + {NULL, NULL, NULL, NULL} // end of table }; #endif // This is the official SQL (and ordering of the fields) to load a Monitor. // It will be used wherever a Monitor dbrow is needed. std::string load_monitor_sql = -"SELECT `Id`, `Name`, `Deleted`, `ServerId`, `StorageId`, `Type`, " -"`Capturing`+0, `Analysing`+0, `AnalysisSource`+0, `AnalysisImage`+0, " -"`Recording`+0, `RecordingSource`+0, `Decoding`+0, " -"`RTSP2WebEnabled`, `RTSP2WebType`, " -"`JanusEnabled`, `JanusAudioEnabled`, `Janus_Profile_Override`, " -"`Janus_Use_RTSP_Restream`, `Janus_RTSP_User`, `Janus_RTSP_Session_Timeout`, " -"`LinkedMonitors`, `EventStartCommand`, `EventEndCommand`, `AnalysisFPSLimit`," -"`AnalysisUpdateDelay`, `MaxFPS`, `AlarmMaxFPS`," -"`Device`, `Channel`, `Format`, `V4LMultiBuffer`, `V4LCapturesPerFrame`, " -"`Protocol`, `Method`, `Options`, `User`, `Pass`, `Host`, `Port`, `Path`, " -"`SecondPath`, `Width`, `Height`, `Colours`, `Palette`, `Orientation`+0, " -"`Deinterlacing`, " -"`Decoder`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, " -"`SaveJPEGs`, `VideoWriter`, `EncoderParameters`, " -"`OutputCodec`, `Encoder`, `OutputContainer`, " -"`RecordAudio`, " -"`Brightness`, `Contrast`, `Hue`, `Colour`, " -"`EventPrefix`, `LabelFormat`, `LabelX`, `LabelY`, `LabelSize`," -"`ImageBufferCount`, `MaxImageBufferCount`, `WarmupCount`, `PreEventCount`, " -"`PostEventCount`, `StreamReplayBuffer`, `AlarmFrameCount`, " -"`SectionLength`, `SectionLengthWarn`, `MinSectionLength`, `EventCloseMode`+0, " -"`FrameSkip`, `MotionFrameSkip`, " -"`FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`, " -"`Latitude`, `Longitude`, " -"`RTSPServer`, `RTSPStreamName`, `SOAP_wsa_compl`, `ONVIF_Alarm_Text`," -"`ONVIF_URL`, `ONVIF_EVENTS_PATH`, `ONVIF_Username`, `ONVIF_Password`, `ONVIF_Options`, " -"`ONVIF_Event_Listener`, `use_Amcrest_API`," -"`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1, ZoneCount " + "SELECT `Id`, `Name`, `Deleted`, `ServerId`, `StorageId`, `Type`, " + "`Capturing`+0, `Analysing`+0, `AnalysisSource`+0, `AnalysisImage`+0, " + "`Recording`+0, `RecordingSource`+0, `Decoding`+0, " + "`RTSP2WebEnabled`, `RTSP2WebType`, " + "`JanusEnabled`, `JanusAudioEnabled`, `Janus_Profile_Override`, " + "`Janus_Use_RTSP_Restream`, `Janus_RTSP_User`, `Janus_RTSP_Session_Timeout`, " + "`LinkedMonitors`, `EventStartCommand`, `EventEndCommand`, `AnalysisFPSLimit`," + "`AnalysisUpdateDelay`, `MaxFPS`, `AlarmMaxFPS`," + "`Device`, `Channel`, `Format`, `V4LMultiBuffer`, `V4LCapturesPerFrame`, " + "`Protocol`, `Method`, `Options`, `User`, `Pass`, `Host`, `Port`, `Path`, " + "`SecondPath`, `Width`, `Height`, `Colours`, `Palette`, `Orientation`+0, " + "`Deinterlacing`, " + "`Decoder`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, " + "`SaveJPEGs`, `VideoWriter`, `EncoderParameters`, " + "`OutputCodec`, `Encoder`, `OutputContainer`, " + "`RecordAudio`, " + "`Brightness`, `Contrast`, `Hue`, `Colour`, " + "`EventPrefix`, `LabelFormat`, `LabelX`, `LabelY`, `LabelSize`," + "`ImageBufferCount`, `MaxImageBufferCount`, `WarmupCount`, `PreEventCount`, " + "`PostEventCount`, `StreamReplayBuffer`, `AlarmFrameCount`, " + "`SectionLength`, `SectionLengthWarn`, `MinSectionLength`, `EventCloseMode`+0, " + "`FrameSkip`, `MotionFrameSkip`, " + "`FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`, " + "`Latitude`, `Longitude`, " + "`RTSPServer`, `RTSPStreamName`, `SOAP_wsa_compl`, `ONVIF_Alarm_Text`," + "`ONVIF_URL`, `ONVIF_EVENTS_PATH`, `ONVIF_Username`, `ONVIF_Password`, `ONVIF_Options`, " + "`ONVIF_Event_Listener`, `use_Amcrest_API`," + "`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1, ZoneCount " #if MOSQUITTOPP_FOUND -", `MQTT_Enabled`, `MQTT_Subscriptions`" + ", `MQTT_Enabled`, `MQTT_Subscriptions`" #endif -", `StartupDelay`" -" FROM `Monitors`"; + ", `StartupDelay`" + " FROM `Monitors`"; std::string CameraType_Strings[] = { "Unknown", @@ -258,7 +257,7 @@ Monitor::Monitor() : longitude(0.0), rtsp_server(false), rtsp_streamname(""), - soap_wsa_compl(false), + soap_wsa_compl(false), onvif_alarm_txt(""), importance(0), zone_count(0), @@ -329,8 +328,7 @@ Monitor::Monitor() : green_val(0), blue_val(0), grayscale_val(0), - colour_val(0) -{ + colour_val(0) { if (strcmp(config.event_close_mode, "time") == 0) { event_close_mode = CLOSE_TIME; } else if (strcmp(config.event_close_mode, "alarm") == 0) { @@ -373,12 +371,17 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { purpose = p; int col = 0; - id = atoi(dbrow[col]); col++; - name = dbrow[col]; col++; - deleted = dbrow[col] ? atoi(dbrow[col]) : false; col++; - server_id = dbrow[col] ? atoi(dbrow[col]) : 0; col++; + id = atoi(dbrow[col]); + col++; + name = dbrow[col]; + col++; + deleted = dbrow[col] ? atoi(dbrow[col]) : false; + col++; + server_id = dbrow[col] ? atoi(dbrow[col]) : 0; + col++; - storage_id = atoi(dbrow[col]); col++; + storage_id = atoi(dbrow[col]); + col++; delete storage; storage = new Storage(storage_id); @@ -401,46 +404,68 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { } Debug(1, "Have camera type %s", CameraType_Strings[type].c_str()); col++; - capturing = (CapturingOption)atoi(dbrow[col]); col++; - analysing = (AnalysingOption)atoi(dbrow[col]); col++; - analysis_source = (AnalysisSourceOption)atoi(dbrow[col]); col++; - analysis_image = (AnalysisImageOption)atoi(dbrow[col]); col++; - recording = (RecordingOption)atoi(dbrow[col]); col++; - recording_source = (RecordingSourceOption)atoi(dbrow[col]); col++; + capturing = (CapturingOption)atoi(dbrow[col]); + col++; + analysing = (AnalysingOption)atoi(dbrow[col]); + col++; + analysis_source = (AnalysisSourceOption)atoi(dbrow[col]); + col++; + analysis_image = (AnalysisImageOption)atoi(dbrow[col]); + col++; + recording = (RecordingOption)atoi(dbrow[col]); + col++; + recording_source = (RecordingSourceOption)atoi(dbrow[col]); + col++; - decoding = (DecodingOption)atoi(dbrow[col]); col++; + decoding = (DecodingOption)atoi(dbrow[col]); + col++; // See below after save_jpegs for a recalculation of decoding_enabled - RTSP2Web_enabled = dbrow[col] ? atoi(dbrow[col]) : false; col++; - RTSP2Web_type = (RTSP2WebOption)atoi(dbrow[col]); col++; - janus_enabled = dbrow[col] ? atoi(dbrow[col]) : false; col++; - janus_audio_enabled = dbrow[col] ? atoi(dbrow[col]) : false; col++; - janus_profile_override = std::string(dbrow[col] ? dbrow[col] : ""); col++; - janus_use_rtsp_restream = dbrow[col] ? atoi(dbrow[col]) : false; col++; - janus_rtsp_user = dbrow[col] ? atoi(dbrow[col]) : 0; col++; - janus_rtsp_session_timeout = dbrow[col] ? atoi(dbrow[col]) : 0; col++; + RTSP2Web_enabled = dbrow[col] ? atoi(dbrow[col]) : false; + col++; + RTSP2Web_type = (RTSP2WebOption)atoi(dbrow[col]); + col++; + janus_enabled = dbrow[col] ? atoi(dbrow[col]) : false; + col++; + janus_audio_enabled = dbrow[col] ? atoi(dbrow[col]) : false; + col++; + janus_profile_override = std::string(dbrow[col] ? dbrow[col] : ""); + col++; + janus_use_rtsp_restream = dbrow[col] ? atoi(dbrow[col]) : false; + col++; + janus_rtsp_user = dbrow[col] ? atoi(dbrow[col]) : 0; + col++; + janus_rtsp_session_timeout = dbrow[col] ? atoi(dbrow[col]) : 0; + col++; - linked_monitors_string = dbrow[col] ? dbrow[col] : ""; col++; - event_start_command = dbrow[col] ? dbrow[col] : ""; col++; - event_end_command = dbrow[col] ? dbrow[col] : ""; col++; + linked_monitors_string = dbrow[col] ? dbrow[col] : ""; + col++; + event_start_command = dbrow[col] ? dbrow[col] : ""; + col++; + event_end_command = dbrow[col] ? dbrow[col] : ""; + col++; /* "AnalysisFPSLimit, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS," */ - analysis_fps_limit = dbrow[col] ? strtod(dbrow[col], nullptr) : 0.0; col++; + analysis_fps_limit = dbrow[col] ? strtod(dbrow[col], nullptr) : 0.0; + col++; analysis_update_delay = Seconds(strtoul(dbrow[col++], nullptr, 0)); capture_delay = - (dbrow[col] && atof(dbrow[col]) > 0.0) ? - std::chrono::duration_cast(FPSeconds(1 / atof(dbrow[col]))) - : Microseconds(0); + (dbrow[col] && atof(dbrow[col]) > 0.0) ? + std::chrono::duration_cast(FPSeconds(1 / atof(dbrow[col]))) + : Microseconds(0); col++; alarm_capture_delay = - (dbrow[col] && atof(dbrow[col]) > 0.0) ? - std::chrono::duration_cast(FPSeconds(1 / atof(dbrow[col]))) - : Microseconds(0); + (dbrow[col] && atof(dbrow[col]) > 0.0) ? + std::chrono::duration_cast(FPSeconds(1 / atof(dbrow[col]))) + : Microseconds(0); col++; /* "Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, " */ - device = dbrow[col] ? dbrow[col] : ""; col++; - channel = atoi(dbrow[col]); col++; - format = atoi(dbrow[col]); col++; + device = dbrow[col] ? dbrow[col] : ""; + col++; + channel = atoi(dbrow[col]); + col++; + format = atoi(dbrow[col]); + col++; v4l_multi_buffer = config.v4l_multi_buffer; if ( dbrow[col] ) { if (*dbrow[col] == '0' ) { @@ -460,68 +485,109 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { col++; /* "Protocol, Method, Options, User, Pass, Host, Port, Path, SecondPath, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, " */ - protocol = dbrow[col] ? dbrow[col] : ""; col++; - method = dbrow[col] ? dbrow[col] : ""; col++; - options = dbrow[col] ? dbrow[col] : ""; col++; - user = dbrow[col] ? dbrow[col] : ""; col++; - pass = dbrow[col] ? dbrow[col] : ""; col++; - host = dbrow[col] ? dbrow[col] : ""; col++; - port = dbrow[col] ? dbrow[col] : ""; col++; - path = dbrow[col] ? dbrow[col] : ""; col++; - second_path = dbrow[col] ? dbrow[col] : ""; col++; - camera_width = atoi(dbrow[col]); col++; - camera_height = atoi(dbrow[col]); col++; - colours = atoi(dbrow[col]); col++; - palette = atoi(dbrow[col]); col++; - orientation = (Orientation)atoi(dbrow[col]); col++; + protocol = dbrow[col] ? dbrow[col] : ""; + col++; + method = dbrow[col] ? dbrow[col] : ""; + col++; + options = dbrow[col] ? dbrow[col] : ""; + col++; + user = dbrow[col] ? dbrow[col] : ""; + col++; + pass = dbrow[col] ? dbrow[col] : ""; + col++; + host = dbrow[col] ? dbrow[col] : ""; + col++; + port = dbrow[col] ? dbrow[col] : ""; + col++; + path = dbrow[col] ? dbrow[col] : ""; + col++; + second_path = dbrow[col] ? dbrow[col] : ""; + col++; + camera_width = atoi(dbrow[col]); + col++; + camera_height = atoi(dbrow[col]); + col++; + colours = atoi(dbrow[col]); + col++; + palette = atoi(dbrow[col]); + col++; + orientation = (Orientation)atoi(dbrow[col]); + col++; width = (orientation==ROTATE_90||orientation==ROTATE_270) ? camera_height : camera_width; height = (orientation==ROTATE_90||orientation==ROTATE_270) ? camera_width : camera_height; - deinterlacing = atoi(dbrow[col]); col++; + deinterlacing = atoi(dbrow[col]); + col++; deinterlacing_value = deinterlacing & 0xff; /*"`Decoder`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, " */ - decoder_name = dbrow[col] ? dbrow[col] : ""; col++; - decoder_hwaccel_name = dbrow[col] ? dbrow[col] : ""; col++; - decoder_hwaccel_device = dbrow[col] ? dbrow[col] : ""; col++; - rtsp_describe = (dbrow[col] && *dbrow[col] != '0'); col++; + decoder_name = dbrow[col] ? dbrow[col] : ""; + col++; + decoder_hwaccel_name = dbrow[col] ? dbrow[col] : ""; + col++; + decoder_hwaccel_device = dbrow[col] ? dbrow[col] : ""; + col++; + rtsp_describe = (dbrow[col] && *dbrow[col] != '0'); + col++; /* "`SaveJPEGs`, `VideoWriter`, `EncoderParameters`, " */ - savejpegs = atoi(dbrow[col]); col++; - videowriter = (VideoWriter)atoi(dbrow[col]); col++; - encoderparams = dbrow[col] ? dbrow[col] : ""; col++; + savejpegs = atoi(dbrow[col]); + col++; + videowriter = (VideoWriter)atoi(dbrow[col]); + col++; + encoderparams = dbrow[col] ? dbrow[col] : ""; + col++; Debug(3, "Decoding: %d savejpegs %d videowriter %d", decoding, savejpegs, videowriter); /*"`OutputCodec`, `Encoder`, `OutputContainer`, " */ - output_codec = dbrow[col] ? atoi(dbrow[col]) : 0; col++; - encoder = dbrow[col] ? dbrow[col] : ""; col++; - output_container = dbrow[col] ? dbrow[col] : ""; col++; - record_audio = (*dbrow[col] != '0'); col++; + output_codec = dbrow[col] ? atoi(dbrow[col]) : 0; + col++; + encoder = dbrow[col] ? dbrow[col] : ""; + col++; + output_container = dbrow[col] ? dbrow[col] : ""; + col++; + record_audio = (*dbrow[col] != '0'); + col++; /* "Brightness, Contrast, Hue, Colour, " */ - brightness = atoi(dbrow[col]); col++; - contrast = atoi(dbrow[col]); col++; - hue = atoi(dbrow[col]); col++; - colour = atoi(dbrow[col]); col++; + brightness = atoi(dbrow[col]); + col++; + contrast = atoi(dbrow[col]); + col++; + hue = atoi(dbrow[col]); + col++; + colour = atoi(dbrow[col]); + col++; /* "EventPrefix, LabelFormat, LabelX, LabelY, LabelSize," */ - event_prefix = dbrow[col] ? dbrow[col] : ""; col++; - label_format = dbrow[col] ? ReplaceAll(dbrow[col], "\\n", "\n") : ""; col++; - label_coord = Vector2(atoi(dbrow[col]), atoi(dbrow[col + 1])); col += 2; - label_size = atoi(dbrow[col]); col++; + event_prefix = dbrow[col] ? dbrow[col] : ""; + col++; + label_format = dbrow[col] ? ReplaceAll(dbrow[col], "\\n", "\n") : ""; + col++; + label_coord = Vector2(atoi(dbrow[col]), atoi(dbrow[col + 1])); + col += 2; + label_size = atoi(dbrow[col]); + col++; /* "ImageBufferCount, `MaxImageBufferCount`, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, " */ - image_buffer_count = atoi(dbrow[col]); col++; - max_image_buffer_count = atoi(dbrow[col]); col++; - warmup_count = atoi(dbrow[col]); col++; - pre_event_count = atoi(dbrow[col]); col++; + image_buffer_count = atoi(dbrow[col]); + col++; + max_image_buffer_count = atoi(dbrow[col]); + col++; + warmup_count = atoi(dbrow[col]); + col++; + pre_event_count = atoi(dbrow[col]); + col++; packetqueue.setPreEventVideoPackets(pre_event_count); packetqueue.setMaxVideoPackets(max_image_buffer_count); packetqueue.setKeepKeyframes(videowriter == PASSTHROUGH || recording != RECORDING_NONE); - post_event_count = atoi(dbrow[col]); col++; - stream_replay_buffer = atoi(dbrow[col]); col++; - alarm_frame_count = atoi(dbrow[col]); col++; + post_event_count = atoi(dbrow[col]); + col++; + stream_replay_buffer = atoi(dbrow[col]); + col++; + alarm_frame_count = atoi(dbrow[col]); + col++; if (alarm_frame_count < 1) { alarm_frame_count = 1; } else if (alarm_frame_count > MAX_PRE_ALARM_FRAMES) { @@ -529,82 +595,108 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { } /* "SectionLength, SectionLengthWarn, MinSectionLength, EventCloseMode, FrameSkip, MotionFrameSkip, " */ - section_length = Seconds(atoi(dbrow[col])); col++; - section_length_warn = dbrow[col] ? atoi(dbrow[col]) : false; col++; - min_section_length = Seconds(atoi(dbrow[col])); col++; + section_length = Seconds(atoi(dbrow[col])); + col++; + section_length_warn = dbrow[col] ? atoi(dbrow[col]) : false; + col++; + min_section_length = Seconds(atoi(dbrow[col])); + col++; if (section_length < min_section_length) { section_length = min_section_length; Warning("Section length %ld < Min Section Length %ld. This is invalid.", - Seconds(section_length).count(), - Seconds(min_section_length).count() - ); + Seconds(section_length).count(), + Seconds(min_section_length).count() + ); } - event_close_mode = static_cast(dbrow[col] ? atoi(dbrow[col]) : 0); col++; + event_close_mode = static_cast(dbrow[col] ? atoi(dbrow[col]) : 0); + col++; switch (event_close_mode) { - case CLOSE_SYSTEM: - if (strcmp(config.event_close_mode, "time") == 0) { - event_close_mode = CLOSE_TIME; - } else if (strcmp(config.event_close_mode, "alarm") == 0) { - event_close_mode = CLOSE_ALARM; - } else if (strcmp(config.event_close_mode, "idle") == 0) { - event_close_mode = CLOSE_IDLE; - } else { - Warning("Unknown value for event_close_mode %s", config.event_close_mode); - event_close_mode = CLOSE_IDLE; - } - break; - case CLOSE_TIME: - case CLOSE_ALARM: - case CLOSE_IDLE: - case CLOSE_DURATION: - break; - default: - Warning("Unknown value for event_close_mode %d, defaulting to idle", event_close_mode); + case CLOSE_SYSTEM: + if (strcmp(config.event_close_mode, "time") == 0) { + event_close_mode = CLOSE_TIME; + } else if (strcmp(config.event_close_mode, "alarm") == 0) { + event_close_mode = CLOSE_ALARM; + } else if (strcmp(config.event_close_mode, "idle") == 0) { event_close_mode = CLOSE_IDLE; + } else { + Warning("Unknown value for event_close_mode %s", config.event_close_mode); + event_close_mode = CLOSE_IDLE; + } + break; + case CLOSE_TIME: + case CLOSE_ALARM: + case CLOSE_IDLE: + case CLOSE_DURATION: + break; + default: + Warning("Unknown value for event_close_mode %d, defaulting to idle", event_close_mode); + event_close_mode = CLOSE_IDLE; } - frame_skip = atoi(dbrow[col]); col++; - motion_frame_skip = atoi(dbrow[col]); col++; + frame_skip = atoi(dbrow[col]); + col++; + motion_frame_skip = atoi(dbrow[col]); + col++; /* "FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, Exif," */ - fps_report_interval = atoi(dbrow[col]); col++; - ref_blend_perc = atoi(dbrow[col]); col++; - alarm_ref_blend_perc = atoi(dbrow[col]); col++; - track_motion = atoi(dbrow[col]); col++; - embed_exif = (*dbrow[col] != '0'); col++; + fps_report_interval = atoi(dbrow[col]); + col++; + ref_blend_perc = atoi(dbrow[col]); + col++; + alarm_ref_blend_perc = atoi(dbrow[col]); + col++; + track_motion = atoi(dbrow[col]); + col++; + embed_exif = (*dbrow[col] != '0'); + col++; /* These will only be used to init shmem */ - latitude = dbrow[col] ? atof(dbrow[col]) : 0.0; col++; - longitude = dbrow[col] ? atof(dbrow[col]) : 0.0; col++; + latitude = dbrow[col] ? atof(dbrow[col]) : 0.0; + col++; + longitude = dbrow[col] ? atof(dbrow[col]) : 0.0; + col++; /* "`RTSPServer`,`RTSPStreamName`, */ - rtsp_server = (*dbrow[col] != '0'); col++; - rtsp_streamname = dbrow[col]; col++; + rtsp_server = (*dbrow[col] != '0'); + col++; + rtsp_streamname = dbrow[col]; + col++; // get soap_wsa_compliance value - soap_wsa_compl = (*dbrow[col] != '0'); col++; + soap_wsa_compl = (*dbrow[col] != '0'); + col++; // get alarm text from table. - onvif_alarm_txt = std::string(dbrow[col] ? dbrow[col] : ""); col++; + onvif_alarm_txt = std::string(dbrow[col] ? dbrow[col] : ""); + col++; if (onvif_alarm_txt.empty()) onvif_alarm_txt = "MotionAlarm"; /* "`ONVIF_URL`, `ONVIF_Username`, `ONVIF_Password`, `ONVIF_Options`, `ONVIF_Event_Listener`, `use_Amcrest_API`, " */ - onvif_url = std::string(dbrow[col] ? dbrow[col] : ""); col++; + onvif_url = std::string(dbrow[col] ? dbrow[col] : ""); + col++; if (onvif_url.empty()) { Uri path_uri(path); if (!path_uri.Host.empty()) { onvif_url = "http://"+path_uri.Host+"/onvif/device_service"; } } - onvif_events_path = std::string(dbrow[col] ? dbrow[col] : ""); col++; + onvif_events_path = std::string(dbrow[col] ? dbrow[col] : ""); + col++; if (onvif_events_path.empty()) onvif_events_path = "/Events"; - onvif_username = std::string(dbrow[col] ? dbrow[col] : ""); col++; - onvif_password = std::string(dbrow[col] ? dbrow[col] : ""); col++; - onvif_options = std::string(dbrow[col] ? dbrow[col] : ""); col++; - onvif_event_listener = (*dbrow[col] != '0'); col++; - use_Amcrest_API = (*dbrow[col] != '0'); col++; + onvif_username = std::string(dbrow[col] ? dbrow[col] : ""); + col++; + onvif_password = std::string(dbrow[col] ? dbrow[col] : ""); + col++; + onvif_options = std::string(dbrow[col] ? dbrow[col] : ""); + col++; + onvif_event_listener = (*dbrow[col] != '0'); + col++; + use_Amcrest_API = (*dbrow[col] != '0'); + col++; /*"SignalCheckPoints, SignalCheckColour, Importance-1 FROM Monitors"; */ - signal_check_points = atoi(dbrow[col]); col++; - signal_check_colour = strtol(dbrow[col][0] == '#' ? dbrow[col]+1 : dbrow[col], 0, 16); col++; + signal_check_points = atoi(dbrow[col]); + col++; + signal_check_colour = strtol(dbrow[col][0] == '#' ? dbrow[col]+1 : dbrow[col], 0, 16); + col++; colour_val = rgb_convert(signal_check_colour, ZM_SUBPIX_ORDER_BGR); /* HTML colour code is actually BGR in memory, we want RGB */ colour_val = rgb_convert(colour_val, palette); @@ -613,17 +705,22 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { blue_val = BLUE_VAL_BGRA(signal_check_colour); grayscale_val = signal_check_colour & 0xff; /* Clear all bytes but lowest byte */ - importance = dbrow[col] ? atoi(dbrow[col]) : 0; col++; + importance = dbrow[col] ? atoi(dbrow[col]) : 0; + col++; if (importance < 0) importance = 0; // Should only be >= 0 - zone_count = dbrow[col] ? atoi(dbrow[col]) : 0; col++; + zone_count = dbrow[col] ? atoi(dbrow[col]) : 0; + col++; #if MOSQUITTOPP_FOUND - mqtt_enabled = (*dbrow[col] != '0'); col++; + mqtt_enabled = (*dbrow[col] != '0'); + col++; std::string mqtt_subscriptions_string = std::string(dbrow[col] ? dbrow[col] : ""); - mqtt_subscriptions = Split(mqtt_subscriptions_string, ','); col++; + mqtt_subscriptions = Split(mqtt_subscriptions_string, ','); + col++; Error("MQTT enabled ? %d, subs %s", mqtt_enabled, mqtt_subscriptions_string.c_str()); #endif - startup_delay = dbrow[col] ? atoi(dbrow[col]) : 0; col++; + startup_delay = dbrow[col] ? atoi(dbrow[col]) : 0; + col++; // How many frames we need to have before we start analysing ready_count = std::max(warmup_count, pre_event_count); @@ -632,7 +729,7 @@ void Monitor::Load(MYSQL_ROW dbrow, bool load_zones=true, Purpose p = QUERY) { last_alarm_count = 0; state = IDLE; last_signal = true; // Defaulting to having signal so that we don't get a signal change on the first frame. - // Instead initial failure to capture will cause a loss of signal change which I think makes more sense. + // Instead initial failure to capture will cause a loss of signal change which I think makes more sense. // Should maybe store this for later use std::string monitor_dir = stringtf("%s/%u", storage->Path(), id); @@ -664,82 +761,139 @@ void Monitor::LoadCamera() { return; switch (type) { - case LOCAL: { + case LOCAL: { #if ZM_HAS_V4L2 - int extras = (deinterlacing >> 24) & 0xff; + int extras = (deinterlacing >> 24) & 0xff; - camera = zm::make_unique(this, - device, - channel, - format, - v4l_multi_buffer, - v4l_captures_per_frame, - method, - camera_width, - camera_height, - colours, - palette, - brightness, - contrast, - hue, - colour, - purpose == CAPTURE, - record_audio, - extras - ); + camera = zm::make_unique(this, + device, + channel, + format, + v4l_multi_buffer, + v4l_captures_per_frame, + method, + camera_width, + camera_height, + colours, + palette, + brightness, + contrast, + hue, + colour, + purpose == CAPTURE, + record_audio, + extras + ); #else - Fatal("Not compiled with local v4l camera support"); + Fatal("Not compiled with local v4l camera support"); #endif - break; + break; + } + case REMOTE: { + if (protocol == "http") { + camera = zm::make_unique(this, + method, + host, + port, + path, + user, + pass, + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose == CAPTURE, + record_audio + ); + } else if (protocol == "rtsp") { + camera = zm::make_unique(this, + method, + host, // Host + port, // Port + path, // Path + user, + pass, + camera_width, + camera_height, + rtsp_describe, + colours, + brightness, + contrast, + hue, + colour, + purpose == CAPTURE, + record_audio + ); + } else { + Error("Unexpected remote camera protocol '%s'", protocol.c_str()); } - case REMOTE: { - if (protocol == "http") { - camera = zm::make_unique(this, - method, - host, - port, - path, - user, - pass, - camera_width, - camera_height, - colours, - brightness, - contrast, - hue, - colour, - purpose == CAPTURE, - record_audio - ); - } - else if (protocol == "rtsp") { - camera = zm::make_unique(this, - method, - host, // Host - port, // Port - path, // Path - user, - pass, - camera_width, - camera_height, - rtsp_describe, - colours, - brightness, - contrast, - hue, - colour, - purpose == CAPTURE, - record_audio - ); - } - else { - Error("Unexpected remote camera protocol '%s'", protocol.c_str()); - } - break; - } - case FILE: { - camera = zm::make_unique(this, + break; + } + case FILE: { + camera = zm::make_unique(this, + path.c_str(), + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose == CAPTURE, + record_audio + ); + break; + } + case FFMPEG: { + camera = zm::make_unique(this, + path, + second_path, + user, + pass, + method, + options, + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose == CAPTURE, + record_audio, + decoder_hwaccel_name, + decoder_hwaccel_device + ); + break; + } + case NVSOCKET: { + camera = zm::make_unique(this, + host.c_str(), + port.c_str(), + path.c_str(), + camera_width, + camera_height, + colours, + brightness, + contrast, + hue, + colour, + purpose == CAPTURE, + record_audio + ); + break; + } + case LIBVLC: { +#if HAVE_LIBVLC + camera = zm::make_unique(this, path.c_str(), + user, + pass, + method, + options, camera_width, camera_height, colours, @@ -749,97 +903,38 @@ void Monitor::LoadCamera() { colour, purpose == CAPTURE, record_audio - ); - break; - } - case FFMPEG: { - camera = zm::make_unique(this, - path, - second_path, - user, - pass, - method, - options, - camera_width, - camera_height, - colours, - brightness, - contrast, - hue, - colour, - purpose == CAPTURE, - record_audio, - decoder_hwaccel_name, - decoder_hwaccel_device - ); - break; - } - case NVSOCKET: { - camera = zm::make_unique(this, - host.c_str(), - port.c_str(), - path.c_str(), - camera_width, - camera_height, - colours, - brightness, - contrast, - hue, - colour, - purpose == CAPTURE, - record_audio - ); - break; - } - case LIBVLC: { -#if HAVE_LIBVLC - camera = zm::make_unique(this, - path.c_str(), - user, - pass, - method, - options, - camera_width, - camera_height, - colours, - brightness, - contrast, - hue, - colour, - purpose == CAPTURE, - record_audio - ); + ); #else // HAVE_LIBVLC - Error("You must have vlc libraries installed to use vlc cameras for monitor %d", id); + Error("You must have vlc libraries installed to use vlc cameras for monitor %d", id); #endif // HAVE_LIBVLC - break; - } - case VNC: { + break; + } + case VNC: { #if HAVE_LIBVNC - camera = zm::make_unique(this, - host.c_str(), - port.c_str(), - user.c_str(), - pass.c_str(), - width, - height, - colours, - brightness, - contrast, - hue, - colour, - purpose == CAPTURE, - record_audio - ); + camera = zm::make_unique(this, + host.c_str(), + port.c_str(), + user.c_str(), + pass.c_str(), + width, + height, + colours, + brightness, + contrast, + hue, + colour, + purpose == CAPTURE, + record_audio + ); #else // HAVE_LIBVNC - Fatal("You must have libvnc installed to use VNC cameras for monitor id %d", id); + Fatal("You must have libvnc installed to use VNC cameras for monitor id %d", id); #endif // HAVE_LIBVNC - break; - } - default: { - Fatal("Tried to load unsupported camera type %d for monitor %u", int(type), id); - break; - } + break; + } + default: { + Fatal("Tried to load unsupported camera type %d for monitor %u", int(type), id); + break; + } } } @@ -870,14 +965,14 @@ bool Monitor::connect() { if (!camera) LoadCamera(); uint64_t image_size = camera->ImageSize(); mem_size = sizeof(SharedData) - + sizeof(TriggerData) - + (zone_count * sizeof(int)) // Per zone scores - + sizeof(VideoStoreData) //Information to pass back to the capture process - + (image_buffer_count*sizeof(struct timeval)) - + (image_buffer_count*image_size) - + (image_buffer_count*image_size) // alarm_images - + (image_buffer_count*sizeof(AVPixelFormat)) // - + 64; /* Padding used to permit aligning the images buffer to 64 byte boundary */ + + sizeof(TriggerData) + + (zone_count * sizeof(int)) // Per zone scores + + sizeof(VideoStoreData) //Information to pass back to the capture process + + (image_buffer_count*sizeof(struct timeval)) + + (image_buffer_count*image_size) + + (image_buffer_count*image_size) // alarm_images + + (image_buffer_count*sizeof(AVPixelFormat)) // + + 64; /* Padding used to permit aligning the images buffer to 64 byte boundary */ Debug(1, "SharedData=%zu " @@ -989,9 +1084,9 @@ bool Monitor::connect() { /* Align images buffer to nearest 64 byte boundary */ unsigned char * aligned_shared_images = (unsigned char *)((unsigned long)shared_images + (64 - ((unsigned long)shared_images % 64))); Debug(3, "Aligning shared memory images to the next 64 byte boundary %p to %p moved %lu bytes", - shared_images, aligned_shared_images, - (unsigned long)(aligned_shared_images - shared_images) - ); + shared_images, aligned_shared_images, + (unsigned long)(aligned_shared_images - shared_images) + ); shared_images = (unsigned char *)aligned_shared_images; } @@ -1001,10 +1096,10 @@ bool Monitor::connect() { image_buffer[i]->HoldBuffer(true); /* Don't release the internal buffer or replace it with another */ } alarm_image.AssignDirect(width, height, camera->Colours(), camera->SubpixelOrder(), - &(shared_images[image_buffer_count*image_size]), - image_size, - ZM_BUFTYPE_DONTFREE - ); + &(shared_images[image_buffer_count*image_size]), + image_size, + ZM_BUFTYPE_DONTFREE + ); alarm_image.HoldBuffer(true); /* Don't release the internal buffer or replace it with another */ if (alarm_image.Buffer() + image_size > mem_ptr + mem_size) { Warning("We will exceed memsize by %td bytes!", (alarm_image.Buffer() + image_size) - (mem_ptr + mem_size)); @@ -1088,7 +1183,7 @@ bool Monitor::connect() { std::string Termination_time = "PT60S"; wsnt__Renew.TerminationTime = &Termination_time; soap = soap_new(); - soap->connect_timeout = 0; + soap->connect_timeout = 0; soap->recv_timeout = 0; soap->send_timeout = 0; //soap->bind_flags |= SO_REUSEADDR; @@ -1101,7 +1196,7 @@ bool Monitor::connect() { proxyEvent.soap_endpoint = full_url.c_str(); set_credentials(soap); const char *RequestMessageID = soap_wsa_compl ? soap_wsa_rand_uuid(soap) : "RequestMessageID"; - if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, proxyEvent.soap_endpoint , "CreatePullPointSubscriptionRequest") == SOAP_OK)) { + if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, proxyEvent.soap_endpoint, "CreatePullPointSubscriptionRequest") == SOAP_OK)) { Debug(1, "ONVIF Endpoint: %s", proxyEvent.soap_endpoint); if (proxyEvent.CreatePullPointSubscription(&request, response) != SOAP_OK) { const char *detail = soap_fault_detail(soap); @@ -1117,11 +1212,11 @@ bool Monitor::connect() { //Empty the stored messages set_credentials(soap); RequestMessageID = soap_wsa_compl ? soap_wsa_rand_uuid(soap):NULL; - if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address , "PullMessageRequest") == SOAP_OK)) { + if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "PullMessageRequest") == SOAP_OK)) { Debug(1, "ONVIF :soap_wsa_request OK "); if ((proxyEvent.PullMessages(response.SubscriptionReference.Address, NULL, &tev__PullMessages, tev__PullMessagesResponse) != SOAP_OK) && (soap->error != SOAP_EOF) - ) { //SOAP_EOF could indicate no messages to pull. + ) { //SOAP_EOF could indicate no messages to pull. Error("Couldn't do initial event pull! Error %i %s, %s", soap->error, soap_fault_string(soap), soap_fault_detail(soap)); Event_Poller_Healthy = false; } else { @@ -1129,12 +1224,12 @@ bool Monitor::connect() { Event_Poller_Healthy = true; } } else { - Error("ONVIF Couldn't set wsa headers RequestMessageID= %s ; TO= %s ; Request= PullMessageRequest .... ! Error %i %s, %s",RequestMessageID , response.SubscriptionReference.Address , soap->error, soap_fault_string(soap), soap_fault_detail(soap)); + Error("ONVIF Couldn't set wsa headers RequestMessageID= %s ; TO= %s ; Request= PullMessageRequest .... ! Error %i %s, %s",RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); Event_Poller_Healthy = false; } // we renew the current subscription ......... - if (soap_wsa_compl){ + if (soap_wsa_compl) { set_credentials(soap); RequestMessageID = soap_wsa_rand_uuid(soap); if (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "RenewRequest") == SOAP_OK) { @@ -1152,18 +1247,18 @@ bool Monitor::connect() { } } else { Error("ONVIF Couldn't set wsa headers RequestMessageID=%s; TO=%s; Request=RenewRequest Error %i %s, %s", - RequestMessageID, - response.SubscriptionReference.Address, - soap->error, - soap_fault_string(soap), - soap_fault_detail(soap)); + RequestMessageID, + response.SubscriptionReference.Address, + soap->error, + soap_fault_string(soap), + soap_fault_detail(soap)); Event_Poller_Healthy = false; }// end renew - } + } } } else { Error("ONVIF Couldn't set wsa headers RequestMessageID=%s; TO=%s; Request=CreatePullPointSubscriptionRequest Error %i %s, %s", - RequestMessageID, proxyEvent.soap_endpoint, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); + RequestMessageID, proxyEvent.soap_endpoint, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); } } else { Warning("You must specify the url to the ONVIF endpoint"); @@ -1650,9 +1745,9 @@ void Monitor::DumpZoneImage(const char *zone_string) { } extra_zone.Clip(Box( - {0, 0}, - {static_cast(zone_image->Width()), static_cast(zone_image->Height())} - )); + {0, 0}, + {static_cast(zone_image->Width()), static_cast(zone_image->Height())} + )); for (const Zone &zone : zones) { if (exclude_id && (!extra_colour || !extra_zone.GetVertices().empty()) && zone.Id() == exclude_id) { @@ -1719,10 +1814,10 @@ bool Monitor::CheckSignal(const Image *image) { break; // Avoid sampling the rows with timestamp in if ( - index < (label_coord.y_ * width) - || - index >= (label_coord.y_ + Image::LINE_HEIGHT) * width - ) { + index < (label_coord.y_ * width) + || + index >= (label_coord.y_ + Image::LINE_HEIGHT) * width + ) { break; } } @@ -1803,11 +1898,11 @@ void Monitor::CheckAction() { void Monitor::UpdateFPS() { if ( fps_report_interval and - ( - !(image_count%fps_report_interval) - or - ( (image_count < fps_report_interval) and !(image_count%10) ) - ) + ( + !(image_count%fps_report_interval) + or + ( (image_count < fps_report_interval) and !(image_count%10) ) + ) ) { SystemTimePoint now = std::chrono::system_clock::now(); FPSeconds elapsed = now - last_fps_time; @@ -1819,7 +1914,7 @@ void Monitor::UpdateFPS() { double new_capture_fps = (image_count - last_capture_image_count) / elapsed.count(); uint32 new_camera_bytes = camera->Bytes(); uint32 new_capture_bandwidth = - static_cast((new_camera_bytes - last_camera_bytes) / elapsed.count()); + static_cast((new_camera_bytes - last_camera_bytes) / elapsed.count()); double new_analysis_fps = (motion_frame_count - last_motion_frame_count) / elapsed.count(); Debug(4, "FPS: capture count %d - last capture count %d = %d now:%lf, last %lf, elapsed %lf = capture: %lf fps analysis: %lf fps", @@ -1833,11 +1928,11 @@ void Monitor::UpdateFPS() { new_analysis_fps); Info("%s: %d - Capturing at %.2lf fps, capturing bandwidth %ubytes/sec Analysing at %.2lf fps", - name.c_str(), image_count, new_capture_fps, new_capture_bandwidth, new_analysis_fps); + name.c_str(), image_count, new_capture_fps, new_capture_bandwidth, new_analysis_fps); #if MOSQUITTOPP_FOUND if (mqtt) mqtt->send(stringtf("Capturing at %.2lf fps, capturing bandwidth %ubytes/sec Analysing at %.2lf fps", - new_capture_fps, new_capture_bandwidth, new_analysis_fps)); + new_capture_fps, new_capture_bandwidth, new_analysis_fps)); #endif shared_data->capture_fps = new_capture_fps; @@ -1848,8 +1943,8 @@ void Monitor::UpdateFPS() { last_camera_bytes = new_camera_bytes; std::string sql = stringtf( - "UPDATE LOW_PRIORITY Monitor_Status SET Status='Connected', CaptureFPS = %.2lf, CaptureBandwidth=%u, AnalysisFPS = %.2lf, UpdatedOn=NOW() WHERE MonitorId=%u", - new_capture_fps, new_capture_bandwidth, new_analysis_fps, id); + "UPDATE LOW_PRIORITY Monitor_Status SET Status='Connected', CaptureFPS = %.2lf, CaptureBandwidth=%u, AnalysisFPS = %.2lf, UpdatedOn=NOW() WHERE MonitorId=%u", + new_capture_fps, new_capture_bandwidth, new_analysis_fps, id); dbQueue.push(std::move(sql)); } // now != last_fps_time } // end if report fps @@ -1874,7 +1969,7 @@ bool Monitor::Poll() { if (result != SOAP_OK) { const char *detail = soap_fault_detail(soap); Debug(1, "Result of getting ONVIF messages= %d soap_fault_string=%s detail=%s", - result, soap_fault_string(soap), detail ? detail : "null"); + result, soap_fault_string(soap), detail ? detail : "null"); if (result != SOAP_EOF) { //Ignore the timeout error Error("Failed to get ONVIF messages! %d %s", result, soap_fault_string(soap)); // Event_Poller_Healthy = false; @@ -1915,7 +2010,7 @@ bool Monitor::Poll() { } // end foreach msg // we renew the current subscription ......... - if (soap_wsa_compl){ + if (soap_wsa_compl) { set_credentials(soap); std::string Termination_time = "PT60S"; wsnt__Renew.TerminationTime = &Termination_time; @@ -1935,14 +2030,14 @@ bool Monitor::Poll() { } } else { Error("Couldn't set wsa headers RequestMessageID=%s; TO=%s; Request= RenewRequest .... ! Error %i %s, %s", - RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); + RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); Event_Poller_Healthy = false; } // end renew - } + } } // end if SOAP OK/NOT OK } else { Error("Couldn't set wsa headers RequestMessageID= %s ; TO= %s ; Request= PullMessageRequest .... ! Error %i %s, %s", - RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); + RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); } // end if soap == OK #endif } // end if Amcrest or not @@ -1993,9 +2088,10 @@ bool Monitor::Analyse() { last_signal = signal; Debug(3, "Motion detection is enabled?(%d) signal(%d) signal_change(%d) trigger state(%s) image index %d", - shared_data->analysing, signal, signal_change, TriggerState_Strings[trigger_data->trigger_state].c_str(), snap->image_index); + shared_data->analysing, signal, signal_change, TriggerState_Strings[trigger_data->trigger_state].c_str(), snap->image_index); - { // scope for event lock + { + // scope for event lock // Need to guard around event creation/deletion from Reload() std::lock_guard lck(event_mutex); int score = 0; @@ -2075,10 +2171,10 @@ bool Monitor::Analyse() { // TODO: Shouldn't we try to connect? if (linked_monitors[i]->isConnected()) { Debug(1, "Linked monitor %d %s is connected", - linked_monitors[i]->Id(), linked_monitors[i]->Name()); + linked_monitors[i]->Id(), linked_monitors[i]->Name()); if (linked_monitors[i]->hasAlarmed()) { Debug(1, "Linked monitor %d %s is alarmed score will be %d", - linked_monitors[i]->Id(), linked_monitors[i]->Name(), linked_monitors[i]->lastFrameScore()); + linked_monitors[i]->Id(), linked_monitors[i]->Name(), linked_monitors[i]->lastFrameScore()); if (!event) { if (first_link) { if (cause.length()) @@ -2091,7 +2187,7 @@ bool Monitor::Analyse() { score += linked_monitors[i]->lastFrameScore(); // 50; } else { Debug(1, "Linked monitor %d %s is not alarmed", - linked_monitors[i]->Id(), linked_monitors[i]->Name()); + linked_monitors[i]->Id(), linked_monitors[i]->Name()); } } else { Debug(1, "Linked monitor %d %d is not connected. Connecting.", i, linked_monitors[i]->Id()); @@ -2139,7 +2235,7 @@ bool Monitor::Analyse() { double capture_fps = get_capture_fps(); motion_frame_skip = capture_fps / analysis_fps_limit; Debug(1, "Recalculating motion_frame_skip (%d) = capture_fps(%f) / analysis_fps(%f)", - motion_frame_skip, capture_fps, analysis_fps_limit); + motion_frame_skip, capture_fps, analysis_fps_limit); } Event::StringSet zoneSet; @@ -2184,11 +2280,12 @@ bool Monitor::Analyse() { snap->analysis_image->Overlay(*(zone.AlarmImage())); } Debug(4, "Setting score for zone %d to %d", zone_index, zone.Score()); - zone_scores[zone_index] = zone.Score(); zone_index ++; + zone_scores[zone_index] = zone.Score(); + zone_index ++; } //alarm_image.Assign(*(snap->analysis_image)); Debug(3, "After motion detection, score:%d last_motion_score(%d), new motion score(%d)", - score, last_motion_score, motion_score); + score, last_motion_score, motion_score); motion_frame_count += 1; last_motion_score = motion_score; @@ -2208,11 +2305,11 @@ bool Monitor::Analyse() { ref_image.Blend(*(snap->y_image), ( state==ALARM ? alarm_ref_blend_perc : ref_blend_perc )); } else if (snap->image) { Debug(1, "Blending full colour image because analysis_image = %d, in_frame=%p and format %d != %d, %d", - analysis_image, snap->in_frame.get(), - (snap->in_frame ? snap->in_frame->format : -1), - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_YUVJ420P - ); + analysis_image, snap->in_frame.get(), + (snap->in_frame ? snap->in_frame->format : -1), + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUVJ420P + ); ref_image.Blend(*(snap->image), ( state==ALARM ? alarm_ref_blend_perc : ref_blend_perc )); Debug(1, "Done Blending"); } else { @@ -2227,7 +2324,7 @@ bool Monitor::Analyse() { } // end if active and doing motion detection } // end if videostream - + if (score > 255) score = 255; // Set this before any state changes so that it's value is picked up immediately by linked monitors shared_data->last_frame_score = score; @@ -2236,7 +2333,7 @@ bool Monitor::Analyse() { if ((state == IDLE) || (state == PREALARM)) { if ((!pre_event_count) || (Event::PreAlarmCount() >= alarm_frame_count-1)) { Info("%s: %03d - Gone into alarm state PreAlarmCount: %u > AlarmFrameCount:%u Cause:%s", - name.c_str(), snap->image_index, Event::PreAlarmCount(), alarm_frame_count, cause.c_str()); + name.c_str(), snap->image_index, Event::PreAlarmCount(), alarm_frame_count, cause.c_str()); shared_data->state = state = ALARM; } else if (state != PREALARM) { Info("%s: %03d - Gone into prealarm state", name.c_str(), analysis_image_count); @@ -2250,7 +2347,7 @@ bool Monitor::Analyse() { } else if (state == ALERT) { alert_to_alarm_frame_count--; Debug(1, "%s: %03d - Alarmed frame while in alert state. Consecutive alarmed frames left to return to alarm state: %03d", - name.c_str(), analysis_image_count, alert_to_alarm_frame_count); + name.c_str(), analysis_image_count, alert_to_alarm_frame_count); if (alert_to_alarm_frame_count == 0) { Info("%s: %03d - ExtAlm - Gone back into alarm state", name.c_str(), analysis_image_count); shared_data->state = state = ALARM; @@ -2280,16 +2377,16 @@ bool Monitor::Analyse() { shared_data->state = state = IDLE; } Debug(1, - "State %d %s because analysis_image_count(%d)-last_alarm_count(%d) = %d > post_event_count(%d) and timestamp.tv_sec(%" PRIi64 ") - recording.tv_src(%" PRIi64 ") >= min_section_length(%" PRIi64 ")", - state, - State_Strings[state].c_str(), - analysis_image_count, - last_alarm_count, - analysis_image_count - last_alarm_count, - post_event_count, - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(GetVideoWriterStartTime().time_since_epoch()).count()), - static_cast(Seconds(min_section_length).count())); + "State %d %s because analysis_image_count(%d)-last_alarm_count(%d) = %d > post_event_count(%d) and timestamp.tv_sec(%" PRIi64 ") - recording.tv_src(%" PRIi64 ") >= min_section_length(%" PRIi64 ")", + state, + State_Strings[state].c_str(), + analysis_image_count, + last_alarm_count, + analysis_image_count - last_alarm_count, + post_event_count, + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(GetVideoWriterStartTime().time_since_epoch()).count()), + static_cast(Seconds(min_section_length).count())); if (Event::PreAlarmCount()) Event::EmptyPreAlarmFrames(); @@ -2298,23 +2395,23 @@ bool Monitor::Analyse() { if (event) { Debug(1, "Event %" PRIu64 ", alarm frames %d Id(), event->AlarmFrames(), alarm_frame_count, - static_cast(std::chrono::duration_cast(event->Duration()).count()), - event_close_mode - ); + event->Id(), event->AlarmFrames(), alarm_frame_count, + static_cast(std::chrono::duration_cast(event->Duration()).count()), + event_close_mode + ); if (event->Duration() >= min_section_length) { // If doing record, check to see if we need to close the event or not. - + if ((event->Duration() >= section_length) and (event->Frames() < Seconds(min_section_length).count())) { /* This is a detection for the case where huge keyframe * intervals cause a huge time gap between the first * frame and second frame */ Warning("%s: event %" PRIu64 ", has exceeded desired section length. %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64, - name.c_str(), event->Id(), - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(event->Duration()).count()), - static_cast(Seconds(section_length).count())); + name.c_str(), event->Id(), + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(event->Duration()).count()), + static_cast(Seconds(section_length).count())); } if (shared_data->recording == RECORDING_ALWAYS) { @@ -2324,53 +2421,53 @@ bool Monitor::Analyse() { // If we should end the previous continuous event and start a new non-continuous event if (event->AlarmFrames() < alarm_frame_count) { Info("%s: %03d - Closing event %" PRIu64 ", continuous end, alarm begins. Event alarm frames %d < alarm_frame_count %d", - name.c_str(), snap->image_index, event->Id(), event->AlarmFrames(), alarm_frame_count); + name.c_str(), snap->image_index, event->Id(), event->AlarmFrames(), alarm_frame_count); closeEvent(); // If we should end the event and start a new event because the current event is longer than the request section length } else if (event->Duration() > section_length) { - Info("%s: %03d - Closing event %" PRIu64 ", section end forced still alarmed %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64 , - name.c_str(), - snap->image_index, - event->Id(), - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), - static_cast(Seconds(section_length).count())); + Info("%s: %03d - Closing event %" PRIu64 ", section end forced still alarmed %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64, + name.c_str(), + snap->image_index, + event->Id(), + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), + static_cast(Seconds(section_length).count())); closeEvent(); } else { Debug(1, "Not Closing event %" PRIu64 ". Event alarm frames %d < alarm_frame_count %d", - event->Id(), event->AlarmFrames(), alarm_frame_count); + event->Id(), event->AlarmFrames(), alarm_frame_count); } } else if (state == IDLE) { if (event->AlarmFrames() > alarm_frame_count and (analysis_image_count - last_alarm_count > post_event_count)) { Info("%s: %03d - Closing event %" PRIu64 ", alarm end", name.c_str(), analysis_image_count, event->Id()); closeEvent(); } else if (event->Duration() > section_length) { - Info("%s: %03d - Closing event %" PRIu64 ", section end forced %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64 , - name.c_str(), - snap->image_index, - event->Id(), - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), - static_cast(Seconds(section_length).count())); + Info("%s: %03d - Closing event %" PRIu64 ", section end forced %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64, + name.c_str(), + snap->image_index, + event->Id(), + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), + static_cast(Seconds(section_length).count())); closeEvent(); } } else { Debug(1, "Not closing event because state==%s and event AlarmFrames %d >= %d", - State_Strings[state].c_str(), event->AlarmFrames(), alarm_frame_count); + State_Strings[state].c_str(), event->AlarmFrames(), alarm_frame_count); } } else if (event_close_mode == CLOSE_TIME) { Debug(1, "CLOSE_MODE Time"); if (std::chrono::duration_cast(snap->timestamp.time_since_epoch()) % section_length == Seconds(0)) { - Info("%s: %03d - Closing event %" PRIu64 ", section end forced %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64 , - name.c_str(), - snap->image_index, - event->Id(), - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), - static_cast(Seconds(section_length).count())); + Info("%s: %03d - Closing event %" PRIu64 ", section end forced %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64, + name.c_str(), + snap->image_index, + event->Id(), + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), + static_cast(Seconds(section_length).count())); closeEvent(); } } else if (event_close_mode == CLOSE_IDLE) { @@ -2378,14 +2475,14 @@ bool Monitor::Analyse() { if (state == IDLE) { if (event->Duration() >= section_length) { //std::chrono::duration_cast(snap->timestamp.time_since_epoch()) % section_length == Seconds(0)) { - Info("%s: %03d - Closing event %" PRIu64 ", section end forced %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64 , - name.c_str(), - snap->image_index, - event->Id(), - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), - static_cast(Seconds(section_length).count())); + Info("%s: %03d - Closing event %" PRIu64 ", section end forced %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64, + name.c_str(), + snap->image_index, + event->Id(), + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), + static_cast(Seconds(section_length).count())); closeEvent(); } } // end if IDLE @@ -2394,18 +2491,18 @@ bool Monitor::Analyse() { } // end if event_close_mode } else if (shared_data->recording == RECORDING_ONMOTION) { if (event->Duration() > section_length or (IDLE==state and (analysis_image_count - last_alarm_count > post_event_count))) { - Info("%s: %03d - Closing event %" PRIu64 " %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64 , - name.c_str(), - snap->image_index, - event->Id(), - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), - static_cast(Seconds(section_length).count())); + Info("%s: %03d - Closing event %" PRIu64 " %" PRIi64 " - %" PRIi64 " = %" PRIi64 " >= %" PRIi64, + name.c_str(), + snap->image_index, + event->Id(), + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(event->StartTime().time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(snap->timestamp - event->StartTime()).count()), + static_cast(Seconds(section_length).count())); closeEvent(); } else { Debug(1, "Not Closing event %" PRIu64 ", continuous end, alarm begins. Event alarm frames %d < alarm_frame_count %d", - event->Id(), event->AlarmFrames(), alarm_frame_count); + event->Id(), event->AlarmFrames(), alarm_frame_count); } } else { Warning("Recording mode unknown %d", shared_data->recording); @@ -2415,16 +2512,16 @@ bool Monitor::Analyse() { if (!event) { if ( - (shared_data->recording == RECORDING_ALWAYS) - or - ((shared_data->recording == RECORDING_ONMOTION) and (state == ALARM)) - ) { - Info("%s: %03d - Opening event timestamp %" PRIi64 " %% %" PRIi64, - name.c_str(), - snap->image_index, - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch() % section_length).count()) - ); + (shared_data->recording == RECORDING_ALWAYS) + or + ((shared_data->recording == RECORDING_ONMOTION) and (state == ALARM)) + ) { + Info("%s: %03d - Opening event timestamp %" PRIi64 " %% %" PRIi64, + name.c_str(), + snap->image_index, + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(snap->timestamp.time_since_epoch() % section_length).count()) + ); if ((event = openEvent(snap, cause.empty() ? "Continuous" : cause, noteSetMap)) != nullptr) { Info("Opened new event %" PRIu64 " %s", event->Id(), cause.empty() ? "Continuous" : cause.c_str()); } @@ -2519,7 +2616,7 @@ void Monitor::ReloadZones() { void Monitor::ReloadLinkedMonitors() { Debug(1, "Reloading linked monitors for monitor %s, '%s'", - name.c_str(), linked_monitors_string.c_str()); + name.c_str(), linked_monitors_string.c_str()); delete linked_monitors; linked_monitors = nullptr; @@ -2555,17 +2652,17 @@ void Monitor::ReloadLinkedMonitors() { n_linked_monitors = count; } // end if has link_ids } else { - // Logical expression - booleval::evaluator evaluator { booleval::make_field( "field", &Monitor::MonitorLink::hasAlarmed ) }; - } + // Logical expression + booleval::evaluator evaluator { booleval::make_field( "field", &Monitor::MonitorLink::hasAlarmed ) }; + } #endif - linked_monitors = new MonitorLinkExpression(linked_monitors_string); - if (!linked_monitors->parse()) { - Warning("Failed parsing linked_monitors"); - delete linked_monitors; - linked_monitors = nullptr; - } - } // end if p_linked_monitors + linked_monitors = new MonitorLinkExpression(linked_monitors_string); + if (!linked_monitors->parse()) { + Warning("Failed parsing linked_monitors"); + delete linked_monitors; + linked_monitors = nullptr; + } +} // end if p_linked_monitors } // end void Monitor::ReloadLinkedMonitors() std::vector> Monitor::LoadMonitors(const std::string &where, Purpose purpose) { @@ -2684,7 +2781,7 @@ int Monitor::Capture() { shared_data->last_write_time = std::chrono::system_clock::to_time_t(packet->timestamp); } Debug(2, "Have packet stream_index:%d ?= videostream_id: %d q.vpktcount %d event? %d image_count %d", - packet->packet->stream_index, video_stream_id, packetqueue.packet_count(video_stream_id), ( event ? 1 : 0 ), image_count); + packet->packet->stream_index, video_stream_id, packetqueue.packet_count(video_stream_id), ( event ? 1 : 0 ), image_count); if (packet->codec_type == AVMEDIA_TYPE_VIDEO) { packet->packet->stream_index = video_stream_id; // Convert to packetQueue's index @@ -2694,9 +2791,9 @@ int Monitor::Capture() { // stick them in extradata. Need to send them along with keyframes AVStream *stream = camera->getVideoStream(); video_fifo->write( - static_cast(stream->codecpar->extradata), - stream->codecpar->extradata_size, - packet->pts); + static_cast(stream->codecpar->extradata), + stream->codecpar->extradata_size, + packet->pts); } video_fifo->writePacket(*packet); } @@ -2751,45 +2848,45 @@ bool Monitor::setupConvertContext(const AVFrame *input_frame, const Image *image AVPixelFormat inputPixFormat; bool changeColorspaceDetails = false; switch (input_frame->format) { - case AV_PIX_FMT_YUVJ420P: - inputPixFormat = AV_PIX_FMT_YUV420P; - changeColorspaceDetails = true; - break; - case AV_PIX_FMT_YUVJ422P: - inputPixFormat = AV_PIX_FMT_YUV422P; - changeColorspaceDetails = true; - break; - case AV_PIX_FMT_YUVJ444P: - inputPixFormat = AV_PIX_FMT_YUV444P; - changeColorspaceDetails = true; - break; - case AV_PIX_FMT_YUVJ440P: - inputPixFormat = AV_PIX_FMT_YUV440P; - changeColorspaceDetails = true; - break; - default: - inputPixFormat = (AVPixelFormat)input_frame->format; + case AV_PIX_FMT_YUVJ420P: + inputPixFormat = AV_PIX_FMT_YUV420P; + changeColorspaceDetails = true; + break; + case AV_PIX_FMT_YUVJ422P: + inputPixFormat = AV_PIX_FMT_YUV422P; + changeColorspaceDetails = true; + break; + case AV_PIX_FMT_YUVJ444P: + inputPixFormat = AV_PIX_FMT_YUV444P; + changeColorspaceDetails = true; + break; + case AV_PIX_FMT_YUVJ440P: + inputPixFormat = AV_PIX_FMT_YUV440P; + changeColorspaceDetails = true; + break; + default: + inputPixFormat = (AVPixelFormat)input_frame->format; } convert_context = sws_getContext( - input_frame->width, - input_frame->height, - inputPixFormat, - image->Width(), image->Height(), - imagePixFormat, SWS_BICUBIC, - nullptr, nullptr, nullptr); + input_frame->width, + input_frame->height, + inputPixFormat, + image->Width(), image->Height(), + imagePixFormat, SWS_BICUBIC, + nullptr, nullptr, nullptr); if (convert_context == nullptr) { Error("Unable to create conversion context from %s to %s", - av_get_pix_fmt_name(inputPixFormat), - av_get_pix_fmt_name(imagePixFormat) - ); + av_get_pix_fmt_name(inputPixFormat), + av_get_pix_fmt_name(imagePixFormat) + ); } else { Debug(1, "Setup conversion context for %dx%d %s to %dx%d %s", - input_frame->width, input_frame->height, - av_get_pix_fmt_name(inputPixFormat), - image->Width(), image->Height(), - av_get_pix_fmt_name(imagePixFormat) - ); + input_frame->width, input_frame->height, + av_get_pix_fmt_name(inputPixFormat), + image->Width(), image->Height(), + av_get_pix_fmt_name(imagePixFormat) + ); if (changeColorspaceDetails) { // change the range of input data by first reading the current color space and then setting it's range as yuvj. int dummy[4]; @@ -2799,7 +2896,7 @@ bool Monitor::setupConvertContext(const AVFrame *input_frame, const Image *image const int* coefs = sws_getCoefficients(SWS_CS_DEFAULT); srcRange = 1; // this marks that values are according to yuvj sws_setColorspaceDetails(convert_context, coefs, srcRange, coefs, dstRange, - brightness, contrast, saturation); + brightness, contrast, saturation); } } return (convert_context != nullptr); @@ -2860,25 +2957,25 @@ bool Monitor::Decode() { ((AVPixelFormat)packet->in_frame->format == AV_PIX_FMT_YUV420P) || ((AVPixelFormat)packet->in_frame->format == AV_PIX_FMT_YUVJ420P) - ) ) { - packet->y_image = new Image(packet->in_frame->width, packet->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, packet->in_frame->data[0], 0); - if (packet->in_frame->width != camera_width || packet->in_frame->height != camera_height) - packet->y_image->Scale(camera_width, camera_height); + ) ) { + packet->y_image = new Image(packet->in_frame->width, packet->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, packet->in_frame->data[0], 0); + if (packet->in_frame->width != camera_width || packet->in_frame->height != camera_height) + packet->y_image->Scale(camera_width, camera_height); if (orientation != ROTATE_0) { switch (orientation) { - case ROTATE_0 : - // No action required - break; - case ROTATE_90 : - case ROTATE_180 : - case ROTATE_270 : - packet->y_image->Rotate((orientation-1)*90); - break; - case FLIP_HORI : - case FLIP_VERT : - packet->y_image->Flip(orientation==FLIP_HORI); - break; + case ROTATE_0 : + // No action required + break; + case ROTATE_90 : + case ROTATE_180 : + case ROTATE_270 : + packet->y_image->Rotate((orientation-1)*90); + break; + case FLIP_HORI : + case FLIP_VERT : + packet->y_image->Flip(orientation==FLIP_HORI); + break; } } // end if have rotation } @@ -2929,18 +3026,18 @@ bool Monitor::Decode() { if (orientation != ROTATE_0) { Debug(3, "Doing rotation"); switch (orientation) { - case ROTATE_0 : - // No action required - break; - case ROTATE_90 : - case ROTATE_180 : - case ROTATE_270 : - capture_image->Rotate((orientation-1)*90); - break; - case FLIP_HORI : - case FLIP_VERT : - capture_image->Flip(orientation==FLIP_HORI); - break; + case ROTATE_0 : + // No action required + break; + case ROTATE_90 : + case ROTATE_180 : + case ROTATE_270 : + capture_image->Rotate((orientation-1)*90); + break; + case FLIP_HORI : + case FLIP_VERT : + capture_image->Flip(orientation==FLIP_HORI); + break; } } // end if have rotation @@ -2964,7 +3061,7 @@ bool Monitor::Decode() { shared_data->last_write_time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); if (std::chrono::system_clock::now() - packet->timestamp > Seconds(ZM_WATCH_MAX_DELAY)) { Warning("Decoding is not keeping up. We are %.2f seconds behind capture.", - FPSeconds(std::chrono::system_clock::now() - packet->timestamp).count()); + FPSeconds(std::chrono::system_clock::now() - packet->timestamp).count()); } } // end if have image packet->decoded = true; @@ -2994,21 +3091,21 @@ std::string Monitor::Substitute(const std::string &format, SystemTimePoint ts_ti bool found_macro = false; int rc = 0; switch ( *(s_ptr+1) ) { - case 'N' : - rc = snprintf(d_ptr, max_len, "%s", name.c_str()); - found_macro = true; - break; - case 'Q' : - rc = snprintf(d_ptr, max_len, "%s", trigger_data->trigger_showtext); - found_macro = true; - break; - case 'f' : - typedef std::chrono::duration Centiseconds; - Centiseconds centi_sec = std::chrono::duration_cast( - ts_time.time_since_epoch() - std::chrono::duration_cast(ts_time.time_since_epoch())); - rc = snprintf(d_ptr, max_len, "%02lld", static_cast(centi_sec.count())); - found_macro = true; - break; + case 'N' : + rc = snprintf(d_ptr, max_len, "%s", name.c_str()); + found_macro = true; + break; + case 'Q' : + rc = snprintf(d_ptr, max_len, "%s", trigger_data->trigger_showtext); + found_macro = true; + break; + case 'f' : + typedef std::chrono::duration Centiseconds; + Centiseconds centi_sec = std::chrono::duration_cast( + ts_time.time_since_epoch() - std::chrono::duration_cast(ts_time.time_since_epoch())); + rc = snprintf(d_ptr, max_len, "%02lld", static_cast(centi_sec.count())); + found_macro = true; + break; } if (rc < 0 || static_cast(rc) > max_len) { break; @@ -3035,15 +3132,15 @@ void Monitor::TimestampImage(Image *ts_image, SystemTimePoint ts_time) const { } // end void Monitor::TimestampImage Event * Monitor::openEvent( - const std::shared_ptr &snap, - const std::string &cause, - const Event::StringSetMap ¬eSetMap) { + const std::shared_ptr &snap, + const std::string &cause, + const Event::StringSetMap ¬eSetMap) { // FIXME this iterator is not protected from invalidation packetqueue_iterator *start_it = packetqueue.get_event_start_packet_it( - *analysis_it, - (cause == "Continuous" ? 0 : (pre_event_count > alarm_frame_count ? pre_event_count : alarm_frame_count)) - ); + *analysis_it, + (cause == "Continuous" ? 0 : (pre_event_count > alarm_frame_count ? pre_event_count : alarm_frame_count)) + ); // This gets a lock on the starting packet @@ -3076,10 +3173,10 @@ Event * Monitor::openEvent( if (!event_start_command.empty()) { if (fork() == 0) { execlp(event_start_command.c_str(), - event_start_command.c_str(), - std::to_string(event->Id()).c_str(), - std::to_string(event->MonitorId()).c_str(), - nullptr); + event_start_command.c_str(), + std::to_string(event->Id()).c_str(), + std::to_string(event->MonitorId()).c_str(), + nullptr); Logger *log = Logger::fetch(); log->databaseLevel(Logger::NOLOG); Error("Error execing %s: %s", event_start_command.c_str(), strerror(errno)); @@ -3121,24 +3218,24 @@ void Monitor::closeEvent() { if (mqtt) mqtt->send(stringtf("event end: %" PRId64, event->Id())); #endif Debug(1, "Starting thread to close event"); - close_event_thread = std::thread([](Event *e, const std::string &command){ - int64_t event_id = e->Id(); - int monitor_id = e->MonitorId(); - delete e; + close_event_thread = std::thread([](Event *e, const std::string &command) { + int64_t event_id = e->Id(); + int monitor_id = e->MonitorId(); + delete e; - if (!command.empty()) { - if (fork() == 0) { - execlp(command.c_str(), command.c_str(), - std::to_string(event_id).c_str(), - std::to_string(monitor_id).c_str(), - nullptr); - Logger *log = Logger::fetch(); - log->databaseLevel(Logger::NOLOG); - Error("Error execing %s: %s", command.c_str(), strerror(errno)); - exit(0); - } - } - }, event, event_end_command); + if (!command.empty()) { + if (fork() == 0) { + execlp(command.c_str(), command.c_str(), + std::to_string(event_id).c_str(), + std::to_string(monitor_id).c_str(), + nullptr); + Logger *log = Logger::fetch(); + log->databaseLevel(Logger::NOLOG); + Error("Error execing %s: %s", command.c_str(), strerror(errno)); + exit(0); + } + } + }, event, event_end_command); Debug(1, "Nulling event"); event = nullptr; if (shared_data) video_store_data->recording = {}; @@ -3178,7 +3275,7 @@ unsigned int Monitor::DetectMotion(const Image &comp_image, Event::StringSet &zo int old_zone_score = zone.Score(); bool old_zone_alarmed = zone.Alarmed(); Debug(3, "Checking preclusive zone %s - old score: %d, state: %s", - zone.Label(),old_zone_score, zone.Alarmed()?"alarmed":"quiet"); + zone.Label(),old_zone_score, zone.Alarmed()?"alarmed":"quiet"); if (zone.CheckAlarms(&delta_image)) { alarm = true; score += zone.Score(); @@ -3189,7 +3286,7 @@ unsigned int Monitor::DetectMotion(const Image &comp_image, Event::StringSet &zo // check if end of alarm if (old_zone_alarmed) { Debug(3, "Preclusive Zone %s alarm Ends. Previous score: %d", - zone.Label(), old_zone_score); + zone.Label(), old_zone_score); if (old_zone_score > 0) { zone.SetExtendAlarmCount(zone.GetExtendAlarmFrames()); } @@ -3273,7 +3370,7 @@ unsigned int Monitor::DetectMotion(const Image &comp_image, Event::StringSet &zo shared_data->alarm_y = alarm_centre.y_; Info("Got alarm centre at %d,%d, at count %d", - shared_data->alarm_x, shared_data->alarm_y, analysis_image_count); + shared_data->alarm_x, shared_data->alarm_y, analysis_image_count); } else { shared_data->alarm_x = shared_data->alarm_y = -1; } @@ -3297,20 +3394,19 @@ bool Monitor::DumpSettings(char *output, bool verbose) { sprintf( output+strlen(output), "Standard : %d\n", cam->Standard() ); } else #endif // ZM_HAS_V4L2 - if ( camera->IsRemote() ) { - RemoteCamera* cam = static_cast(camera.get()); - sprintf( output+strlen(output), "Protocol : %s\n", cam->Protocol().c_str() ); - sprintf( output+strlen(output), "Host : %s\n", cam->Host().c_str() ); - sprintf( output+strlen(output), "Port : %s\n", cam->Port().c_str() ); - sprintf( output+strlen(output), "Path : %s\n", cam->Path().c_str() ); - } else if ( camera->IsFile() ) { - FileCamera* cam = static_cast(camera.get()); - sprintf( output+strlen(output), "Path : %s\n", cam->Path().c_str() ); - } - else if ( camera->IsFfmpeg() ) { - FfmpegCamera* cam = static_cast(camera.get()); - sprintf( output+strlen(output), "Path : %s\n", cam->Path().c_str() ); - } + if ( camera->IsRemote() ) { + RemoteCamera* cam = static_cast(camera.get()); + sprintf( output+strlen(output), "Protocol : %s\n", cam->Protocol().c_str() ); + sprintf( output+strlen(output), "Host : %s\n", cam->Host().c_str() ); + sprintf( output+strlen(output), "Port : %s\n", cam->Port().c_str() ); + sprintf( output+strlen(output), "Path : %s\n", cam->Path().c_str() ); + } else if ( camera->IsFile() ) { + FileCamera* cam = static_cast(camera.get()); + sprintf( output+strlen(output), "Path : %s\n", cam->Path().c_str() ); + } else if ( camera->IsFfmpeg() ) { + FfmpegCamera* cam = static_cast(camera.get()); + sprintf( output+strlen(output), "Path : %s\n", cam->Path().c_str() ); + } sprintf( output+strlen(output), "Width : %u\n", camera->Width() ); sprintf( output+strlen(output), "Height : %u\n", camera->Height() ); #if ZM_HAS_V4L2 @@ -3346,13 +3442,13 @@ bool Monitor::DumpSettings(char *output, bool verbose) { zone.DumpSettings(output+strlen(output), verbose); } sprintf(output+strlen(output), "Capturing Enabled? %s\n", - (shared_data->capturing != CAPTURING_NONE) ? "enabled" : "disabled"); + (shared_data->capturing != CAPTURING_NONE) ? "enabled" : "disabled"); sprintf(output+strlen(output), "Motion Detection Enabled? %s\n", - (shared_data->analysing != ANALYSING_NONE) ? "enabled" : "disabled"); + (shared_data->analysing != ANALYSING_NONE) ? "enabled" : "disabled"); sprintf(output+strlen(output), "Recording Enabled? %s\n", - (shared_data->recording != RECORDING_NONE) ? "enabled" : "disabled"); + (shared_data->recording != RECORDING_NONE) ? "enabled" : "disabled"); sprintf(output+strlen(output), "Events Enabled (!TRIGGER_OFF)? %s\n", - (trigger_data->trigger_state == TRIGGER_OFF) ? "disabled" : "enabled"); + (trigger_data->trigger_state == TRIGGER_OFF) ? "disabled" : "enabled"); return true; } // bool Monitor::DumpSettings(char *output, bool verbose) @@ -3375,7 +3471,7 @@ int Monitor::PrimeCapture() { } Debug(2, "Video stream id is %d, audio is %d, minimum_packets to keep in buffer %d", - video_stream_id, audio_stream_id, pre_event_count); + video_stream_id, audio_stream_id, pre_event_count); if (rtsp_server) { if (video_stream_id >= 0) { @@ -3384,7 +3480,7 @@ int Monitor::PrimeCapture() { staticConfig.PATH_SOCKS.c_str(), id, avcodec_get_name(videoStream->codecpar->codec_id) - ); + ); video_fifo = new Fifo(shared_data->video_fifo_path, true); } if (record_audio and (audio_stream_id >= 0)) { @@ -3393,8 +3489,8 @@ int Monitor::PrimeCapture() { snprintf(shared_data->audio_fifo_path, sizeof(shared_data->audio_fifo_path) - 1, "%s/audio_fifo_%u.%s", staticConfig.PATH_SOCKS.c_str(), id, avcodec_get_name(audioStream->codecpar->codec_id) - ); - audio_fifo = new Fifo(shared_data->audio_fifo_path, true); + ); + audio_fifo = new Fifo(shared_data->audio_fifo_path, true); } else { Warning("No audioStream %p or codec?", audioStream); } @@ -3503,7 +3599,7 @@ int Monitor::Play() { } Debug(2, "Video stream id is %d, audio is %d, minimum_packets to keep in buffer %d", - video_stream_id, audio_stream_id, pre_event_count); + video_stream_id, audio_stream_id, pre_event_count); if (decoding != DECODING_NONE) { Debug(1, "Restarting decoder thread"); decoder->Start(); @@ -3527,14 +3623,13 @@ int Monitor::Close() { _wsnt__Unsubscribe wsnt__Unsubscribe; _wsnt__UnsubscribeResponse wsnt__UnsubscribeResponse; const char *RequestMessageID = soap_wsa_compl ? soap_wsa_rand_uuid(soap) : "RequestMessageID"; - if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "UnsubscribeRequest") == SOAP_OK)) - { + if ((!soap_wsa_compl) || (soap_wsa_request(soap, RequestMessageID, response.SubscriptionReference.Address, "UnsubscribeRequest") == SOAP_OK)) { proxyEvent.Unsubscribe(response.SubscriptionReference.Address, NULL, &wsnt__Unsubscribe, wsnt__UnsubscribeResponse); } else { Error("Couldn't set wsa headers RequestMessageID=%s; TO= %s; Request=UnsubscribeRequest .... ! Error %i %s, %s", - RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); + RequestMessageID, response.SubscriptionReference.Address, soap->error, soap_fault_string(soap), soap_fault_detail(soap)); } - + soap_destroy(soap); soap_end(soap); soap_free(soap); @@ -3581,13 +3676,13 @@ void Monitor::get_ref_image() { analysis_it = packetqueue.get_video_it(true); while ( - ( - !( snap_lock = packetqueue.get_packet(analysis_it)) - or - ( snap_lock->packet_->codec_type != AVMEDIA_TYPE_VIDEO ) - or - ! snap_lock->packet_->image - ) + ( + !( snap_lock = packetqueue.get_packet(analysis_it)) + or + ( snap_lock->packet_->codec_type != AVMEDIA_TYPE_VIDEO ) + or + ! snap_lock->packet_->image + ) and !zm_terminate) { Debug(1, "Waiting for capture daemon lastwriteindex(%d) lastwritetime(%" PRIi64 ")", @@ -3603,11 +3698,11 @@ void Monitor::get_ref_image() { std::shared_ptr snap = snap_lock->packet_; Debug(1, "get_ref_image: packet.stream %d ?= video_stream %d, packet image id %d packet image %p", - snap->packet->stream_index, video_stream_id, snap->image_index, snap->image ); + snap->packet->stream_index, video_stream_id, snap->image_index, snap->image ); // Might not have been decoded yet FIXME if (snap->image) { ref_image.Assign(width, height, camera->Colours(), - camera->SubpixelOrder(), snap->image->Buffer(), camera->ImageSize()); + camera->SubpixelOrder(), snap->image->Buffer(), camera->ImageSize()); Debug(2, "Have ref image about to unlock"); } else { Debug(2, "Have no ref image about to unlock"); @@ -3619,8 +3714,8 @@ std::vector Monitor::Groups() { // At the moment, only load groups once. if (!groups.size()) { std::string sql = stringtf( - "SELECT `Id`, `ParentId`, `Name` FROM `Groups` WHERE `Groups.Id` IN " - "(SELECT `GroupId` FROM `Groups_Monitors` WHERE `MonitorId`=%d)", id); + "SELECT `Id`, `ParentId`, `Name` FROM `Groups` WHERE `Groups.Id` IN " + "(SELECT `GroupId` FROM `Groups_Monitors` WHERE `MonitorId`=%d)", id); MYSQL_RES *result = zmDbFetch(sql); if (!result) { Error("Can't load groups: %s", mysql_error(&dbconn)); diff --git a/src/zm_monitor.h b/src/zm_monitor.h index d75162a6e..4fb98b727 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -63,7 +63,7 @@ class Monitor : public std::enable_shared_from_this { friend class MonitorStream; friend class MonitorLinkExpression; -public: + public: typedef enum { QUERY=0, CAPTURE, @@ -167,7 +167,7 @@ public: PASSTHROUGH, } VideoWriter; -protected: + protected: typedef std::set ZoneSet; typedef enum { GET_SETTINGS=0x1, SET_SETTINGS=0x2, RELOAD=0x4, SUSPEND=0x10, RESUME=0x20 } Action; @@ -205,7 +205,7 @@ protected: uint32_t audio_frequency; /* +68 */ uint32_t audio_channels; /* +72 */ uint32_t reserved3; /* +76 */ - /* + /* ** This keeps 32bit time_t and 64bit time_t identical and compatible as long as time is before 2038. ** Shared memory layout should be identical for both 32bit and 64bit and is multiples of 16. ** Because startup_time is 64bit it may be aligned to a 64bit boundary. So it's offset SHOULD be a multiple @@ -265,9 +265,9 @@ protected: timeval recording; // used as both bool and a pointer to the timestamp when recording should begin } VideoStoreData; -public: + public: class MonitorLink { - protected: + protected: std::shared_ptr monitor; unsigned int zone_id; const Zone *zone; @@ -296,39 +296,39 @@ public: uint64_t last_event_id; std::vector zones; - public: - MonitorLink(std::shared_ptr p_monitor, unsigned int p_zone_id); - ~MonitorLink(); + public: + MonitorLink(std::shared_ptr p_monitor, unsigned int p_zone_id); + ~MonitorLink(); - inline unsigned int Id() const { return monitor->Id(); } - inline const char *Name() const { return name.c_str(); } + inline unsigned int Id() const { return monitor->Id(); } + inline const char *Name() const { return name.c_str(); } - inline bool isConnected() const { return connected && shared_data->valid; } - inline time_t getLastConnectTime() const { return last_connect_time; } + inline bool isConnected() const { return connected && shared_data->valid; } + inline time_t getLastConnectTime() const { return last_connect_time; } - inline uint32_t lastFrameScore() { - return shared_data->last_frame_score; - } + inline uint32_t lastFrameScore() { + return shared_data->last_frame_score; + } - bool connect(); - bool disconnect(); + bool connect(); + bool disconnect(); - bool isAlarmed(); - bool inAlarm(); - bool hasAlarmed(); - int score(); + bool isAlarmed(); + bool inAlarm(); + bool hasAlarmed(); + int score(); }; -protected: + protected: class AmcrestAPI { - protected: + protected: Monitor *parent; std::string amcrest_response; CURLM *curl_multi = nullptr; CURL *Amcrest_handle = nullptr; static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp); - public: + public: explicit AmcrestAPI(Monitor *parent_); ~AmcrestAPI(); int API_Connect(); @@ -338,7 +338,7 @@ protected: }; class RTSP2WebManager { - protected: + protected: Monitor *parent; CURL *curl = nullptr; //helper class for CURL @@ -350,7 +350,7 @@ protected: std::string rtsp_password; std::string rtsp_path; - public: + public: explicit RTSP2WebManager(Monitor *parent_); ~RTSP2WebManager(); void load_from_monitor(); @@ -360,7 +360,7 @@ protected: }; class JanusManager { - protected: + protected: Monitor *parent; CURL *curl = nullptr; //helper class for CURL @@ -378,7 +378,7 @@ protected: std::string profile_override; std::uint32_t rtsp_session_timeout; - public: + public: explicit JanusManager(Monitor *parent_); ~JanusManager(); void load_from_monitor(); @@ -498,7 +498,7 @@ protected: int fps_report_interval; // How many images should be captured/processed between reporting the current FPS int ref_blend_perc; // Percentage of new image going into reference image. int alarm_ref_blend_perc; // Percentage of new image going into reference image during alarm. - bool track_motion; // Whether this monitor tries to track detected motion + bool track_motion; // Whether this monitor tries to track detected motion int signal_check_points; // Number of points in the image to check for signal Rgb signal_check_colour; // The colour that the camera will emit when no video signal detected bool embed_exif; // Whether to embed Exif data into each image frame or not @@ -506,10 +506,10 @@ protected: double longitude; bool rtsp_server; // Whether to include this monitor as an rtsp server stream std::string rtsp_streamname; // path in the rtsp url for this monitor - bool soap_wsa_compl; // Whether the camera supports soap_wsa or not. + bool soap_wsa_compl; // Whether the camera supports soap_wsa or not. std::string onvif_alarm_txt; // def onvif_alarm_txt int importance; // Importance of this monitor, affects Connection logging errors. - int startup_delay; // Seconds to sleep before connecting to camera + int startup_delay; // Seconds to sleep before connecting to camera unsigned int zone_count; int capture_max_fps; @@ -634,7 +634,7 @@ protected: Rgb colour_val; /* RGB32 color */ int usedsubpixorder; -public: + public: explicit Monitor(); ~Monitor(); @@ -674,7 +674,7 @@ public: return storage; } inline CameraType GetType() const { return type; } - + CapturingOption Capturing() const { return capturing; } AnalysingOption Analysing() const { return analysing; } RecordingOption Recording() const { return recording; } @@ -733,23 +733,23 @@ public: } void setLastViewed(SystemTimePoint new_time) { if (shared_data && shared_data->valid) - shared_data->last_viewed_time = + shared_data->last_viewed_time = static_cast(std::chrono::duration_cast(new_time.time_since_epoch()).count()); } bool hasViewers() { if (shared_data && shared_data->valid) { SystemTimePoint now = std::chrono::system_clock::now(); - Debug(3, "Last viewed %" PRId64 " seconds ago", - static_cast(std::chrono::duration_cast(now.time_since_epoch()).count()) - - - shared_data->last_viewed_time - ); + Debug(3, "Last viewed %" PRId64 " seconds ago", + static_cast(std::chrono::duration_cast(now.time_since_epoch()).count()) + - + shared_data->last_viewed_time + ); return ( - ( - static_cast(std::chrono::duration_cast(now.time_since_epoch()).count()) - - - shared_data->last_viewed_time - ) > 1 ? false : true); + ( + static_cast(std::chrono::duration_cast(now.time_since_epoch()).count()) + - + shared_data->last_viewed_time + ) > 1 ? false : true); } return false; } @@ -864,8 +864,8 @@ public: void CheckAction(); unsigned int DetectMotion( const Image &comp_image, Event::StringSet &zoneSet ); - // DetectBlack seems to be unused. Check it on zm_monitor.cpp for more info. - //unsigned int DetectBlack( const Image &comp_image, Event::StringSet &zoneSet ); + // DetectBlack seems to be unused. Check it on zm_monitor.cpp for more info. + //unsigned int DetectBlack( const Image &comp_image, Event::StringSet &zoneSet ); bool CheckSignal( const Image *image ); bool Analyse(); bool setupConvertContext(const AVFrame *input_frame, const Image *image); @@ -875,9 +875,9 @@ public: std::string Substitute(const std::string &format, SystemTimePoint ts_time) const; void TimestampImage(Image *ts_image, SystemTimePoint ts_time) const; Event *openEvent( - const std::shared_ptr &snap, - const std::string &cause, - const Event::StringSetMap ¬eSetMap); + const std::shared_ptr &snap, + const std::string &cause, + const Event::StringSetMap ¬eSetMap); void closeEvent(); void Reload(); diff --git a/src/zm_monitor_amcrest.cpp b/src/zm_monitor_amcrest.cpp index e86e4a776..5d2526503 100644 --- a/src/zm_monitor_amcrest.cpp +++ b/src/zm_monitor_amcrest.cpp @@ -21,8 +21,7 @@ Monitor::AmcrestAPI::AmcrestAPI(Monitor *parent_) : parent(parent_), - Amcrest_Alarmed(false) -{ + Amcrest_Alarmed(false) { curl_multi = curl_multi_init(); start_Amcrest(); } @@ -49,7 +48,7 @@ int Monitor::AmcrestAPI::start_Amcrest() { if (full_url.back() != '/') full_url += '/'; full_url += "eventManager.cgi?action=attach&codes=[VideoMotion]"; Amcrest_handle = curl_easy_init(); - if (!Amcrest_handle){ + if (!Amcrest_handle) { Warning("Handle is null!"); return -1; } @@ -82,7 +81,7 @@ int Monitor::AmcrestAPI::start_Amcrest() { } else { Warning("AMCREST Response: %s", amcrest_response.c_str()); Warning("AMCREST Seeing %i streams, and error of %i, url: %s", - running_handles, curl_error, full_url.c_str()); + running_handles, curl_error, full_url.c_str()); curl_easy_getinfo(Amcrest_handle, CURLINFO_OS_ERRNO, &response_code); Warning("AMCREST Response code: %lu", response_code); } @@ -98,7 +97,7 @@ void Monitor::AmcrestAPI::WaitForMessage() { start_Amcrest(); // http transfer ended, need to restart. } else { // wait for max 5 seconds for event. - curl_multi_wait(curl_multi, nullptr, 0, 5000, &transfers); + curl_multi_wait(curl_multi, nullptr, 0, 5000, &transfers); if (transfers > 0) { // have data to deal with // actually grabs the data, populates amcrest_response curl_multi_perform(curl_multi, &open_handles); @@ -128,10 +127,10 @@ void Monitor::AmcrestAPI::WaitForMessage() { } size_t Monitor::AmcrestAPI::WriteCallback( - void *contents, - size_t size, - size_t nmemb, - void *userp) { + void *contents, + size_t size, + size_t nmemb, + void *userp) { ((std::string*)userp)->append((char*)contents, size * nmemb); return size * nmemb; } diff --git a/src/zm_monitor_janus.cpp b/src/zm_monitor_janus.cpp index c6ec28c5e..1ab63042d 100644 --- a/src/zm_monitor_janus.cpp +++ b/src/zm_monitor_janus.cpp @@ -27,8 +27,7 @@ std::string escape_json_string(std::string input); Monitor::JanusManager::JanusManager(Monitor *parent_) : parent(parent_), - Janus_Healthy(false) -{ + Janus_Healthy(false) { load_from_monitor(); } @@ -66,22 +65,22 @@ void Monitor::JanusManager::load_from_monitor() { localtime_r(&now_t, &now_tm); if (parent->janus_rtsp_user) { std::string sql = "SELECT `Id`, `Username`, `Password`, `Enabled`," - " `Stream`+0, `Events`+0, `Control`+0, `Monitors`+0, `System`+0" - " FROM `Users` WHERE `Enabled`=1 AND `Id`=" + std::to_string(parent->janus_rtsp_user); + " `Stream`+0, `Events`+0, `Control`+0, `Monitors`+0, `System`+0" + " FROM `Users` WHERE `Enabled`=1 AND `Id`=" + std::to_string(parent->janus_rtsp_user); MYSQL_RES *result = zmDbFetch(sql); if (result) { MYSQL_ROW dbrow = mysql_fetch_row(result); std::string auth_key = stringtf("%s%s%s%s%d%d%d%d", - config.auth_hash_secret, - dbrow[1], // username - dbrow[2], // password - (config.auth_hash_ips ? "127.0.0.1" : ""), - now_tm.tm_hour, - now_tm.tm_mday, - now_tm.tm_mon, - now_tm.tm_year); + config.auth_hash_secret, + dbrow[1], // username + dbrow[2], // password + (config.auth_hash_ips ? "127.0.0.1" : ""), + now_tm.tm_hour, + now_tm.tm_mday, + now_tm.tm_mon, + now_tm.tm_year); Debug(1, "Creating auth_key '%s'", auth_key.c_str()); zm::crypto::MD5::Digest md5_digest = zm::crypto::MD5::GetDigestOf(auth_key); @@ -162,7 +161,7 @@ int Monitor::JanusManager::check_janus() { } //check for changed PIN - if (response.find(parent->janus_pin) == std::string::npos){ + if (response.find(parent->janus_pin) == std::string::npos) { Warning("JANUS PIN changed, remounting."); return remove_from_janus(); } @@ -195,14 +194,14 @@ int Monitor::JanusManager::add_to_janus() { postData += "\", \"pin\" : \""; postData += parent->janus_pin; if (profile_override[0] != '\0') { - postData += "\", \"videofmtp\" : \""; - postData += profile_override; + postData += "\", \"videofmtp\" : \""; + postData += profile_override; } if (!rtsp_username.empty()) { - postData += "\", \"rtsp_user\" : \""; - postData += rtsp_username; - postData += "\", \"rtsp_pwd\" : \""; - postData += rtsp_password; + postData += "\", \"rtsp_user\" : \""; + postData += rtsp_username; + postData += "\", \"rtsp_pwd\" : \""; + postData += rtsp_password; } postData += "\", \"id\" : "; @@ -210,10 +209,10 @@ int Monitor::JanusManager::add_to_janus() { if (parent->janus_audio_enabled) postData += ", \"audio\" : true"; // Add rtsp_session_timeout if not set to 0 if (rtsp_session_timeout != 0) { - // Add rtsp_session_timeout to postData, this works. Is there a better way? - std::string rtsp_timeout = std::to_string(rtsp_session_timeout); - postData += ", \"rtsp_session_timeout\" : "; - postData += rtsp_timeout; + // Add rtsp_session_timeout to postData, this works. Is there a better way? + std::string rtsp_timeout = std::to_string(rtsp_session_timeout); + postData += ", \"rtsp_session_timeout\" : "; + postData += rtsp_timeout; } postData += ", \"video\" : true}}"; Debug(1, "JANUS Sending %s to %s", postData.c_str(), endpoint.c_str()); @@ -285,8 +284,7 @@ int Monitor::JanusManager::remove_from_janus() { return 0; } -size_t Monitor::JanusManager::WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) -{ +size_t Monitor::JanusManager::WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) { ((std::string*)userp)->append((char*)contents, size * nmemb); return size * nmemb; } diff --git a/src/zm_monitor_monitorlink.cpp b/src/zm_monitor_monitorlink.cpp index 8fb485888..7af757077 100644 --- a/src/zm_monitor_monitorlink.cpp +++ b/src/zm_monitor_monitorlink.cpp @@ -38,8 +38,7 @@ Monitor::MonitorLink::MonitorLink(std::shared_ptrp_monitor, unsigned in shared_data(nullptr), trigger_data(nullptr), video_store_data(nullptr), - zone_scores(nullptr) -{ + zone_scores(nullptr) { name = monitor->Name(); if (zone_id) { zones = Zone::Load(monitor); diff --git a/src/zm_monitor_permission.h b/src/zm_monitor_permission.h index 61cab4a74..2da3f6c6d 100644 --- a/src/zm_monitor_permission.h +++ b/src/zm_monitor_permission.h @@ -1,21 +1,21 @@ /* * ZoneMinder Monitor_Permission Class Interface * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ @@ -42,7 +42,8 @@ class Monitor_Permission { Monitor_Permission(const Monitor_Permission &mp) { Copy(mp); } void Copy(const Monitor_Permission &mp); Monitor_Permission& operator=(const Monitor_Permission &mp) { - Copy(mp); return *this; + Copy(mp); + return *this; } int Id() const { return id; } diff --git a/src/zm_monitor_rtsp2web.cpp b/src/zm_monitor_rtsp2web.cpp index 11149c87b..9dca0ec59 100644 --- a/src/zm_monitor_rtsp2web.cpp +++ b/src/zm_monitor_rtsp2web.cpp @@ -30,8 +30,7 @@ std::string escape_json_string(std::string input); Monitor::RTSP2WebManager::RTSP2WebManager(Monitor *parent_) : parent(parent_), - RTSP2Web_Healthy(false) -{ + RTSP2Web_Healthy(false) { Use_RTSP_Restream = false; if ((config.rtsp2web_path != nullptr) && (config.rtsp2web_path[0] != '\0')) { RTSP2Web_endpoint = config.rtsp2web_path; diff --git a/src/zm_monitorlink_expression.cpp b/src/zm_monitorlink_expression.cpp index 54f5687f8..004338b90 100644 --- a/src/zm_monitorlink_expression.cpp +++ b/src/zm_monitorlink_expression.cpp @@ -11,15 +11,15 @@ bool MonitorLinkExpression::parse() { // First we tokenize while (first != std::end(expression_)) { auto const second = std::find_first_of( - first, std::cend(expression_), - std::cbegin(delimiters_), std::cend(delimiters_) - ); + first, std::cend(expression_), + std::cbegin(delimiters_), std::cend(delimiters_) + ); if (first != second) { std::string_view t = expression_.substr( - std::distance(std::begin(expression_), first), - std::distance(first, second) - ); + std::distance(std::begin(expression_), first), + std::distance(first, second) + ); Debug(1, "Have a token %s", std::string(t).c_str()); tokens.emplace_back(t); @@ -59,7 +59,7 @@ bool MonitorLinkExpression::evaluate() { if (!result.success) { Warning("%s", std::string(result.message).c_str()); return false; - } + } return result.score > 0; } @@ -74,10 +74,10 @@ const MonitorLinkExpression::Result MonitorLinkExpression::result() { MonitorLinkExpression::Result MonitorLinkExpression::visit(Node const & node) { Debug(1, "visit: Node: %p Token: %d value %s", - &node, - static_cast(node.token.type()), - std::string(node.token.value()).c_str() - ); + &node, + static_cast(node.token.type()), + std::string(node.token.value()).c_str() + ); if (node.token.type() == Token::TokenType::monitorlink) { Debug(1, "Have monitorlink, return true, value %d", node.token.score()); return { true, "", node.token.score() }; @@ -86,24 +86,23 @@ MonitorLinkExpression::Result MonitorLinkExpression::visit(Node const & node) { } switch (node.token.type()) { - case Token::TokenType::logical_and: - Debug(1, "and"); - return visit_logical_and(node); - case Token::TokenType::logical_or : - Debug(1, "or"); - return visit_logical_or(node); - case Token::TokenType::logical_comma : - Debug(1, "comma"); - return visit_logical_or(node); - default: - Debug(1, "unknown"); - return { false, "Unknown token type" }; + case Token::TokenType::logical_and: + Debug(1, "and"); + return visit_logical_and(node); + case Token::TokenType::logical_or : + Debug(1, "or"); + return visit_logical_or(node); + case Token::TokenType::logical_comma : + Debug(1, "comma"); + return visit_logical_or(node); + default: + Debug(1, "unknown"); + return { false, "Unknown token type" }; } } MonitorLinkExpression::Result -MonitorLinkExpression::visit_logical_and(MonitorLinkExpression::Node const & node) -{ +MonitorLinkExpression::visit_logical_and(MonitorLinkExpression::Node const & node) { auto const left { visit(*node.left) }; auto const right { visit(*node.right) }; @@ -114,13 +113,12 @@ MonitorLinkExpression::visit_logical_and(MonitorLinkExpression::Node const & nod Debug(1, "AND left score %d right score %d", left.score, right.score); return { left.success && right.success, message, - ((left.score and right.score) ? left.score + right.score : 0) - }; + ((left.score and right.score) ? left.score + right.score : 0) + }; } MonitorLinkExpression::Result -MonitorLinkExpression::visit_logical_or(MonitorLinkExpression::Node const & node) -{ +MonitorLinkExpression::visit_logical_or(MonitorLinkExpression::Node const & node) { auto const left { visit(*node.left) }; auto const right { visit(*node.right) }; @@ -132,12 +130,12 @@ MonitorLinkExpression::visit_logical_or(MonitorLinkExpression::Node const & node Debug(1, "Or left score %d right score %d", left.score, right.score); return { left.success || right.success, - message, - ((left.score or right.score) ? left.score + right.score : 0) + message, + ((left.score or right.score) ? left.score + right.score : 0) }; } -std::unique_ptr +std::unique_ptr MonitorLinkExpression::parse_expression( Tokens const & tokens, std::size_t & current ) { if (tokens.size() == 1) { Debug(1, "Special case monitorlink"); @@ -146,16 +144,16 @@ MonitorLinkExpression::parse_expression( Tokens const & tokens, std::size_t & cu } // First token could me a parenthesis or monitorlink. Otherwise invalid. - + auto left{ parse_and_operation(tokens, current) }; if ( - has_unused(tokens, current) - and - tokens[current].is_not(Token::TokenType::logical_or) - and - tokens[current].is_not(Token::TokenType::logical_comma) - ) { + has_unused(tokens, current) + and + tokens[current].is_not(Token::TokenType::logical_or) + and + tokens[current].is_not(Token::TokenType::logical_comma) + ) { Debug(1, "parse_expression: not or, Returning left %s", std::string(left->token.value()).c_str()); return left; } @@ -174,19 +172,19 @@ MonitorLinkExpression::parse_expression( Tokens const & tokens, std::size_t & cu */ while (has_unused(tokens, current) and - ( - tokens[current].is(Token::TokenType::logical_or) - or - tokens[current].is(Token::TokenType::logical_comma) - ) - ) { + ( + tokens[current].is(Token::TokenType::logical_or) + or + tokens[current].is(Token::TokenType::logical_comma) + ) + ) { Debug(1, "Have or adding it"); auto logical_or{ std::make_unique( Token::TokenType::logical_or ) }; current++; auto right{ parse_and_operation( tokens, current ) }; - if (right == nullptr) { + if (right == nullptr) { Debug(1, "null from right side"); return nullptr; } @@ -199,7 +197,7 @@ MonitorLinkExpression::parse_expression( Tokens const & tokens, std::size_t & cu return left; } -std::unique_ptr +std::unique_ptr MonitorLinkExpression::parse_and_operation( Tokens const & tokens, std::size_t & current ) { auto left{ parse_parentheses( tokens, current ) }; @@ -210,10 +208,10 @@ MonitorLinkExpression::parse_and_operation( Tokens const & tokens, std::size_t & } while ( - has_unused(tokens, current) - and - tokens[current].is(Token::TokenType::logical_and) - ) { + has_unused(tokens, current) + and + tokens[current].is(Token::TokenType::logical_and) + ) { ++current; auto logical_and{ std::make_unique< Node >(Token::TokenType::logical_and) }; @@ -234,7 +232,7 @@ MonitorLinkExpression::parse_and_operation( Tokens const & tokens, std::size_t & return left; } -std::unique_ptr +std::unique_ptr MonitorLinkExpression::parse_parentheses(Tokens const &tokens, std::size_t ¤t) { if (!has_unused(tokens, current)) { Debug(1, "No unused..."); diff --git a/src/zm_monitorlink_expression.h b/src/zm_monitorlink_expression.h index ed2d0376c..6d1c53ac3 100644 --- a/src/zm_monitorlink_expression.h +++ b/src/zm_monitorlink_expression.h @@ -28,78 +28,78 @@ class MonitorLinkExpression { - public: + public: + /** + * struct node + * + * Represents the tree node containing references to left and right child nodes + * as well as the token that the node represents in the actual expression tree. + */ + class Node { + public: + Token token{ Token::TokenType::unknown }; + + std::unique_ptr< Node > left { nullptr }; + std::unique_ptr< Node > right{ nullptr }; + + constexpr Node() noexcept = default; + + Node( Node && rhs ) noexcept = default; + Node( Node const & rhs ) noexcept = delete; + + constexpr Node(Token::TokenType const type) noexcept : token(type) {} + constexpr Node(Token const &token) noexcept : token(token) {} + + Node & operator=( Node && rhs ) noexcept = default; + Node & operator=( Node const & rhs ) noexcept = delete; + + ~Node() noexcept = default; + }; + + struct Result { /** - * struct node - * - * Represents the tree node containing references to left and right child nodes - * as well as the token that the node represents in the actual expression tree. + * True if evaluation process is successful. Otherwise, false. */ - class Node { - public: - Token token{ Token::TokenType::unknown }; + bool success{ false }; - std::unique_ptr< Node > left { nullptr }; - std::unique_ptr< Node > right{ nullptr }; + /** + * Message in case of the fault. + */ + std::string_view message{}; + int score {-1}; + }; - constexpr Node() noexcept = default; + public: + using Tokens = std::vector< Token >; + private: + std::unique_ptr tree_; + int score_; - Node( Node && rhs ) noexcept = default; - Node( Node const & rhs ) noexcept = delete; + static std::unique_ptr< Node > parse_and_operation ( Tokens const & tokens, std::size_t & current ); + static std::unique_ptr< Node > parse_or_operation ( Tokens const & tokens, std::size_t & current ); + static std::unique_ptr< Node > parse_parentheses ( Tokens const & tokens, std::size_t & current ); + static std::unique_ptr< Node > parse_terminal ( Tokens const & tokens, std::size_t & current ); + static std::unique_ptr parse_expression( Tokens const & tokens, std::size_t & current ); - constexpr Node(Token::TokenType const type) noexcept : token(type) {} - constexpr Node(Token const &token) noexcept : token(token) {} + static inline bool has_unused( Tokens const & tokens, std::size_t const current ) noexcept { + return current < std::size( tokens ); + } - Node & operator=( Node && rhs ) noexcept = default; - Node & operator=( Node const & rhs ) noexcept = delete; + static Result visit(Node const &node); + static Result visit_logical_and(Node const &node); + static Result visit_logical_or(Node const &node); - ~Node() noexcept = default; - }; - - struct Result { - /** - * True if evaluation process is successful. Otherwise, false. - */ - bool success{ false }; - - /** - * Message in case of the fault. - */ - std::string_view message{}; - int score {-1}; - }; - - public: - using Tokens = std::vector< Token >; - private: - std::unique_ptr tree_; - int score_; - - static std::unique_ptr< Node > parse_and_operation ( Tokens const & tokens, std::size_t & current ); - static std::unique_ptr< Node > parse_or_operation ( Tokens const & tokens, std::size_t & current ); - static std::unique_ptr< Node > parse_parentheses ( Tokens const & tokens, std::size_t & current ); - static std::unique_ptr< Node > parse_terminal ( Tokens const & tokens, std::size_t & current ); - static std::unique_ptr parse_expression( Tokens const & tokens, std::size_t & current ); - - static inline bool has_unused( Tokens const & tokens, std::size_t const current ) noexcept { - return current < std::size( tokens ); - } - - static Result visit(Node const &node); - static Result visit_logical_and(Node const &node); - static Result visit_logical_or(Node const &node); - - public: - MonitorLinkExpression(); - MonitorLinkExpression(const std::string &expression) : expression_(expression) { - }; - int score() { return score_; } - bool evaluate(); - const Result result(); - bool parse(); - private: - const std::string_view delimiters_ = "|&(),"; - std::string_view expression_; + public: + MonitorLinkExpression(); + MonitorLinkExpression(const std::string &expression) : expression_(expression) { + }; + int score() { return score_; } + bool evaluate(); + const Result result(); + bool parse(); + private: + const std::string_view delimiters_ = "|&(),"; + std::string_view expression_; }; #endif diff --git a/src/zm_monitorlink_token.h b/src/zm_monitorlink_token.h index 51f2962e2..f86cc9787 100644 --- a/src/zm_monitorlink_token.h +++ b/src/zm_monitorlink_token.h @@ -25,202 +25,198 @@ #include "zm_monitor.h" class Token { - public: - /** - * enum class token_type - * - * Represents a token type. Supported types are logical operators, relational operators, parentheses and monitorlink - */ - enum class [[ nodiscard ]] TokenType : std::uint8_t { - unknown, - monitorlink, - logical_and, - logical_or, - logical_comma, - lp, - rp + public: + /** + * enum class token_type + * + * Represents a token type. Supported types are logical operators, relational operators, parentheses and monitorlink + */ + enum class [[ nodiscard ]] TokenType : std::uint8_t { + unknown, + monitorlink, + logical_and, + logical_or, + logical_comma, + lp, + rp + }; + + /** + * @class token + * + * Represents all tokens ('and', 'or', 'eq', ...). + */ + private: + using token_type_pair = std::pair; + constexpr static std::array symbols { + token_type_pair{ "&", TokenType::logical_and }, + token_type_pair{ "|", TokenType::logical_or }, + token_type_pair{ ",", TokenType::logical_comma }, // or + token_type_pair{ "(", TokenType::lp }, + token_type_pair{ ")", TokenType::rp } + }; + + //constexpr TokenType to_token_type( std::string_view const value ) noexcept; + constexpr TokenType to_token_type( std::string_view const value ) noexcept { + auto find_matching { + [ value ]( auto const & collection ) noexcept { + return utils::find_if + ( + std::cbegin( collection ), + std::cend ( collection ), + [ value ]( auto && item ) { + return item.first == value; + } + ); + } }; - /** - * @class token - * - * Represents all tokens ('and', 'or', 'eq', ...). - */ - private: - using token_type_pair = std::pair; - constexpr static std::array symbols { - token_type_pair{ "&", TokenType::logical_and }, - token_type_pair{ "|", TokenType::logical_or }, - token_type_pair{ ",", TokenType::logical_comma }, // or - token_type_pair{ "(", TokenType::lp }, - token_type_pair{ ")", TokenType::rp } - }; + auto const symbol{ find_matching(symbols) }; + if (symbol != std::cend(symbols)) { + return symbol->second; + } - //constexpr TokenType to_token_type( std::string_view const value ) noexcept; - constexpr TokenType to_token_type( std::string_view const value ) noexcept { - auto find_matching { - [ value ]( auto const & collection ) noexcept { - return utils::find_if - ( - std::cbegin( collection ), - std::cend ( collection ), - [ value ]( auto && item ) - { - return item.first == value; - } - ); - } - }; + return TokenType::monitorlink; + } // end constexpr TokenType to_token_type( std::string_view const value ) - auto const symbol{ find_matching(symbols) }; - if (symbol != std::cend(symbols)) { - return symbol->second; - } + public: - return TokenType::monitorlink; - } // end constexpr TokenType to_token_type( std::string_view const value ) + Token(TokenType const type, std::string_view const value) + : type_(type) + , value_(value) + , monitor_link_(nullptr) { + if (type_ == TokenType::monitorlink) { + auto colon_position = value_.find(':'); + unsigned int monitor_id = 0; + unsigned int zone_id = 0; + std::string monitor_name; + std::string zone_name; - public: - - Token(TokenType const type, std::string_view const value) - : type_(type) - , value_(value) - , monitor_link_(nullptr) - { - if (type_ == TokenType::monitorlink) { - auto colon_position = value_.find(':'); - unsigned int monitor_id = 0; - unsigned int zone_id = 0; - std::string monitor_name; - std::string zone_name; - - if (colon_position != std::string::npos) { - // Has a zone specification - monitor_id = std::stoul(std::string(value_.substr(0, colon_position))); - zone_id = std::stoul(std::string(value_.substr(colon_position+1, std::string::npos))); - } else { - monitor_id = std::stoul(std::string(value_)); - } - Debug(1, "Have linked monitor %d zone %d", monitor_id, zone_id); - - std::shared_ptr monitor = Monitor::Load(monitor_id, false, Monitor::QUERY); - monitor_link_ = new Monitor::MonitorLink(monitor, zone_id); + if (colon_position != std::string::npos) { + // Has a zone specification + monitor_id = std::stoul(std::string(value_.substr(0, colon_position))); + zone_id = std::stoul(std::string(value_.substr(colon_position+1, std::string::npos))); } else { - Debug( 1, "Not a monitor link value is %s", std::string(value_).c_str()); + monitor_id = std::stoul(std::string(value_)); } + Debug(1, "Have linked monitor %d zone %d", monitor_id, zone_id); + + std::shared_ptr monitor = Monitor::Load(monitor_id, false, Monitor::QUERY); + monitor_link_ = new Monitor::MonitorLink(monitor, zone_id); + } else { + Debug( 1, "Not a monitor link value is %s", std::string(value_).c_str()); } + } - constexpr Token() noexcept : - type_(TokenType::unknown), - value_(""), - monitor_link_(nullptr) - { } - //Token( TokenType const type, std::string_view const value ); + constexpr Token() noexcept : + type_(TokenType::unknown), + value_(""), + monitor_link_(nullptr) + { } + //Token( TokenType const type, std::string_view const value ); - constexpr Token( Token && rhs ) noexcept = default; - constexpr Token( Token const & rhs ) noexcept = default; + constexpr Token( Token && rhs ) noexcept = default; + constexpr Token( Token const & rhs ) noexcept = default; - constexpr Token( TokenType const type ) noexcept - : type_ ( type ) - , value_("") - , monitor_link_(nullptr) - {} + constexpr Token( TokenType const type ) noexcept + : type_ ( type ) + , value_("") + , monitor_link_(nullptr) + {} - Token( std::string_view const value ) noexcept - : type_ (to_token_type(value)) - , value_(value) - , monitor_link_(nullptr) - { - if (type_ == TokenType::monitorlink) { - auto colon_position = value_.find(':'); - unsigned int monitor_id = 0; - unsigned int zone_id = 0; - std::string monitor_name; - std::string zone_name; + Token( std::string_view const value ) noexcept + : type_ (to_token_type(value)) + , value_(value) + , monitor_link_(nullptr) { + if (type_ == TokenType::monitorlink) { + auto colon_position = value_.find(':'); + unsigned int monitor_id = 0; + unsigned int zone_id = 0; + std::string monitor_name; + std::string zone_name; - if (colon_position != std::string::npos) { - // Has a zone specification - monitor_id = std::stoul(std::string(value_.substr(0, colon_position))); - zone_id = std::stoul(std::string(value_.substr(colon_position+1, std::string::npos))); - } else { - monitor_id = std::stoul(std::string(value_)); - } - Debug(1, "Have linked monitor %d zone %d", monitor_id, zone_id); - - std::shared_ptr monitor = Monitor::Load(monitor_id, false, Monitor::QUERY); - monitor_link_ = new Monitor::MonitorLink(monitor, zone_id); + if (colon_position != std::string::npos) { + // Has a zone specification + monitor_id = std::stoul(std::string(value_.substr(0, colon_position))); + zone_id = std::stoul(std::string(value_.substr(colon_position+1, std::string::npos))); } else { - Debug( 1, "Not a monitor link value is %s", std::string(value_).c_str()); - } + monitor_id = std::stoul(std::string(value_)); } + Debug(1, "Have linked monitor %d zone %d", monitor_id, zone_id); - Token & operator=( Token && rhs ) noexcept = default; - Token & operator=( Token const & rhs ) noexcept = default; + std::shared_ptr monitor = Monitor::Load(monitor_id, false, Monitor::QUERY); + monitor_link_ = new Monitor::MonitorLink(monitor, zone_id); + } else { + Debug( 1, "Not a monitor link value is %s", std::string(value_).c_str()); + } + } - [[ nodiscard ]] constexpr bool operator==( Token const & rhs ) const noexcept { - return type_ == rhs.type_ && value_ == rhs.value_; + Token & operator=( Token && rhs ) noexcept = default; + Token & operator=( Token const & rhs ) noexcept = default; + + [[ nodiscard ]] constexpr bool operator==( Token const & rhs ) const noexcept { + return type_ == rhs.type_ && value_ == rhs.value_; + } + + ~Token() noexcept = default; + constexpr void type( TokenType const type ) noexcept { + if ( type != type_ ) { + type_ = type; + value_ = "";//to_token_keyword( type ); } - ~Token() noexcept = default; - constexpr void type( TokenType const type ) noexcept { - if ( type != type_ ) { - type_ = type; - value_ = "";//to_token_keyword( type ); - } + } - } + constexpr TokenType type() const noexcept { return type_; } - constexpr TokenType type() const noexcept { return type_; } + constexpr void value( std::string_view const value ) noexcept { + type_ = to_token_type( value ); + value_ = value; - constexpr void value( std::string_view const value ) noexcept { - type_ = to_token_type( value ); - value_ = value; + } - } + [[ nodiscard ]] constexpr std::string_view value() const noexcept { + return value_; + } - [[ nodiscard ]] constexpr std::string_view value() const noexcept { - return value_; - } + [[ nodiscard ]] constexpr bool is( TokenType const type ) const noexcept { + return type_ == type; + } - [[ nodiscard ]] constexpr bool is( TokenType const type ) const noexcept { - return type_ == type; - } + [[ nodiscard ]] constexpr bool is_not( TokenType const type ) const noexcept { + return type_ != type; + } - [[ nodiscard ]] constexpr bool is_not( TokenType const type ) const noexcept { - return type_ != type; - } + [[ nodiscard ]] constexpr bool is_one_of( + TokenType const first, + TokenType const second + ) const noexcept { + return is(first) || is(second); + } - [[ nodiscard ]] constexpr bool is_one_of( - TokenType const first, - TokenType const second - ) const noexcept - { - return is(first) || is(second); - } + [[ nodiscard ]] constexpr bool hasAlarmed() const { + return (monitor_link_ && monitor_link_->connect() && monitor_link_->hasAlarmed()); + } - [[ nodiscard ]] constexpr bool hasAlarmed() const { - return (monitor_link_ && monitor_link_->connect() && monitor_link_->hasAlarmed()); - } - - [[ nodiscard ]] constexpr int score() const { - if ( monitor_link_ ) { - if (!monitor_link_->isConnected() ) { - Debug(1, "connecting"); - if (!monitor_link_->connect()) { - Debug(1, "failed"); - return 0; - } + [[ nodiscard ]] constexpr int score() const { + if ( monitor_link_ ) { + if (!monitor_link_->isConnected() ) { + Debug(1, "connecting"); + if (!monitor_link_->connect()) { + Debug(1, "failed"); + return 0; } - int s = monitor_link_->score(); - Debug(1, "Score from monitor %s is %d", monitor_link_->Name(), s); - return s; } - return 0; + int s = monitor_link_->score(); + Debug(1, "Score from monitor %s is %d", monitor_link_->Name(), s); + return s; } + return 0; + } - private: - TokenType type_; - std::string_view value_; - Monitor::MonitorLink *monitor_link_; + private: + TokenType type_; + std::string_view value_; + Monitor::MonitorLink *monitor_link_; }; #endif diff --git a/src/zm_monitorstream.cpp b/src/zm_monitorstream.cpp index af2437b93..b49df3243 100644 --- a/src/zm_monitorstream.cpp +++ b/src/zm_monitorstream.cpp @@ -84,153 +84,152 @@ void MonitorStream::processCommand(const CmdMsg *msg) { Debug(2, "Got message, type %d, msg %d", msg->msg_type, msg->msg_data[0]); // Check for incoming command switch ((MsgCommand)msg->msg_data[0]) { - case CMD_PAUSE : - Debug(1, "Got PAUSE command"); - paused = true; - delayed = true; - last_frame_sent = now; - break; - case CMD_PLAY : - Debug(1, "Got PLAY command"); - if (paused) { - paused = false; - delayed = true; - } - replay_rate = ZM_RATE_BASE; - break; - case CMD_VARPLAY : - Debug(1, "Got VARPLAY command"); - if (paused) { - paused = false; - delayed = true; - } - replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; - break; - case CMD_STOP : - Debug(1, "Got STOP command"); + case CMD_PAUSE : + Debug(1, "Got PAUSE command"); + paused = true; + delayed = true; + last_frame_sent = now; + break; + case CMD_PLAY : + Debug(1, "Got PLAY command"); + if (paused) { paused = false; - delayed = false; - break; - case CMD_FASTFWD : - Debug(1, "Got FAST FWD command"); - if (paused) { - paused = false; - delayed = true; - } - // Set play rate - switch (replay_rate) { - case 2 * ZM_RATE_BASE : - replay_rate = 5 * ZM_RATE_BASE; - break; - case 5 * ZM_RATE_BASE : - replay_rate = 10 * ZM_RATE_BASE; - break; - case 10 * ZM_RATE_BASE : - replay_rate = 25 * ZM_RATE_BASE; - break; - case 25 * ZM_RATE_BASE : - case 50 * ZM_RATE_BASE : - replay_rate = 50 * ZM_RATE_BASE; - break; - default : - replay_rate = 2 * ZM_RATE_BASE; - break; - } - break; - case CMD_MAXFPS : - { - double int_part = ((unsigned char) msg->msg_data[1] << 24) | ((unsigned char) msg->msg_data[2] << 16) - | ((unsigned char) msg->msg_data[3] << 8) | (unsigned char) msg->msg_data[4]; - double dec_part = ((unsigned char) msg->msg_data[5] << 24) | ((unsigned char) msg->msg_data[6] << 16) - | ((unsigned char) msg->msg_data[7] << 8) | (unsigned char) msg->msg_data[8]; - - maxfps = (int_part + dec_part / 1000000.0); - - Debug(1, "Got MAXFPS %f", maxfps); - break; - } - case CMD_SLOWFWD : - Debug(1, "Got SLOW FWD command"); - paused = true; delayed = true; - replay_rate = ZM_RATE_BASE; - step = 1; - break; - case CMD_SLOWREV : - Debug(1, "Got SLOW REV command"); - paused = true; + } + replay_rate = ZM_RATE_BASE; + break; + case CMD_VARPLAY : + Debug(1, "Got VARPLAY command"); + if (paused) { + paused = false; delayed = true; - replay_rate = ZM_RATE_BASE; - step = -1; + } + replay_rate = ntohs(((unsigned char)msg->msg_data[2]<<8)|(unsigned char)msg->msg_data[1])-32768; + break; + case CMD_STOP : + Debug(1, "Got STOP command"); + paused = false; + delayed = false; + break; + case CMD_FASTFWD : + Debug(1, "Got FAST FWD command"); + if (paused) { + paused = false; + delayed = true; + } + // Set play rate + switch (replay_rate) { + case 2 * ZM_RATE_BASE : + replay_rate = 5 * ZM_RATE_BASE; break; - case CMD_FASTREV : - Debug(1, "Got FAST REV command"); - if (paused) { - paused = false; - delayed = true; - } - // Set play rate - switch (replay_rate) { - case -2 * ZM_RATE_BASE : - replay_rate = -5 * ZM_RATE_BASE; - break; - case -5 * ZM_RATE_BASE : - replay_rate = -10 * ZM_RATE_BASE; - break; - case -10 * ZM_RATE_BASE : - replay_rate = -25 * ZM_RATE_BASE; - break; - case -25 * ZM_RATE_BASE : - case -50 * ZM_RATE_BASE : - replay_rate = -50 * ZM_RATE_BASE; - break; - default : - replay_rate = -2 * ZM_RATE_BASE; - break; - } + case 5 * ZM_RATE_BASE : + replay_rate = 10 * ZM_RATE_BASE; break; - case CMD_ZOOMIN : - x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; - y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; - zoom += 10; - Debug(1, "Got ZOOM IN command, to %d,%d zoom value %d%%", x, y, zoom); + case 10 * ZM_RATE_BASE : + replay_rate = 25 * ZM_RATE_BASE; break; - case CMD_ZOOMOUT : - zoom -= 10; - if (zoom < 100) zoom = 100; - Debug(1, "Got ZOOM OUT command resulting zoom %d%%", zoom); - break; - case CMD_ZOOMSTOP : - zoom = 100; - Debug(1, "Got ZOOM OUT FULL command resulting zoom %d%%", zoom); - break; - case CMD_PAN : - x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; - y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; - Debug(1, "Got PAN command, to %d,%d", x, y); - break; - case CMD_SCALE : - scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; - Debug(1, "Got SCALE command, to %d", scale); - break; - case CMD_QUIT : - Info("User initiated exit - CMD_QUIT"); - zm_terminate = true; - break; - case CMD_ANALYZE_ON : - frame_type = FRAME_ANALYSIS; - Debug(1, "ANALYSIS on"); - break; - case CMD_ANALYZE_OFF : - frame_type = FRAME_NORMAL; - Debug(1, "ANALYSIS off"); - break; - case CMD_QUERY : - Debug(1, "Got QUERY command, sending STATUS"); + case 25 * ZM_RATE_BASE : + case 50 * ZM_RATE_BASE : + replay_rate = 50 * ZM_RATE_BASE; break; default : - Error("Got unexpected command %d", msg->msg_data[0]); + replay_rate = 2 * ZM_RATE_BASE; break; + } + break; + case CMD_MAXFPS : { + double int_part = ((unsigned char) msg->msg_data[1] << 24) | ((unsigned char) msg->msg_data[2] << 16) + | ((unsigned char) msg->msg_data[3] << 8) | (unsigned char) msg->msg_data[4]; + double dec_part = ((unsigned char) msg->msg_data[5] << 24) | ((unsigned char) msg->msg_data[6] << 16) + | ((unsigned char) msg->msg_data[7] << 8) | (unsigned char) msg->msg_data[8]; + + maxfps = (int_part + dec_part / 1000000.0); + + Debug(1, "Got MAXFPS %f", maxfps); + break; + } + case CMD_SLOWFWD : + Debug(1, "Got SLOW FWD command"); + paused = true; + delayed = true; + replay_rate = ZM_RATE_BASE; + step = 1; + break; + case CMD_SLOWREV : + Debug(1, "Got SLOW REV command"); + paused = true; + delayed = true; + replay_rate = ZM_RATE_BASE; + step = -1; + break; + case CMD_FASTREV : + Debug(1, "Got FAST REV command"); + if (paused) { + paused = false; + delayed = true; + } + // Set play rate + switch (replay_rate) { + case -2 * ZM_RATE_BASE : + replay_rate = -5 * ZM_RATE_BASE; + break; + case -5 * ZM_RATE_BASE : + replay_rate = -10 * ZM_RATE_BASE; + break; + case -10 * ZM_RATE_BASE : + replay_rate = -25 * ZM_RATE_BASE; + break; + case -25 * ZM_RATE_BASE : + case -50 * ZM_RATE_BASE : + replay_rate = -50 * ZM_RATE_BASE; + break; + default : + replay_rate = -2 * ZM_RATE_BASE; + break; + } + break; + case CMD_ZOOMIN : + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + zoom += 10; + Debug(1, "Got ZOOM IN command, to %d,%d zoom value %d%%", x, y, zoom); + break; + case CMD_ZOOMOUT : + zoom -= 10; + if (zoom < 100) zoom = 100; + Debug(1, "Got ZOOM OUT command resulting zoom %d%%", zoom); + break; + case CMD_ZOOMSTOP : + zoom = 100; + Debug(1, "Got ZOOM OUT FULL command resulting zoom %d%%", zoom); + break; + case CMD_PAN : + x = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + y = ((unsigned char)msg->msg_data[3]<<8)|(unsigned char)msg->msg_data[4]; + Debug(1, "Got PAN command, to %d,%d", x, y); + break; + case CMD_SCALE : + scale = ((unsigned char)msg->msg_data[1]<<8)|(unsigned char)msg->msg_data[2]; + Debug(1, "Got SCALE command, to %d", scale); + break; + case CMD_QUIT : + Info("User initiated exit - CMD_QUIT"); + zm_terminate = true; + break; + case CMD_ANALYZE_ON : + frame_type = FRAME_ANALYSIS; + Debug(1, "ANALYSIS on"); + break; + case CMD_ANALYZE_OFF : + frame_type = FRAME_NORMAL; + Debug(1, "ANALYSIS off"); + break; + case CMD_QUERY : + Debug(1, "Got QUERY command, sending STATUS"); + break; + default : + Error("Got unexpected command %d", msg->msg_data[0]); + break; } // end switch command struct { @@ -262,7 +261,7 @@ void MonitorStream::processCommand(const CmdMsg *msg) { status_data.buffer_level = 0; } else { FPSeconds elapsed = now - last_fps_update; - if (elapsed.count()) { + if (elapsed.count()) { actual_fps = (actual_fps + (frame_count - last_frame_count) / elapsed.count())/2; last_frame_count = frame_count; last_fps_update = now; @@ -287,18 +286,18 @@ void MonitorStream::processCommand(const CmdMsg *msg) { status_data.zoom = zoom; status_data.scale = scale; Debug(2, "viewing fps: %.2f capture_fps: %.2f analysis_fps: %.2f Buffer Level:%d, Delayed:%d, Paused:%d, Rate:%d, delay:%.3f, Zoom:%d, Enabled:%d Forced:%d", - status_data.fps, - status_data.capture_fps, - status_data.analysis_fps, - status_data.buffer_level, - status_data.delayed, - status_data.paused, - status_data.rate, - status_data.delay, - status_data.zoom, - status_data.enabled, - status_data.forced - ); + status_data.fps, + status_data.capture_fps, + status_data.analysis_fps, + status_data.buffer_level, + status_data.delayed, + status_data.paused, + status_data.rate, + status_data.delay, + status_data.zoom, + status_data.enabled, + status_data.forced + ); DataMsg status_msg; status_msg.msg_type = MSG_DATA_WATCH; @@ -314,10 +313,10 @@ bool MonitorStream::sendFrame(const std::string &filepath, SystemTimePoint times bool send_raw = ((scale>=ZM_SCALE_BASE)&&(zoom==ZM_SCALE_BASE)); if ( - (type != STREAM_JPEG) - || - (!config.timestamp_on_capture) - ) + (type != STREAM_JPEG) + || + (!config.timestamp_on_capture) + ) send_raw = false; if (!send_raw) { @@ -339,11 +338,11 @@ bool MonitorStream::sendFrame(const std::string &filepath, SystemTimePoint times TimePoint send_start_time = std::chrono::steady_clock::now(); if ( - (0 > fprintf(stdout, "Content-Length: %d\r\nX-Timestamp: %.6f\r\n\r\n", - img_buffer_size, std::chrono::duration_cast(timestamp.time_since_epoch()).count())) - || - (fwrite(img_buffer, img_buffer_size, 1, stdout) != 1) - ) { + (0 > fprintf(stdout, "Content-Length: %d\r\nX-Timestamp: %.6f\r\n\r\n", + img_buffer_size, std::chrono::duration_cast(timestamp.time_since_epoch()).count())) + || + (fwrite(img_buffer, img_buffer_size, 1, stdout) != 1) + ) { if (!zm_terminate) Warning("Unable to send stream frame: %s", strerror(errno)); return false; @@ -357,8 +356,8 @@ bool MonitorStream::sendFrame(const std::string &filepath, SystemTimePoint times if (frame_send_time > Milliseconds(lround(Milliseconds::period::den / maxfps))) { Info("Frame send time %" PRIi64 " ms too slow, throttling maxfps to %.2f", - static_cast(std::chrono::duration_cast(frame_send_time).count()), - maxfps); + static_cast(std::chrono::duration_cast(frame_send_time).count()), + maxfps); } } @@ -400,36 +399,36 @@ bool MonitorStream::sendFrame(Image *image, SystemTimePoint timestamp) { unsigned char *img_buffer = temp_img_buffer; switch (type) { - case STREAM_JPEG : - send_image->EncodeJpeg(img_buffer, &img_buffer_size); - fputs("Content-Type: image/jpeg\r\n", stdout); - break; - case STREAM_RAW : - fputs("Content-Type: image/x-rgb\r\n", stdout); - img_buffer = send_image->Buffer(); - img_buffer_size = send_image->Size(); - break; - case STREAM_ZIP : + case STREAM_JPEG : + send_image->EncodeJpeg(img_buffer, &img_buffer_size); + fputs("Content-Type: image/jpeg\r\n", stdout); + break; + case STREAM_RAW : + fputs("Content-Type: image/x-rgb\r\n", stdout); + img_buffer = send_image->Buffer(); + img_buffer_size = send_image->Size(); + break; + case STREAM_ZIP : #if HAVE_ZLIB_H - fputs("Content-Type: image/x-rgbz\r\n", stdout); - unsigned long zip_buffer_size; - send_image->Zip(img_buffer, &zip_buffer_size); - img_buffer_size = zip_buffer_size; + fputs("Content-Type: image/x-rgbz\r\n", stdout); + unsigned long zip_buffer_size; + send_image->Zip(img_buffer, &zip_buffer_size); + img_buffer_size = zip_buffer_size; #else - Error("zlib is required for zipped images. Falling back to raw image"); - type = STREAM_RAW; + Error("zlib is required for zipped images. Falling back to raw image"); + type = STREAM_RAW; #endif // HAVE_ZLIB_H - break; - default : - Error("Unexpected frame type %d", type); - return false; + break; + default : + Error("Unexpected frame type %d", type); + return false; } if ( - (0 > fprintf(stdout, "Content-Length: %d\r\nX-Timestamp: %.6f\r\n\r\n", - img_buffer_size, std::chrono::duration_cast(timestamp.time_since_epoch()).count())) - || - (fwrite(img_buffer, img_buffer_size, 1, stdout) != 1) - ) { + (0 > fprintf(stdout, "Content-Length: %d\r\nX-Timestamp: %.6f\r\n\r\n", + img_buffer_size, std::chrono::duration_cast(timestamp.time_since_epoch()).count())) + || + (fwrite(img_buffer, img_buffer_size, 1, stdout) != 1) + ) { // If the pipe was closed, we will get signalled SIGPIPE to exit, which will set zm_terminate Debug(1, "Unable to send stream frame: %s, zm_terminate: %d", strerror(errno), zm_terminate); return false; @@ -447,9 +446,9 @@ bool MonitorStream::sendFrame(Image *image, SystemTimePoint timestamp) { if (frame_send_time > maxfps_milliseconds) { //maxfps /= 1.5; Debug(1, "Frame send time %" PRIi64 " msec too slow (> %" PRIi64 ", %.3f", - static_cast(std::chrono::duration_cast(frame_send_time).count()), - static_cast(std::chrono::duration_cast(maxfps_milliseconds).count()), - maxfps); + static_cast(std::chrono::duration_cast(frame_send_time).count()), + static_cast(std::chrono::duration_cast(maxfps_milliseconds).count()), + maxfps); } } return true; @@ -473,7 +472,7 @@ void MonitorStream::runStream() { sendTextFrame("Unable to stream"); } } else { - // Not yet migrated over to stream class + // Not yet migrated over to stream class SingleImage(scale); } zm_terminate = true; @@ -547,7 +546,7 @@ void MonitorStream::runStream() { } else { Debug(2, "Not using playback_buffer"); } // end if connkey && playback_buffer - + std::thread command_processor; if (connkey) { command_processor = std::thread(&MonitorStream::checkCommandQueue, this); @@ -649,7 +648,7 @@ void MonitorStream::runStream() { if (!sendFrame( temp_image_buffer[temp_read_index].file_name, temp_image_buffer[temp_read_index].timestamp) - ) { + ) { zm_terminate = true; } frame_count++; @@ -693,16 +692,16 @@ void MonitorStream::runStream() { if (!paused && !delayed) { last_read_index = monitor->shared_data->last_write_index; Debug(2, "Sending frame index: %d: frame_mod: %d frame count: %d paused(%d) delayed(%d)", - index, frame_mod, frame_count, paused, delayed); + index, frame_mod, frame_count, paused, delayed); // Send the next frame // - // Perhaps we should use NOW instead. + // Perhaps we should use NOW instead. last_frame_timestamp = - SystemTimePoint(zm::chrono::duration_cast(monitor->shared_timestamps[index])); + SystemTimePoint(zm::chrono::duration_cast(monitor->shared_timestamps[index])); Image *send_image = nullptr; /* - if ((frame_type == FRAME_ANALYSIS) && + if ((frame_type == FRAME_ANALYSIS) && (monitor->Analysing() != Monitor::ANALYSING_NONE)) { Debug(1, "Sending analysis image"); send_image = monitor->GetAlarmImage(); @@ -763,7 +762,7 @@ void MonitorStream::runStream() { } // end if actual_delta_time > 5 } // end if change in zoom } // end if paused or not - //} else { + //} else { //frame_count++; } // end if should send frame now > when_to_send_next_frame @@ -778,7 +777,7 @@ void MonitorStream::runStream() { } temp_image_buffer[temp_index].timestamp = - SystemTimePoint(zm::chrono::duration_cast(monitor->shared_timestamps[index])); + SystemTimePoint(zm::chrono::duration_cast(monitor->shared_timestamps[index])); monitor->image_buffer[index]->WriteJpeg(temp_image_buffer[temp_index].file_name, config.jpeg_file_quality); temp_write_index = MOD_ADD(temp_write_index, 1, temp_image_buffer_count); if (temp_write_index == temp_read_index) { @@ -797,8 +796,8 @@ void MonitorStream::runStream() { } // end if buffered playback } else { Debug(3, "Waiting for capture last_write_index=%u == last_read_index=%u", - monitor->shared_data->last_write_index, - last_read_index); + monitor->shared_data->last_write_index, + last_read_index); if (now - last_frame_sent > Seconds(5)) { if (last_read_index == monitor->GetImageBufferCount()) { @@ -816,7 +815,7 @@ void MonitorStream::runStream() { double capture_fps = monitor->GetFPS(); double fps = ((maxfps > 0.0) && (capture_fps > maxfps)) ? maxfps : capture_fps; double sleep_time_seconds = (1 / ((fps ? fps : 1))) // 1 second / fps - * (replay_rate ? abs(replay_rate)/ZM_RATE_BASE : 1); // replay_rate is 100 for 1x + * (replay_rate ? abs(replay_rate)/ZM_RATE_BASE : 1); // replay_rate is 100 for 1x Debug(3, "Using %f for maxfps. capture_fps: %f maxfps %f * replay_rate: %d = %f", fps, capture_fps, maxfps, replay_rate, sleep_time_seconds); sleep_time = FPSeconds(sleep_time_seconds); @@ -912,7 +911,7 @@ void MonitorStream::SingleImage(int scale) { int count = 10; // Give it 1 second to connect or else send text frame. while (count and (monitor->shared_data->last_write_index >= monitor->image_buffer_count) and !zm_terminate) { Debug(1, "Waiting for capture to begin. last write index %d >=? %d", - monitor->shared_data->last_write_index, monitor->image_buffer_count); + monitor->shared_data->last_write_index, monitor->image_buffer_count); std::this_thread::sleep_for(Milliseconds(100)); count--; } @@ -938,9 +937,9 @@ void MonitorStream::SingleImage(int scale) { snap_image->EncodeJpeg(img_buffer, &img_buffer_size); fprintf(stdout, - "Content-Length: %d\r\n" - "Content-Type: image/jpeg\r\n\r\n", - img_buffer_size); + "Content-Length: %d\r\n" + "Content-Type: image/jpeg\r\n\r\n", + img_buffer_size); fwrite(img_buffer, img_buffer_size, 1, stdout); } // end void MonitorStream::SingleImage(int scale) @@ -959,9 +958,9 @@ void MonitorStream::SingleImageRaw(int scale) { } fprintf(stdout, - "Content-Length: %u\r\n" - "Content-Type: image/x-rgb\r\n\r\n", - snap_image->Size()); + "Content-Length: %u\r\n" + "Content-Type: image/x-rgb\r\n\r\n", + snap_image->Size()); fwrite(snap_image->Buffer(), snap_image->Size(), 1, stdout); } // end void MonitorStream::SingleImageRaw(int scale) @@ -985,9 +984,9 @@ void MonitorStream::SingleImageZip(int scale) { snap_image->Zip(img_buffer, &img_buffer_size); fprintf(stdout, - "Content-Length: %lu\r\n" - "Content-Type: image/x-rgbz\r\n\r\n", - img_buffer_size); + "Content-Length: %lu\r\n" + "Content-Type: image/x-rgbz\r\n\r\n", + img_buffer_size); fwrite(img_buffer, img_buffer_size, 1, stdout); } // end void MonitorStream::SingleImageZip(int scale) #endif // HAVE_ZLIB_H diff --git a/src/zm_monitorstream.h b/src/zm_monitorstream.h index 04d2be25c..0ef2e6c88 100644 --- a/src/zm_monitorstream.h +++ b/src/zm_monitorstream.h @@ -1,21 +1,21 @@ // // ZoneMinder MonitorStream Class Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_MONITORSTREAM_H #define ZM_MONITORSTREAM_H @@ -23,56 +23,56 @@ #include "zm_stream.h" class MonitorStream : public StreamBase { - protected: - struct SwapImage { - bool valid = false; - SystemTimePoint timestamp; - std::string file_name; - }; + protected: + struct SwapImage { + bool valid = false; + SystemTimePoint timestamp; + std::string file_name; + }; - private: - SwapImage *temp_image_buffer; - int temp_image_buffer_count; - int temp_read_index; - int temp_write_index; + private: + SwapImage *temp_image_buffer; + int temp_image_buffer_count; + int temp_read_index; + int temp_write_index; - protected: - Microseconds ttl; - int playback_buffer; - bool delayed; + protected: + Microseconds ttl; + int playback_buffer; + bool delayed; - protected: - bool checkSwapPath(const char *path, bool create_path); - bool sendFrame(const std::string &filepath, SystemTimePoint timestamp); - bool sendFrame(Image *image, SystemTimePoint timestamp); - void processCommand(const CmdMsg *msg) override; - void SingleImage(int scale=100); - void SingleImageRaw(int scale=100); + protected: + bool checkSwapPath(const char *path, bool create_path); + bool sendFrame(const std::string &filepath, SystemTimePoint timestamp); + bool sendFrame(Image *image, SystemTimePoint timestamp); + void processCommand(const CmdMsg *msg) override; + void SingleImage(int scale=100); + void SingleImageRaw(int scale=100); #ifdef HAVE_ZLIB_H - void SingleImageZip(int scale=100); + void SingleImageZip(int scale=100); #endif - public: - MonitorStream() : - temp_image_buffer(nullptr), - temp_image_buffer_count(0), - temp_read_index(0), - temp_write_index(0), - ttl(0), - playback_buffer(0), - delayed(false) + public: + MonitorStream() : + temp_image_buffer(nullptr), + temp_image_buffer_count(0), + temp_read_index(0), + temp_write_index(0), + ttl(0), + playback_buffer(0), + delayed(false) {} - void setStreamBuffer(int p_playback_buffer) { - playback_buffer = p_playback_buffer; - } - void setStreamTTL(time_t p_ttl) { - ttl = Seconds(p_ttl); - } - bool setStreamStart(int monitor_id) { - return loadMonitor(monitor_id); - } - void runStream() override; + void setStreamBuffer(int p_playback_buffer) { + playback_buffer = p_playback_buffer; + } + void setStreamTTL(time_t p_ttl) { + ttl = Seconds(p_ttl); + } + bool setStreamStart(int monitor_id) { + return loadMonitor(monitor_id); + } + void runStream() override; }; #endif // ZM_MONITORSTREAM_H diff --git a/src/zm_mpeg.cpp b/src/zm_mpeg.cpp index 0d8fbad7d..fd61fc13c 100644 --- a/src/zm_mpeg.cpp +++ b/src/zm_mpeg.cpp @@ -26,81 +26,81 @@ bool VideoStream::initialised = false; VideoStream::MimeData VideoStream::mime_data[] = { - { "asf", "video/x-ms-asf" }, - { "swf", "application/x-shockwave-flash" }, - { "flv", "video/x-flv" }, - { "mov", "video/quicktime" } + { "asf", "video/x-ms-asf" }, + { "swf", "application/x-shockwave-flash" }, + { "flv", "video/x-flv" }, + { "mov", "video/quicktime" } }; void VideoStream::Initialise( ) { FFMPEGInit(); - initialised = true; + initialised = true; } void VideoStream::SetupFormat( ) { - /* allocate the output media context */ - ofc = nullptr; - avformat_alloc_output_context2(&ofc, nullptr, format, filename); + /* allocate the output media context */ + ofc = nullptr; + avformat_alloc_output_context2(&ofc, nullptr, format, filename); - if (!ofc) { - Fatal("avformat_alloc_..._context failed"); - } + if (!ofc) { + Fatal("avformat_alloc_..._context failed"); + } - of = ofc->oformat; + of = ofc->oformat; Debug(1, "Using output format: %s (%s)", of->name, of->long_name); } int VideoStream::SetupCodec( - int colours, - int subpixelorder, - int width, - int height, - int bitrate, - double frame_rate - ) { - /* ffmpeg format matching */ - switch (colours) { - case ZM_COLOUR_RGB24: - if (subpixelorder == ZM_SUBPIX_ORDER_BGR) { - /* BGR subpixel order */ - pf = AV_PIX_FMT_BGR24; - } else { - /* Assume RGB subpixel order */ - pf = AV_PIX_FMT_RGB24; - } - break; - case ZM_COLOUR_RGB32: - if (subpixelorder == ZM_SUBPIX_ORDER_ARGB) { - /* ARGB subpixel order */ - pf = AV_PIX_FMT_ARGB; - } else if (subpixelorder == ZM_SUBPIX_ORDER_ABGR) { - /* ABGR subpixel order */ - pf = AV_PIX_FMT_ABGR; - } else if (subpixelorder == ZM_SUBPIX_ORDER_BGRA) { - /* BGRA subpixel order */ - pf = AV_PIX_FMT_BGRA; - } else { - /* Assume RGBA subpixel order */ - pf = AV_PIX_FMT_RGBA; - } - break; - case ZM_COLOUR_GRAY8: - pf = AV_PIX_FMT_GRAY8; - break; - default: - Panic("Unexpected colours: %d",colours); - break; - } + int colours, + int subpixelorder, + int width, + int height, + int bitrate, + double frame_rate +) { + /* ffmpeg format matching */ + switch (colours) { + case ZM_COLOUR_RGB24: + if (subpixelorder == ZM_SUBPIX_ORDER_BGR) { + /* BGR subpixel order */ + pf = AV_PIX_FMT_BGR24; + } else { + /* Assume RGB subpixel order */ + pf = AV_PIX_FMT_RGB24; + } + break; + case ZM_COLOUR_RGB32: + if (subpixelorder == ZM_SUBPIX_ORDER_ARGB) { + /* ARGB subpixel order */ + pf = AV_PIX_FMT_ARGB; + } else if (subpixelorder == ZM_SUBPIX_ORDER_ABGR) { + /* ABGR subpixel order */ + pf = AV_PIX_FMT_ABGR; + } else if (subpixelorder == ZM_SUBPIX_ORDER_BGRA) { + /* BGRA subpixel order */ + pf = AV_PIX_FMT_BGRA; + } else { + /* Assume RGBA subpixel order */ + pf = AV_PIX_FMT_RGBA; + } + break; + case ZM_COLOUR_GRAY8: + pf = AV_PIX_FMT_GRAY8; + break; + default: + Panic("Unexpected colours: %d",colours); + break; + } - if (strcmp("rtp", of->name) == 0) { - // RTP must have a packet_size. - // Not sure what this value should be really... - ofc->packet_size = width*height; + if (strcmp("rtp", of->name) == 0) { + // RTP must have a packet_size. + // Not sure what this value should be really... + ofc->packet_size = width*height; Debug(1,"Setting packet_size to %d", ofc->packet_size); - } + } - _AVCODECID codec_id = of->video_codec; - if (codec_name) { + _AVCODECID codec_id = of->video_codec; + if (codec_name) { const AVCodec *a = avcodec_find_encoder_by_name(codec_name); if (a) { codec_id = a->id; @@ -108,66 +108,66 @@ int VideoStream::SetupCodec( } else { Debug(1, "Could not find codec \"%s\". Using default \"%s\"", codec_name, avcodec_get_name(codec_id)); } - } + } - /* add the video streams using the default format codecs - and initialize the codecs */ - ost = nullptr; - if (codec_id != AV_CODEC_ID_NONE) { - codec = avcodec_find_encoder(codec_id); - if (!codec) { - Error("Could not find encoder for '%s'", avcodec_get_name(codec_id)); + /* add the video streams using the default format codecs + and initialize the codecs */ + ost = nullptr; + if (codec_id != AV_CODEC_ID_NONE) { + codec = avcodec_find_encoder(codec_id); + if (!codec) { + Error("Could not find encoder for '%s'", avcodec_get_name(codec_id)); return -1; - } + } - Debug(1, "Found encoder for '%s'", avcodec_get_name(codec_id)); - ost = avformat_new_stream(ofc, codec); - if (!ost) { - Error("Could not alloc stream"); + Debug(1, "Found encoder for '%s'", avcodec_get_name(codec_id)); + ost = avformat_new_stream(ofc, codec); + if (!ost) { + Error("Could not alloc stream"); return -1; - } - Debug(1, "Allocated stream (%d) !=? (%d)", ost->id , ofc->nb_streams - 1); - ost->id = ofc->nb_streams - 1; + } + Debug(1, "Allocated stream (%d) !=? (%d)", ost->id, ofc->nb_streams - 1); + ost->id = ofc->nb_streams - 1; codec_context = avcodec_alloc_context3(nullptr); //avcodec_parameters_to_context(codec_context, ost->codecpar); - codec_context->codec_id = codec->id; - codec_context->codec_type = codec->type; + codec_context->codec_id = codec->id; + codec_context->codec_type = codec->type; - codec_context->pix_fmt = strcmp("mjpeg", ofc->oformat->name) == 0 ? AV_PIX_FMT_YUVJ422P : AV_PIX_FMT_YUV420P; - if (bitrate <= 100) { - // Quality based bitrate control (VBR). Scale is 1..31 where 1 is best. - // This gets rid of artifacts in the beginning of the movie; and well, even quality. - codec_context->flags |= AV_CODEC_FLAG_QSCALE; - codec_context->global_quality = FF_QP2LAMBDA * (31 - (31 * (bitrate / 100.0))); - } else { - codec_context->bit_rate = bitrate; - } + codec_context->pix_fmt = strcmp("mjpeg", ofc->oformat->name) == 0 ? AV_PIX_FMT_YUVJ422P : AV_PIX_FMT_YUV420P; + if (bitrate <= 100) { + // Quality based bitrate control (VBR). Scale is 1..31 where 1 is best. + // This gets rid of artifacts in the beginning of the movie; and well, even quality. + codec_context->flags |= AV_CODEC_FLAG_QSCALE; + codec_context->global_quality = FF_QP2LAMBDA * (31 - (31 * (bitrate / 100.0))); + } else { + codec_context->bit_rate = bitrate; + } - /* resolution must be a multiple of two */ - codec_context->width = width; - codec_context->height = height; - /* time base: this is the fundamental unit of time (in seconds) in terms - of which frame timestamps are represented. for fixed-fps content, - timebase should be 1/framerate and timestamp increments should be - identically 1. */ - codec_context->time_base.den = frame_rate; - codec_context->time_base.num = 1; + /* resolution must be a multiple of two */ + codec_context->width = width; + codec_context->height = height; + /* time base: this is the fundamental unit of time (in seconds) in terms + of which frame timestamps are represented. for fixed-fps content, + timebase should be 1/framerate and timestamp increments should be + identically 1. */ + codec_context->time_base.den = frame_rate; + codec_context->time_base.num = 1; ost->time_base.den = frame_rate; - ost->time_base.num = 1; - Debug( 1, "Will encode in %d fps. %dx%d", codec_context->time_base.den, width, height ); + ost->time_base.num = 1; + Debug( 1, "Will encode in %d fps. %dx%d", codec_context->time_base.den, width, height ); - /* emit one intra frame every second */ - codec_context->gop_size = frame_rate; + /* emit one intra frame every second */ + codec_context->gop_size = frame_rate; - // some formats want stream headers to be separate - if (of->flags & AVFMT_GLOBALHEADER) - codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + // some formats want stream headers to be separate + if (of->flags & AVFMT_GLOBALHEADER) + codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; avcodec_parameters_from_context(ost->codecpar, codec_context); zm_dump_codecpar(ost->codecpar); - } else { - Error("of->video_codec == AV_CODEC_ID_NONE"); + } else { + Error("of->video_codec == AV_CODEC_ID_NONE"); return -1; } return 0; @@ -177,43 +177,43 @@ void VideoStream::SetParameters( ) { } const char *VideoStream::MimeType() const { - for ( unsigned int i = 0; i < sizeof (mime_data) / sizeof (*mime_data); i++ ) { - if ( strcmp(format, mime_data[i].format) == 0 ) { - Debug(1, "MimeType is \"%s\"", mime_data[i].mime_type); - return mime_data[i].mime_type; - } - } - const char *mime_type = of->mime_type; - if ( !mime_type ) { - std::string mime = std::string("video/") + format; - mime_type = strdup(mime.c_str()); // mem leak - Warning( "Unable to determine mime type for '%s' format, using '%s' as default", format, mime_type); - } + for ( unsigned int i = 0; i < sizeof (mime_data) / sizeof (*mime_data); i++ ) { + if ( strcmp(format, mime_data[i].format) == 0 ) { + Debug(1, "MimeType is \"%s\"", mime_data[i].mime_type); + return mime_data[i].mime_type; + } + } + const char *mime_type = of->mime_type; + if ( !mime_type ) { + std::string mime = std::string("video/") + format; + mime_type = strdup(mime.c_str()); // mem leak + Warning( "Unable to determine mime type for '%s' format, using '%s' as default", format, mime_type); + } - Debug(1, "MimeType is \"%s\"", mime_type); + Debug(1, "MimeType is \"%s\"", mime_type); - return mime_type; + return mime_type; } bool VideoStream::OpenStream( ) { - int ret; + int ret; - /* now that all the parameters are set, we can open the - video codecs and allocate the necessary encode buffers */ - if ( ost ) { + /* now that all the parameters are set, we can open the + video codecs and allocate the necessary encode buffers */ + if ( ost ) { Debug(1,"Opening codec"); - /* open the codec */ + /* open the codec */ - if ((ret = avcodec_open2(codec_context, codec, nullptr)) < 0) { - Error("Could not open codec. Error code %d \"%s\"", ret, av_err2str(ret)); + if ((ret = avcodec_open2(codec_context, codec, nullptr)) < 0) { + Error("Could not open codec. Error code %d \"%s\"", ret, av_err2str(ret)); return false; - } + } - Debug( 1, "Opened codec" ); + Debug( 1, "Opened codec" ); - /* allocate the encoded raw picture */ - opicture = av_frame_ptr{zm_av_frame_alloc()}; + /* allocate the encoded raw picture */ + opicture = av_frame_ptr{zm_av_frame_alloc()}; if (!opicture) { Error("Could not allocate opicture"); return false; @@ -230,7 +230,7 @@ bool VideoStream::OpenStream( ) { return false; } av_image_fill_arrays(opicture->data, opicture->linesize, - opicture->buf[0]->data, codec_context->pix_fmt, codec_context->width, codec_context->height, 1); + opicture->buf[0]->data, codec_context->pix_fmt, codec_context->width, codec_context->height, 1); /* if the output format is not identical to the input format, then a temporary picture is needed too. It is then converted to the required @@ -250,40 +250,40 @@ bool VideoStream::OpenStream( ) { } av_image_fill_arrays(tmp_opicture->data, - tmp_opicture->linesize, tmp_opicture->buf[0]->data, pf, - codec_context->width, codec_context->height, 1); + tmp_opicture->linesize, tmp_opicture->buf[0]->data, pf, + codec_context->width, codec_context->height, 1); } } // end if ost /* open the output file, if needed */ if ( !(of->flags & AVFMT_NOFILE) ) { - ret = avio_open2( &ofc->pb, filename, AVIO_FLAG_WRITE, nullptr, nullptr ); + ret = avio_open2( &ofc->pb, filename, AVIO_FLAG_WRITE, nullptr, nullptr ); - if ( ret < 0 ) { - Error("Could not open '%s'", filename); + if ( ret < 0 ) { + Error("Could not open '%s'", filename); return false; - } + } - Debug(1, "Opened output \"%s\"", filename); - } else { - Error( "of->flags & AVFMT_NOFILE" ); + Debug(1, "Opened output \"%s\"", filename); + } else { + Error( "of->flags & AVFMT_NOFILE" ); return false; - } + } - video_outbuf = nullptr; + video_outbuf = nullptr; if (codec_context->codec_type == AVMEDIA_TYPE_VIDEO && codec_context->codec_id == AV_CODEC_ID_RAWVIDEO) { - /* allocate output buffer */ - /* XXX: API change will be done */ - // TODO: Make buffer dynamic. - video_outbuf_size = 4000000; - video_outbuf = (uint8_t *)malloc( video_outbuf_size ); - if ( video_outbuf == nullptr ) { - Fatal("Unable to malloc memory for outbuf"); - } - } + /* allocate output buffer */ + /* XXX: API change will be done */ + // TODO: Make buffer dynamic. + video_outbuf_size = 4000000; + video_outbuf = (uint8_t *)malloc( video_outbuf_size ); + if ( video_outbuf == nullptr ) { + Fatal("Unable to malloc memory for outbuf"); + } + } - av_dump_format(ofc, 0, filename, 1); + av_dump_format(ofc, 0, filename, 1); ret = avformat_write_header(ofc, nullptr); @@ -295,167 +295,166 @@ bool VideoStream::OpenStream( ) { } VideoStream::VideoStream( const char *in_filename, const char *in_format, int bitrate, double frame_rate, int colours, int subpixelorder, int width, int height ) : - filename(in_filename), - format(in_format), - video_outbuf(nullptr), - video_outbuf_size(0), - last_pts( -1 ), - streaming_thread(0), - do_streaming(true), - add_timestamp(false), - timestamp(0), - buffer_copy(nullptr), - buffer_copy_lock(new pthread_mutex_t), - buffer_copy_size(0), - buffer_copy_used(0), - packet_index(0) -{ - if ( !initialised ) { - Initialise( ); - } + filename(in_filename), + format(in_format), + video_outbuf(nullptr), + video_outbuf_size(0), + last_pts( -1 ), + streaming_thread(0), + do_streaming(true), + add_timestamp(false), + timestamp(0), + buffer_copy(nullptr), + buffer_copy_lock(new pthread_mutex_t), + buffer_copy_size(0), + buffer_copy_used(0), + packet_index(0) { + if ( !initialised ) { + Initialise( ); + } - if ( format ) { - int length = strlen(format); - codec_and_format = new char[length+1];; - strcpy( codec_and_format, format ); - format = codec_and_format; - codec_name = nullptr; - char *f = strchr(codec_and_format, '/'); - if (f != nullptr) { - *f = 0; - codec_name = f+1; - } - } + if ( format ) { + int length = strlen(format); + codec_and_format = new char[length+1];; + strcpy( codec_and_format, format ); + format = codec_and_format; + codec_name = nullptr; + char *f = strchr(codec_and_format, '/'); + if (f != nullptr) { + *f = 0; + codec_name = f+1; + } + } codec_context = nullptr; - SetupFormat( ); - SetupCodec( colours, subpixelorder, width, height, bitrate, frame_rate ); - SetParameters( ); + SetupFormat( ); + SetupCodec( colours, subpixelorder, width, height, bitrate, frame_rate ); + SetParameters( ); // Allocate buffered packets. for (auto &pkt : packet_buffers) pkt = av_packet_ptr{av_packet_alloc()}; - // Initialize mutex used by streaming thread. - if ( pthread_mutex_init( buffer_copy_lock, nullptr ) != 0 ) { - Fatal("pthread_mutex_init failed"); - } + // Initialize mutex used by streaming thread. + if ( pthread_mutex_init( buffer_copy_lock, nullptr ) != 0 ) { + Fatal("pthread_mutex_init failed"); + } } VideoStream::~VideoStream( ) { - Debug( 1, "VideoStream destructor." ); + Debug( 1, "VideoStream destructor." ); - // Stop streaming thread. - if ( streaming_thread ) { - do_streaming = false; - void* thread_exit_code; + // Stop streaming thread. + if ( streaming_thread ) { + do_streaming = false; + void* thread_exit_code; - Debug( 1, "Asking streaming thread to exit." ); + Debug( 1, "Asking streaming thread to exit." ); - // Wait for thread to exit. - pthread_join(streaming_thread, &thread_exit_code); - } + // Wait for thread to exit. + pthread_join(streaming_thread, &thread_exit_code); + } - if ( buffer_copy != nullptr ) { - av_free( buffer_copy ); - } + if ( buffer_copy != nullptr ) { + av_free( buffer_copy ); + } - if ( buffer_copy_lock ) { - if ( pthread_mutex_destroy( buffer_copy_lock ) != 0 ) { - Error( "pthread_mutex_destroy failed" ); - } - delete buffer_copy_lock; - } + if ( buffer_copy_lock ) { + if ( pthread_mutex_destroy( buffer_copy_lock ) != 0 ) { + Error( "pthread_mutex_destroy failed" ); + } + delete buffer_copy_lock; + } - /* close each codec */ - if ( ost ) { - avcodec_close( codec_context ); - av_free( video_outbuf ); - } + /* close each codec */ + if ( ost ) { + avcodec_close( codec_context ); + av_free( video_outbuf ); + } - /* write the trailer, if any */ - av_write_trailer( ofc ); + /* write the trailer, if any */ + av_write_trailer( ofc ); - /* free the streams */ - for ( unsigned int i = 0; i < ofc->nb_streams; i++ ) { - av_freep( &ofc->streams[i] ); - } + /* free the streams */ + for ( unsigned int i = 0; i < ofc->nb_streams; i++ ) { + av_freep( &ofc->streams[i] ); + } - if ( !(of->flags & AVFMT_NOFILE) ) { - /* close the output file */ - avio_close( ofc->pb ); - } + if ( !(of->flags & AVFMT_NOFILE) ) { + /* close the output file */ + avio_close( ofc->pb ); + } - /* free the stream */ - av_free( ofc ); + /* free the stream */ + av_free( ofc ); - /* free format and codec_name data. */ - if ( codec_and_format ) { - delete codec_and_format; - } + /* free format and codec_name data. */ + if ( codec_and_format ) { + delete codec_and_format; + } } double VideoStream::EncodeFrame( const uint8_t *buffer, int buffer_size, bool _add_timestamp, unsigned int _timestamp ) { - if ( pthread_mutex_lock(buffer_copy_lock) != 0 ) { - Fatal( "EncodeFrame: pthread_mutex_lock failed." ); - } + if ( pthread_mutex_lock(buffer_copy_lock) != 0 ) { + Fatal( "EncodeFrame: pthread_mutex_lock failed." ); + } - if (buffer_copy_size < buffer_size) { - if ( buffer_copy ) { - av_free(buffer_copy); - } + if (buffer_copy_size < buffer_size) { + if ( buffer_copy ) { + av_free(buffer_copy); + } - // Allocate a buffer to store source images for the streaming thread to encode. - buffer_copy = (uint8_t *)av_malloc(buffer_size); - if ( !buffer_copy ) { - Error( "Could not allocate buffer_copy" ); + // Allocate a buffer to store source images for the streaming thread to encode. + buffer_copy = (uint8_t *)av_malloc(buffer_size); + if ( !buffer_copy ) { + Error( "Could not allocate buffer_copy" ); pthread_mutex_unlock(buffer_copy_lock); return 0; - } - buffer_copy_size = buffer_size; - } + } + buffer_copy_size = buffer_size; + } - add_timestamp = _add_timestamp; - timestamp = _timestamp; - buffer_copy_used = buffer_size; - memcpy(buffer_copy, buffer, buffer_size); + add_timestamp = _add_timestamp; + timestamp = _timestamp; + buffer_copy_used = buffer_size; + memcpy(buffer_copy, buffer, buffer_size); - if ( pthread_mutex_unlock(buffer_copy_lock) != 0 ) { - Fatal( "EncodeFrame: pthread_mutex_unlock failed." ); - } + if ( pthread_mutex_unlock(buffer_copy_lock) != 0 ) { + Fatal( "EncodeFrame: pthread_mutex_unlock failed." ); + } - if ( streaming_thread == 0 ) { - Debug( 1, "Starting streaming thread" ); + if ( streaming_thread == 0 ) { + Debug( 1, "Starting streaming thread" ); - // Start a thread for streaming encoded video. - if (pthread_create( &streaming_thread, nullptr, StreamingThreadCallback, (void*) this) != 0){ - // Log a fatal error and exit the process. - Fatal( "VideoStream failed to create streaming thread." ); - } - } + // Start a thread for streaming encoded video. + if (pthread_create( &streaming_thread, nullptr, StreamingThreadCallback, (void*) this) != 0) { + // Log a fatal error and exit the process. + Fatal( "VideoStream failed to create streaming thread." ); + } + } - //return ActuallyEncodeFrame( buffer, buffer_size, add_timestamp, timestamp); + //return ActuallyEncodeFrame( buffer, buffer_size, add_timestamp, timestamp); - return _timestamp; + return _timestamp; } double VideoStream::ActuallyEncodeFrame( const uint8_t *buffer, int buffer_size, bool add_timestamp, unsigned int timestamp ) { - if ( codec_context->pix_fmt != pf ) { + if ( codec_context->pix_fmt != pf ) { static struct SwsContext *img_convert_ctx = nullptr; - memcpy( tmp_opicture->data[0], buffer, buffer_size ); - if ( !img_convert_ctx ) { - img_convert_ctx = sws_getCachedContext( nullptr, codec_context->width, codec_context->height, pf, codec_context->width, codec_context->height, codec_context->pix_fmt, SWS_BICUBIC, nullptr, nullptr, nullptr ); - if ( !img_convert_ctx ) - Panic( "Unable to initialise image scaling context" ); - } - sws_scale( img_convert_ctx, tmp_opicture->data, tmp_opicture->linesize, 0, codec_context->height, opicture->data, opicture->linesize ); - } else { - memcpy( opicture->data[0], buffer, buffer_size ); - } + memcpy( tmp_opicture->data[0], buffer, buffer_size ); + if ( !img_convert_ctx ) { + img_convert_ctx = sws_getCachedContext( nullptr, codec_context->width, codec_context->height, pf, codec_context->width, codec_context->height, codec_context->pix_fmt, SWS_BICUBIC, nullptr, nullptr, nullptr ); + if ( !img_convert_ctx ) + Panic( "Unable to initialise image scaling context" ); + } + sws_scale( img_convert_ctx, tmp_opicture->data, tmp_opicture->linesize, 0, codec_context->height, opicture->data, opicture->linesize ); + } else { + memcpy( opicture->data[0], buffer, buffer_size ); + } - AVFrame *opicture_ptr = opicture.get(); - AVPacket *pkt = packet_buffers[packet_index].get(); + AVFrame *opicture_ptr = opicture.get(); + AVPacket *pkt = packet_buffers[packet_index].get(); if (codec_context->codec_type == AVMEDIA_TYPE_VIDEO && codec_context->codec_id == AV_CODEC_ID_RAWVIDEO) { @@ -463,9 +462,9 @@ double VideoStream::ActuallyEncodeFrame( const uint8_t *buffer, int buffer_size, pkt->stream_index = ost->index; pkt->data = (uint8_t *)opicture_ptr; pkt->size = buffer_size; - } else { - opicture_ptr->pts = codec_context->frame_number; - opicture_ptr->quality = codec_context->global_quality; + } else { + opicture_ptr->pts = codec_context->frame_number; + opicture_ptr->quality = codec_context->global_quality; avcodec_send_frame(codec_context, opicture_ptr); int ret = avcodec_receive_packet(codec_context, pkt); @@ -512,7 +511,7 @@ void *VideoStream::StreamingThreadCallback(void *ctx) { VideoStream *videoStream = reinterpret_cast(ctx); TimePoint::duration target_interval = std::chrono::duration_cast(FPSeconds( - videoStream->codec_context->time_base.num / static_cast(videoStream->codec_context->time_base.den))); + videoStream->codec_context->time_base.num / static_cast(videoStream->codec_context->time_base.den))); uint64_t frame_count = 0; TimePoint start_time = std::chrono::steady_clock::now(); diff --git a/src/zm_mpeg.h b/src/zm_mpeg.h index 20195b2df..f2d38caf4 100644 --- a/src/zm_mpeg.h +++ b/src/zm_mpeg.h @@ -25,17 +25,17 @@ #include class VideoStream { -protected: + protected: struct MimeData { const char *format; const char *mime_type; }; -protected: + protected: static bool initialised; static struct MimeData mime_data[]; -protected: + protected: char *codec_and_format; const char *filename; const char *format; @@ -65,7 +65,7 @@ protected: int SendPacket(AVPacket *packet); static void* StreamingThreadCallback(void *ctx); -protected: + protected: static void Initialise(); void SetupFormat( ); @@ -74,7 +74,7 @@ protected: void ActuallyOpenStream(); double ActuallyEncodeFrame( const uint8_t *buffer, int buffer_size, bool add_timestamp=false, unsigned int timestamp=0 ); -public: + public: VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int subpixelorder, int width, int height ); ~VideoStream(); const char *MimeType() const; diff --git a/src/zm_mqtt.cpp b/src/zm_mqtt.cpp index 216ce1d9d..efc30c1c8 100644 --- a/src/zm_mqtt.cpp +++ b/src/zm_mqtt.cpp @@ -12,8 +12,7 @@ MQTT::MQTT(Monitor *monitor) : mosquittopp("ZoneMinder"), monitor_(monitor), - connected_(false) -{ + connected_(false) { mosqpp::lib_init(); connect(); } @@ -52,7 +51,7 @@ void MQTT::on_connect(int rc) { } void MQTT::on_message(const struct mosquitto_message *message) { -Debug(1, "MQTT: Have message %s: %s", message->topic, message->payload); + Debug(1, "MQTT: Have message %s: %s", message->topic, message->payload); } void MQTT::on_subscribe(int mid, int qos_count, const int *granted_qos) { @@ -102,8 +101,8 @@ void MQTT::addValue(std::string name, double value) { // } // valuesList.insert ( std::pair(name, value)); std::chrono::milliseconds ms = std::chrono::duration_cast< std::chrono::milliseconds >( - std::chrono::high_resolution_clock::now().time_since_epoch() - ); + std::chrono::high_resolution_clock::now().time_since_epoch() + ); sensorListIterator->second.insert(std::pair(ms, value)); } diff --git a/src/zm_mqtt.h b/src/zm_mqtt.h index 1a1cfa5f6..f5b9e8c31 100644 --- a/src/zm_mqtt.h +++ b/src/zm_mqtt.h @@ -16,34 +16,34 @@ class Monitor; class MQTT : public mosqpp::mosquittopp { - public: - MQTT(Monitor *); - ~MQTT(); - void autoconfigure(); - void connect(); - void disconnect(); - void send(const std::string &message); - void addSensor(std::string name, std::string type); - void add_subscription(const std::string &name); + public: + MQTT(Monitor *); + ~MQTT(); + void autoconfigure(); + void connect(); + void disconnect(); + void send(const std::string &message); + void addSensor(std::string name, std::string type); + void add_subscription(const std::string &name); - void addValue(std::string name, double value); - void listValues(const std::string &sensor_name); - void on_connect(int rc); - void on_message(const struct mosquitto_message *message); - void on_subscribe(int mid, int qos_count, const int *granted_qos); - void on_publish(); - enum sensorTypes { - NUMERIC = 0, - DIGITAL - }; + void addValue(std::string name, double value); + void listValues(const std::string &sensor_name); + void on_connect(int rc); + void on_message(const struct mosquitto_message *message); + void on_subscribe(int mid, int qos_count, const int *granted_qos); + void on_publish(); + enum sensorTypes { + NUMERIC = 0, + DIGITAL + }; - private: - std::map> sensorList; - std::map>::iterator sensorListIterator; - std::map actuatorList; + private: + std::map> sensorList; + std::map>::iterator sensorListIterator; + std::map actuatorList; - Monitor *monitor_; - bool connected_; + Monitor *monitor_; + bool connected_; }; #endif // MOSQUITTOPP_FOUND diff --git a/src/zm_packet.cpp b/src/zm_packet.cpp index c54f0f8e9..35762d49d 100644 --- a/src/zm_packet.cpp +++ b/src/zm_packet.cpp @@ -36,8 +36,7 @@ ZMPacket::ZMPacket() : image_index(-1), codec_imgsize(0), pts(0), - decoded(false) -{ + decoded(false) { packet = av_packet_ptr{av_packet_alloc()}; } @@ -53,8 +52,7 @@ ZMPacket::ZMPacket(Image *i, SystemTimePoint tv) : image_index(-1), codec_imgsize(0), pts(0), - decoded(false) -{ + decoded(false) { packet = av_packet_ptr{av_packet_alloc()}; } @@ -70,8 +68,7 @@ ZMPacket::ZMPacket(ZMPacket &p) : image_index(-1), codec_imgsize(0), pts(0), - decoded(false) -{ + decoded(false) { packet = av_packet_ptr{av_packet_alloc()}; if (zm_av_packet_ref(packet.get(), p.packet.get()) < 0) { @@ -87,16 +84,16 @@ ZMPacket::~ZMPacket() { ssize_t ZMPacket::ram() { return packet->size + - (in_frame ? in_frame->linesize[0] * in_frame->height : 0) + - (out_frame ? out_frame->linesize[0] * out_frame->height : 0) + - (image ? image->Size() : 0) + - (analysis_image ? analysis_image->Size() : 0); + (in_frame ? in_frame->linesize[0] * in_frame->height : 0) + + (out_frame ? out_frame->linesize[0] * out_frame->height : 0) + + (image ? image->Size() : 0) + + (analysis_image ? analysis_image->Size() : 0); } -/* returns < 0 on error, 0 on not ready, int bytes consumed on success +/* returns < 0 on error, 0 on not ready, int bytes consumed on success * This functions job is to populate in_frame with the image in an appropriate * format. It MAY also populate image if able to. In this case in_frame is populated - * by the image buffer. + * by the image buffer. */ int ZMPacket::decode(AVCodecContext *ctx) { Debug(4, "about to decode video, image_index is (%d)", image_index); @@ -114,7 +111,7 @@ int ZMPacket::decode(AVCodecContext *ctx) { if (ret < 0) { if (AVERROR(EAGAIN) != ret) { Warning("Unable to receive frame : code %d %s.", - ret, av_make_error_string(ret).c_str()); + ret, av_make_error_string(ret).c_str()); } in_frame = nullptr; return 0; @@ -128,28 +125,28 @@ int ZMPacket::decode(AVCodecContext *ctx) { if ((ctx->sw_pix_fmt != AV_PIX_FMT_NONE) and (fix_deprecated_pix_fmt(ctx->sw_pix_fmt) != fix_deprecated_pix_fmt(static_cast(in_frame->format)))) { Debug(3, "Have different format ctx->pix_fmt %d %s ?= ctx->sw_pix_fmt %d %s in_frame->format %d %s.", - ctx->pix_fmt, - av_get_pix_fmt_name(ctx->pix_fmt), - ctx->sw_pix_fmt, - av_get_pix_fmt_name(ctx->sw_pix_fmt), - in_frame->format, - av_get_pix_fmt_name(static_cast(in_frame->format)) - ); + ctx->pix_fmt, + av_get_pix_fmt_name(ctx->pix_fmt), + ctx->sw_pix_fmt, + av_get_pix_fmt_name(ctx->sw_pix_fmt), + in_frame->format, + av_get_pix_fmt_name(static_cast(in_frame->format)) + ); #if 0 if ( target_format == AV_PIX_FMT_NONE and ctx->hw_frames_ctx and (image->Colours() == 4) ) { // Look for rgb0 in list of supported formats enum AVPixelFormat *formats; if ( 0 <= av_hwframe_transfer_get_formats( - ctx->hw_frames_ctx, - AV_HWFRAME_TRANSFER_DIRECTION_FROM, - &formats, - 0 - ) ) { + ctx->hw_frames_ctx, + AV_HWFRAME_TRANSFER_DIRECTION_FROM, + &formats, + 0 + ) ) { for (int i = 0; formats[i] != AV_PIX_FMT_NONE; i++) { - Debug(1, "Available dest formats %d %s", - formats[i], - av_get_pix_fmt_name(formats[i]) - ); + Debug(1, "Available dest formats %d %s", + formats[i], + av_get_pix_fmt_name(formats[i]) + ); if ( formats[i] == AV_PIX_FMT_RGB0 ) { target_format = formats[i]; break; @@ -179,14 +176,14 @@ int ZMPacket::decode(AVCodecContext *ctx) { ret = av_hwframe_transfer_data(new_frame.get(), in_frame.get(), 0); if (ret < 0) { Error("Unable to transfer frame: %s, continuing", - av_make_error_string(ret).c_str()); + av_make_error_string(ret).c_str()); in_frame = nullptr; return 0; } ret = av_frame_copy_props(new_frame.get(), in_frame.get()); if (ret < 0) { Error("Unable to copy props: %s, continuing", - av_make_error_string(ret).c_str()); + av_make_error_string(ret).c_str()); } zm_dump_video_frame(new_frame.get(), "After hwtransfer"); @@ -201,9 +198,9 @@ int ZMPacket::decode(AVCodecContext *ctx) { #endif #endif Debug(3, "Same pix format %s so not hwtransferring. sw_pix_fmt is %s", - av_get_pix_fmt_name(ctx->pix_fmt), - av_get_pix_fmt_name(ctx->sw_pix_fmt) - ); + av_get_pix_fmt_name(ctx->pix_fmt), + av_get_pix_fmt_name(ctx->sw_pix_fmt) + ); #if 0 if ( image ) { image->Assign(in_frame); @@ -222,7 +219,7 @@ Image *ZMPacket::get_image(Image *i) { if (!i) { Error("Need a pre-allocated image buffer"); return nullptr; - } + } image = i; } image->Assign(in_frame.get()); @@ -254,9 +251,9 @@ AVFrame *ZMPacket::get_out_frame(int width, int height, AVPixelFormat format) { int alignment = 32; if (width%alignment) alignment = 1; - + codec_imgsize = av_image_get_buffer_size( - format, width, height, alignment); + format, width, height, alignment); Debug(1, "buffer size %u from %s %dx%d", codec_imgsize, av_get_pix_fmt_name(format), width, height); out_frame->buf[0] = av_buffer_alloc(codec_imgsize); if (!out_frame->buf[0]) { @@ -266,13 +263,13 @@ AVFrame *ZMPacket::get_out_frame(int width, int height, AVPixelFormat format) { } int ret; if ((ret=av_image_fill_arrays( - out_frame->data, - out_frame->linesize, - out_frame->buf[0]->data, - format, - width, - height, - alignment))<0) { + out_frame->data, + out_frame->linesize, + out_frame->buf[0]->data, + format, + width, + height, + alignment))<0) { Error("Failed to fill_arrays %s", av_make_error_string(ret).c_str()); out_frame = nullptr; return nullptr; diff --git a/src/zm_packet.h b/src/zm_packet.h index 4a2d95191..41e0f7e43 100644 --- a/src/zm_packet.h +++ b/src/zm_packet.h @@ -36,99 +36,99 @@ extern "C" { class Image; class ZMPacket { - public: - - std::mutex mutex_; - // The condition has to be in the packet because it is shared between locks - std::condition_variable condition_; + public: - int keyframe; - AVStream *stream; // Input stream - av_packet_ptr packet; // Input packet, undecoded - av_frame_ptr in_frame; // Input image, decoded Theoretically only filled if needed. - av_frame_ptr out_frame; // output image, Only filled if needed. - SystemTimePoint timestamp; - Image *image; - Image *y_image; - Image *analysis_image; - int score; - AVMediaType codec_type; - int image_index; - int codec_imgsize; - int64_t pts; // pts in the packet can be in another time base. This MUST be in AV_TIME_BASE_Q - bool decoded; - std::vector zone_stats; - std::string alarm_cause; + std::mutex mutex_; + // The condition has to be in the packet because it is shared between locks + std::condition_variable condition_; - public: - AVPacket *av_packet() { return packet.get(); } - AVPacket *set_packet(AVPacket *p) ; - AVFrame *av_frame() { return out_frame.get(); } - Image *get_image(Image *i=nullptr); - Image *set_image(Image *); - ssize_t ram(); + int keyframe; + AVStream *stream; // Input stream + av_packet_ptr packet; // Input packet, undecoded + av_frame_ptr in_frame; // Input image, decoded Theoretically only filled if needed. + av_frame_ptr out_frame; // output image, Only filled if needed. + SystemTimePoint timestamp; + Image *image; + Image *y_image; + Image *analysis_image; + int score; + AVMediaType codec_type; + int image_index; + int codec_imgsize; + int64_t pts; // pts in the packet can be in another time base. This MUST be in AV_TIME_BASE_Q + bool decoded; + std::vector zone_stats; + std::string alarm_cause; - int is_keyframe() { return keyframe; }; - int decode(AVCodecContext *ctx); - explicit ZMPacket(Image *image, SystemTimePoint tv); - explicit ZMPacket(ZMPacket &packet); - ZMPacket(); - ~ZMPacket(); + public: + AVPacket *av_packet() { return packet.get(); } + AVPacket *set_packet(AVPacket *p) ; + AVFrame *av_frame() { return out_frame.get(); } + Image *get_image(Image *i=nullptr); + Image *set_image(Image *); + ssize_t ram(); - //AVFrame *get_out_frame(const AVCodecContext *ctx); - AVFrame *get_out_frame(int width, int height, AVPixelFormat format); - int get_codec_imgsize() { return codec_imgsize; }; - void notify_all() { - this->condition_.notify_all(); - } + int is_keyframe() { return keyframe; }; + int decode(AVCodecContext *ctx); + explicit ZMPacket(Image *image, SystemTimePoint tv); + explicit ZMPacket(ZMPacket &packet); + ZMPacket(); + ~ZMPacket(); + + //AVFrame *get_out_frame(const AVCodecContext *ctx); + AVFrame *get_out_frame(int width, int height, AVPixelFormat format); + int get_codec_imgsize() { return codec_imgsize; }; + void notify_all() { + this->condition_.notify_all(); + } }; class ZMLockedPacket { - public: - std::shared_ptr packet_; - std::unique_lock lck_; - bool locked; + public: + std::shared_ptr packet_; + std::unique_lock lck_; + bool locked; - explicit ZMLockedPacket(std::shared_ptr p) : - packet_(p), - lck_(packet_->mutex_, std::defer_lock), - locked(false) { - } + explicit ZMLockedPacket(std::shared_ptr p) : + packet_(p), + lck_(packet_->mutex_, std::defer_lock), + locked(false) { + } - ~ZMLockedPacket() { - if (locked) unlock(); - } + ~ZMLockedPacket() { + if (locked) unlock(); + } - void lock() { - Debug(4, "locking packet %d %p %d owns %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); - lck_.lock(); - locked = true; - Debug(4, "packet %d locked", packet_->image_index); - }; + void lock() { + Debug(4, "locking packet %d %p %d owns %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); + lck_.lock(); + locked = true; + Debug(4, "packet %d locked", packet_->image_index); + }; - bool trylock() { - Debug(4, "TryLocking packet %d %p locked: %d owns: %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); - locked = lck_.try_lock(); - Debug(4, "TryLocking packet %d %p %d, owns: %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); - return locked; - }; + bool trylock() { + Debug(4, "TryLocking packet %d %p locked: %d owns: %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); + locked = lck_.try_lock(); + Debug(4, "TryLocking packet %d %p %d, owns: %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); + return locked; + }; - void unlock() { - Debug(4, "packet %d unlocked, %p, locked %d, owns %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); - locked = false; - lck_.unlock(); - Debug(4, "packet %d unlocked, %p, locked %d, owns %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); - packet_->condition_.notify_all(); - }; + void unlock() { + Debug(4, "packet %d unlocked, %p, locked %d, owns %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); + locked = false; + lck_.unlock(); + Debug(4, "packet %d unlocked, %p, locked %d, owns %d", packet_->image_index, packet_.get(), locked, lck_.owns_lock()); + packet_->condition_.notify_all(); + }; + + void wait() { + Debug(4, "packet %d waiting", packet_->image_index); + packet_->condition_.wait(lck_); + } + void notify_all() { + packet_->notify_all(); + } - void wait() { - Debug(4, "packet %d waiting", packet_->image_index); - packet_->condition_.wait(lck_); - } - void notify_all() { - packet_->notify_all(); - } - }; #endif /* ZM_PACKET_H */ diff --git a/src/zm_packetqueue.cpp b/src/zm_packetqueue.cpp index f758a536e..ccf707571 100644 --- a/src/zm_packetqueue.cpp +++ b/src/zm_packetqueue.cpp @@ -35,8 +35,7 @@ PacketQueue::PacketQueue(): keep_keyframes(false), warned_count(0), has_out_of_order_packets_(false), - max_keyframe_interval_(0) -{ + max_keyframe_interval_(0) { } /* Assumes queue is empty when adding streams @@ -108,7 +107,7 @@ bool PacketQueue::queuePacket(std::shared_ptr add_packet) { rit++; } // end while } - + if (!max_keyframe_interval_ and add_packet->keyframe and (video_stream_id==add_packet->packet->stream_index)) { auto rit = pktQueue.rbegin(); int packet_count = 0; @@ -128,10 +127,10 @@ bool PacketQueue::queuePacket(std::shared_ptr add_packet) { /* Any iterators that are pointing to the end will now point to the newly pushed packet */ for ( - auto iterators_it = iterators.begin(); - iterators_it != iterators.end(); - ++iterators_it - ) { + auto iterators_it = iterators.begin(); + iterators_it != iterators.end(); + ++iterators_it + ) { packetqueue_iterator *iterator_it = *iterators_it; if (*iterator_it == pktQueue.end()) { --(*iterator_it); @@ -140,30 +139,30 @@ bool PacketQueue::queuePacket(std::shared_ptr add_packet) { packet_counts[add_packet->packet->stream_index] += 1; Debug(2, "packet counts for %d is %d", - add_packet->packet->stream_index, - packet_counts[add_packet->packet->stream_index]); + add_packet->packet->stream_index, + packet_counts[add_packet->packet->stream_index]); if ( - (add_packet->packet->stream_index == video_stream_id) - and - (max_video_packet_count > 0) - and - (packet_counts[video_stream_id] > max_video_packet_count) - ) { + (add_packet->packet->stream_index == video_stream_id) + and + (max_video_packet_count > 0) + and + (packet_counts[video_stream_id] > max_video_packet_count) + ) { if (!warned_count) { warned_count++; Warning("You have set the max video packets in the queue to %u." - " The queue is full. Either Analysis is not keeping up or" - " your camera's keyframe interval %d is larger than this setting." - , max_video_packet_count, max_keyframe_interval_); + " The queue is full. Either Analysis is not keeping up or" + " your camera's keyframe interval %d is larger than this setting." + , max_video_packet_count, max_keyframe_interval_); } for ( - // Start at second packet because the first is always a keyframe - auto it = ++pktQueue.begin(); - //it != pktQueue.end() and // can't hit end because we added our packet - (*it != add_packet) && !(deleting or zm_terminate); - // iterator is incremented by erase + // Start at second packet because the first is always a keyframe + auto it = ++pktQueue.begin(); + //it != pktQueue.end() and // can't hit end because we added our packet + (*it != add_packet) && !(deleting or zm_terminate); + // iterator is incremented by erase ) { std::shared_ptr zm_packet = *it; @@ -179,10 +178,10 @@ bool PacketQueue::queuePacket(std::shared_ptr add_packet) { } for ( - auto iterators_it = iterators.begin(); - iterators_it != iterators.end(); - ++iterators_it - ) { + auto iterators_it = iterators.begin(); + iterators_it != iterators.end(); + ++iterators_it + ) { auto iterator_it = *iterators_it; // Have to check each iterator and make sure it doesn't point to the packet we are about to delete if (*(*iterator_it) == zm_packet) { @@ -197,13 +196,13 @@ bool PacketQueue::queuePacket(std::shared_ptr add_packet) { it = pktQueue.erase(it); packet_counts[zm_packet->packet->stream_index] -= 1; Debug(1, - "Deleting a packet with stream index:%d image_index:%d with keyframe:%d, video frames in queue:%d max: %d, queuesize:%zu", - zm_packet->packet->stream_index, - zm_packet->image_index, - zm_packet->keyframe, - packet_counts[video_stream_id], - max_video_packet_count, - pktQueue.size()); + "Deleting a packet with stream index:%d image_index:%d with keyframe:%d, video frames in queue:%d max: %d, queuesize:%zu", + zm_packet->packet->stream_index, + zm_packet->image_index, + zm_packet->keyframe, + packet_counts[video_stream_id], + max_video_packet_count, + pktQueue.size()); if (zm_packet->packet->stream_index == video_stream_id) break; @@ -216,18 +215,18 @@ bool PacketQueue::queuePacket(std::shared_ptr add_packet) { Debug(4, "packetqueue queuepacket, unlocked signalling"); condition.notify_all(); - return true; + return true; } // end bool PacketQueue::queuePacket(ZMPacket* zm_packet) void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { // Only do queueCleaning if we are adding a video keyframe, so that we guarantee that there is one. - // No good. Have to satisfy two conditions: + // No good. Have to satisfy two conditions: // 1. packetqueue starts with a video keyframe // 2. Have minimum # of video packets // 3. No packets can be locked // 4. No iterator can point to one of the packets // - // So start at the beginning, counting video packets until the next keyframe. + // So start at the beginning, counting video packets until the next keyframe. // Then if deleting those packets doesn't break 1 and 2, then go ahead and delete them. // // One assumption that we can make is that there will be packets in the queue. Because we call it while holding a locked packet @@ -239,14 +238,14 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { add_packet->keyframe and (packet_counts[video_stream_id] > pre_event_video_packet_count) - and + and *(pktQueue.begin()) != add_packet - ) + ) ) { Debug(3, "stream index %d ?= video_stream_id %d, keyframe %d, keep_keyframes %d, counts %d > pre_event_count %d at begin %d", - add_packet->packet->stream_index, video_stream_id, add_packet->keyframe, keep_keyframes, packet_counts[video_stream_id], pre_event_video_packet_count, - ( *(pktQueue.begin()) != add_packet ) - ); + add_packet->packet->stream_index, video_stream_id, add_packet->keyframe, keep_keyframes, packet_counts[video_stream_id], pre_event_video_packet_count, + ( *(pktQueue.begin()) != add_packet ) + ); return; } std::unique_lock lck(mutex); @@ -268,7 +267,7 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { if ((*it)->packet->stream_index == video_stream_id) ++tail_count; } - + --it; } } @@ -319,7 +318,7 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { delete lp; return; } // end if first packet not locked - + int video_packets_to_delete = 0; // This is a count of how many packets we will delete so we know when to stop looking ++it; delete lp; @@ -357,7 +356,7 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { ++video_packets_to_delete; if (packet_counts[video_stream_id] - video_packets_to_delete <= pre_event_video_packet_count + tail_count) { Debug(3, "Counted %d video packets. Which would leave %d in packetqueue tail count is %d", - video_packets_to_delete, packet_counts[video_stream_id]-video_packets_to_delete, tail_count); + video_packets_to_delete, packet_counts[video_stream_id]-video_packets_to_delete, tail_count); break; } } @@ -365,10 +364,10 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { } // end while Debug(1, "Resulting it pointing at latest packet? %d, next front points to begin? %d, Keyframe interval %d", - ( *it == add_packet ), - ( next_front == pktQueue.begin() ), - keyframe_interval_count - ); + ( *it == add_packet ), + ( next_front == pktQueue.begin() ), + keyframe_interval_count + ); if (next_front != pktQueue.begin()) { while (pktQueue.begin() != next_front) { zm_packet = *pktQueue.begin(); @@ -390,7 +389,7 @@ void PacketQueue::clearPackets(const std::shared_ptr &add_packet) { } } // end if have at least max_video_packet_count video packets remaining - return; + return; } // end voidPacketQueue::clearPackets(ZMPacket* zm_packet) void PacketQueue::stop() { @@ -416,13 +415,13 @@ void PacketQueue::clear() { ZMLockedPacket *lp = new ZMLockedPacket(packet); lp->lock(); Debug(1, - "Deleting a packet with stream index:%d image_index:%d with keyframe:%d, video frames in queue:%d max: %d, queuesize:%zu", - packet->packet->stream_index, - packet->image_index, - packet->keyframe, - packet_counts[video_stream_id], - pre_event_video_packet_count, - pktQueue.size()); + "Deleting a packet with stream index:%d image_index:%d with keyframe:%d, video frames in queue:%d max: %d, queuesize:%zu", + packet->packet->stream_index, + packet->image_index, + packet->keyframe, + packet_counts[video_stream_id], + pre_event_video_packet_count, + pktQueue.size()); packet_counts[packet->packet->stream_index] -= 1; pktQueue.pop_front(); delete lp; @@ -430,10 +429,10 @@ void PacketQueue::clear() { Debug(1, "Packetqueue is clear, deleting iterators"); for ( - std::list::iterator iterators_it = iterators.begin(); - iterators_it != iterators.end(); - ++iterators_it - ) { + std::list::iterator iterators_it = iterators.begin(); + iterators_it != iterators.end(); + ++iterators_it + ) { packetqueue_iterator *iterator_it = *iterators_it; *iterator_it = pktQueue.begin(); } // end foreach iterator @@ -467,7 +466,8 @@ ZMLockedPacket *PacketQueue::get_packet(packetqueue_iterator *it) { std::addressof(*it), (*it == pktQueue.end())); ZMLockedPacket *lp = nullptr; - { // scope for lock + { + // scope for lock std::unique_lock lck(mutex); Debug(4, "Have Lock in get_packet"); while (!lp) { @@ -483,7 +483,7 @@ ZMLockedPacket *PacketQueue::get_packet(packetqueue_iterator *it) { return nullptr; } Debug(3, "get_packet using it %p locking index %d", - std::addressof(*it), p->image_index); + std::addressof(*it), p->image_index); lp = new ZMLockedPacket(p); if (lp->trylock()) { @@ -513,7 +513,8 @@ ZMLockedPacket *PacketQueue::get_packet_and_increment_it(packetqueue_iterator *i std::addressof(*it), (*it == pktQueue.end())); ZMLockedPacket *lp = nullptr; - { // scope for lock + { + // scope for lock std::unique_lock lck(mutex); Debug(4, "Have Lock in get_packet"); while (!lp) { @@ -529,7 +530,7 @@ ZMLockedPacket *PacketQueue::get_packet_and_increment_it(packetqueue_iterator *i return nullptr; } Debug(3, "get_packet using it %p locking index %d", - std::addressof(*it), p->image_index); + std::addressof(*it), p->image_index); lp = new ZMLockedPacket(p); if (lp->trylock()) { @@ -591,9 +592,9 @@ bool PacketQueue::increment_it(packetqueue_iterator *it, int stream_id) { } // end bool PacketQueue::increment_it(packetqueue_iterator *it) packetqueue_iterator *PacketQueue::get_event_start_packet_it( - packetqueue_iterator snapshot_it, - unsigned int pre_event_count - ) { + packetqueue_iterator snapshot_it, + unsigned int pre_event_count +) { std::unique_lock lck(mutex); packetqueue_iterator *it = new packetqueue_iterator; @@ -685,7 +686,7 @@ packetqueue_iterator * PacketQueue::get_video_it(bool wait) { return nullptr; } Debug(1, "Packet keyframe %d for stream %d, so returning the it to it", - zm_packet->keyframe, zm_packet->packet->stream_index); + zm_packet->keyframe, zm_packet->packet->stream_index); if (zm_packet->keyframe and ( zm_packet->packet->stream_index == video_stream_id )) { Debug(1, "Found a keyframe for stream %d, so returning the it to it", video_stream_id); return it; @@ -698,10 +699,10 @@ packetqueue_iterator * PacketQueue::get_video_it(bool wait) { void PacketQueue::free_it(packetqueue_iterator *it) { for ( - std::list::iterator iterators_it = iterators.begin(); - iterators_it != iterators.end(); - ++iterators_it - ) { + std::list::iterator iterators_it = iterators.begin(); + iterators_it != iterators.end(); + ++iterators_it + ) { if ( *iterators_it == it ) { iterators.erase(iterators_it); break; @@ -711,10 +712,10 @@ void PacketQueue::free_it(packetqueue_iterator *it) { bool PacketQueue::is_there_an_iterator_pointing_to_packet(const std::shared_ptr &zm_packet) { for ( - std::list::iterator iterators_it = iterators.begin(); - iterators_it != iterators.end(); - ++iterators_it - ) { + std::list::iterator iterators_it = iterators.begin(); + iterators_it != iterators.end(); + ++iterators_it + ) { packetqueue_iterator *iterator_it = *iterators_it; if (*iterator_it == pktQueue.end()) { continue; diff --git a/src/zm_packetqueue.h b/src/zm_packetqueue.h index 52ec531f1..fb75ae46e 100644 --- a/src/zm_packetqueue.h +++ b/src/zm_packetqueue.h @@ -30,66 +30,66 @@ class ZMLockedPacket; typedef std::list>::iterator packetqueue_iterator; class PacketQueue { - private: // For now just to ease development - std::list> pktQueue; - std::list>::iterator analysis_it; + private: // For now just to ease development + std::list> pktQueue; + std::list>::iterator analysis_it; - int video_stream_id; - int max_video_packet_count; // allow a negative value to someday mean unlimited - // This is now a hard limit on the # of video packets to keep in the queue so that we can limit ram - int pre_event_video_packet_count; // Was max_video_packet_count - int max_stream_id; - int *packet_counts; /* packet count for each stream_id, to keep track of how many video vs audio packets are in the queue */ - bool deleting; - bool keep_keyframes; - std::list iterators; + int video_stream_id; + int max_video_packet_count; // allow a negative value to someday mean unlimited + // This is now a hard limit on the # of video packets to keep in the queue so that we can limit ram + int pre_event_video_packet_count; // Was max_video_packet_count + int max_stream_id; + int *packet_counts; /* packet count for each stream_id, to keep track of how many video vs audio packets are in the queue */ + bool deleting; + bool keep_keyframes; + std::list iterators; - std::mutex mutex; - std::condition_variable condition; - int warned_count; - bool has_out_of_order_packets_; - int max_keyframe_interval_; + std::mutex mutex; + std::condition_variable condition; + int warned_count; + bool has_out_of_order_packets_; + int max_keyframe_interval_; - public: - PacketQueue(); - virtual ~PacketQueue(); - std::list>::const_iterator end() const { return pktQueue.end(); } - std::list>::const_iterator begin() const { return pktQueue.begin(); } + public: + PacketQueue(); + virtual ~PacketQueue(); + std::list>::const_iterator end() const { return pktQueue.end(); } + std::list>::const_iterator begin() const { return pktQueue.begin(); } - int addStream(); - void setMaxVideoPackets(int p); - void setPreEventVideoPackets(int p); - void setKeepKeyframes(bool k) { keep_keyframes = k; }; + int addStream(); + void setMaxVideoPackets(int p); + void setPreEventVideoPackets(int p); + void setKeepKeyframes(bool k) { keep_keyframes = k; }; - bool queuePacket(std::shared_ptr packet); - void stop(); - bool stopping() const { return deleting; }; - void clear(); - void dumpQueue(); - unsigned int size(); - unsigned int get_packet_count(int stream_id) const { return packet_counts[stream_id]; }; - bool has_out_of_order_packets() const { return has_out_of_order_packets_; }; - int get_max_keyframe_interval() const { return max_keyframe_interval_; }; + bool queuePacket(std::shared_ptr packet); + void stop(); + bool stopping() const { return deleting; }; + void clear(); + void dumpQueue(); + unsigned int size(); + unsigned int get_packet_count(int stream_id) const { return packet_counts[stream_id]; }; + bool has_out_of_order_packets() const { return has_out_of_order_packets_; }; + int get_max_keyframe_interval() const { return max_keyframe_interval_; }; - void clearPackets(const std::shared_ptr &packet); - int packet_count(int stream_id); + void clearPackets(const std::shared_ptr &packet); + int packet_count(int stream_id); - bool increment_it(packetqueue_iterator *it); - bool increment_it(packetqueue_iterator *it, int stream_id); - ZMLockedPacket *get_packet(packetqueue_iterator *); - ZMLockedPacket *get_packet_and_increment_it(packetqueue_iterator *); - packetqueue_iterator *get_video_it(bool wait); - packetqueue_iterator *get_stream_it(int stream_id); - void free_it(packetqueue_iterator *); + bool increment_it(packetqueue_iterator *it); + bool increment_it(packetqueue_iterator *it, int stream_id); + ZMLockedPacket *get_packet(packetqueue_iterator *); + ZMLockedPacket *get_packet_and_increment_it(packetqueue_iterator *); + packetqueue_iterator *get_video_it(bool wait); + packetqueue_iterator *get_stream_it(int stream_id); + void free_it(packetqueue_iterator *); - packetqueue_iterator *get_event_start_packet_it( - packetqueue_iterator snapshot_it, - unsigned int pre_event_count - ); - bool is_there_an_iterator_pointing_to_packet(const std::shared_ptr &zm_packet); - void unlock(ZMLockedPacket *lp); - void notify_all(); - void wait(); + packetqueue_iterator *get_event_start_packet_it( + packetqueue_iterator snapshot_it, + unsigned int pre_event_count + ); + bool is_there_an_iterator_pointing_to_packet(const std::shared_ptr &zm_packet); + void unlock(ZMLockedPacket *lp); + void notify_all(); + void wait(); }; #endif /* ZM_PACKETQUEUE_H */ diff --git a/src/zm_poll_thread.cpp b/src/zm_poll_thread.cpp index ee46dbfe5..5aa637146 100644 --- a/src/zm_poll_thread.cpp +++ b/src/zm_poll_thread.cpp @@ -5,7 +5,7 @@ #include "zm_time.h" PollThread::PollThread(Monitor *monitor) : - monitor_(monitor), terminate_(false) { + monitor_(monitor), terminate_(false) { thread_ = std::thread(&PollThread::Run, this); } diff --git a/src/zm_poly.cpp b/src/zm_poly.cpp index 6485bc192..40f010db4 100644 --- a/src/zm_poly.cpp +++ b/src/zm_poly.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Polygon Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_poly.h" @@ -64,9 +64,9 @@ void Polygon::UpdateCentre() { double float_y = 0.0; for (size_t i = 0, j = vertices_.size() - 1; i < vertices_.size(); j = i++) { float_x += ((vertices_[i].y_ - vertices_[j].y_) - * ((vertices_[i].x_ * 2) + (vertices_[i].x_ * vertices_[j].x_) + (vertices_[j].x_ * 2))); + * ((vertices_[i].x_ * 2) + (vertices_[i].x_ * vertices_[j].x_) + (vertices_[j].x_ * 2))); float_y += ((vertices_[j].x_ - vertices_[i].x_) - * ((vertices_[i].y_ * 2) + (vertices_[i].y_ * vertices_[j].y_) + (vertices_[j].y_ * 2))); + * ((vertices_[i].y_ * 2) + (vertices_[i].y_ * vertices_[j].y_) + (vertices_[j].y_ * 2))); } float_x /= (6 * area); float_y /= (6 * area); @@ -78,7 +78,7 @@ bool Polygon::Contains(const Vector2 &coord) const { bool inside = false; for (size_t i = 0, j = vertices_.size() - 1; i < vertices_.size(); j = i++) { if ((((vertices_[i].y_ <= coord.y_) && (coord.y_ < vertices_[j].y_)) || ((vertices_[j].y_ <= coord.y_) && (coord.y_ < vertices_[i].y_))) - && (coord.x_ < (vertices_[j].x_ - vertices_[i].x_) * (coord.y_ - vertices_[i].y_) / (vertices_[j].y_ - vertices_[i].y_) + vertices_[i].x_)) { + && (coord.x_ < (vertices_[j].x_ - vertices_[i].x_) * (coord.y_ - vertices_[i].y_) / (vertices_[j].y_ - vertices_[i].y_) + vertices_[i].x_)) { inside = !inside; } } diff --git a/src/zm_poly.h b/src/zm_poly.h index c25033262..a73f0259c 100644 --- a/src/zm_poly.h +++ b/src/zm_poly.h @@ -1,21 +1,21 @@ // // ZoneMinder Polygon Class Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_POLY_H #define ZM_POLY_H diff --git a/src/zm_regexp.cpp b/src/zm_regexp.cpp index 1541b31ef..80e9a6a8b 100644 --- a/src/zm_regexp.cpp +++ b/src/zm_regexp.cpp @@ -1,17 +1,17 @@ /* * ZoneMinder regular expression class implementation, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -24,23 +24,19 @@ #if HAVE_LIBPCRE -RegExpr::RegExpr( const char *pattern, int flags, int p_max_matches ) : max_matches( p_max_matches ), match_buffers( nullptr ), match_lengths( nullptr ), match_valid( nullptr ) -{ +RegExpr::RegExpr( const char *pattern, int flags, int p_max_matches ) : max_matches( p_max_matches ), match_buffers( nullptr ), match_lengths( nullptr ), match_valid( nullptr ) { const char *errstr; int erroffset = 0; - if ( !(regex = pcre_compile( pattern, flags, &errstr, &erroffset, 0 )) ) - { + if ( !(regex = pcre_compile( pattern, flags, &errstr, &erroffset, 0 )) ) { Panic( "pcre_compile(%s): %s at %d", pattern, errstr, erroffset ); } regextra = pcre_study( regex, 0, &errstr ); - if ( errstr ) - { + if ( errstr ) { Panic( "pcre_study(%s): %s", pattern, errstr ); } - if ( (ok = (bool)regex) ) - { + if ( (ok = (bool)regex) ) { match_vectors = new int[3*max_matches]; memset( match_vectors, 0, sizeof(*match_vectors)*3*max_matches ); match_buffers = new char *[max_matches]; @@ -56,12 +52,9 @@ RegExpr::RegExpr( const char *pattern, int flags, int p_max_matches ) : max_matc n_matches = 0; } -RegExpr::~RegExpr() -{ - for ( int i = 0; i < max_matches; i++ ) - { - if ( match_buffers[i] ) - { +RegExpr::~RegExpr() { + for ( int i = 0; i < max_matches; i++ ) { + if ( match_buffers[i] ) { delete[] match_buffers[i]; } } @@ -71,39 +64,31 @@ RegExpr::~RegExpr() delete[] match_vectors; } -int RegExpr::Match( const char *subject_string, int subject_length, int flags ) -{ +int RegExpr::Match( const char *subject_string, int subject_length, int flags ) { match_string = subject_string; n_matches = pcre_exec( regex, regextra, subject_string, subject_length, 0, flags, match_vectors, 2*max_matches ); - if ( n_matches <= 0 ) - { - if ( n_matches < PCRE_ERROR_NOMATCH ) - { + if ( n_matches <= 0 ) { + if ( n_matches < PCRE_ERROR_NOMATCH ) { Error( "Error %d executing regular expression", n_matches ); } return( n_matches = 0 ); } - for( int i = 0; i < max_matches; i++ ) - { + for( int i = 0; i < max_matches; i++ ) { match_valid[i] = false; } return( n_matches ); } -const char *RegExpr::MatchString( int match_index ) const -{ - if ( match_index > n_matches ) - { +const char *RegExpr::MatchString( int match_index ) const { + if ( match_index > n_matches ) { return( 0 ); } - if ( !match_valid[match_index] ) - { + if ( !match_valid[match_index] ) { int match_len = match_vectors[(2*match_index)+1]-match_vectors[2*match_index]; - if ( match_lengths[match_index] < (match_len+1) ) - { + if ( match_lengths[match_index] < (match_len+1) ) { delete[] match_buffers[match_index]; match_buffers[match_index] = new char[match_len+1]; match_lengths[match_index] = match_len+1; @@ -115,10 +100,8 @@ const char *RegExpr::MatchString( int match_index ) const return( match_buffers[match_index] ); } -int RegExpr::MatchLength( int match_index ) const -{ - if ( match_index > n_matches ) - { +int RegExpr::MatchLength( int match_index ) const { + if ( match_index > n_matches ) { return( 0 ); } return( match_vectors[(2*match_index)+1]-match_vectors[2*match_index] ); diff --git a/src/zm_regexp.h b/src/zm_regexp.h index 9c9ec5675..0568d441b 100644 --- a/src/zm_regexp.h +++ b/src/zm_regexp.h @@ -1,21 +1,21 @@ /* * ZoneMinder Regular Expression Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #ifndef ZM_REGEXP_H #define ZM_REGEXP_H @@ -32,9 +32,8 @@ #error Unable to locate pcre.h, please do 'locate pcre.h' and report location to zoneminder.com #endif -class RegExpr -{ -protected: +class RegExpr { + protected: pcre *regex; pcre_extra *regextra; int max_matches; @@ -43,14 +42,14 @@ protected: int *match_lengths; bool *match_valid; -protected: + protected: const char *match_string; int n_matches; - -protected: + + protected: bool ok; -public: + public: explicit RegExpr( const char *pattern, int cflags=0, int p_max_matches=32 ); ~RegExpr(); bool Ok() const { return( ok ); } diff --git a/src/zm_remote_camera.cpp b/src/zm_remote_camera.cpp index a4f6443c0..032ec6bb1 100644 --- a/src/zm_remote_camera.cpp +++ b/src/zm_remote_camera.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Remote Camera Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_remote_camera.h" @@ -41,20 +41,19 @@ RemoteCamera::RemoteCamera( int p_colour, bool p_capture, bool p_record_audio - ) : - Camera(monitor, REMOTE_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture, p_record_audio), - protocol(p_protocol), - host(p_host), - port(p_port), - path(p_path), - username(p_user), - password(p_pass), - hp(nullptr), - mNeedAuth(false), - mAuthenticator(nullptr) -{ - if (path[0] != '/') - path = '/'+path; +) : + Camera(monitor, REMOTE_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture, p_record_audio), + protocol(p_protocol), + host(p_host), + port(p_port), + path(p_path), + username(p_user), + password(p_pass), + hp(nullptr), + mNeedAuth(false), + mAuthenticator(nullptr) { + if (path[0] != '/') + path = '/'+path; } RemoteCamera::~RemoteCamera() { @@ -62,21 +61,21 @@ RemoteCamera::~RemoteCamera() { freeaddrinfo(hp); hp = nullptr; } - delete mAuthenticator; + delete mAuthenticator; } void RemoteCamera::Initialise() { if (protocol.empty()) Fatal("No protocol specified for remote camera"); - if (host.empty()) - Fatal("No host specified for remote camera"); + if (host.empty()) + Fatal("No host specified for remote camera"); - if (port.empty()) - Fatal("No port specified for remote camera"); + if (port.empty()) + Fatal("No port specified for remote camera"); - // Cache as much as we can to speed things up + // Cache as much as we can to speed things up std::string::size_type authIndex = host.rfind('@'); if (authIndex != std::string::npos) { @@ -94,12 +93,12 @@ void RemoteCamera::Initialise() { } mNeedAuth = false; - mAuthenticator = new zm::Authenticator(username, password); + mAuthenticator = new zm::Authenticator(username, password); - struct addrinfo hints; - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; + struct addrinfo hints; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; int ret = getaddrinfo(host.c_str(), port.c_str(), &hints, &hp); if (ret != 0) { @@ -119,7 +118,7 @@ int RemoteCamera::Read( int fd, char *buf, int size ) { while ( ReceivedBytes < size ) { // recv blocks until we get data, but it may be of ARBITRARY LENGTH and INCOMPLETE int bytes_to_recv = size - ReceivedBytes; - if ( SOCKET_BUF_SIZE < bytes_to_recv ) + if ( SOCKET_BUF_SIZE < bytes_to_recv ) bytes_to_recv = SOCKET_BUF_SIZE; //Debug(3, "Aiming to receive %d of %d bytes", bytes_to_recv, size ); int bytes = recv(fd, &buf[ReceivedBytes], bytes_to_recv, 0); //socket, buffer, len, flags diff --git a/src/zm_remote_camera.h b/src/zm_remote_camera.h index 971f33ad3..6e43a8ad0 100644 --- a/src/zm_remote_camera.h +++ b/src/zm_remote_camera.h @@ -1,21 +1,21 @@ // // ZoneMinder Remote Camera Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_REMOTE_CAMERA_H #define ZM_REMOTE_CAMERA_H @@ -31,7 +31,7 @@ // accessed over a network connection. // class RemoteCamera : public Camera { -protected: + protected: std::string protocol; std::string host; std::string port; @@ -50,7 +50,7 @@ protected: bool mNeedAuth; zm::Authenticator* mAuthenticator; -public: + public: RemoteCamera( const Monitor *monitor, const std::string &p_proto, diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index f70b17fa8..233a5dae2 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Remote Camera Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_remote_camera_http.h" @@ -76,8 +76,7 @@ RemoteCameraHttp::RemoteCameraHttp( p_hue, p_colour, p_capture, - p_record_audio ) -{ + p_record_audio ) { sd = -1; timeout.tv_sec = 0; @@ -117,7 +116,7 @@ void RemoteCameraHttp::Initialise() { } if ( !timeout.tv_sec ) { - timeout.tv_sec = config.http_timeout/1000; + timeout.tv_sec = config.http_timeout/1000; timeout.tv_usec = (config.http_timeout%1000)*1000; } @@ -130,18 +129,18 @@ void RemoteCameraHttp::Initialise() { state = HEADER; #if HAVE_LIBPCRE - if ( method == REGEXP ) { - if ( !header_expr ) - header_expr = new RegExpr("^(.+?\r?\n\r?\n)", PCRE_DOTALL); - if ( !status_expr ) - status_expr = new RegExpr("^HTTP/(1\\.[01]) +([0-9]+) +(.+?)\r?\n", PCRE_CASELESS); - if ( !connection_expr ) - connection_expr = new RegExpr("Connection: ?(.+?)\r?\n", PCRE_CASELESS); - if ( !content_length_expr ) - content_length_expr = new RegExpr("Content-length: ?([0-9]+)\r?\n", PCRE_CASELESS); - if ( !content_type_expr ) - content_type_expr = new RegExpr("Content-type: ?(.+?)(?:; ?boundary=\x22?(.+?)\x22?)?\r?\n", PCRE_CASELESS); - } + if ( method == REGEXP ) { + if ( !header_expr ) + header_expr = new RegExpr("^(.+?\r?\n\r?\n)", PCRE_DOTALL); + if ( !status_expr ) + status_expr = new RegExpr("^HTTP/(1\\.[01]) +([0-9]+) +(.+?)\r?\n", PCRE_CASELESS); + if ( !connection_expr ) + connection_expr = new RegExpr("Connection: ?(.+?)\r?\n", PCRE_CASELESS); + if ( !content_length_expr ) + content_length_expr = new RegExpr("Content-length: ?([0-9]+)\r?\n", PCRE_CASELESS); + if ( !content_type_expr ) + content_type_expr = new RegExpr("Content-type: ?(.+?)(?:; ?boundary=\x22?(.+?)\x22?)?\r?\n", PCRE_CASELESS); + } #endif } // end void RemoteCameraHttp::Initialise() @@ -168,7 +167,7 @@ int RemoteCameraHttp::Connect() { sd = -1; char buf[sizeof(struct in6_addr)]; struct sockaddr_in *addr; - addr = (struct sockaddr_in *)p->ai_addr; + addr = (struct sockaddr_in *)p->ai_addr; inet_ntop( AF_INET, &(addr->sin_addr), buf, INET6_ADDRSTRLEN ); Warning("Can't connect to remote camera mid: %d at %s: %s", monitor->Id(), buf, strerror(errno)); @@ -270,7 +269,7 @@ int RemoteCameraHttp::ReadData(Buffer &buffer, unsigned int bytes_expected) { return -1; } // Case where we are grabbing a single jpg, but no content-length was given, so the expectation is that we read until close. - return 0; + return 0; } // If socket is closed locally, then select will fail, but if it is closed remotely // then we have an exception on our socket.. but no data. @@ -346,231 +345,228 @@ int RemoteCameraHttp::GetResponse() { while ( !zm_terminate ) { switch( state ) { - case HEADER : - { - int buffer_len = GetData(); - if ( buffer_len < 0 ) { - Error("Unable to read header data"); - return -1; - } - bytes += buffer_len; - if ( header_expr->Match( (char*)buffer, buffer.size() ) == 2 ) { - header = header_expr->MatchString( 1 ); - header_len = header_expr->MatchLength( 1 ); - Debug(4, "Captured header (%d bytes):\n'%s'", header_len, header); + case HEADER : { + int buffer_len = GetData(); + if ( buffer_len < 0 ) { + Error("Unable to read header data"); + return -1; + } + bytes += buffer_len; + if ( header_expr->Match( (char*)buffer, buffer.size() ) == 2 ) { + header = header_expr->MatchString( 1 ); + header_len = header_expr->MatchLength( 1 ); + Debug(4, "Captured header (%d bytes):\n'%s'", header_len, header); - if ( status_expr->Match( header, header_len ) < 4 ) { - Error( "Unable to extract HTTP status from header" ); - return( -1 ); - } - http_version = status_expr->MatchString( 1 ); - status_code = atoi( status_expr->MatchString( 2 ) ); - status_mesg = status_expr->MatchString( 3 ); - - if ( status_code == 401 ) { - if ( mNeedAuth ) { - Error( "Failed authentication: " ); - return( -1 ); - } - mNeedAuth = true; - std::string Header = header; - - mAuthenticator->checkAuthResponse(Header); - if ( mAuthenticator->auth_method() == zm::AUTH_DIGEST ) { - Debug( 2, "Need Digest Authentication" ); - request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); - request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); - request += stringtf( "Host: %s\r\n", host.c_str()); - if ( strcmp( config.http_version, "1.0" ) == 0 ) - request += "Connection: Keep-Alive\r\n"; - request += mAuthenticator->getAuthHeader("GET", path); - request += "\r\n"; - - Debug( 2, "New request header: %s", request.c_str() ); - return( 0 ); - } - - } else if ( status_code < 200 || status_code > 299 ) { - Error( "Invalid response status %d: %s\n%s", status_code, status_mesg, (char *)buffer ); - return( -1 ); - } - Debug( 3, "Got status '%d' (%s), http version %s", status_code, status_mesg, http_version ); - - if ( connection_expr->Match( header, header_len ) == 2 ) { - connection_type = connection_expr->MatchString( 1 ); - Debug( 3, "Got connection '%s'", connection_type ); - } - - if ( content_length_expr->Match( header, header_len ) == 2 ) { - content_length = atoi( content_length_expr->MatchString( 1 ) ); - Debug( 3, "Got content length '%d'", content_length ); - } - - if ( content_type_expr->Match( header, header_len ) >= 2 ) { - content_type = content_type_expr->MatchString( 1 ); - Debug( 3, "Got content type '%s'\n", content_type ); - if ( content_type_expr->MatchCount() > 2 ) { - content_boundary = content_type_expr->MatchString( 2 ); - Debug( 3, "Got content boundary '%s'", content_boundary ); - } - } - - if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) ) { - // Single image - mode = SINGLE_IMAGE; - format = JPEG; - state = CONTENT; - } else if ( !strcasecmp( content_type, "application/octet-stream" ) ) { - // Single image - mode = SINGLE_IMAGE; - format = JPEG; - state = CONTENT; - } else if ( !strcasecmp( content_type, "image/x-rgb" ) ) { - // Single image - mode = SINGLE_IMAGE; - format = X_RGB; - state = CONTENT; - } else if ( !strcasecmp( content_type, "image/x-rgbz" ) ) { - // Single image - mode = SINGLE_IMAGE; - format = X_RGBZ; - state = CONTENT; - } else if ( !strcasecmp( content_type, "multipart/x-mixed-replace" ) ) { - // Image stream, so start processing - if ( !content_boundary[0] ) { - Error( "No content boundary found in header '%s'", header ); - return( -1 ); - } - mode = MULTI_IMAGE; - state = SUBHEADER; - } - //else if ( !strcasecmp( content_type, "video/mpeg" ) || !strcasecmp( content_type, "video/mpg" ) ) - //{ - //// MPEG stream, coming soon! - //} - else { - Error("Unrecognised content type '%s'", content_type); - return -1; - } - buffer.consume(header_len); - } else { - Debug(3, "Unable to extract header from stream, retrying"); - //return( -1 ); - } - break; + if ( status_expr->Match( header, header_len ) < 4 ) { + Error( "Unable to extract HTTP status from header" ); + return( -1 ); } - case SUBHEADER : - { - static RegExpr *subheader_expr = nullptr; - static RegExpr *subcontent_length_expr = nullptr; - static RegExpr *subcontent_type_expr = nullptr; + http_version = status_expr->MatchString( 1 ); + status_code = atoi( status_expr->MatchString( 2 ) ); + status_mesg = status_expr->MatchString( 3 ); - if ( !subheader_expr ) { - char subheader_pattern[256] = ""; - snprintf( subheader_pattern, sizeof(subheader_pattern), "^((?:\r?\n){0,2}?(?:--)?%s\r?\n.+?\r?\n\r?\n)", content_boundary ); - subheader_expr = new RegExpr( subheader_pattern, PCRE_DOTALL ); - } - if ( subheader_expr->Match( (char *)buffer, (int)buffer ) == 2 ) { - subheader = subheader_expr->MatchString( 1 ); - subheader_len = subheader_expr->MatchLength( 1 ); - Debug( 4, "Captured subheader (%d bytes):'%s'", subheader_len, subheader ); - - if ( !subcontent_length_expr ) - subcontent_length_expr = new RegExpr( "Content-length: ?([0-9]+)\r?\n", PCRE_CASELESS ); - if ( subcontent_length_expr->Match( subheader, subheader_len ) == 2 ) { - content_length = atoi( subcontent_length_expr->MatchString( 1 ) ); - Debug( 3, "Got subcontent length '%d'", content_length ); - } - - if ( !subcontent_type_expr ) - subcontent_type_expr = new RegExpr( "Content-type: ?(.+?)\r?\n", PCRE_CASELESS ); - if ( subcontent_type_expr->Match( subheader, subheader_len ) == 2 ) { - content_type = subcontent_type_expr->MatchString( 1 ); - Debug( 3, "Got subcontent type '%s'", content_type ); - } - - buffer.consume( subheader_len ); - state = CONTENT; - } else { - Debug( 3, "Unable to extract subheader from stream, retrying" ); - int buffer_len = GetData(); - if ( buffer_len < 0 ) { - Error( "Unable to extract subheader data" ); - return( -1 ); - } - bytes += buffer_len; - } - break; - } - case CONTENT : - { - - // if content_type is something like image/jpeg;size=, this will strip the ;size= - char * semicolon = strchr( (char *)content_type, ';' ); - if ( semicolon ) { - *semicolon = '\0'; - } - - if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) ) { - format = JPEG; - } else if ( !strcasecmp( content_type, "application/octet-stream" ) ) { - format = JPEG; - } else if ( !strcasecmp( content_type, "image/x-rgb" ) ) { - format = X_RGB; - } else if ( !strcasecmp( content_type, "image/x-rgbz" ) ) { - format = X_RGBZ; - } else { - Error( "Found unsupported content type '%s'", content_type ); + if ( status_code == 401 ) { + if ( mNeedAuth ) { + Error( "Failed authentication: " ); return( -1 ); } + mNeedAuth = true; + std::string Header = header; - if (content_length) { - while (((long)buffer.size() < content_length ) and !zm_terminate) { - Debug(3, "Need more data buffer %d < content length %d", buffer.size(), content_length); - int bytes_read = ReadData(buffer, content_length - buffer.size()); + mAuthenticator->checkAuthResponse(Header); + if ( mAuthenticator->auth_method() == zm::AUTH_DIGEST ) { + Debug( 2, "Need Digest Authentication" ); + request = stringtf( "GET %s HTTP/%s\r\n", path.c_str(), config.http_version ); + request += stringtf( "User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION ); + request += stringtf( "Host: %s\r\n", host.c_str()); + if ( strcmp( config.http_version, "1.0" ) == 0 ) + request += "Connection: Keep-Alive\r\n"; + request += mAuthenticator->getAuthHeader("GET", path); + request += "\r\n"; - if (bytes_read < 0) { - Error("Unable to read content"); - return -1; - } - bytes += bytes_read; - } - Debug(3, "Got end of image by length, content-length = %d", content_length); - } else { - while (!content_length) { - int buffer_len = GetData(); - if (buffer_len < 0) { - Error("Unable to read content"); - return -1; - } - bytes += buffer_len; - static RegExpr *content_expr = 0; - if (mode == MULTI_IMAGE) { - if (!content_expr) { - char content_pattern[256] = ""; - snprintf(content_pattern, sizeof(content_pattern), "^(.+?)(?:\r?\n)*(?:--)?%s\r?\n", content_boundary); - content_expr = new RegExpr(content_pattern, PCRE_DOTALL); - } - if (content_expr->Match( buffer, buffer.size()) == 2) { - content_length = content_expr->MatchLength( 1 ); - Debug(3, "Got end of image by pattern, content-length = %d", content_length); - } - } - } + Debug( 2, "New request header: %s", request.c_str() ); + return( 0 ); } - if ( mode == SINGLE_IMAGE ) { - state = HEADER; - Disconnect(); - } else { - state = SUBHEADER; - } - Debug( 3, "Returning %d (%d) bytes of captured content", content_length, buffer.size() ); - return content_length; + + } else if ( status_code < 200 || status_code > 299 ) { + Error( "Invalid response status %d: %s\n%s", status_code, status_mesg, (char *)buffer ); + return( -1 ); } - case HEADERCONT : - case SUBHEADERCONT : - // Ignore - break; + Debug( 3, "Got status '%d' (%s), http version %s", status_code, status_mesg, http_version ); + + if ( connection_expr->Match( header, header_len ) == 2 ) { + connection_type = connection_expr->MatchString( 1 ); + Debug( 3, "Got connection '%s'", connection_type ); + } + + if ( content_length_expr->Match( header, header_len ) == 2 ) { + content_length = atoi( content_length_expr->MatchString( 1 ) ); + Debug( 3, "Got content length '%d'", content_length ); + } + + if ( content_type_expr->Match( header, header_len ) >= 2 ) { + content_type = content_type_expr->MatchString( 1 ); + Debug( 3, "Got content type '%s'\n", content_type ); + if ( content_type_expr->MatchCount() > 2 ) { + content_boundary = content_type_expr->MatchString( 2 ); + Debug( 3, "Got content boundary '%s'", content_boundary ); + } + } + + if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) ) { + // Single image + mode = SINGLE_IMAGE; + format = JPEG; + state = CONTENT; + } else if ( !strcasecmp( content_type, "application/octet-stream" ) ) { + // Single image + mode = SINGLE_IMAGE; + format = JPEG; + state = CONTENT; + } else if ( !strcasecmp( content_type, "image/x-rgb" ) ) { + // Single image + mode = SINGLE_IMAGE; + format = X_RGB; + state = CONTENT; + } else if ( !strcasecmp( content_type, "image/x-rgbz" ) ) { + // Single image + mode = SINGLE_IMAGE; + format = X_RGBZ; + state = CONTENT; + } else if ( !strcasecmp( content_type, "multipart/x-mixed-replace" ) ) { + // Image stream, so start processing + if ( !content_boundary[0] ) { + Error( "No content boundary found in header '%s'", header ); + return( -1 ); + } + mode = MULTI_IMAGE; + state = SUBHEADER; + } + //else if ( !strcasecmp( content_type, "video/mpeg" ) || !strcasecmp( content_type, "video/mpg" ) ) + //{ + //// MPEG stream, coming soon! + //} + else { + Error("Unrecognised content type '%s'", content_type); + return -1; + } + buffer.consume(header_len); + } else { + Debug(3, "Unable to extract header from stream, retrying"); + //return( -1 ); + } + break; + } + case SUBHEADER : { + static RegExpr *subheader_expr = nullptr; + static RegExpr *subcontent_length_expr = nullptr; + static RegExpr *subcontent_type_expr = nullptr; + + if ( !subheader_expr ) { + char subheader_pattern[256] = ""; + snprintf( subheader_pattern, sizeof(subheader_pattern), "^((?:\r?\n){0,2}?(?:--)?%s\r?\n.+?\r?\n\r?\n)", content_boundary ); + subheader_expr = new RegExpr( subheader_pattern, PCRE_DOTALL ); + } + if ( subheader_expr->Match( (char *)buffer, (int)buffer ) == 2 ) { + subheader = subheader_expr->MatchString( 1 ); + subheader_len = subheader_expr->MatchLength( 1 ); + Debug( 4, "Captured subheader (%d bytes):'%s'", subheader_len, subheader ); + + if ( !subcontent_length_expr ) + subcontent_length_expr = new RegExpr( "Content-length: ?([0-9]+)\r?\n", PCRE_CASELESS ); + if ( subcontent_length_expr->Match( subheader, subheader_len ) == 2 ) { + content_length = atoi( subcontent_length_expr->MatchString( 1 ) ); + Debug( 3, "Got subcontent length '%d'", content_length ); + } + + if ( !subcontent_type_expr ) + subcontent_type_expr = new RegExpr( "Content-type: ?(.+?)\r?\n", PCRE_CASELESS ); + if ( subcontent_type_expr->Match( subheader, subheader_len ) == 2 ) { + content_type = subcontent_type_expr->MatchString( 1 ); + Debug( 3, "Got subcontent type '%s'", content_type ); + } + + buffer.consume( subheader_len ); + state = CONTENT; + } else { + Debug( 3, "Unable to extract subheader from stream, retrying" ); + int buffer_len = GetData(); + if ( buffer_len < 0 ) { + Error( "Unable to extract subheader data" ); + return( -1 ); + } + bytes += buffer_len; + } + break; + } + case CONTENT : { + + // if content_type is something like image/jpeg;size=, this will strip the ;size= + char * semicolon = strchr( (char *)content_type, ';' ); + if ( semicolon ) { + *semicolon = '\0'; + } + + if ( !strcasecmp( content_type, "image/jpeg" ) || !strcasecmp( content_type, "image/jpg" ) ) { + format = JPEG; + } else if ( !strcasecmp( content_type, "application/octet-stream" ) ) { + format = JPEG; + } else if ( !strcasecmp( content_type, "image/x-rgb" ) ) { + format = X_RGB; + } else if ( !strcasecmp( content_type, "image/x-rgbz" ) ) { + format = X_RGBZ; + } else { + Error( "Found unsupported content type '%s'", content_type ); + return( -1 ); + } + + if (content_length) { + while (((long)buffer.size() < content_length ) and !zm_terminate) { + Debug(3, "Need more data buffer %d < content length %d", buffer.size(), content_length); + int bytes_read = ReadData(buffer, content_length - buffer.size()); + + if (bytes_read < 0) { + Error("Unable to read content"); + return -1; + } + bytes += bytes_read; + } + Debug(3, "Got end of image by length, content-length = %d", content_length); + } else { + while (!content_length) { + int buffer_len = GetData(); + if (buffer_len < 0) { + Error("Unable to read content"); + return -1; + } + bytes += buffer_len; + static RegExpr *content_expr = 0; + if (mode == MULTI_IMAGE) { + if (!content_expr) { + char content_pattern[256] = ""; + snprintf(content_pattern, sizeof(content_pattern), "^(.+?)(?:\r?\n)*(?:--)?%s\r?\n", content_boundary); + content_expr = new RegExpr(content_pattern, PCRE_DOTALL); + } + if (content_expr->Match( buffer, buffer.size()) == 2) { + content_length = content_expr->MatchLength( 1 ); + Debug(3, "Got end of image by pattern, content-length = %d", content_length); + } + } + } + } + if ( mode == SINGLE_IMAGE ) { + state = HEADER; + Disconnect(); + } else { + state = SUBHEADER; + } + Debug( 3, "Returning %d (%d) bytes of captured content", content_length, buffer.size() ); + return content_length; + } + case HEADERCONT : + case SUBHEADERCONT : + // Ignore + break; } } } else @@ -625,443 +621,441 @@ int RemoteCameraHttp::GetResponse() { while (!zm_terminate) { switch (state) { - case HEADER : - n_headers = 0; - http_header = nullptr; - connection_header = nullptr; - content_length_header = nullptr; - content_type_header = nullptr; - authenticate_header = nullptr; + case HEADER : + n_headers = 0; + http_header = nullptr; + connection_header = nullptr; + content_length_header = nullptr; + content_type_header = nullptr; + authenticate_header = nullptr; - http_version[0] = '\0'; - status_code [0]= '\0'; - status_mesg [0]= '\0'; - connection_type [0]= '\0'; - content_length = 0; - content_type[0] = '\0'; - content_boundary[0] = '\0'; - content_boundary_len = 0; - FALLTHROUGH; - case HEADERCONT : - { - int buffer_len = GetData(); + http_version[0] = '\0'; + status_code [0]= '\0'; + status_mesg [0]= '\0'; + connection_type [0]= '\0'; + content_length = 0; + content_type[0] = '\0'; + content_boundary[0] = '\0'; + content_boundary_len = 0; + FALLTHROUGH; + case HEADERCONT : { + int buffer_len = GetData(); + if (buffer_len < 0) { + Error("Unable to read header"); + return -1; + } + bytes += buffer_len; + + char *crlf = nullptr; + char *header_ptr = buffer; + int header_len = buffer.size(); + bool all_headers = false; + + while (!zm_terminate) { + int crlf_len = memspn(header_ptr, "\r\n", header_len); + if (n_headers) { + if ( + (crlf_len == 2 && !strncmp(header_ptr, "\n\n", crlf_len)) + || + (crlf_len == 4 && !strncmp(header_ptr, "\r\n\r\n", crlf_len)) + ) { + Debug(3, "Have double linefeed, done headers"); + *header_ptr = '\0'; + header_ptr += crlf_len; + header_len -= buffer.consume(header_ptr-(char *)buffer); + all_headers = true; + break; + } + } + if (crlf_len) { + if (header_len == crlf_len) { + break; + } else { + *header_ptr = '\0'; + header_ptr += crlf_len; + header_len -= buffer.consume(header_ptr-(char *)buffer); + } + } + + Debug(6, "%s", header_ptr); + if ((crlf = mempbrk(header_ptr, "\r\n", header_len))) { + //headers[n_headers++] = header_ptr; + n_headers++; + + if (!http_header && (strncasecmp(header_ptr, http_match, http_match_len) == 0)) { + http_header = header_ptr+http_match_len; + Debug(6, "Got http header '%s'", header_ptr); + } else if ( !connection_header && (strncasecmp(header_ptr, connection_match, connection_match_len) == 0) ) { + connection_header = header_ptr+connection_match_len; + Debug(6, "Got connection header '%s'", header_ptr); + } else if ( !content_length_header && (strncasecmp(header_ptr, content_length_match, content_length_match_len) == 0) ) { + content_length_header = header_ptr+content_length_match_len; + Debug(6, "Got content length header '%s'", header_ptr); + } else if ( !authenticate_header && (strncasecmp(header_ptr, authenticate_match, authenticate_match_len) == 0) ) { + authenticate_header = header_ptr; + Debug(6, "Got authenticate header '%s'", header_ptr); + } else if ( !content_type_header && (strncasecmp(header_ptr, content_type_match, content_type_match_len) == 0) ) { + content_type_header = header_ptr+content_type_match_len; + Debug(6, "Got content type header '%s'", header_ptr); + } else { + Debug(6, "Got ignored header '%s'", header_ptr); + } + header_ptr = crlf; + header_len -= buffer.consume(header_ptr-(char *)buffer); + } else { + // No end of line found + break; + } + } // end while search for headers + + if (all_headers) { + char *start_ptr, *end_ptr; + + if (!http_header) { + Error("Unable to extract HTTP status from header"); + return -1; + } + + start_ptr = http_header; + end_ptr = start_ptr+strspn(start_ptr, "10."); + + // FIXME Why are we memsetting every time? Can we not do it once? + //memset(http_version, 0, sizeof(http_version)); + strncpy(http_version, start_ptr, end_ptr-start_ptr); + + start_ptr = end_ptr; + start_ptr += strspn(start_ptr, " "); + end_ptr = start_ptr+strspn(start_ptr, "0123456789"); + + memset(status_code, 0, sizeof(status_code)); + strncpy(status_code, start_ptr, end_ptr-start_ptr); + int status = atoi(status_code); + + start_ptr = end_ptr; + start_ptr += strspn(start_ptr, " "); + strcpy(status_mesg, start_ptr); + + if (status == 401) { + if (mNeedAuth) { + Error("Failed authentication"); + return -1; + } + if (!authenticate_header) { + Error("Failed authentication, but don't have an authentication header."); + return -1; + } + mNeedAuth = true; + std::string Header = authenticate_header; + Debug(2, "Checking for digest auth in %s", authenticate_header); + + mAuthenticator->checkAuthResponse(Header); + if (mAuthenticator->auth_method() == zm::AUTH_DIGEST) { + Debug(2, "Need Digest Authentication"); + request = stringtf("GET %s HTTP/%s\r\n", path.c_str(), config.http_version); + request += stringtf("User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION); + request += stringtf("Host: %s\r\n", host.c_str()); + if ( strcmp(config.http_version, "1.0") == 0 ) + request += "Connection: Keep-Alive\r\n"; + request += mAuthenticator->getAuthHeader("GET", path); + request += "\r\n"; + + Debug(2, "New request header: %s", request.c_str()); + return 0; + } else { + Debug(2, "Need some other kind of Authentication"); + } + } else if (status < 200 || status > 299) { + Error("Invalid response status %s: %s", status_code, status_mesg); + return -1; + } + Debug(3, "Got status '%d' (%s), http version %s", status, status_mesg, http_version); + + if (connection_header) { + memset(connection_type, 0, sizeof(connection_type)); + start_ptr = connection_header + strspn(connection_header, " "); + // FIXME Should we not use strncpy? + strcpy(connection_type, start_ptr); + Debug(3, "Got connection '%s'", connection_type); + } + if (content_length_header) { + start_ptr = content_length_header + strspn(content_length_header, " "); + content_length = atoi(start_ptr); + Debug(3, "Got content length '%d'", content_length); + } + if (content_type_header) { + //memset(content_type, 0, sizeof(content_type)); + start_ptr = content_type_header + strspn(content_type_header, " "); + if ( (end_ptr = strchr(start_ptr, ';')) ) { + strncpy(content_type, start_ptr, end_ptr-start_ptr); + Debug(3, "Got content type '%s'", content_type); + + start_ptr = end_ptr + strspn(end_ptr, "; "); + + if (strncasecmp(start_ptr, boundary_match, boundary_match_len) == 0) { + start_ptr += boundary_match_len; + start_ptr += strspn(start_ptr, "-"); + content_boundary_len = sprintf(content_boundary, "--%s", start_ptr); + Debug(3, "Got content boundary '%s'", content_boundary); + } else { + Error("No content boundary found in header '%s'", content_type_header); + } + } else { + strcpy(content_type, start_ptr); + Debug(3, "Got content type '%s'", content_type); + } + } // end if content_type_header + + if (!strcasecmp(content_type, "image/jpeg") || !strcasecmp(content_type, "image/jpg")) { + // Single image + mode = SINGLE_IMAGE; + format = JPEG; + state = CONTENT; + } else if (!strcasecmp(content_type, "application/octet-stream")) { + // Single image + mode = SINGLE_IMAGE; + format = JPEG; + state = CONTENT; + } else if (!strcasecmp(content_type, "image/x-rgb")) { + // Single image + mode = SINGLE_IMAGE; + format = X_RGB; + state = CONTENT; + } else if (!strcasecmp(content_type, "image/x-rgbz")) { + // Single image + mode = SINGLE_IMAGE; + format = X_RGBZ; + state = CONTENT; + } else if (!strcasecmp(content_type, "multipart/x-mixed-replace")) { + // Image stream, so start processing + if (!content_boundary[0]) { + Error("No content boundary found in header '%s'", content_type_header); + return -1; + } + mode = MULTI_IMAGE; + state = SUBHEADER; + } + //else if ( !strcasecmp( content_type, "video/mpeg" ) || !strcasecmp( content_type, "video/mpg" ) ) + //{ + //// MPEG stream, coming soon! + //} + else { + Error("Unrecognised content type '%s'", content_type); + return -1; + } + } else { + Debug(3, "Unable to extract entire header from stream, continuing"); + state = HEADERCONT; + //return( -1 ); + } // end if all_headers + break; + } + case SUBHEADER : + n_subheaders = 0; + boundary_header = 0; + subcontent_length_header[0] = '\0'; + subcontent_type_header[0] = '\0'; + content_length = 0; + content_type[0] = '\0'; + FALLTHROUGH; + case SUBHEADERCONT : { + char *crlf = nullptr; + char *subheader_ptr = (char *)buffer; + int subheader_len = buffer.size(); + bool all_headers = false; + + while (!zm_terminate) { + int crlf_len = memspn(subheader_ptr, "\r\n", subheader_len); + if (n_subheaders) { + if ((crlf_len == 2 && !strncmp(subheader_ptr, "\n\n", crlf_len)) + || + (crlf_len == 4 && !strncmp(subheader_ptr, "\r\n\r\n", crlf_len)) + ) { + *subheader_ptr = '\0'; + subheader_ptr += crlf_len; + subheader_len -= buffer.consume(subheader_ptr-(char *)buffer); + all_headers = true; + break; + } + } + if (crlf_len) { + if (subheader_len == crlf_len) { + break; + } else { + *subheader_ptr = '\0'; + subheader_ptr += crlf_len; + subheader_len -= buffer.consume(subheader_ptr-(char *)buffer); + } + } + + Debug(6, "%d: %s", subheader_len, subheader_ptr); + + if ( (crlf = mempbrk(subheader_ptr, "\r\n", subheader_len)) ) { + //subheaders[n_subheaders++] = subheader_ptr; + n_subheaders++; + + if ( !boundary_header && (strncasecmp(subheader_ptr, content_boundary, content_boundary_len) == 0) ) { + boundary_header = subheader_ptr; + Debug(4, "Got boundary subheader '%s'", subheader_ptr); + } else if ( + !subcontent_length_header[0] + && + (strncasecmp(subheader_ptr, content_length_match, content_length_match_len) == 0) + ) { + strncpy( + subcontent_length_header, + subheader_ptr+content_length_match_len, + sizeof(subcontent_length_header)-1 + ); + *(subcontent_length_header+strcspn(subcontent_length_header, "\r\n")) = '\0'; + Debug(4, "Got content length subheader '%s'", subcontent_length_header); + } else if ( !subcontent_type_header[0] && (strncasecmp( subheader_ptr, content_type_match, content_type_match_len) == 0) ) { + strncpy( + subcontent_type_header, + subheader_ptr+content_type_match_len, + sizeof(subcontent_type_header)-1 + ); + *(subcontent_type_header+strcspn(subcontent_type_header, "\r\n")) = '\0'; + Debug(4, "Got content type subheader '%s'", subcontent_type_header); + } else { + Debug(6, "Got ignored subheader '%s' found", subheader_ptr); + } + subheader_ptr = crlf; + subheader_len -= buffer.consume( subheader_ptr-(char *)buffer ); + } else { + // No line end found + break; + } + } + + if (all_headers && boundary_header) { + char *start_ptr/*, *end_ptr*/; + + Debug(3, "Got boundary '%s'", boundary_header); + + if (subcontent_length_header[0]) { + start_ptr = subcontent_length_header + strspn(subcontent_length_header, " "); + content_length = atoi(start_ptr); + Debug(3, "Got subcontent length '%d'", content_length); + } + if (subcontent_type_header[0]) { + //memset(content_type, 0, sizeof(content_type)); + start_ptr = subcontent_type_header + strspn(subcontent_type_header, " "); + strcpy(content_type, start_ptr); + Debug(3, "Got subcontent type '%s'", content_type); + } + state = CONTENT; + } else { + Debug(3, "Unable to extract subheader from stream, retrying"); + int buffer_len = GetData(); + if (buffer_len < 0) { + Error("Unable to read subheader"); + return -1; + } + bytes += buffer_len; + state = SUBHEADERCONT; + } + break; + } + case CONTENT : { + // if content_type is something like image/jpeg;size=, this will strip the ;size= + char * semicolon = strchr(content_type, ';'); + if (semicolon) { + *semicolon = '\0'; + } + + if (!strcasecmp(content_type, "image/jpeg") || !strcasecmp(content_type, "image/jpg")) { + format = JPEG; + } else if (!strcasecmp(content_type, "application/octet-stream")) { + format = JPEG; + } else if (!strcasecmp(content_type, "image/x-rgb")) { + format = X_RGB; + } else if (!strcasecmp(content_type, "image/x-rgbz")) { + format = X_RGBZ; + } else { + Error("Found unsupported content type '%s'", content_type); + return -1; + } + + // This is an early test for jpeg content, so we can bail early + if (format == JPEG and buffer.size() >= 2) { + if (buffer[0] != 0xff or buffer[1] != 0xd8) { + Error("Found bogus jpeg header '%02x%02x'", buffer[0], buffer[1]); + return -1; + } + } + + if (content_length) { + while (((long)buffer.size() < content_length) and !zm_terminate) { + Debug(4, "getting more data"); + int bytes_read = ReadData(buffer, content_length-buffer.size()); + if (bytes_read < 0) { + Error("Unable to read content"); + return -1; + } + bytes += bytes_read; + } + Debug(3, "Got end of image by length, content-length = %d", content_length); + } else { + // Read until we find the end of image or the stream closes. + while (!content_length && !zm_terminate) { + Debug(4, "!content_length, ReadData"); + int buffer_len = ReadData(buffer); if (buffer_len < 0) { - Error("Unable to read header"); + Error("Unable to read content"); return -1; } - bytes += buffer_len; + bytes += buffer_len; + int buffer_size = buffer.size(); + if (buffer_len) { + // Got some data - char *crlf = nullptr; - char *header_ptr = buffer; - int header_len = buffer.size(); - bool all_headers = false; - - while (!zm_terminate) { - int crlf_len = memspn(header_ptr, "\r\n", header_len); - if (n_headers) { - if ( - (crlf_len == 2 && !strncmp(header_ptr, "\n\n", crlf_len)) - || - (crlf_len == 4 && !strncmp(header_ptr, "\r\n\r\n", crlf_len)) - ) { - Debug(3, "Have double linefeed, done headers"); - *header_ptr = '\0'; - header_ptr += crlf_len; - header_len -= buffer.consume(header_ptr-(char *)buffer); - all_headers = true; - break; - } - } - if (crlf_len) { - if (header_len == crlf_len) { - break; + if (mode == MULTI_IMAGE) { + // Look for the boundary marker, determine content length using it's position + if (const char *start_ptr = (char *)memstr( (char *)buffer, "\r\n--", buffer_size)) { + content_length = start_ptr - (char *)buffer; + Debug(2, "Got end of image by pattern (crlf--), content-length = %d", content_length); } else { - *header_ptr = '\0'; - header_ptr += crlf_len; - header_len -= buffer.consume(header_ptr-(char *)buffer); + Debug(2, "Did not find end of image by pattern (crlf--) yet, content-length = %d", content_length); } - } - - Debug(6, "%s", header_ptr); - if ((crlf = mempbrk(header_ptr, "\r\n", header_len))) { - //headers[n_headers++] = header_ptr; - n_headers++; - - if (!http_header && (strncasecmp(header_ptr, http_match, http_match_len) == 0)) { - http_header = header_ptr+http_match_len; - Debug(6, "Got http header '%s'", header_ptr); - } else if ( !connection_header && (strncasecmp(header_ptr, connection_match, connection_match_len) == 0) ) { - connection_header = header_ptr+connection_match_len; - Debug(6, "Got connection header '%s'", header_ptr); - } else if ( !content_length_header && (strncasecmp(header_ptr, content_length_match, content_length_match_len) == 0) ) { - content_length_header = header_ptr+content_length_match_len; - Debug(6, "Got content length header '%s'", header_ptr); - } else if ( !authenticate_header && (strncasecmp(header_ptr, authenticate_match, authenticate_match_len) == 0) ) { - authenticate_header = header_ptr; - Debug(6, "Got authenticate header '%s'", header_ptr); - } else if ( !content_type_header && (strncasecmp(header_ptr, content_type_match, content_type_match_len) == 0) ) { - content_type_header = header_ptr+content_type_match_len; - Debug(6, "Got content type header '%s'", header_ptr); - } else { - Debug(6, "Got ignored header '%s'", header_ptr); - } - header_ptr = crlf; - header_len -= buffer.consume(header_ptr-(char *)buffer); - } else { - // No end of line found - break; - } - } // end while search for headers - - if (all_headers) { - char *start_ptr, *end_ptr; - - if (!http_header) { - Error("Unable to extract HTTP status from header"); - return -1; - } - - start_ptr = http_header; - end_ptr = start_ptr+strspn(start_ptr, "10."); - - // FIXME Why are we memsetting every time? Can we not do it once? - //memset(http_version, 0, sizeof(http_version)); - strncpy(http_version, start_ptr, end_ptr-start_ptr); - - start_ptr = end_ptr; - start_ptr += strspn(start_ptr, " "); - end_ptr = start_ptr+strspn(start_ptr, "0123456789"); - - memset(status_code, 0, sizeof(status_code)); - strncpy(status_code, start_ptr, end_ptr-start_ptr); - int status = atoi(status_code); - - start_ptr = end_ptr; - start_ptr += strspn(start_ptr, " "); - strcpy(status_mesg, start_ptr); - - if (status == 401) { - if (mNeedAuth) { - Error("Failed authentication"); - return -1; - } - if (!authenticate_header) { - Error("Failed authentication, but don't have an authentication header."); - return -1; - } - mNeedAuth = true; - std::string Header = authenticate_header; - Debug(2, "Checking for digest auth in %s", authenticate_header); - - mAuthenticator->checkAuthResponse(Header); - if (mAuthenticator->auth_method() == zm::AUTH_DIGEST) { - Debug(2, "Need Digest Authentication"); - request = stringtf("GET %s HTTP/%s\r\n", path.c_str(), config.http_version); - request += stringtf("User-Agent: %s/%s\r\n", config.http_ua, ZM_VERSION); - request += stringtf("Host: %s\r\n", host.c_str()); - if ( strcmp(config.http_version, "1.0") == 0 ) - request += "Connection: Keep-Alive\r\n"; - request += mAuthenticator->getAuthHeader("GET", path); - request += "\r\n"; - - Debug(2, "New request header: %s", request.c_str()); - return 0; - } else { - Debug(2, "Need some other kind of Authentication"); - } - } else if (status < 200 || status > 299) { - Error("Invalid response status %s: %s", status_code, status_mesg); - return -1; - } - Debug(3, "Got status '%d' (%s), http version %s", status, status_mesg, http_version); - - if (connection_header) { - memset(connection_type, 0, sizeof(connection_type)); - start_ptr = connection_header + strspn(connection_header, " "); - // FIXME Should we not use strncpy? - strcpy(connection_type, start_ptr); - Debug(3, "Got connection '%s'", connection_type); - } - if (content_length_header) { - start_ptr = content_length_header + strspn(content_length_header, " "); - content_length = atoi(start_ptr); - Debug(3, "Got content length '%d'", content_length); - } - if (content_type_header) { - //memset(content_type, 0, sizeof(content_type)); - start_ptr = content_type_header + strspn(content_type_header, " "); - if ( (end_ptr = strchr(start_ptr, ';')) ) { - strncpy(content_type, start_ptr, end_ptr-start_ptr); - Debug(3, "Got content type '%s'", content_type); - - start_ptr = end_ptr + strspn(end_ptr, "; "); - - if (strncasecmp(start_ptr, boundary_match, boundary_match_len) == 0) { - start_ptr += boundary_match_len; - start_ptr += strspn(start_ptr, "-"); - content_boundary_len = sprintf(content_boundary, "--%s", start_ptr); - Debug(3, "Got content boundary '%s'", content_boundary); - } else { - Error("No content boundary found in header '%s'", content_type_header); - } - } else { - strcpy(content_type, start_ptr); - Debug(3, "Got content type '%s'", content_type); - } - } // end if content_type_header - - if (!strcasecmp(content_type, "image/jpeg") || !strcasecmp(content_type, "image/jpg")) { - // Single image - mode = SINGLE_IMAGE; - format = JPEG; - state = CONTENT; - } else if (!strcasecmp(content_type, "application/octet-stream")) { - // Single image - mode = SINGLE_IMAGE; - format = JPEG; - state = CONTENT; - } else if (!strcasecmp(content_type, "image/x-rgb")) { - // Single image - mode = SINGLE_IMAGE; - format = X_RGB; - state = CONTENT; - } else if (!strcasecmp(content_type, "image/x-rgbz")) { - // Single image - mode = SINGLE_IMAGE; - format = X_RGBZ; - state = CONTENT; - } else if (!strcasecmp(content_type, "multipart/x-mixed-replace")) { - // Image stream, so start processing - if (!content_boundary[0]) { - Error("No content boundary found in header '%s'", content_type_header); - return -1; - } - mode = MULTI_IMAGE; - state = SUBHEADER; - } - //else if ( !strcasecmp( content_type, "video/mpeg" ) || !strcasecmp( content_type, "video/mpg" ) ) - //{ - //// MPEG stream, coming soon! - //} - else { - Error("Unrecognised content type '%s'", content_type); - return -1; - } + } // end if MULTI_IMAGE } else { - Debug(3, "Unable to extract entire header from stream, continuing"); - state = HEADERCONT; - //return( -1 ); - } // end if all_headers - break; + content_length = buffer_size; + Debug(2, "Got end of image by closure, content-length = %d", content_length); + if (mode == SINGLE_IMAGE) { + char *end_ptr = (char *)buffer+buffer_size; + + // strip off any last line feeds + while (*end_ptr == '\r' || *end_ptr == '\n') { + content_length--; + end_ptr--; + } + + if (end_ptr != ((char *)buffer+buffer_size)) { + Debug(2, "Trimmed end of image, new content-length = %d", content_length); + } + } // end if SINGLE_IMAGE + } // end if read some data + } // end while ! content_length + } // end if content_length + + if (mode == SINGLE_IMAGE) { + state = HEADER; + Disconnect(); + } else { + state = SUBHEADER; + } + + if (format == JPEG && buffer.size() >= 2) { + if (buffer[0] != 0xff || buffer[1] != 0xd8) { + Error("Found bogus jpeg header '%02x%02x'", buffer[0], buffer[1]); + return -1; } - case SUBHEADER : - n_subheaders = 0; - boundary_header = 0; - subcontent_length_header[0] = '\0'; - subcontent_type_header[0] = '\0'; - content_length = 0; - content_type[0] = '\0'; - FALLTHROUGH; - case SUBHEADERCONT : - { - char *crlf = nullptr; - char *subheader_ptr = (char *)buffer; - int subheader_len = buffer.size(); - bool all_headers = false; + } - while (!zm_terminate) { - int crlf_len = memspn(subheader_ptr, "\r\n", subheader_len); - if (n_subheaders) { - if ((crlf_len == 2 && !strncmp(subheader_ptr, "\n\n", crlf_len)) - || - (crlf_len == 4 && !strncmp(subheader_ptr, "\r\n\r\n", crlf_len)) - ) { - *subheader_ptr = '\0'; - subheader_ptr += crlf_len; - subheader_len -= buffer.consume(subheader_ptr-(char *)buffer); - all_headers = true; - break; - } - } - if (crlf_len) { - if (subheader_len == crlf_len) { - break; - } else { - *subheader_ptr = '\0'; - subheader_ptr += crlf_len; - subheader_len -= buffer.consume(subheader_ptr-(char *)buffer); - } - } - - Debug(6, "%d: %s", subheader_len, subheader_ptr); - - if ( (crlf = mempbrk(subheader_ptr, "\r\n", subheader_len)) ) { - //subheaders[n_subheaders++] = subheader_ptr; - n_subheaders++; - - if ( !boundary_header && (strncasecmp(subheader_ptr, content_boundary, content_boundary_len) == 0) ) { - boundary_header = subheader_ptr; - Debug(4, "Got boundary subheader '%s'", subheader_ptr); - } else if ( - !subcontent_length_header[0] - && - (strncasecmp(subheader_ptr, content_length_match, content_length_match_len) == 0) - ) { - strncpy( - subcontent_length_header, - subheader_ptr+content_length_match_len, - sizeof(subcontent_length_header)-1 - ); - *(subcontent_length_header+strcspn(subcontent_length_header, "\r\n")) = '\0'; - Debug(4, "Got content length subheader '%s'", subcontent_length_header); - } else if ( !subcontent_type_header[0] && (strncasecmp( subheader_ptr, content_type_match, content_type_match_len) == 0) ) { - strncpy( - subcontent_type_header, - subheader_ptr+content_type_match_len, - sizeof(subcontent_type_header)-1 - ); - *(subcontent_type_header+strcspn(subcontent_type_header, "\r\n")) = '\0'; - Debug(4, "Got content type subheader '%s'", subcontent_type_header); - } else { - Debug(6, "Got ignored subheader '%s' found", subheader_ptr); - } - subheader_ptr = crlf; - subheader_len -= buffer.consume( subheader_ptr-(char *)buffer ); - } else { - // No line end found - break; - } - } - - if (all_headers && boundary_header) { - char *start_ptr/*, *end_ptr*/; - - Debug(3, "Got boundary '%s'", boundary_header); - - if (subcontent_length_header[0]) { - start_ptr = subcontent_length_header + strspn(subcontent_length_header, " "); - content_length = atoi(start_ptr); - Debug(3, "Got subcontent length '%d'", content_length); - } - if (subcontent_type_header[0]) { - //memset(content_type, 0, sizeof(content_type)); - start_ptr = subcontent_type_header + strspn(subcontent_type_header, " "); - strcpy(content_type, start_ptr); - Debug(3, "Got subcontent type '%s'", content_type); - } - state = CONTENT; - } else { - Debug(3, "Unable to extract subheader from stream, retrying"); - int buffer_len = GetData(); - if (buffer_len < 0) { - Error("Unable to read subheader"); - return -1; - } - bytes += buffer_len; - state = SUBHEADERCONT; - } - break; - } - case CONTENT : { - // if content_type is something like image/jpeg;size=, this will strip the ;size= - char * semicolon = strchr(content_type, ';'); - if (semicolon) { - *semicolon = '\0'; - } - - if (!strcasecmp(content_type, "image/jpeg") || !strcasecmp(content_type, "image/jpg")) { - format = JPEG; - } else if (!strcasecmp(content_type, "application/octet-stream")) { - format = JPEG; - } else if (!strcasecmp(content_type, "image/x-rgb")) { - format = X_RGB; - } else if (!strcasecmp(content_type, "image/x-rgbz")) { - format = X_RGBZ; - } else { - Error("Found unsupported content type '%s'", content_type); - return -1; - } - - // This is an early test for jpeg content, so we can bail early - if (format == JPEG and buffer.size() >= 2) { - if (buffer[0] != 0xff or buffer[1] != 0xd8) { - Error("Found bogus jpeg header '%02x%02x'", buffer[0], buffer[1]); - return -1; - } - } - - if (content_length) { - while (((long)buffer.size() < content_length) and !zm_terminate) { - Debug(4, "getting more data"); - int bytes_read = ReadData(buffer, content_length-buffer.size()); - if (bytes_read < 0) { - Error("Unable to read content"); - return -1; - } - bytes += bytes_read; - } - Debug(3, "Got end of image by length, content-length = %d", content_length); - } else { - // Read until we find the end of image or the stream closes. - while (!content_length && !zm_terminate) { - Debug(4, "!content_length, ReadData"); - int buffer_len = ReadData(buffer); - if (buffer_len < 0) { - Error("Unable to read content"); - return -1; - } - bytes += buffer_len; - int buffer_size = buffer.size(); - if (buffer_len) { - // Got some data - - if (mode == MULTI_IMAGE) { - // Look for the boundary marker, determine content length using it's position - if (const char *start_ptr = (char *)memstr( (char *)buffer, "\r\n--", buffer_size)) { - content_length = start_ptr - (char *)buffer; - Debug(2, "Got end of image by pattern (crlf--), content-length = %d", content_length); - } else { - Debug(2, "Did not find end of image by pattern (crlf--) yet, content-length = %d", content_length); - } - } // end if MULTI_IMAGE - } else { - content_length = buffer_size; - Debug(2, "Got end of image by closure, content-length = %d", content_length); - if (mode == SINGLE_IMAGE) { - char *end_ptr = (char *)buffer+buffer_size; - - // strip off any last line feeds - while (*end_ptr == '\r' || *end_ptr == '\n') { - content_length--; - end_ptr--; - } - - if (end_ptr != ((char *)buffer+buffer_size)) { - Debug(2, "Trimmed end of image, new content-length = %d", content_length); - } - } // end if SINGLE_IMAGE - } // end if read some data - } // end while ! content_length - } // end if content_length - - if (mode == SINGLE_IMAGE) { - state = HEADER; - Disconnect(); - } else { - state = SUBHEADER; - } - - if (format == JPEG && buffer.size() >= 2) { - if (buffer[0] != 0xff || buffer[1] != 0xd8) { - Error("Found bogus jpeg header '%02x%02x'", buffer[0], buffer[1]); - return -1; - } - } - - Debug(3, "Returning %d bytes, buffer size: (%d) bytes of captured content", - content_length, buffer.size()); - return content_length; - } // end case CONTENT + Debug(3, "Returning %d bytes, buffer size: (%d) bytes of captured content", + content_length, buffer.size()); + return content_length; + } // end case CONTENT } // end switch } } @@ -1121,30 +1115,30 @@ int RemoteCameraHttp::Capture(std::shared_ptr &packet) { packet->stream = mVideoStream; switch (format) { - case JPEG : - if (!image->DecodeJpeg(buffer.extract(content_length), content_length, colours, subpixelorder)) { - Error("Unable to decode jpeg"); - return -1; - } - break; - case X_RGB : - if (content_length != (long)image->Size()) { - Error("Image length mismatch, expected %d bytes, content length was %d", - image->Size(), content_length); - return -1; - } - image->Assign(width, height, colours, subpixelorder, buffer.head(), imagesize); - break; - case X_RGBZ : - if (!image->Unzip(buffer.extract(content_length), content_length)) { - Error("Unable to unzip RGB image"); - return -1; - } - image->Assign(width, height, colours, subpixelorder, buffer.head(), imagesize); - break; - default : - Error("Unexpected image format encountered"); + case JPEG : + if (!image->DecodeJpeg(buffer.extract(content_length), content_length, colours, subpixelorder)) { + Error("Unable to decode jpeg"); return -1; + } + break; + case X_RGB : + if (content_length != (long)image->Size()) { + Error("Image length mismatch, expected %d bytes, content length was %d", + image->Size(), content_length); + return -1; + } + image->Assign(width, height, colours, subpixelorder, buffer.head(), imagesize); + break; + case X_RGBZ : + if (!image->Unzip(buffer.extract(content_length), content_length)) { + Error("Unable to unzip RGB image"); + return -1; + } + image->Assign(width, height, colours, subpixelorder, buffer.head(), imagesize); + break; + default : + Error("Unexpected image format encountered"); + return -1; } return 1; } // end ZmPacket *RmoteCameraHttp::Capture( &image ); diff --git a/src/zm_remote_camera_http.h b/src/zm_remote_camera_http.h index e27117d2e..424ef4df1 100644 --- a/src/zm_remote_camera_http.h +++ b/src/zm_remote_camera_http.h @@ -1,21 +1,21 @@ // // ZoneMinder Remote HTTP Camera Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_REMOTE_CAMERA_HTTP_H #define ZM_REMOTE_CAMERA_HTTP_H @@ -28,7 +28,7 @@ // accessed over a network connection using http // class RemoteCameraHttp : public RemoteCamera { -protected: + protected: std::string request; struct timeval timeout; //struct hostent *hp; @@ -40,25 +40,25 @@ protected: enum { HEADER, HEADERCONT, SUBHEADER, SUBHEADERCONT, CONTENT } state; enum { SIMPLE, REGEXP } method; -public: + public: RemoteCameraHttp( - const Monitor *monitor, - const std::string &method, - const std::string &host, - const std::string &port, - const std::string &path, - const std::string &p_user, - const std::string &p_pass, - int p_width, - int p_height, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio - ); + const Monitor *monitor, + const std::string &method, + const std::string &host, + const std::string &port, + const std::string &path, + const std::string &p_user, + const std::string &p_pass, + int p_width, + int p_height, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio + ); ~RemoteCameraHttp(); void Initialise() override; @@ -67,7 +67,7 @@ public: int Disconnect() override; int SendRequest(); int ReadData( Buffer &buffer, unsigned int bytes_expected=0 ); - int GetData(); + int GetData(); int GetResponse(); int PrimeCapture() override; int PreCapture() override; diff --git a/src/zm_remote_camera_nvsocket.cpp b/src/zm_remote_camera_nvsocket.cpp index 8a342846b..4e4330914 100644 --- a/src/zm_remote_camera_nvsocket.cpp +++ b/src/zm_remote_camera_nvsocket.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Remote Camera Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_remote_camera_nvsocket.h" @@ -63,8 +63,7 @@ RemoteCameraNVSocket::RemoteCameraNVSocket( p_hue, p_colour, p_capture, - p_record_audio ) -{ + p_record_audio ) { sd = -1; timeout.tv_sec = 0; @@ -87,7 +86,7 @@ void RemoteCameraNVSocket::Initialise() { RemoteCamera::Initialise(); if ( !timeout.tv_sec ) { - timeout.tv_sec = config.http_timeout/1000; + timeout.tv_sec = config.http_timeout/1000; timeout.tv_usec = (config.http_timeout%1000)*1000; } @@ -115,7 +114,7 @@ int RemoteCameraNVSocket::Connect() { } //if ( connect( sd, p->ai_addr, p->ai_addrlen ) < 0 ) { - if ( connect( sd, (struct sockaddr *)&servaddr , sizeof(servaddr) ) < 0 ) { + if ( connect( sd, (struct sockaddr *)&servaddr, sizeof(servaddr) ) < 0 ) { close(sd); sd = -1; @@ -191,13 +190,13 @@ int RemoteCameraNVSocket::Capture(std::shared_ptr &zm_packet) { Warning("Unable to capture image, retrying"); return 0; } - int bytes_read = Read(sd, buffer, imagesize); + int bytes_read = Read(sd, buffer, imagesize); if ( (bytes_read < 0) || ( (unsigned int)bytes_read < imagesize ) ) { Warning("Unable to capture image, retrying"); return 0; } uint32_t end; - if (Read(sd, (char *) &end , sizeof(end)) < 0) { + if (Read(sd, (char *) &end, sizeof(end)) < 0) { Warning("Unable to capture image, retrying"); return 0; } diff --git a/src/zm_remote_camera_nvsocket.h b/src/zm_remote_camera_nvsocket.h index 58152dcf4..0def75ba3 100644 --- a/src/zm_remote_camera_nvsocket.h +++ b/src/zm_remote_camera_nvsocket.h @@ -1,21 +1,21 @@ // // ZoneMinder Remote NVSOCKET Camera Class Interface, $Date$, $Revision$ // Copyright (C) 2017 ZoneMinder LLC -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_REMOTE_CAMERA_NVSOCKET_H #define ZM_REMOTE_CAMERA_NVSOCKET_H @@ -24,27 +24,27 @@ #include "zm_remote_camera.h" class RemoteCameraNVSocket : public RemoteCamera { -protected: + protected: std::string request; struct timeval timeout; int sd; Buffer buffer; -public: + public: RemoteCameraNVSocket( - const Monitor *monitor, - const std::string &host, - const std::string &port, - const std::string &path, - int p_width, - int p_height, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio ); + const Monitor *monitor, + const std::string &host, + const std::string &port, + const std::string &path, + int p_width, + int p_height, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio ); ~RemoteCameraNVSocket(); void Initialise() override; diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp index ceee75fce..f5414f87b 100644 --- a/src/zm_remote_camera_rtsp.cpp +++ b/src/zm_remote_camera_rtsp.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Remote Camera Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_remote_camera_rtsp.h" @@ -25,35 +25,34 @@ #include "zm_signal.h" RemoteCameraRtsp::RemoteCameraRtsp( - const Monitor *monitor, - const std::string &p_method, - const std::string &p_host, - const std::string &p_port, - const std::string &p_path, - const std::string &p_user, - const std::string &p_pass, - int p_width, - int p_height, - bool p_rtsp_describe, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio ) : + const Monitor *monitor, + const std::string &p_method, + const std::string &p_host, + const std::string &p_port, + const std::string &p_path, + const std::string &p_user, + const std::string &p_pass, + int p_width, + int p_height, + bool p_rtsp_describe, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio ) : RemoteCamera( - monitor, "rtsp", - p_host, p_port, p_path, - p_user, p_pass, - p_width, p_height, p_colours, - p_brightness, p_contrast, p_hue, p_colour, - p_capture, p_record_audio), + monitor, "rtsp", + p_host, p_port, p_path, + p_user, p_pass, + p_width, p_height, p_colours, + p_brightness, p_contrast, p_hue, p_colour, + p_capture, p_record_audio), rtsp_describe(p_rtsp_describe), user(p_user), pass(p_pass), - frameCount(0) -{ + frameCount(0) { if ( p_method == "rtpUni" ) method = RtspThread::RTP_UNICAST; else if ( p_method == "rtpMulti" ) @@ -68,7 +67,7 @@ RemoteCameraRtsp::RemoteCameraRtsp( if ( capture ) { Initialise(); } - + /* Has to be located inside the constructor so other components such as zma will receive correct colours and subpixel order */ if ( colours == ZM_COLOUR_RGB32 ) { subpixelorder = ZM_SUBPIX_ORDER_RGBA; @@ -87,8 +86,8 @@ RemoteCameraRtsp::RemoteCameraRtsp( RemoteCameraRtsp::~RemoteCameraRtsp() { if ( mVideoCodecContext ) { - avcodec_close(mVideoCodecContext); - mVideoCodecContext = nullptr; // Freed by avformat_free_context in the destructor of RtspThread class + avcodec_close(mVideoCodecContext); + mVideoCodecContext = nullptr; // Freed by avformat_free_context in the destructor of RtspThread class } // Is allocated in RTSPThread and is free there as well mFormatContext = nullptr; @@ -150,7 +149,7 @@ int RemoteCameraRtsp::PrimeCapture() { mVideoStreamId = -1; mAudioStreamId = -1; - // Find the first video stream. + // Find the first video stream. for ( unsigned int i = 0; i < mFormatContext->nb_streams; i++ ) { if ( is_video_stream(mFormatContext->streams[i]) ) { if ( mVideoStreamId == -1 ) { @@ -238,20 +237,20 @@ int RemoteCameraRtsp::Capture(std::shared_ptr &zm_packet) { if ( mVideoCodecContext->codec_id == AV_CODEC_ID_H264 ) { // SPS and PPS frames should be saved and appended to IDR frames int nalType = (buffer.head()[3] & 0x1f); - + // SPS The SPS NAL unit contains parameters that apply to a series of consecutive coded video pictures if ( nalType == 1 ) { } else if ( nalType == 7 ) { lastSps = buffer; continue; } else if ( nalType == 8 ) { - // PPS The PPS NAL unit contains parameters that apply to the decoding of one or more individual pictures inside a coded video sequence + // PPS The PPS NAL unit contains parameters that apply to the decoding of one or more individual pictures inside a coded video sequence lastPps = buffer; continue; } else if ( nalType == 5 ) { packet->flags |= AV_PKT_FLAG_KEY; zm_packet->keyframe = 1; - // IDR + // IDR buffer += lastSps; buffer += lastPps; } else { diff --git a/src/zm_remote_camera_rtsp.h b/src/zm_remote_camera_rtsp.h index b70bf6103..72c972fda 100644 --- a/src/zm_remote_camera_rtsp.h +++ b/src/zm_remote_camera_rtsp.h @@ -1,21 +1,21 @@ // // ZoneMinder Remote RTSP Camera Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_REMOTE_CAMERA_RTSP_H #define ZM_REMOTE_CAMERA_RTSP_H @@ -30,7 +30,7 @@ // (Real Time Streaming Protocol) // class RemoteCameraRtsp : public RemoteCamera { -protected: + protected: struct sockaddr_in rtsp_sa; struct sockaddr_in rtcp_sa; int rtsp_sd; @@ -53,25 +53,25 @@ protected: _AVPIXELFORMAT imagePixFormat; -public: + public: RemoteCameraRtsp( - const Monitor *monitor, - const std::string &method, - const std::string &host, - const std::string &port, - const std::string &path, - const std::string &user, - const std::string &pass, - int p_width, - int p_height, - bool p_rtsp_describe, - int p_colours, - int p_brightness, - int p_contrast, - int p_hue, - int p_colour, - bool p_capture, - bool p_record_audio); + const Monitor *monitor, + const std::string &method, + const std::string &host, + const std::string &port, + const std::string &path, + const std::string &user, + const std::string &pass, + int p_width, + int p_height, + bool p_rtsp_describe, + int p_colours, + int p_brightness, + int p_contrast, + int p_hue, + int p_colour, + bool p_capture, + bool p_record_audio); ~RemoteCameraRtsp(); void Initialise() override; @@ -85,7 +85,7 @@ public: int PostCapture() override; int Close() override { return 0; }; - AVStream *get_VideoStream() { + AVStream *get_VideoStream() { if ( mVideoStreamId != -1 ) return mFormatContext->streams[mVideoStreamId]; return nullptr; diff --git a/src/zm_rgb.h b/src/zm_rgb.h index 91884bcfc..eb1f4d5a4 100644 --- a/src/zm_rgb.h +++ b/src/zm_rgb.h @@ -1,21 +1,21 @@ // // ZoneMinder RGB Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_RGB_H #define ZM_RGB_H @@ -120,31 +120,31 @@ constexpr Rgb kRGBTransparent = 0x01000000; /* Convert RGB colour value into BGR\ARGB\ABGR */ inline Rgb rgb_convert(Rgb p_col, int p_subpixorder) { Rgb result = 0; - + switch (p_subpixorder) { - case ZM_SUBPIX_ORDER_BGR: - case ZM_SUBPIX_ORDER_BGRA: - BLUE_PTR_BGRA(&result) = BLUE_VAL_RGBA(p_col); - GREEN_PTR_BGRA(&result) = GREEN_VAL_RGBA(p_col); - RED_PTR_BGRA(&result) = RED_VAL_RGBA(p_col); - break; - case ZM_SUBPIX_ORDER_ARGB: - BLUE_PTR_ARGB(&result) = BLUE_VAL_RGBA(p_col); - GREEN_PTR_ARGB(&result) = GREEN_VAL_RGBA(p_col); - RED_PTR_ARGB(&result) = RED_VAL_RGBA(p_col); - break; - case ZM_SUBPIX_ORDER_ABGR: - BLUE_PTR_ABGR(&result) = BLUE_VAL_RGBA(p_col); - GREEN_PTR_ABGR(&result) = GREEN_VAL_RGBA(p_col); - RED_PTR_ABGR(&result) = RED_VAL_RGBA(p_col); - break; - /* Grayscale */ - case ZM_SUBPIX_ORDER_NONE: - result = p_col & 0xff; - break; - default: - result = p_col; - break; + case ZM_SUBPIX_ORDER_BGR: + case ZM_SUBPIX_ORDER_BGRA: + BLUE_PTR_BGRA(&result) = BLUE_VAL_RGBA(p_col); + GREEN_PTR_BGRA(&result) = GREEN_VAL_RGBA(p_col); + RED_PTR_BGRA(&result) = RED_VAL_RGBA(p_col); + break; + case ZM_SUBPIX_ORDER_ARGB: + BLUE_PTR_ARGB(&result) = BLUE_VAL_RGBA(p_col); + GREEN_PTR_ARGB(&result) = GREEN_VAL_RGBA(p_col); + RED_PTR_ARGB(&result) = RED_VAL_RGBA(p_col); + break; + case ZM_SUBPIX_ORDER_ABGR: + BLUE_PTR_ABGR(&result) = BLUE_VAL_RGBA(p_col); + GREEN_PTR_ABGR(&result) = GREEN_VAL_RGBA(p_col); + RED_PTR_ABGR(&result) = RED_VAL_RGBA(p_col); + break; + /* Grayscale */ + case ZM_SUBPIX_ORDER_NONE: + result = p_col & 0xff; + break; + default: + result = p_col; + break; } return result; diff --git a/src/zm_rtp.cpp b/src/zm_rtp.cpp index e02dbc2df..1b833f1bc 100644 --- a/src/zm_rtp.cpp +++ b/src/zm_rtp.cpp @@ -1,21 +1,21 @@ // // ZoneMinder RTP/RTCP Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_rtp.h" diff --git a/src/zm_rtp.h b/src/zm_rtp.h index f45e14c74..bcace6eb6 100644 --- a/src/zm_rtp.h +++ b/src/zm_rtp.h @@ -1,21 +1,21 @@ // // ZoneMinder RTP/RTCP Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_RTP_H #define ZM_RTP_H diff --git a/src/zm_rtp_ctrl.cpp b/src/zm_rtp_ctrl.cpp index a82ff2b2a..af995330d 100644 --- a/src/zm_rtp_ctrl.cpp +++ b/src/zm_rtp_ctrl.cpp @@ -1,17 +1,17 @@ // // ZoneMinder RTCP Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -24,8 +24,7 @@ #include "zm_rtsp.h" RtpCtrlThread::RtpCtrlThread(RtspThread &rtspThread, RtpSource &rtpSource) - : mRtspThread(rtspThread), mRtpSource(rtpSource), mTerminate(false) -{ + : mRtspThread(rtspThread), mRtpSource(rtpSource), mTerminate(false) { mThread = std::thread(&RtpCtrlThread::Run, this); } @@ -43,7 +42,7 @@ int RtpCtrlThread::recvPacket( const unsigned char *packet, ssize_t packetLen ) //printf( "C: " ); //for ( int i = 0; i < packetLen; i++ ) - //printf( "%02x ", (unsigned char)packet[i] ); + //printf( "%02x ", (unsigned char)packet[i] ); //printf( "\n" ); int ver = rtcpPacket->header.version; int count = rtcpPacket->header.count; @@ -53,92 +52,89 @@ int RtpCtrlThread::recvPacket( const unsigned char *packet, ssize_t packetLen ) Debug( 5, "RTCP Ver: %d Count: %d Pt: %d len: %d", ver, count, pt, len); switch( pt ) { - case RTCP_SR : - { - uint32_t ssrc = ntohl(rtcpPacket->body.sr.ssrcN); + case RTCP_SR : { + uint32_t ssrc = ntohl(rtcpPacket->body.sr.ssrcN); - Debug( 5, "RTCP Got SR (%x)", ssrc ); - if ( mRtpSource.getSsrc() ) { - if ( ssrc != mRtpSource.getSsrc() ) { - Warning( "Discarding packet for unrecognised ssrc %x", ssrc ); - return( -1 ); - } - } else if ( ssrc ) { - mRtpSource.setSsrc( ssrc ); + Debug( 5, "RTCP Got SR (%x)", ssrc ); + if ( mRtpSource.getSsrc() ) { + if ( ssrc != mRtpSource.getSsrc() ) { + Warning( "Discarding packet for unrecognised ssrc %x", ssrc ); + return( -1 ); + } + } else if ( ssrc ) { + mRtpSource.setSsrc( ssrc ); + } + + if ( len > 1 ) { + //printf( "NTPts:%d.%d, RTPts:%d\n", $ntptsmsb, $ntptslsb, $rtpts ); + uint16_t ntptsmsb = ntohl(rtcpPacket->body.sr.ntpSecN); + uint16_t ntptslsb = ntohl(rtcpPacket->body.sr.ntpFracN); + //printf( "NTPts:%x.%04x, RTPts:%x\n", $ntptsmsb, $ntptslsb, $rtpts ); + //printf( "Pkts:$sendpkts, Octs:$sendocts\n" ); + uint32_t rtpTime = ntohl(rtcpPacket->body.sr.rtpTsN); + + mRtpSource.updateRtcpData( ntptsmsb, ntptslsb, rtpTime ); + } + break; + } + case RTCP_SDES : { + ssize_t contentLen = packetLen - sizeof(rtcpPacket->header); + while ( contentLen ) { + Debug( 5, "RTCP CL: %zd", contentLen ); + uint32_t ssrc = ntohl(rtcpPacket->body.sdes.srcN); + + Debug( 5, "RTCP Got SDES (%x), %d items", ssrc, count ); + if ( mRtpSource.getSsrc() && (ssrc != mRtpSource.getSsrc()) ) { + Warning( "Discarding packet for unrecognised ssrc %x", ssrc ); + return( -1 ); } - if ( len > 1 ) { - //printf( "NTPts:%d.%d, RTPts:%d\n", $ntptsmsb, $ntptslsb, $rtpts ); - uint16_t ntptsmsb = ntohl(rtcpPacket->body.sr.ntpSecN); - uint16_t ntptslsb = ntohl(rtcpPacket->body.sr.ntpFracN); - //printf( "NTPts:%x.%04x, RTPts:%x\n", $ntptsmsb, $ntptslsb, $rtpts ); - //printf( "Pkts:$sendpkts, Octs:$sendocts\n" ); - uint32_t rtpTime = ntohl(rtcpPacket->body.sr.rtpTsN); - - mRtpSource.updateRtcpData( ntptsmsb, ntptslsb, rtpTime ); + unsigned char *sdesPtr = (unsigned char *)&rtcpPacket->body.sdes.item; + for ( int i = 0; i < count; i++ ) { + RtcpSdesItem *item = (RtcpSdesItem *)sdesPtr; + Debug( 5, "RTCP Item length %d", item->len ); + switch( item->type ) { + case RTCP_SDES_CNAME : { + std::string cname( item->data, item->len ); + Debug( 5, "RTCP Got CNAME %s", cname.c_str() ); + break; + } + case RTCP_SDES_END : + case RTCP_SDES_NAME : + case RTCP_SDES_EMAIL : + case RTCP_SDES_PHONE : + case RTCP_SDES_LOC : + case RTCP_SDES_TOOL : + case RTCP_SDES_NOTE : + case RTCP_SDES_PRIV : + default : + Error( "Received unexpected SDES item type %d, ignoring", item->type ); + return -1; + } + int paddedLen = 4+2+item->len+1; // Add null byte + paddedLen = (((paddedLen-1)/4)+1)*4; // Round to nearest multiple of 4 + Debug(5, "RTCP PL:%d", paddedLen); + sdesPtr += paddedLen; + contentLen = ( paddedLen <= contentLen ) ? ( contentLen - paddedLen ) : 0; } - break; - } - case RTCP_SDES : - { - ssize_t contentLen = packetLen - sizeof(rtcpPacket->header); - while ( contentLen ) { - Debug( 5, "RTCP CL: %zd", contentLen ); - uint32_t ssrc = ntohl(rtcpPacket->body.sdes.srcN); - - Debug( 5, "RTCP Got SDES (%x), %d items", ssrc, count ); - if ( mRtpSource.getSsrc() && (ssrc != mRtpSource.getSsrc()) ) { - Warning( "Discarding packet for unrecognised ssrc %x", ssrc ); - return( -1 ); - } - - unsigned char *sdesPtr = (unsigned char *)&rtcpPacket->body.sdes.item; - for ( int i = 0; i < count; i++ ) { - RtcpSdesItem *item = (RtcpSdesItem *)sdesPtr; - Debug( 5, "RTCP Item length %d", item->len ); - switch( item->type ) { - case RTCP_SDES_CNAME : - { - std::string cname( item->data, item->len ); - Debug( 5, "RTCP Got CNAME %s", cname.c_str() ); - break; - } - case RTCP_SDES_END : - case RTCP_SDES_NAME : - case RTCP_SDES_EMAIL : - case RTCP_SDES_PHONE : - case RTCP_SDES_LOC : - case RTCP_SDES_TOOL : - case RTCP_SDES_NOTE : - case RTCP_SDES_PRIV : - default : - Error( "Received unexpected SDES item type %d, ignoring", item->type ); - return -1; - } - int paddedLen = 4+2+item->len+1; // Add null byte - paddedLen = (((paddedLen-1)/4)+1)*4; // Round to nearest multiple of 4 - Debug(5, "RTCP PL:%d", paddedLen); - sdesPtr += paddedLen; - contentLen = ( paddedLen <= contentLen ) ? ( contentLen - paddedLen ) : 0; - } - } // end whiel contentLen - break; - } - case RTCP_BYE : - Debug(5, "RTCP Got BYE"); - Stop(); - break; - case RTCP_APP : - // Ignoring as per RFC 3550 - Debug(5, "Received RTCP_APP packet, ignoring."); - break; - case RTCP_RR : - Error("Received RTCP_RR packet."); - return -1; - default : - // Ignore unknown packet types. Some cameras do this by design. - Debug(5, "Received unexpected packet type %d, ignoring", pt); - break; + } // end whiel contentLen + break; + } + case RTCP_BYE : + Debug(5, "RTCP Got BYE"); + Stop(); + break; + case RTCP_APP : + // Ignoring as per RFC 3550 + Debug(5, "Received RTCP_APP packet, ignoring."); + break; + case RTCP_RR : + Error("Received RTCP_RR packet."); + return -1; + default : + // Ignore unknown packet types. Some cameras do this by design. + Debug(5, "Received unexpected packet type %d, ignoring", pt); + break; } consumed = sizeof(uint32_t)*(len+1); return consumed; @@ -159,12 +155,12 @@ int RtpCtrlThread::generateRr( const unsigned char *packet, ssize_t packetLen ) mRtpSource.updateRtcpStats(); Debug(5, "Ssrc = %d Ssrc_1 = %d Last Seq = %d Jitter = %d Last SR = %d", - mRtspThread.getSsrc()+1, - mRtpSource.getSsrc(), - mRtpSource.getMaxSeq(), - mRtpSource.getJitter(), - mRtpSource.getLastSrTimestamp() - ); + mRtspThread.getSsrc()+1, + mRtpSource.getSsrc(), + mRtpSource.getMaxSeq(), + mRtpSource.getJitter(), + mRtpSource.getLastSrTimestamp() + ); rtcpPacket->body.rr.ssrcN = htonl(mRtspThread.getSsrc()+1); rtcpPacket->body.rr.rr[0].ssrcN = htonl(mRtpSource.getSsrc()); @@ -225,7 +221,7 @@ int RtpCtrlThread::recvPackets( unsigned char *buffer, ssize_t nBytes ) { // rtcp_t *end; /* end of compound RTCP packet */ // if ((*(u_int16 *)r & RTCP_VALID_MASK) != RTCP_VALID_VALUE) { - // /* something wrong with packet format */ + // /* something wrong with packet format */ // } // end = (rtcp_t *)((u_int32 *)r + len); @@ -233,7 +229,7 @@ int RtpCtrlThread::recvPackets( unsigned char *buffer, ssize_t nBytes ) { // while (r < end && r->common.version == 2); // if (r != end) { - // /* something wrong with packet format */ + // /* something wrong with packet format */ // } while ( nBytes > 0 ) { diff --git a/src/zm_rtp_ctrl.h b/src/zm_rtp_ctrl.h index 9346496f7..3d0fe45df 100644 --- a/src/zm_rtp_ctrl.h +++ b/src/zm_rtp_ctrl.h @@ -1,21 +1,21 @@ // // ZoneMinder RTCP Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_RTP_CTRL_H #define ZM_RTP_CTRL_H @@ -35,9 +35,9 @@ class RtspThread; class RtpSource; class RtpCtrlThread { -friend class RtspThread; + friend class RtspThread; -private: + private: typedef enum { RTCP_SR = 200, RTCP_RR = 201, @@ -63,7 +63,7 @@ private: uint8_t p:1; // padding flag uint8_t version:2; // protocol version uint8_t pt; // RTCP packet type - uint16_t lenN; // pkt len in words, w/o this word, network order + uint16_t lenN; // pkt len in words, w/o this word, network order }; // Reception report block @@ -116,10 +116,10 @@ private: uint32_t srcN[]; // list of sources // can't express trailing text for reason (what does this mean? it's not even english!) } bye; - } body; + } body; }; -private: + private: RtspThread &mRtspThread; RtpSource &mRtpSource; int mPort; @@ -127,7 +127,7 @@ private: std::atomic mTerminate; std::thread mThread; -private: + private: int recvPacket( const unsigned char *packet, ssize_t packetLen ); int generateRr( const unsigned char *packet, ssize_t packetLen ); int generateSdes( const unsigned char *packet, ssize_t packetLen ); @@ -135,7 +135,7 @@ private: int recvPackets( unsigned char *buffer, ssize_t nBytes ); void Run(); -public: + public: RtpCtrlThread( RtspThread &rtspThread, RtpSource &rtpSource ); ~RtpCtrlThread(); diff --git a/src/zm_rtp_data.cpp b/src/zm_rtp_data.cpp index e8ce628f2..f9b61d859 100644 --- a/src/zm_rtp_data.cpp +++ b/src/zm_rtp_data.cpp @@ -1,21 +1,21 @@ // // ZoneMinder RTP Data Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_rtp_data.h" @@ -24,8 +24,7 @@ #include "zm_signal.h" RtpDataThread::RtpDataThread(RtspThread &rtspThread, RtpSource &rtpSource) : - mRtspThread(rtspThread), mRtpSource(rtpSource), mTerminate(false) -{ + mRtspThread(rtspThread), mRtpSource(rtpSource), mTerminate(false) { mThread = std::thread(&RtpDataThread::Run, this); } @@ -40,20 +39,20 @@ bool RtpDataThread::recvPacket(const unsigned char *packet, size_t packetLen) { rtpHeader = (RtpDataHeader *)packet; Debug(5, "Ver: %d P: %d Pt: %d Mk: %d Seq: %d T/S: %x SSRC: %x", - rtpHeader->version, - rtpHeader->p, - rtpHeader->pt, - rtpHeader->m, - ntohs(rtpHeader->seqN), - ntohl(rtpHeader->timestampN), - ntohl(rtpHeader->ssrcN)); + rtpHeader->version, + rtpHeader->p, + rtpHeader->pt, + rtpHeader->m, + ntohs(rtpHeader->seqN), + ntohl(rtpHeader->timestampN), + ntohl(rtpHeader->ssrcN)); //unsigned short seq = ntohs(rtpHeader->seqN); unsigned long ssrc = ntohl(rtpHeader->ssrcN); if ( mRtpSource.getSsrc() && (ssrc != mRtpSource.getSsrc()) ) { - Warning("Discarding packet for unrecognised ssrc %lx", ssrc); - return false; + Warning("Discarding packet for unrecognised ssrc %lx", ssrc); + return false; } return mRtpSource.handlePacket(packet, packetLen); @@ -61,7 +60,7 @@ bool RtpDataThread::recvPacket(const unsigned char *packet, size_t packetLen) { void RtpDataThread::Run() { Debug(2, "Starting data thread %d on port %d", - mRtpSource.getSsrc(), mRtpSource.getLocalDataPort()); + mRtpSource.getSsrc(), mRtpSource.getLocalDataPort()); zm::SockAddrInet localAddr; zm::UdpInetServer rtpDataSocket; @@ -70,8 +69,8 @@ void RtpDataThread::Run() { Fatal("Failed to bind RTP server"); } else { if ( !rtpDataSocket.bind( - mRtspThread.getAddressFamily() == AF_INET6 ? "::" : "0.0.0.0", - mRtpSource.getLocalDataPort() ) ) + mRtspThread.getAddressFamily() == AF_INET6 ? "::" : "0.0.0.0", + mRtpSource.getLocalDataPort() ) ) Fatal("Failed to bind RTP server"); } Debug(3, "Bound to %s:%d", mRtpSource.getLocalHost().c_str(), mRtpSource.getLocalDataPort()); @@ -82,25 +81,25 @@ void RtpDataThread::Run() { unsigned char buffer[ZM_NETWORK_BUFSIZ]; while ( !zm_terminate && !mTerminate && (select.wait() >= 0) ) { zm::Select::CommsList readable = select.getReadable(); - if ( readable.size() == 0 ) { - Error("RTP timed out"); - Stop(); - break; - } - for (zm::Select::CommsList::iterator iter = readable.begin(); iter != readable.end(); ++iter ) { - if ( zm::UdpInetServer *socket = dynamic_cast(*iter) ) { - int nBytes = socket->recv(buffer, sizeof(buffer)); - Debug(4, "Got %d bytes on sd %d", nBytes, socket->getReadDesc()); - if ( nBytes ) { - recvPacket(buffer, nBytes); - } else { + if ( readable.size() == 0 ) { + Error("RTP timed out"); + Stop(); + break; + } + for (zm::Select::CommsList::iterator iter = readable.begin(); iter != readable.end(); ++iter ) { + if ( zm::UdpInetServer *socket = dynamic_cast(*iter) ) { + int nBytes = socket->recv(buffer, sizeof(buffer)); + Debug(4, "Got %d bytes on sd %d", nBytes, socket->getReadDesc()); + if ( nBytes ) { + recvPacket(buffer, nBytes); + } else { Stop(); break; - } - } else { - Panic("Barfed"); - } - } // end foreach commsList + } + } else { + Panic("Barfed"); + } + } // end foreach commsList } rtpDataSocket.close(); mRtspThread.Stop(); diff --git a/src/zm_rtp_data.h b/src/zm_rtp_data.h index e20878212..aff813077 100644 --- a/src/zm_rtp_data.h +++ b/src/zm_rtp_data.h @@ -1,21 +1,21 @@ // // ZoneMinder RTP Data Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_RTP_DATA_H #define ZM_RTP_DATA_H @@ -27,8 +27,7 @@ class RtspThread; class RtpSource; -struct RtpDataHeader -{ +struct RtpDataHeader { uint8_t cc:4; // CSRC count uint8_t x:1; // header extension flag uint8_t p:1; // padding flag @@ -41,22 +40,21 @@ struct RtpDataHeader uint32_t csrc[]; // optional CSRC list }; -class RtpDataThread -{ -friend class RtspThread; +class RtpDataThread { + friend class RtspThread; -private: + private: RtspThread &mRtspThread; RtpSource &mRtpSource; std::atomic mTerminate; std::thread mThread; -private: + private: bool recvPacket( const unsigned char *packet, size_t packetLen ); void Run(); -public: + public: RtpDataThread( RtspThread &rtspThread, RtpSource &rtpSource ); ~RtpDataThread(); diff --git a/src/zm_rtp_source.cpp b/src/zm_rtp_source.cpp index b8f2d62ac..a9680a95d 100644 --- a/src/zm_rtp_source.cpp +++ b/src/zm_rtp_source.cpp @@ -1,21 +1,21 @@ // // ZoneMinder RTP Source Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_rtp_source.h" @@ -26,16 +26,16 @@ #include RtpSource::RtpSource( - int id, - const std::string &localHost, - int localPortBase, - const std::string &remoteHost, - int remotePortBase, - uint32_t ssrc, - uint16_t seq, - uint32_t rtpClock, - uint32_t rtpTime, - _AVCODECID codecId ) : + int id, + const std::string &localHost, + int localPortBase, + const std::string &remoteHost, + int remotePortBase, + uint32_t ssrc, + uint16_t seq, + uint32_t rtpClock, + uint32_t rtpTime, + _AVCODECID codecId ) : mId(id), mSsrc(ssrc), mLocalHost(localHost), @@ -48,8 +48,7 @@ RtpSource::RtpSource( prevM(false), mFrameReady(false), mFrameProcessed(false), - mTerminate(false) -{ + mTerminate(false) { char hostname[256] = ""; gethostname(hostname, sizeof(hostname)); @@ -198,11 +197,11 @@ void RtpSource::updateJitter( const RtpDataHeader *header ) { } void RtpSource::updateRtcpData( - uint32_t ntpTimeSecs, - uint32_t ntpTimeFrac, - uint32_t rtpTime) { + uint32_t ntpTimeSecs, + uint32_t ntpTimeFrac, + uint32_t rtpTime) { timeval ntpTime = zm::chrono::duration_cast( - Seconds(ntpTimeSecs) + Microseconds((Microseconds::period::den * (ntpTimeFrac >> 16)) / (1 << 16))); + Seconds(ntpTimeSecs) + Microseconds((Microseconds::period::den * (ntpTimeFrac >> 16)) / (1 << 16))); Debug(5, "ntpTime: %ld.%06ld, rtpTime: %x", ntpTime.tv_sec, ntpTime.tv_usec, rtpTime); @@ -212,18 +211,18 @@ void RtpSource::updateRtcpData( mBaseTimeRtp = rtpTime; } else if ( !mRtpClock ) { Debug(5, "lastSrNtpTime: %ld.%06ld, rtpTime: %x" - "ntpTime: %ld.%06ld, rtpTime: %x", - mLastSrTimeNtp.tv_sec, mLastSrTimeNtp.tv_usec, rtpTime, - ntpTime.tv_sec, ntpTime.tv_usec, rtpTime); + "ntpTime: %ld.%06ld, rtpTime: %x", + mLastSrTimeNtp.tv_sec, mLastSrTimeNtp.tv_usec, rtpTime, + ntpTime.tv_sec, ntpTime.tv_usec, rtpTime); FPSeconds diffNtpTime = - zm::chrono::duration_cast(ntpTime) - zm::chrono::duration_cast(mBaseTimeNtp); + zm::chrono::duration_cast(ntpTime) - zm::chrono::duration_cast(mBaseTimeNtp); uint32_t diffRtpTime = rtpTime - mBaseTimeRtp; mRtpFactor = static_cast(diffRtpTime / diffNtpTime.count()); Debug( 5, "NTP-diff: %.6f RTP-diff: %d RTPfactor: %d", - diffNtpTime.count(), diffRtpTime, mRtpFactor); + diffNtpTime.count(), diffRtpTime, mRtpFactor); } mLastSrTimeNtpSecs = ntpTimeSecs; mLastSrTimeNtpFrac = ntpTimeFrac; @@ -282,29 +281,30 @@ bool RtpSource::handlePacket(const unsigned char *packet, size_t packetLen) { Debug(3, "Have H264 frame: nal type is %d", nalType); switch (nalType) { - case 24: // STAP-A - extraHeader = 2; - break; - case 25: // STAP-B - case 26: // MTAP-16 - case 27: // MTAP-24 - extraHeader = 3; - break; - // FU-A and FU-B - case 28: case 29: - // Is this NAL the first NAL in fragmentation sequence - if ( packet[rtpHeaderSize+1] & 0x80 ) { - // Now we will form new header of frame - mFrame.append( "\x0\x0\x1\x0", 4 ); - // Reconstruct NAL header from FU headers - *(mFrame+3) = (packet[rtpHeaderSize+1] & 0x1f) | - (packet[rtpHeaderSize] & 0xe0); - } + case 24: // STAP-A + extraHeader = 2; + break; + case 25: // STAP-B + case 26: // MTAP-16 + case 27: // MTAP-24 + extraHeader = 3; + break; + // FU-A and FU-B + case 28: + case 29: + // Is this NAL the first NAL in fragmentation sequence + if ( packet[rtpHeaderSize+1] & 0x80 ) { + // Now we will form new header of frame + mFrame.append( "\x0\x0\x1\x0", 4 ); + // Reconstruct NAL header from FU headers + *(mFrame+3) = (packet[rtpHeaderSize+1] & 0x1f) | + (packet[rtpHeaderSize] & 0xe0); + } - extraHeader = 2; - break; - default: - Debug(3, "Unhandled nalType %d", nalType); + extraHeader = 2; + break; + default: + Debug(3, "Unhandled nalType %d", nalType); } // Append NAL frame start code @@ -312,7 +312,7 @@ bool RtpSource::handlePacket(const unsigned char *packet, size_t packetLen) { mFrame.append("\x0\x0\x1", 3); } // end if H264 mFrame.append(packet+rtpHeaderSize+extraHeader, - packetLen-rtpHeaderSize-extraHeader); + packetLen-rtpHeaderSize-extraHeader); } else { Debug(3, "NOT H264 frame: type is %d", mCodecId); } @@ -331,7 +331,7 @@ bool RtpSource::handlePacket(const unsigned char *packet, size_t packetLen) { { std::unique_lock lck(mFrameProcessedMutex); - mFrameProcessedCv.wait(lck, [&]{ return mFrameProcessed || mTerminate; }); + mFrameProcessedCv.wait(lck, [&] { return mFrameProcessed || mTerminate; }); mFrameProcessed = false; } @@ -367,7 +367,7 @@ bool RtpSource::handlePacket(const unsigned char *packet, size_t packetLen) { bool RtpSource::getFrame(Buffer &buffer) { { std::unique_lock lck(mFrameReadyMutex); - mFrameReadyCv.wait(lck, [&]{ return mFrameReady || mTerminate; }); + mFrameReadyCv.wait(lck, [&] { return mFrameReady || mTerminate; }); mFrameReady = false; } diff --git a/src/zm_rtp_source.h b/src/zm_rtp_source.h index 71be9af2c..577e1ba05 100644 --- a/src/zm_rtp_source.h +++ b/src/zm_rtp_source.h @@ -1,21 +1,21 @@ // // ZoneMinder RTP Source Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_RTP_SOURCE_H #define ZM_RTP_SOURCE_H @@ -32,17 +32,16 @@ struct RtpDataHeader; -class RtpSource -{ -public: +class RtpSource { + public: typedef enum { EMPTY, FILLING, READY } FrameState; -private: + private: static const int RTP_SEQ_MOD = 1<<16; static const int MAX_DROPOUT = 3000; static const int MAX_MISORDER = 100; static const int MIN_SEQUENTIAL = 2; -private: + private: // Identity int mId; // General id (usually monitor id) std::string mCname; // Canonical name, for SDES @@ -59,12 +58,12 @@ private: uint32_t mReceivedPrior; // packet received at last interval uint32_t mTransit; // relative trans time for prev pkt uint32_t mJitter; // estimated jitter - + // Ports/Channels std::string mLocalHost; - int mLocalPortChans[2]; + int mLocalPortChans[2]; std::string mRemoteHost; - int mRemotePortChans[2]; + int mRemotePortChans[2]; // Time keys uint32_t mRtpClock; @@ -100,13 +99,13 @@ private: std::mutex mFrameProcessedMutex; bool mTerminate; -private: + private: void init(uint16_t seq); -public: + public: RtpSource( int id, const std::string &localHost, int localPortBase, const std::string &remoteHost, int remotePortBase, uint32_t ssrc, uint16_t seq, uint32_t rtpClock, uint32_t rtpTime, _AVCODECID codecId ); ~RtpSource(); - + bool updateSeq( uint16_t seq ); void updateJitter( const RtpDataHeader *header ); void updateRtcpData( uint32_t ntpTimeSecs, uint32_t ntpTimeFrac, uint32_t rtpTime ); @@ -114,79 +113,64 @@ public: bool handlePacket( const unsigned char *packet, size_t packetLen ); - uint32_t getSsrc() const - { + uint32_t getSsrc() const { return( mSsrc ); } - void setSsrc( uint32_t ssrc ) - { + void setSsrc( uint32_t ssrc ) { mSsrc = ssrc; } bool getFrame( Buffer &buffer ); - const std::string &getCname() const - { + const std::string &getCname() const { return( mCname ); } - const std::string &getLocalHost() const - { + const std::string &getLocalHost() const { return( mLocalHost ); } - int getLocalDataPort() const - { + int getLocalDataPort() const { return( mLocalPortChans[0] ); } - int getLocalCtrlPort() const - { + int getLocalCtrlPort() const { return( mLocalPortChans[1] ); } - const std::string &getRemoteHost() const - { + const std::string &getRemoteHost() const { return( mRemoteHost ); } - int getRemoteDataPort() const - { + int getRemoteDataPort() const { return( mRemotePortChans[0] ); } - int getRemoteCtrlPort() const - { + int getRemoteCtrlPort() const { return( mRemotePortChans[1] ); } - uint32_t getMaxSeq() const - { + uint32_t getMaxSeq() const { return( mCycles + mMaxSeq ); } - uint32_t getExpectedPackets() const - { + uint32_t getExpectedPackets() const { return( mExpectedPackets ); } - - uint32_t getLostPackets() const - { + + uint32_t getLostPackets() const { return( mLostPackets ); } - uint8_t getLostFraction() const - { + uint8_t getLostFraction() const { return( mLostFraction ); } - uint32_t getJitter() const - { + uint32_t getJitter() const { return( mJitter >> 4 ); } - uint32_t getLastSrTimestamp() const - { + uint32_t getLastSrTimestamp() const { return( ((mLastSrTimeNtpSecs&0xffff)<<16)|(mLastSrTimeNtpFrac>>16) ); } }; diff --git a/src/zm_rtsp.cpp b/src/zm_rtsp.cpp index edf7b7e9e..1c0ad364f 100644 --- a/src/zm_rtsp.cpp +++ b/src/zm_rtsp.cpp @@ -1,21 +1,21 @@ // // ZoneMinder RTSP Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_rtsp.h" @@ -129,15 +129,15 @@ void RtspThread::releasePorts(int port) { } RtspThread::RtspThread( - int id, - RtspMethod method, - const std::string &protocol, - const std::string &host, - const std::string &port, - const std::string &path, - const std::string &user, - const std::string &pass, - bool rtsp_describe) : + int id, + RtspMethod method, + const std::string &protocol, + const std::string &host, + const std::string &port, + const std::string &path, + const std::string &user, + const std::string &pass, + bool rtsp_describe) : mId(id), mMethod(method), mProtocol(protocol), @@ -152,8 +152,7 @@ RtspThread::RtspThread( mSsrc(0), mDist(UNDEFINED), mRtpTime(0), - mTerminate(false) -{ + mTerminate(false) { mUrl = mProtocol+"://"+mHost+":"+mPort; if ( !mPath.empty() ) { if ( mPath[0] == '/' ) @@ -168,7 +167,7 @@ RtspThread::RtspThread( if ( mMethod == RTP_RTSP_HTTP ) mHttpSession = stringtf("%d", rand()); - + mNeedAuth = false; if ( user.length() > 0 && pass.length() > 0 ) { Debug(2, "# of auth parts 2"); @@ -213,11 +212,11 @@ void RtspThread::Run() { //select.addReader( &mRtspSocket ); //while ( select.wait() ) //{ - //mRtspSocket.recv( response ); - //Debug( 4, "Drained %d bytes from RTSP socket", response.size() ); + //mRtspSocket.recv( response ); + //Debug( 4, "Drained %d bytes from RTSP socket", response.size() ); //} - - bool authTried = false; + + bool authTried = false; if ( mMethod == RTP_RTSP_HTTP ) { if ( !mRtspSocket2.connect(mHost.c_str(), mPort.c_str()) ) Fatal("Unable to connect auxiliary RTSP/HTTP socket"); @@ -225,11 +224,11 @@ void RtspThread::Run() { //select.addReader( &mRtspSocket2 ); //while ( select.wait() ) //{ - //mRtspSocket2.recv( response ); - //Debug( 4, "Drained %d bytes from HTTP socket", response.size() ); + //mRtspSocket2.recv( response ); + //Debug( 4, "Drained %d bytes from HTTP socket", response.size() ); //} - - //possibly retry sending the message for authentication + + //possibly retry sending the message for authentication int respCode = -1; char respText[256]; do { @@ -249,7 +248,7 @@ void RtspThread::Run() { Error("Recv failed; %s", strerror(errno)); return; } - + Debug(2, "Received HTTP response: %s (%zd bytes)", response.c_str(), response.size()); float respVer = 0; respCode = -1; @@ -274,9 +273,9 @@ void RtspThread::Run() { Fatal("Unable to reconnect RTSP socket"); Debug(2, "connection should be reopened now"); } - - } while (respCode == 401 && !authTried); - + + } while (respCode == 401 && !authTried); + if ( respCode != 200 ) { Error("Unexpected response code %d, text is '%s'", respCode, respText); return; @@ -381,8 +380,7 @@ void RtspThread::Run() { if ( !mAuth.empty() ) authUrl.insert( authUrl.find( "://" )+3, mAuth+"@" ); - if ( av_open_input_file( &mFormatContext, authUrl.c_str(), nullptr, 0, nullptr ) != 0 ) - { + if ( av_open_input_file( &mFormatContext, authUrl.c_str(), nullptr, 0, nullptr ) != 0 ) { Error( "Unable to open input '%s'", authUrl.c_str() ); return( -1 ); } @@ -391,9 +389,9 @@ void RtspThread::Run() { uint32_t rtpClock = 0; std::string trackUrl = mUrl; std::string controlUrl; - + _AVCODECID codecId = AV_CODEC_ID_NONE; - + if ( mFormatContext->nb_streams >= 1 ) { for ( unsigned int i = 0; i < mFormatContext->nb_streams; i++ ) { SessionDescriptor::MediaDescriptor *mediaDesc = mSessDesc->getStream(i); @@ -415,23 +413,23 @@ void RtspThread::Run() { } // end if have stream switch ( mMethod ) { - case RTP_UNICAST : - localPorts[0] = requestPorts(); - localPorts[1] = localPorts[0]+1; + case RTP_UNICAST : + localPorts[0] = requestPorts(); + localPorts[1] = localPorts[0]+1; - message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP;unicast;client_port=" - +stringtf("%d", localPorts[0] )+"-"+stringtf( "%d", localPorts[1])+"\r\n"; - break; - case RTP_MULTICAST : - message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP;multicast\r\n"; - break; - case RTP_RTSP : - case RTP_RTSP_HTTP : - message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP/TCP;unicast\r\n"; - break; - default: - Panic("Got unexpected method %d", mMethod); - break; + message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP;unicast;client_port=" + +stringtf("%d", localPorts[0] )+"-"+stringtf( "%d", localPorts[1])+"\r\n"; + break; + case RTP_MULTICAST : + message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP;multicast\r\n"; + break; + case RTP_RTSP : + case RTP_RTSP_HTTP : + message = "SETUP "+trackUrl+" RTSP/1.0\r\nTransport: RTP/AVP/TCP;unicast\r\n"; + break; + default: + Panic("Got unexpected method %d", mMethod); + break; } if ( !sendCommand(message) ) @@ -448,7 +446,7 @@ void RtspThread::Run() { if ( ( lines[i].size() > 8 ) && ( lines[i].substr(0, 8) == "Session:" ) ) { StringVector sessionLine = Split(lines[i].substr(9), ";"); session = TrimSpaces(sessionLine[0]); - if ( sessionLine.size() == 2 ){ + if ( sessionLine.size() == 2 ) { int32 timeout_val = 0; sscanf(TrimSpaces(sessionLine[1]).c_str(), "timeout=%d", &timeout_val); timeout = Seconds(timeout_val); @@ -527,7 +525,7 @@ void RtspThread::Run() { // Check for a timeout again. Some rtsp devices don't send a timeout until after the PLAY command is sent if ((lines[i].size() > 8) && (lines[i].substr(0, 8) == "Session:") && (timeout == Seconds(0))) { StringVector sessionLine = Split(lines[i].substr(9), ";"); - if ( sessionLine.size() == 2 ){ + if ( sessionLine.size() == 2 ) { int32 timeout_val = 0; sscanf(TrimSpaces(sessionLine[1]).c_str(), "timeout=%d", &timeout_val); timeout = Seconds(timeout_val); @@ -563,7 +561,7 @@ void RtspThread::Run() { rtpTime = strtol( subparts[1].c_str(), nullptr, 10 ); } } - break; + break; } } } @@ -576,218 +574,215 @@ void RtspThread::Run() { message = "GET_PARAMETER "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; switch( mMethod ) { - case RTP_UNICAST : - { - RtpSource *source = new RtpSource( mId, "", localPorts[0], mHost, remotePorts[0], ssrc, seq, rtpClock, rtpTime, codecId ); - mSources[ssrc] = source; - RtpDataThread rtpDataThread( *this, *source ); - RtpCtrlThread rtpCtrlThread( *this, *source ); + case RTP_UNICAST : { + RtpSource *source = new RtpSource( mId, "", localPorts[0], mHost, remotePorts[0], ssrc, seq, rtpClock, rtpTime, codecId ); + mSources[ssrc] = source; + RtpDataThread rtpDataThread( *this, *source ); + RtpCtrlThread rtpCtrlThread( *this, *source ); - while (!mTerminate) { - now = std::chrono::steady_clock::now(); - // Send a keepalive message if the server supports this feature and we are close to the timeout expiration - Debug(5, "sendkeepalive %d, timeout %" PRIi64 " s, now: %" PRIi64 " s last: %" PRIi64 " s since: %" PRIi64 "s ", - sendKeepalive, - static_cast(Seconds(timeout).count()), - static_cast(std::chrono::duration_cast(now.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(lastKeepalive.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast((now - lastKeepalive)).count())); + while (!mTerminate) { + now = std::chrono::steady_clock::now(); + // Send a keepalive message if the server supports this feature and we are close to the timeout expiration + Debug(5, "sendkeepalive %d, timeout %" PRIi64 " s, now: %" PRIi64 " s last: %" PRIi64 " s since: %" PRIi64 "s ", + sendKeepalive, + static_cast(Seconds(timeout).count()), + static_cast(std::chrono::duration_cast(now.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(lastKeepalive.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast((now - lastKeepalive)).count())); - if (sendKeepalive && (timeout > Seconds(0)) && ((now - lastKeepalive) > (timeout - Seconds(5)))) { - if (!sendCommand(message)) - return; - lastKeepalive = now; - } - std::this_thread::sleep_for(Microseconds(100)); + if (sendKeepalive && (timeout > Seconds(0)) && ((now - lastKeepalive) > (timeout - Seconds(5)))) { + if (!sendCommand(message)) + return; + lastKeepalive = now; } + std::this_thread::sleep_for(Microseconds(100)); + } #if 0 - message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; - if ( !sendCommand( message ) ) - return( -1 ); - if ( !recvResponse( response ) ) - return( -1 ); + message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); #endif - message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; - if ( !sendCommand( message ) ) - return; - if ( !recvResponse( response ) ) - return; + message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return; + if ( !recvResponse( response ) ) + return; - rtpDataThread.Stop(); - rtpCtrlThread.Stop(); + rtpDataThread.Stop(); + rtpCtrlThread.Stop(); - //rtpDataThread.kill( SIGTERM ); - //rtpCtrlThread.kill( SIGTERM ); + //rtpDataThread.kill( SIGTERM ); + //rtpCtrlThread.kill( SIGTERM ); - delete mSources[ssrc]; - mSources.clear(); + delete mSources[ssrc]; + mSources.clear(); - releasePorts( localPorts[0] ); + releasePorts( localPorts[0] ); - break; - } - case RTP_RTSP : - case RTP_RTSP_HTTP : - { - RtpSource *source = new RtpSource( mId, "", remoteChannels[0], mHost, remoteChannels[0], ssrc, seq, rtpClock, rtpTime, codecId ); - mSources[ssrc] = source; - // These never actually run - RtpDataThread rtpDataThread( *this, *source ); - RtpCtrlThread rtpCtrlThread( *this, *source ); + break; + } + case RTP_RTSP : + case RTP_RTSP_HTTP : { + RtpSource *source = new RtpSource( mId, "", remoteChannels[0], mHost, remoteChannels[0], ssrc, seq, rtpClock, rtpTime, codecId ); + mSources[ssrc] = source; + // These never actually run + RtpDataThread rtpDataThread( *this, *source ); + RtpCtrlThread rtpCtrlThread( *this, *source ); - zm::Select select(Milliseconds(config.http_timeout)); - select.addReader( &mRtspSocket ); + zm::Select select(Milliseconds(config.http_timeout)); + select.addReader( &mRtspSocket ); - Buffer buffer( ZM_NETWORK_BUFSIZ ); - std::string keepaliveMessage = "OPTIONS "+mUrl+" RTSP/1.0\r\n"; - std::string keepaliveResponse = "RTSP/1.0 200 OK\r\n"; - while (!mTerminate && select.wait() >= 0) { - zm::Select::CommsList readable = select.getReadable(); - if ( readable.size() == 0 ) { - Error( "RTSP timed out" ); - break; - } + Buffer buffer( ZM_NETWORK_BUFSIZ ); + std::string keepaliveMessage = "OPTIONS "+mUrl+" RTSP/1.0\r\n"; + std::string keepaliveResponse = "RTSP/1.0 200 OK\r\n"; + while (!mTerminate && select.wait() >= 0) { + zm::Select::CommsList readable = select.getReadable(); + if ( readable.size() == 0 ) { + Error( "RTSP timed out" ); + break; + } - static char tempBuffer[ZM_NETWORK_BUFSIZ]; - ssize_t nBytes = mRtspSocket.recv( tempBuffer, sizeof(tempBuffer) ); - buffer.append( tempBuffer, nBytes ); - Debug( 4, "Read %zd bytes on sd %d, %d total", nBytes, mRtspSocket.getReadDesc(), buffer.size() ); + static char tempBuffer[ZM_NETWORK_BUFSIZ]; + ssize_t nBytes = mRtspSocket.recv( tempBuffer, sizeof(tempBuffer) ); + buffer.append( tempBuffer, nBytes ); + Debug( 4, "Read %zd bytes on sd %d, %d total", nBytes, mRtspSocket.getReadDesc(), buffer.size() ); - while( buffer.size() > 0 ) { - if ( buffer[0] == '$' ) { - if ( buffer.size() < 4 ) - break; - unsigned char channel = buffer[1]; - unsigned short len = ntohs( *((unsigned short *)(buffer+2)) ); + while( buffer.size() > 0 ) { + if ( buffer[0] == '$' ) { + if ( buffer.size() < 4 ) + break; + unsigned char channel = buffer[1]; + unsigned short len = ntohs( *((unsigned short *)(buffer+2)) ); - Debug( 4, "Got %d bytes left, expecting %d byte packet on channel %d", buffer.size(), len, channel ); - if ( (unsigned short)buffer.size() < (len+4) ) { - Debug( 4, "Missing %d bytes, rereading", (len+4)-buffer.size() ); - break; - } - if ( channel == remoteChannels[0] ) { - Debug(4, "Got %d bytes on data channel %d, packet length is %d", buffer.size(), channel, len); - Hexdump(4, (char *)buffer, 16); - rtpDataThread.recvPacket(buffer+4, len); - } else if ( channel == remoteChannels[1] ) { + Debug( 4, "Got %d bytes left, expecting %d byte packet on channel %d", buffer.size(), len, channel ); + if ( (unsigned short)buffer.size() < (len+4) ) { + Debug( 4, "Missing %d bytes, rereading", (len+4)-buffer.size() ); + break; + } + if ( channel == remoteChannels[0] ) { + Debug(4, "Got %d bytes on data channel %d, packet length is %d", buffer.size(), channel, len); + Hexdump(4, (char *)buffer, 16); + rtpDataThread.recvPacket(buffer+4, len); + } else if ( channel == remoteChannels[1] ) { // len = ntohs( *((unsigned short *)(buffer+2)) ); // Debug( 4, "Got %d bytes on control channel %d", nBytes, channel ); - Debug(4, "Got %d bytes on control channel %d, packet length is %d", buffer.size(), channel, len); - Hexdump(4, (char *)buffer, 16); - rtpCtrlThread.recvPackets(buffer+4, len); - } else { - Error("Unexpected channel selector %d in RTSP interleaved data", buffer[1]); - buffer.clear(); - break; - } - buffer.consume(len+4); - nBytes -= len+4; + Debug(4, "Got %d bytes on control channel %d, packet length is %d", buffer.size(), channel, len); + Hexdump(4, (char *)buffer, 16); + rtpCtrlThread.recvPackets(buffer+4, len); } else { - if ( keepaliveResponse.compare( 0, keepaliveResponse.size(), (char *)buffer, keepaliveResponse.size() ) == 0 ) { - Debug( 4, "Got keepalive response '%s'", (char *)buffer ); - //buffer.consume( keepaliveResponse.size() ); - if ( const char *charPtr = (char *)memchr( (char *)buffer, '$', buffer.size() ) ) { - int discardBytes = charPtr-(char *)buffer; - buffer -= discardBytes; - } else { - buffer.clear(); - } + Error("Unexpected channel selector %d in RTSP interleaved data", buffer[1]); + buffer.clear(); + break; + } + buffer.consume(len+4); + nBytes -= len+4; + } else { + if ( keepaliveResponse.compare( 0, keepaliveResponse.size(), (char *)buffer, keepaliveResponse.size() ) == 0 ) { + Debug( 4, "Got keepalive response '%s'", (char *)buffer ); + //buffer.consume( keepaliveResponse.size() ); + if ( const char *charPtr = (char *)memchr( (char *)buffer, '$', buffer.size() ) ) { + int discardBytes = charPtr-(char *)buffer; + buffer -= discardBytes; } else { - if ( const char *charPtr = (char *)memchr( (char *)buffer, '$', buffer.size() ) ) { - int discardBytes = charPtr-(char *)buffer; - Warning( "Unexpected format RTSP interleaved data, resyncing by %d bytes", discardBytes ); - Hexdump( -1, (char *)buffer, discardBytes ); - buffer -= discardBytes; - } else { - Warning( "Unexpected format RTSP interleaved data, dumping %d bytes", buffer.size() ); - Hexdump( -1, (char *)buffer, 32 ); - buffer.clear(); - } + buffer.clear(); + } + } else { + if ( const char *charPtr = (char *)memchr( (char *)buffer, '$', buffer.size() ) ) { + int discardBytes = charPtr-(char *)buffer; + Warning( "Unexpected format RTSP interleaved data, resyncing by %d bytes", discardBytes ); + Hexdump( -1, (char *)buffer, discardBytes ); + buffer -= discardBytes; + } else { + Warning( "Unexpected format RTSP interleaved data, dumping %d bytes", buffer.size() ); + Hexdump( -1, (char *)buffer, 32 ); + buffer.clear(); } } } - // Send a keepalive message if the server supports this feature and we are close to the timeout expiration - // FIXME: Is this really necessary when using tcp ? - now = std::chrono::steady_clock::now(); - // Send a keepalive message if the server supports this feature and we are close to the timeout expiration - Debug(5, "sendkeepalive %d, timeout %" PRIi64 " s, now: %" PRIi64 " s last: %" PRIi64 " s since: %" PRIi64 " s", - sendKeepalive, - static_cast(Seconds(timeout).count()), - static_cast(std::chrono::duration_cast(now.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast(lastKeepalive.time_since_epoch()).count()), - static_cast(std::chrono::duration_cast((now - lastKeepalive)).count())); - - if (sendKeepalive && (timeout > Seconds(0)) && ((now - lastKeepalive) > (timeout - Seconds(5)))) { - if (!sendCommand(message)) { - return; - } - - lastKeepalive = now; - } - buffer.tidy(true); } -#if 0 - message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; - if ( !sendCommand( message ) ) - return( -1 ); - if ( !recvResponse( response ) ) - return( -1 ); -#endif - // Send a teardown message but don't expect a response as this may not be implemented on the server when using TCP - message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; - if ( !sendCommand( message ) ) - return; + // Send a keepalive message if the server supports this feature and we are close to the timeout expiration + // FIXME: Is this really necessary when using tcp ? + now = std::chrono::steady_clock::now(); + // Send a keepalive message if the server supports this feature and we are close to the timeout expiration + Debug(5, "sendkeepalive %d, timeout %" PRIi64 " s, now: %" PRIi64 " s last: %" PRIi64 " s since: %" PRIi64 " s", + sendKeepalive, + static_cast(Seconds(timeout).count()), + static_cast(std::chrono::duration_cast(now.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast(lastKeepalive.time_since_epoch()).count()), + static_cast(std::chrono::duration_cast((now - lastKeepalive)).count())); - delete mSources[ssrc]; - mSources.clear(); - - break; - } - case RTP_MULTICAST : - { - RtpSource *source = new RtpSource( mId, localHost, localPorts[0], mHost, remotePorts[0], ssrc, seq, rtpClock, rtpTime, codecId ); - mSources[ssrc] = source; - RtpDataThread rtpDataThread( *this, *source ); - RtpCtrlThread rtpCtrlThread( *this, *source ); - - - while (!mTerminate) { - // Send a keepalive message if the server supports this feature and we are close to the timeout expiration - if (sendKeepalive && (timeout > Seconds(0)) - && ((std::chrono::steady_clock::now() - lastKeepalive) > (timeout - Seconds(5)))) { - if (!sendCommand(message)) { - return; - } - lastKeepalive = std::chrono::steady_clock::now(); + if (sendKeepalive && (timeout > Seconds(0)) && ((now - lastKeepalive) > (timeout - Seconds(5)))) { + if (!sendCommand(message)) { + return; } - std::this_thread::sleep_for(Microseconds(100)); + + lastKeepalive = now; } -#if 0 - message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; - if ( !sendCommand( message ) ) - return( -1 ); - if ( !recvResponse( response ) ) - return( -1 ); -#endif - message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; - if ( !sendCommand(message) ) - return; - if ( !recvResponse(response) ) - return; - - rtpDataThread.Stop(); - rtpCtrlThread.Stop(); - - delete mSources[ssrc]; - mSources.clear(); - - releasePorts( localPorts[0] ); - break; + buffer.tidy(true); } - default: - Panic("Got unexpected method %d", mMethod); - break; +#if 0 + message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); +#endif + // Send a teardown message but don't expect a response as this may not be implemented on the server when using TCP + message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return; + + delete mSources[ssrc]; + mSources.clear(); + + break; + } + case RTP_MULTICAST : { + RtpSource *source = new RtpSource( mId, localHost, localPorts[0], mHost, remotePorts[0], ssrc, seq, rtpClock, rtpTime, codecId ); + mSources[ssrc] = source; + RtpDataThread rtpDataThread( *this, *source ); + RtpCtrlThread rtpCtrlThread( *this, *source ); + + + while (!mTerminate) { + // Send a keepalive message if the server supports this feature and we are close to the timeout expiration + if (sendKeepalive && (timeout > Seconds(0)) + && ((std::chrono::steady_clock::now() - lastKeepalive) > (timeout - Seconds(5)))) { + if (!sendCommand(message)) { + return; + } + lastKeepalive = std::chrono::steady_clock::now(); + } + std::this_thread::sleep_for(Microseconds(100)); + } +#if 0 + message = "PAUSE "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand( message ) ) + return( -1 ); + if ( !recvResponse( response ) ) + return( -1 ); +#endif + message = "TEARDOWN "+mUrl+" RTSP/1.0\r\nSession: "+session+"\r\n"; + if ( !sendCommand(message) ) + return; + if ( !recvResponse(response) ) + return; + + rtpDataThread.Stop(); + rtpCtrlThread.Stop(); + + delete mSources[ssrc]; + mSources.clear(); + + releasePorts( localPorts[0] ); + break; + } + default: + Panic("Got unexpected method %d", mMethod); + break; } return; diff --git a/src/zm_rtsp.h b/src/zm_rtsp.h index 8bff6f7c5..b19b95f64 100644 --- a/src/zm_rtsp.h +++ b/src/zm_rtsp.h @@ -1,21 +1,21 @@ // // ZoneMinder RTSP Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_RTSP_H #define ZM_RTSP_H @@ -30,22 +30,22 @@ #include class RtspThread { -public: + public: typedef enum { RTP_UNICAST, RTP_MULTICAST, RTP_RTSP, RTP_RTSP_HTTP } RtspMethod; typedef enum { UNDEFINED, UNICAST, MULTICAST } RtspDist; -private: + private: typedef std::set PortSet; typedef std::set SsrcSet; typedef std::map SourceMap; -private: + private: static int smMinDataPort; static int smMaxDataPort; static PortSet smLocalSsrcs; static PortSet smAssignedPorts; -private: + private: int mId; RtspMethod mMethod; @@ -55,7 +55,7 @@ private: std::string mPath; bool mRtspDescribe; std::string mUrl; - + // Reworked authentication system // First try without authentication, even if we have a username and password // on receiving a 401 response, select authentication method (basic or digest) @@ -84,47 +84,43 @@ private: int mRemoteChannels[2]; RtspDist mDist; - unsigned long mRtpTime; + unsigned long mRtpTime; std::thread mThread; std::atomic mTerminate; -private: + private: bool sendCommand( std::string message ); bool recvResponse( std::string &response ); void checkAuthResponse(std::string &response); void Run(); -public: - RtspThread( int id, RtspMethod method, const std::string &protocol, const std::string &host, - const std::string &port, const std::string &path, const std::string &user, const std::string &pass, + public: + RtspThread( int id, RtspMethod method, const std::string &protocol, const std::string &host, + const std::string &port, const std::string &path, const std::string &user, const std::string &pass, bool rtsp_describe ); ~RtspThread(); -public: + public: int requestPorts(); void releasePorts( int port ); bool isValidSsrc( uint32_t ssrc ); bool updateSsrc( uint32_t ssrc, const RtpDataHeader *header ); - uint32_t getSsrc() const - { + uint32_t getSsrc() const { return( mSsrc ); } - bool hasSources() const - { + bool hasSources() const { return( !mSources.empty() ); } - AVFormatContext *getFormatContext() - { + AVFormatContext *getFormatContext() { return( mFormatContext ); } - - bool getFrame( Buffer &frame ) - { + + bool getFrame( Buffer &frame ) { SourceMap::iterator iter = mSources.begin(); if ( iter == mSources.end() ) return( false ); @@ -134,8 +130,7 @@ public: void Stop() { mTerminate = true; } bool IsStopped() const { return mTerminate; } - int getAddressFamily () - { + int getAddressFamily () { return mRtspSocket.getDomain(); } }; diff --git a/src/zm_rtsp_auth.cpp b/src/zm_rtsp_auth.cpp index 39b04d960..0ec859f4c 100644 --- a/src/zm_rtsp_auth.cpp +++ b/src/zm_rtsp_auth.cpp @@ -1,16 +1,16 @@ // // ZoneMinder RTSP Authentication Class Implementation, $Date$, $Revision$ -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -27,20 +27,20 @@ namespace zm { Authenticator::Authenticator(const std::string &username, const std::string &password) - : fAuthMethod(AUTH_UNDEFINED), - fCnonce("0a4f113b"), - fUsername(std::move(username)), - fPassword(std::move(password)), - nc(1) {} + : fAuthMethod(AUTH_UNDEFINED), + fCnonce("0a4f113b"), + fUsername(std::move(username)), + fPassword(std::move(password)), + nc(1) {} Authenticator::~Authenticator() { reset(); } void Authenticator::reset() { - fRealm.clear(); + fRealm.clear(); fNonce.clear(); - fUsername.clear(); + fUsername.clear(); fPassword.clear(); fAuthMethod = AUTH_UNDEFINED; } @@ -49,12 +49,12 @@ void Authenticator::authHandleHeader(const std::string &headerData) { const char* basic_match = "Basic "; const char* digest_match = "Digest "; size_t digest_match_len = strlen(digest_match); - + // Check if basic auth if ( strncasecmp(headerData.c_str(), basic_match, strlen(basic_match)) == 0 ) { fAuthMethod = AUTH_BASIC; Debug(2, "Set authMethod to Basic"); - } + } // Check if digest auth else if ( strncasecmp(headerData.c_str(), digest_match, digest_match_len) == 0) { fAuthMethod = AUTH_DIGEST; @@ -78,7 +78,7 @@ void Authenticator::authHandleHeader(const std::string &headerData) { } } Debug(2, "Auth data completed. User: %s, realm: %s, nonce: %s, qop: %s", - username().c_str(), fRealm.c_str(), fNonce.c_str(), fQop.c_str()); + username().c_str(), fRealm.c_str(), fNonce.c_str(), fQop.c_str()); } } // end void Authenticator::authHandleHeader(std::string headerData) @@ -91,9 +91,9 @@ std::string Authenticator::getAuthHeader(const std::string &method, const std::s if ( fAuthMethod == AUTH_BASIC ) { result += "Basic " + Base64Encode(username() + ":" + password()); } else if ( fAuthMethod == AUTH_DIGEST ) { - result += std::string("Digest ") + - "username=\"" + quote(username()) + "\", realm=\"" + quote(realm()) + "\", " + - "nonce=\"" + quote(nonce()) + "\", uri=\"" + quote(uri) + "\""; + result += std::string("Digest ") + + "username=\"" + quote(username()) + "\", realm=\"" + quote(realm()) + "\", " + + "nonce=\"" + quote(nonce()) + "\", uri=\"" + quote(uri) + "\""; if ( !fQop.empty() ) { result += ", qop=" + fQop; result += ", nc=" + stringtf("%08x",nc); @@ -101,7 +101,7 @@ std::string Authenticator::getAuthHeader(const std::string &method, const std::s } result += ", response=\"" + computeDigestResponse(method, uri) + "\""; result += ", algorithm=\"MD5\""; - + //Authorization: Digest username="zm", // realm="NC-336PW-HD-1080P", // nonce="de8859d97609a6fcc16eaba490dcfd80", @@ -112,7 +112,7 @@ std::string Authenticator::getAuthHeader(const std::string &method, const std::s // qop="auth", // cnonce="c8051140765877dc", // nc=00000001 - + } result += "\r\n"; return result; diff --git a/src/zm_rtsp_auth.h b/src/zm_rtsp_auth.h index 8bf357e94..d613ed379 100644 --- a/src/zm_rtsp_auth.h +++ b/src/zm_rtsp_auth.h @@ -1,20 +1,20 @@ // // ZoneMinder RTSP Authentication Class Interface, $Date$, $Revision$ -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_RTSP_AUTH_H #define ZM_RTSP_AUTH_H @@ -26,7 +26,7 @@ namespace zm { enum AuthMethod { AUTH_UNDEFINED = 0, AUTH_BASIC = 1, AUTH_DIGEST = 2 }; class Authenticator { -public: + public: Authenticator(const std::string &username, const std::string &password); virtual ~Authenticator(); void reset(); @@ -34,21 +34,21 @@ public: std::string realm() { return fRealm; } std::string nonce() { return fNonce; } std::string username() { return fUsername; } - AuthMethod auth_method() const { return fAuthMethod; } - + AuthMethod auth_method() const { return fAuthMethod; } + std::string computeDigestResponse(const std::string &cmd, const std::string &url); void authHandleHeader(const std::string &headerData); std::string getAuthHeader(const std::string &method, const std::string &path); void checkAuthResponse(const std::string &response); - -private: + + private: std::string password() { return fPassword; } AuthMethod fAuthMethod; - std::string fRealm; + std::string fRealm; std::string fNonce; std::string fCnonce; std::string fQop; - std::string fUsername; + std::string fUsername; std::string fPassword; std::string quote( const std::string &src ); int nc; diff --git a/src/zm_rtsp_server.cpp b/src/zm_rtsp_server.cpp index c4907f875..d964074fa 100644 --- a/src/zm_rtsp_server.cpp +++ b/src/zm_rtsp_server.cpp @@ -96,19 +96,19 @@ int main(int argc, char *argv[]) { break; switch (c) { - case 'm': - monitor_id = atoi(optarg); - break; - case 'h': - case '?': - Usage(); - break; - case 'v': - std::cout << ZM_VERSION << "\n"; - exit(0); - default: - // fprintf(stderr, "?? getopt returned character code 0%o ??\n", c); - break; + case 'm': + monitor_id = atoi(optarg); + break; + case 'h': + case '?': + Usage(); + break; + case 'v': + std::cout << ZM_VERSION << "\n"; + exit(0); + default: + // fprintf(stderr, "?? getopt returned character code 0%o ??\n", c); + break; } } @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) { zmSetDefaultDieHandler(); std::shared_ptr eventLoop(new xop::EventLoop()); - std::shared_ptr rtspServer = xop::RtspServer::Create(eventLoop.get()); + std::shared_ptr rtspServer = xop::RtspServer::Create(eventLoop.get()); rtspServer->SetVersion("ZoneMinder RTSP Server"); if (config.opt_use_auth) { @@ -240,13 +240,13 @@ int main(int argc, char *argv[]) { Error("Unable to create session for %s", streamname.c_str()); continue; } - session->AddNotifyConnectedCallback([] (xop::MediaSessionId sessionId, const std::string &peer_ip, uint16_t peer_port){ - Debug(1, "RTSP client connect, ip=%s, port=%hu", peer_ip.c_str(), peer_port); - }); + session->AddNotifyConnectedCallback([] (xop::MediaSessionId sessionId, const std::string &peer_ip, uint16_t peer_port) { + Debug(1, "RTSP client connect, ip=%s, port=%hu", peer_ip.c_str(), peer_port); + }); session->AddNotifyDisconnectedCallback([](xop::MediaSessionId sessionId, const std::string &peer_ip, uint16_t peer_port) { - Debug(1, "RTSP client disconnect, ip=%s, port=%hu", peer_ip.c_str(), peer_port); - }); + Debug(1, "RTSP client disconnect, ip=%s, port=%hu", peer_ip.c_str(), peer_port); + }); rtspServer->AddSession(session); //char *url = rtspServer->rtspURL(session); @@ -261,9 +261,9 @@ int main(int argc, char *argv[]) { session->AddSource(xop::channel_0, xop::H264Source::CreateNew()); videoSource = new H264_ZoneMinderFifoSource(rtspServer, session->GetMediaSessionId(), xop::channel_0, videoFifoPath); } else if ( - std::string::npos != videoFifoPath.find("hevc") - or - std::string::npos != videoFifoPath.find("h265")) { + std::string::npos != videoFifoPath.find("hevc") + or + std::string::npos != videoFifoPath.find("h265")) { session->AddSource(xop::channel_0, xop::H265Source::CreateNew()); videoSource = new H265_ZoneMinderFifoSource(rtspServer, session->GetMediaSessionId(), xop::channel_0, videoFifoPath); } else { @@ -290,18 +290,18 @@ int main(int argc, char *argv[]) { if (std::string::npos != audioFifoPath.find("aac")) { Debug(1, "Adding aac source at %dHz %d channels", - monitor->GetAudioFrequency(), monitor->GetAudioChannels()); + monitor->GetAudioFrequency(), monitor->GetAudioChannels()); session->AddSource(xop::channel_1, xop::AACSource::CreateNew( - monitor->GetAudioFrequency(), - monitor->GetAudioChannels(), - false /* has_adts */)); + monitor->GetAudioFrequency(), + monitor->GetAudioChannels(), + false /* has_adts */)); audioSource = new ADTS_ZoneMinderFifoSource(rtspServer, session->GetMediaSessionId(), xop::channel_1, audioFifoPath); audioSource->setFrequency(monitor->GetAudioFrequency()); audioSource->setChannels(monitor->GetAudioChannels()); } else if (std::string::npos != audioFifoPath.find("pcm_alaw")) { Debug(1, "Adding G711A source at %dHz %d channels", - monitor->GetAudioFrequency(), monitor->GetAudioChannels()); + monitor->GetAudioFrequency(), monitor->GetAudioChannels()); session->AddSource(xop::channel_1, xop::G711ASource::CreateNew()); audioSource = new ADTS_ZoneMinderFifoSource(rtspServer, session->GetMediaSessionId(), xop::channel_1, audioFifoPath); @@ -355,5 +355,5 @@ int main(int argc, char *argv[]) { logTerm(); zmDbClose(); - return 0; + return 0; } diff --git a/src/zm_rtsp_server_adts_source.cpp b/src/zm_rtsp_server_adts_source.cpp index 1c0c1a5a4..31bed0bfa 100644 --- a/src/zm_rtsp_server_adts_source.cpp +++ b/src/zm_rtsp_server_adts_source.cpp @@ -26,23 +26,22 @@ static unsigned const samplingFrequencyTable[16] = { // --------------------------------- // ADTS_ZoneMinderDeviceSource::ADTS_ZoneMinderDeviceSource( - UsageEnvironment& env, - std::shared_ptr monitor, - AVStream *stream, - unsigned int queueSize - ) + UsageEnvironment& env, + std::shared_ptr monitor, + AVStream *stream, + unsigned int queueSize +) : - ZoneMinderDeviceSource(env, std::move(monitor), stream, queueSize), - samplingFrequencyIndex(0), - channels(stream->codecpar->channels) -{ + ZoneMinderDeviceSource(env, std::move(monitor), stream, queueSize), + samplingFrequencyIndex(0), + channels(stream->codecpar->channels) { std::ostringstream os; os << - "profile-level-id=1;" - "mode=AAC-hbr;sizelength=13;indexlength=3;" - "indexdeltalength=3" - //<< extradata2psets(nullptr, m_stream) - << "\r\n"; - m_auxLine.assign(os.str()); + "profile-level-id=1;" + "mode=AAC-hbr;sizelength=13;indexlength=3;" + "indexdeltalength=3" + //<< extradata2psets(nullptr, m_stream) + << "\r\n"; + m_auxLine.assign(os.str()); } #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_adts_source.h b/src/zm_rtsp_server_adts_source.h index bae93b8bd..a7937e16b 100644 --- a/src/zm_rtsp_server_adts_source.h +++ b/src/zm_rtsp_server_adts_source.h @@ -21,40 +21,40 @@ // --------------------------------- class ADTS_ZoneMinderDeviceSource : public ZoneMinderDeviceSource { - public: - static ADTS_ZoneMinderDeviceSource* createNew( - UsageEnvironment& env, - std::shared_ptr monitor, - AVStream * stream, - unsigned int queueSize - ) { - return new ADTS_ZoneMinderDeviceSource(env, std::move(monitor), stream, queueSize); - }; - protected: - ADTS_ZoneMinderDeviceSource( - UsageEnvironment& env, - std::shared_ptr monitor, - AVStream *stream, - unsigned int queueSize - ); + public: + static ADTS_ZoneMinderDeviceSource* createNew( + UsageEnvironment& env, + std::shared_ptr monitor, + AVStream * stream, + unsigned int queueSize + ) { + return new ADTS_ZoneMinderDeviceSource(env, std::move(monitor), stream, queueSize); + }; + protected: + ADTS_ZoneMinderDeviceSource( + UsageEnvironment& env, + std::shared_ptr monitor, + AVStream *stream, + unsigned int queueSize + ); - virtual ~ADTS_ZoneMinderDeviceSource() {} + virtual ~ADTS_ZoneMinderDeviceSource() {} - /* - virtual unsigned char* extractFrame(unsigned char* frame, size_t& size, size_t& outsize); - virtual unsigned char* findMarker(unsigned char *frame, size_t size, size_t &length); - */ - public: - int samplingFrequency() { return m_stream->codecpar->sample_rate; }; - const char *configStr() { return config.c_str(); }; - int numChannels() { - return channels; - } + /* + virtual unsigned char* extractFrame(unsigned char* frame, size_t& size, size_t& outsize); + virtual unsigned char* findMarker(unsigned char *frame, size_t size, size_t &length); + */ + public: + int samplingFrequency() { return m_stream->codecpar->sample_rate; }; + const char *configStr() { return config.c_str(); }; + int numChannels() { + return channels; + } - protected: - std::string config; - int samplingFrequencyIndex; - int channels; + protected: + std::string config; + int samplingFrequencyIndex; + int channels; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_authenticator.h b/src/zm_rtsp_server_authenticator.h index 2e1aeb75a..cc14a6289 100644 --- a/src/zm_rtsp_server_authenticator.h +++ b/src/zm_rtsp_server_authenticator.h @@ -13,82 +13,82 @@ #if HAVE_RTSP_SERVER class ZM_RtspServer_Authenticator : public xop::Authenticator { - public: - ZM_RtspServer_Authenticator() {}; - ~ZM_RtspServer_Authenticator() {}; + public: + ZM_RtspServer_Authenticator() {}; + ~ZM_RtspServer_Authenticator() {}; - bool Authenticate(std::shared_ptr request, std::string &nonce) { + bool Authenticate(std::shared_ptr request, std::string &nonce) { - if (!config.opt_use_auth) { - Debug(1, "Not doing auth"); - return true; - } - std::string url = request->GetRtspUrl(); - Debug(1, "Doing auth %s", url.c_str()); + if (!config.opt_use_auth) { + Debug(1, "Not doing auth"); + return true; + } + std::string url = request->GetRtspUrl(); + Debug(1, "Doing auth %s", url.c_str()); - User *user = nullptr; + User *user = nullptr; - size_t found = url.find("?"); - if (found == std::string::npos) return false; + size_t found = url.find("?"); + if (found == std::string::npos) return false; - std::string queryString = url.substr(found+1, std::string::npos); + std::string queryString = url.substr(found+1, std::string::npos); #if 0 - found = suffix_string.find("/"); - if ( found != std::string::npos ) - suffix_string = suffix_string.substr(0, found); + found = suffix_string.find("/"); + if ( found != std::string::npos ) + suffix_string = suffix_string.substr(0, found); #endif - Debug(1, "suffix %s", queryString.c_str()); - std::istringstream requestStream(queryString); - QueryString query(requestStream); + Debug(1, "suffix %s", queryString.c_str()); + std::istringstream requestStream(queryString); + QueryString query(requestStream); - if (query.has("jwt_token")) { - const QueryParameter *jwt_token = query.get("jwt_token"); - user = zmLoadTokenUser(jwt_token->firstValue(), false); - } else if (query.has("token")) { - const QueryParameter *jwt_token = query.get("token"); - user = zmLoadTokenUser(jwt_token->firstValue(), false); - } else if (strcmp(config.auth_relay, "none") == 0) { - if (query.has("username")) { - std::string username = query.get("username")->firstValue(); - if (checkUser(username.c_str())) { - user = zmLoadUser(username.c_str()); - } else { - Debug(1, "Bad username %s", username.c_str()); - } + if (query.has("jwt_token")) { + const QueryParameter *jwt_token = query.get("jwt_token"); + user = zmLoadTokenUser(jwt_token->firstValue(), false); + } else if (query.has("token")) { + const QueryParameter *jwt_token = query.get("token"); + user = zmLoadTokenUser(jwt_token->firstValue(), false); + } else if (strcmp(config.auth_relay, "none") == 0) { + if (query.has("username")) { + std::string username = query.get("username")->firstValue(); + if (checkUser(username.c_str())) { + user = zmLoadUser(username.c_str()); + } else { + Debug(1, "Bad username %s", username.c_str()); } - } else { - if (query.has("auth")) { - std::string auth_hash = query.get("auth")->firstValue(); - if (!auth_hash.empty()) { - std::string username = query.has("username") ? query.get("username")->firstValue() : ""; - user = zmLoadAuthUser(auth_hash, username, config.auth_hash_ips); - } - } - Debug(1, "Query has username ? %d", query.has("username")); - if ((!user) and query.has("username") and query.has("password")) { - std::string username = query.get("username")->firstValue(); - std::string password = query.get("password")->firstValue(); - Debug(1, "username %s password %s", username.c_str(), password.c_str()); - user = zmLoadUser(username.c_str(), password.c_str()); - } - } // end if query string - - if (user) { - Debug(1, "Authenticated"); - delete user; - return true; } - return false; - } + } else { + if (query.has("auth")) { + std::string auth_hash = query.get("auth")->firstValue(); + if (!auth_hash.empty()) { + std::string username = query.has("username") ? query.get("username")->firstValue() : ""; + user = zmLoadAuthUser(auth_hash, username, config.auth_hash_ips); + } + } + Debug(1, "Query has username ? %d", query.has("username")); + if ((!user) and query.has("username") and query.has("password")) { + std::string username = query.get("username")->firstValue(); + std::string password = query.get("password")->firstValue(); + Debug(1, "username %s password %s", username.c_str(), password.c_str()); + user = zmLoadUser(username.c_str(), password.c_str()); + } + } // end if query string - size_t GetFailedResponse( - std::shared_ptr request, - std::shared_ptr buf, - size_t size) { - return request->BuildUnauthorizedRes(buf.get(), size); + if (user) { + Debug(1, "Authenticated"); + delete user; + return true; } + return false; + } + + size_t GetFailedResponse( + std::shared_ptr request, + std::shared_ptr buf, + size_t size) { + return request->BuildUnauthorizedRes(buf.get(), size); + } }; // end class ZM_RtspServer_Authenticator diff --git a/src/zm_rtsp_server_device_source.cpp b/src/zm_rtsp_server_device_source.cpp index 59df44d31..8db79f4ba 100644 --- a/src/zm_rtsp_server_device_source.cpp +++ b/src/zm_rtsp_server_device_source.cpp @@ -17,22 +17,21 @@ #if HAVE_RTSP_SERVER ZoneMinderDeviceSource::ZoneMinderDeviceSource( - UsageEnvironment& env, - std::shared_ptr monitor, - AVStream *stream, - unsigned int queueSize - ) : + UsageEnvironment& env, + std::shared_ptr monitor, + AVStream *stream, + unsigned int queueSize +) : FramedSource(env), - m_eventTriggerId(envir().taskScheduler().createEventTrigger(ZoneMinderDeviceSource::deliverFrameStub)), - m_stream(stream), - m_monitor(std::move(monitor)), + m_eventTriggerId(envir().taskScheduler().createEventTrigger(ZoneMinderDeviceSource::deliverFrameStub)), + m_stream(stream), + m_monitor(std::move(monitor)), m_packetqueue(nullptr), m_packetqueue_it(nullptr), - m_queueSize(queueSize) -{ - memset(&m_thid, 0, sizeof(m_thid)); - memset(&m_mutex, 0, sizeof(m_mutex)); - if ( m_monitor ) { + m_queueSize(queueSize) { + memset(&m_thid, 0, sizeof(m_thid)); + memset(&m_mutex, 0, sizeof(m_mutex)); + if ( m_monitor ) { m_packetqueue = m_monitor->GetPacketQueue(); if ( !m_packetqueue ) { Fatal("No packetqueue"); @@ -41,50 +40,50 @@ ZoneMinderDeviceSource::ZoneMinderDeviceSource( pthread_create(&m_thid, nullptr, threadStub, this); } else { Error("No monitor in ZoneMinderDeviceSource"); - } + } } ZoneMinderDeviceSource::~ZoneMinderDeviceSource() { stop = 1; - envir().taskScheduler().deleteEventTrigger(m_eventTriggerId); - pthread_join(m_thid, nullptr); + envir().taskScheduler().deleteEventTrigger(m_eventTriggerId); + pthread_join(m_thid, nullptr); while ( m_captureQueue.size() ) { NAL_Frame * f = m_captureQueue.front(); m_captureQueue.pop_front(); delete f; } - pthread_mutex_destroy(&m_mutex); + pthread_mutex_destroy(&m_mutex); } // thread mainloop void* ZoneMinderDeviceSource::thread() { - stop = 0; + stop = 0; - while ( !stop ) { - getNextFrame(); - } - return nullptr; + while ( !stop ) { + getNextFrame(); + } + return nullptr; } // getting FrameSource callback void ZoneMinderDeviceSource::doGetNextFrame() { - deliverFrame(); + deliverFrame(); } // stopping FrameSource callback void ZoneMinderDeviceSource::doStopGettingFrames() { stop = 1; - Debug(1, "ZoneMinderDeviceSource::doStopGettingFrames"); - FramedSource::doStopGettingFrames(); + Debug(1, "ZoneMinderDeviceSource::doStopGettingFrames"); + FramedSource::doStopGettingFrames(); } // deliver frame to the sink void ZoneMinderDeviceSource::deliverFrame() { - if ( !isCurrentlyAwaitingData() ) { + if ( !isCurrentlyAwaitingData() ) { Debug(4, "not awaiting data"); return; - } + } pthread_mutex_lock(&m_mutex); if ( m_captureQueue.empty() ) { @@ -109,11 +108,11 @@ void ZoneMinderDeviceSource::deliverFrame() { fFrameSize = nal_size; } Debug(2, "deliverFrame stream: %d timestamp: %ld.%06ld size: %d queuesize: %d", - m_stream->index, - frame->m_timestamp.tv_sec, frame->m_timestamp.tv_usec, - fFrameSize, - m_captureQueue.size() - ); + m_stream->index, + frame->m_timestamp.tv_sec, frame->m_timestamp.tv_usec, + fFrameSize, + m_captureQueue.size() + ); fPresentationTime = frame->m_timestamp; memcpy(fTo, frame->buffer(), fFrameSize); @@ -127,16 +126,16 @@ void ZoneMinderDeviceSource::deliverFrame() { // FrameSource callback on read event void ZoneMinderDeviceSource::incomingPacketHandler() { - if ( this->getNextFrame() <= 0 ) { - handleClosure(this); - } + if ( this->getNextFrame() <= 0 ) { + handleClosure(this); + } } // read from monitor int ZoneMinderDeviceSource::getNextFrame() { if ( zm_terminate ) return -1; - + if ( !m_packetqueue_it ) { m_packetqueue_it = m_packetqueue->get_video_it(true); } @@ -201,11 +200,11 @@ int ZoneMinderDeviceSource::getNextFrame() { // split packet in frames std::list< std::pair > ZoneMinderDeviceSource::splitFrames(unsigned char* frame, unsigned frameSize) { - std::list< std::pair > frameList; - if ( frame != nullptr ) { - frameList.push_back(std::pair(frame, frameSize)); - } - return frameList; + std::list< std::pair > frameList; + if ( frame != nullptr ) { + frameList.push_back(std::pair(frame, frameSize)); + } + return frameList; } // extract a frame diff --git a/src/zm_rtsp_server_device_source.h b/src/zm_rtsp_server_device_source.h index 4a05e73ee..3c61c922a 100644 --- a/src/zm_rtsp_server_device_source.h +++ b/src/zm_rtsp_server_device_source.h @@ -1,8 +1,8 @@ /* --------------------------------------------------------------------------- ** ** DeviceSource.h -** -** live555 source +** +** live555 source ** ** -------------------------------------------------------------------------*/ @@ -22,56 +22,56 @@ class NAL_Frame; class ZoneMinderDeviceSource: public FramedSource { - - public: - static ZoneMinderDeviceSource* createNew( - UsageEnvironment& env, - std::shared_ptr monitor, - AVStream * stream, - unsigned int queueSize - ) { - return new ZoneMinderDeviceSource(env, monitor, stream, queueSize); - }; - std::string getAuxLine() { return m_auxLine; }; - int getWidth() { return m_monitor->Width(); }; - int getHeight() { return m_monitor->Height(); }; - protected: - ZoneMinderDeviceSource(UsageEnvironment& env, std::shared_ptr monitor, AVStream * stream, unsigned int queueSize); - virtual ~ZoneMinderDeviceSource(); + public: + static ZoneMinderDeviceSource* createNew( + UsageEnvironment& env, + std::shared_ptr monitor, + AVStream * stream, + unsigned int queueSize + ) { + return new ZoneMinderDeviceSource(env, monitor, stream, queueSize); + }; + std::string getAuxLine() { return m_auxLine; }; + int getWidth() { return m_monitor->Width(); }; + int getHeight() { return m_monitor->Height(); }; - protected: - static void* threadStub(void* clientData) { return ((ZoneMinderDeviceSource*) clientData)->thread();}; - void* thread(); - static void deliverFrameStub(void* clientData) {((ZoneMinderDeviceSource*) clientData)->deliverFrame();}; - void deliverFrame(); - static void incomingPacketHandlerStub(void* clientData, int mask) { ((ZoneMinderDeviceSource*) clientData)->incomingPacketHandler(); }; - void incomingPacketHandler(); - int getNextFrame(); - void processFrame(char * frame, int frameSize, const timeval &ref); - void queueFrame(char * frame, int frameSize, const timeval &tv); + protected: + ZoneMinderDeviceSource(UsageEnvironment& env, std::shared_ptr monitor, AVStream * stream, unsigned int queueSize); + virtual ~ZoneMinderDeviceSource(); - // split packet in frames - virtual std::list< std::pair > splitFrames(unsigned char* frame, unsigned frameSize); - - // override FramedSource - virtual void doGetNextFrame(); - virtual void doStopGettingFrames(); - virtual unsigned char *extractFrame(unsigned char *data, size_t& size, size_t& outsize); - - protected: - std::list m_captureQueue; - EventTriggerId m_eventTriggerId; - AVStream *m_stream; - std::shared_ptr m_monitor; - PacketQueue *m_packetqueue; - std::list::iterator *m_packetqueue_it; + protected: + static void* threadStub(void* clientData) { return ((ZoneMinderDeviceSource*) clientData)->thread();}; + void* thread(); + static void deliverFrameStub(void* clientData) {((ZoneMinderDeviceSource*) clientData)->deliverFrame();}; + void deliverFrame(); + static void incomingPacketHandlerStub(void* clientData, int mask) { ((ZoneMinderDeviceSource*) clientData)->incomingPacketHandler(); }; + void incomingPacketHandler(); + int getNextFrame(); + void processFrame(char * frame, int frameSize, const timeval &ref); + void queueFrame(char * frame, int frameSize, const timeval &tv); - unsigned int m_queueSize; - pthread_t m_thid; - pthread_mutex_t m_mutex; - std::string m_auxLine; - int stop; + // split packet in frames + virtual std::list< std::pair > splitFrames(unsigned char* frame, unsigned frameSize); + + // override FramedSource + virtual void doGetNextFrame(); + virtual void doStopGettingFrames(); + virtual unsigned char *extractFrame(unsigned char *data, size_t& size, size_t& outsize); + + protected: + std::list m_captureQueue; + EventTriggerId m_eventTriggerId; + AVStream *m_stream; + std::shared_ptr m_monitor; + PacketQueue *m_packetqueue; + std::list::iterator *m_packetqueue_it; + + unsigned int m_queueSize; + pthread_t m_thid; + pthread_mutex_t m_mutex; + std::string m_auxLine; + int stop; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_fifo_adts_source.cpp b/src/zm_rtsp_server_fifo_adts_source.cpp index bc979d0a6..17afa01c8 100644 --- a/src/zm_rtsp_server_fifo_adts_source.cpp +++ b/src/zm_rtsp_server_fifo_adts_source.cpp @@ -19,14 +19,13 @@ // --------------------------------- // ADTS_ZoneMinderFifoSource::ADTS_ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ) + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo +) : - ZoneMinderFifoAudioSource(rtspServer, sessionId, channelId, fifo) -{ + ZoneMinderFifoAudioSource(rtspServer, sessionId, channelId, fifo) { #if 0 int profile = 0; @@ -37,14 +36,14 @@ ADTS_ZoneMinderFifoSource::ADTS_ZoneMinderFifoSource( std::ostringstream os; os << - "profile-level-id=1;" - "mode=AAC-hbr;sizelength=13;indexlength=3;" - "indexdeltalength=3;config=" << std::hex << std::setw(2) << std::setfill('0') << audioSpecificConfig[0] - << std::hex << std::setw(2) << std::setfill('0') << audioSpecificConfig[1] - << "\r\n"; + "profile-level-id=1;" + "mode=AAC-hbr;sizelength=13;indexlength=3;" + "indexdeltalength=3;config=" << std::hex << std::setw(2) << std::setfill('0') << audioSpecificConfig[0] + << std::hex << std::setw(2) << std::setfill('0') << audioSpecificConfig[1] + << "\r\n"; // Construct the 'AudioSpecificConfig', and from it, the corresponding ASCII string: - m_auxLine.assign(os.str()); + m_auxLine.assign(os.str()); Debug(1, "m_auxline is %s", m_auxLine.c_str()); #endif } diff --git a/src/zm_rtsp_server_fifo_adts_source.h b/src/zm_rtsp_server_fifo_adts_source.h index 4a8f86e85..70fd876e1 100644 --- a/src/zm_rtsp_server_fifo_adts_source.h +++ b/src/zm_rtsp_server_fifo_adts_source.h @@ -21,15 +21,15 @@ // --------------------------------- class ADTS_ZoneMinderFifoSource : public ZoneMinderFifoAudioSource { - public: - ADTS_ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ); + public: + ADTS_ZoneMinderFifoSource( + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo + ); - virtual ~ADTS_ZoneMinderFifoSource() {} + virtual ~ADTS_ZoneMinderFifoSource() {} }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_fifo_audio_source.cpp b/src/zm_rtsp_server_fifo_audio_source.cpp index 96ccf2075..89bf37ba1 100644 --- a/src/zm_rtsp_server_fifo_audio_source.cpp +++ b/src/zm_rtsp_server_fifo_audio_source.cpp @@ -21,17 +21,16 @@ static const int samplingFrequencyTable[16] = { // --------------------------------- // ZoneMinderFifoAudioSource::ZoneMinderFifoAudioSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ) + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo +) : - ZoneMinderFifoSource(rtspServer, sessionId, channelId, fifo), - samplingFrequencyIndex(-1), - frequency(-1), - channels(1) -{ + ZoneMinderFifoSource(rtspServer, sessionId, channelId, fifo), + samplingFrequencyIndex(-1), + frequency(-1), + channels(1) { } int ZoneMinderFifoAudioSource::getFrequencyIndex() { for (int i=0; i<16; i++) diff --git a/src/zm_rtsp_server_fifo_audio_source.h b/src/zm_rtsp_server_fifo_audio_source.h index f5610052d..eedfae12a 100644 --- a/src/zm_rtsp_server_fifo_audio_source.h +++ b/src/zm_rtsp_server_fifo_audio_source.h @@ -21,35 +21,35 @@ // --------------------------------- class ZoneMinderFifoAudioSource : public ZoneMinderFifoSource { - public: - ZoneMinderFifoAudioSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ); + public: + ZoneMinderFifoAudioSource( + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo + ); - virtual ~ZoneMinderFifoAudioSource() {} + virtual ~ZoneMinderFifoAudioSource() {} - void setFrequency(int p_frequency) { - frequency = p_frequency; - samplingFrequencyIndex = getFrequencyIndex(); - m_timeBase = {1, frequency}; - }; - int getFrequency() { return frequency; }; - int getFrequencyIndex(); - const char *configStr() const { return config.c_str(); }; - void setChannels(int p_channels) { channels = p_channels; }; - int getChannels() const { return channels; }; + void setFrequency(int p_frequency) { + frequency = p_frequency; + samplingFrequencyIndex = getFrequencyIndex(); + m_timeBase = {1, frequency}; + }; + int getFrequency() { return frequency; }; + int getFrequencyIndex(); + const char *configStr() const { return config.c_str(); }; + void setChannels(int p_channels) { channels = p_channels; }; + int getChannels() const { return channels; }; - protected: - void PushFrame(const uint8_t *data, size_t size, int64_t pts) override; + protected: + void PushFrame(const uint8_t *data, size_t size, int64_t pts) override; - protected: - std::string config; - int samplingFrequencyIndex; - int frequency; - int channels; + protected: + std::string config; + int samplingFrequencyIndex; + int frequency; + int channels; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_fifo_h264_source.cpp b/src/zm_rtsp_server_fifo_h264_source.cpp index b96f3da8b..a756b99a8 100644 --- a/src/zm_rtsp_server_fifo_h264_source.cpp +++ b/src/zm_rtsp_server_fifo_h264_source.cpp @@ -20,13 +20,12 @@ // --------------------------------- // H264_ZoneMinderFifoSource::H264_ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ) - : H26X_ZoneMinderFifoSource(rtspServer, sessionId, channelId, fifo) -{ + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo +) + : H26X_ZoneMinderFifoSource(rtspServer, sessionId, channelId, fifo) { // extradata appears to simply be the SPS and PPS NAL's //this->splitFrames(m_stream->codecpar->extradata, m_stream->codecpar->extradata_size); m_hType = 264; @@ -34,72 +33,71 @@ H264_ZoneMinderFifoSource::H264_ZoneMinderFifoSource( // split packet into frames std::list< std::pair > H264_ZoneMinderFifoSource::splitFrames(unsigned char* frame, size_t &frameSize) { - std::list< std::pair > frameList; + std::list< std::pair > frameList; - size_t bufSize = frameSize; - size_t size = 0; - unsigned char* buffer = this->extractFrame(frame, bufSize, size); - while ( buffer != nullptr ) { + size_t bufSize = frameSize; + size_t size = 0; + unsigned char* buffer = this->extractFrame(frame, bufSize, size); + while ( buffer != nullptr ) { #if 0 - bool updateAux = false; - switch ( m_frameType & 0x1F ) { - case 7: - Debug(4, "SPS_Size: %d bufSize %d", size, bufSize); - m_sps.assign((char*)buffer, size); - updateAux = true; - break; - case 8: - Debug(4, "PPS_Size: %d bufSize %d", size, bufSize); - m_pps.assign((char*)buffer, size); - updateAux = true; - break; - case 5: - Debug(4, "IDR_Size: %d bufSize %d", size, bufSize); - if ( m_repeatConfig && !m_sps.empty() && !m_pps.empty() ) { - frameList.push_back(std::pair((unsigned char*)m_sps.c_str(), m_sps.size())); - frameList.push_back(std::pair((unsigned char*)m_pps.c_str(), m_pps.size())); - } - break; - default: - break; - } + bool updateAux = false; + switch ( m_frameType & 0x1F ) { + case 7: + Debug(4, "SPS_Size: %d bufSize %d", size, bufSize); + m_sps.assign((char*)buffer, size); + updateAux = true; + break; + case 8: + Debug(4, "PPS_Size: %d bufSize %d", size, bufSize); + m_pps.assign((char*)buffer, size); + updateAux = true; + break; + case 5: + Debug(4, "IDR_Size: %d bufSize %d", size, bufSize); + if ( m_repeatConfig && !m_sps.empty() && !m_pps.empty() ) { + frameList.push_back(std::pair((unsigned char*)m_sps.c_str(), m_sps.size())); + frameList.push_back(std::pair((unsigned char*)m_pps.c_str(), m_pps.size())); + } + break; + default: + break; + } - if ( updateAux and !m_sps.empty() and !m_pps.empty() ) { - u_int32_t profile_level_id = 0; - if ( m_sps.size() >= 4 ) profile_level_id = (m_sps[1]<<16)|(m_sps[2]<<8)|m_sps[3]; + if ( updateAux and !m_sps.empty() and !m_pps.empty() ) { + u_int32_t profile_level_id = 0; + if ( m_sps.size() >= 4 ) profile_level_id = (m_sps[1]<<16)|(m_sps[2]<<8)|m_sps[3]; - char* sps_base64 = base64Encode(m_sps.c_str(), m_sps.size()); - char* pps_base64 = base64Encode(m_pps.c_str(), m_pps.size()); + char* sps_base64 = base64Encode(m_sps.c_str(), m_sps.size()); + char* pps_base64 = base64Encode(m_pps.c_str(), m_pps.size()); - std::ostringstream os; - os << "profile-level-id=" << std::hex << std::setw(6) << std::setfill('0') << profile_level_id; - os << ";sprop-parameter-sets=" << sps_base64 << "," << pps_base64 << "\r\n"; + std::ostringstream os; + os << "profile-level-id=" << std::hex << std::setw(6) << std::setfill('0') << profile_level_id; + os << ";sprop-parameter-sets=" << sps_base64 << "," << pps_base64 << "\r\n"; if (!(m_width and m_height)) os << "a=x-dimensions:" << m_width << "," << m_height << "\r\n"; - m_auxLine.assign(os.str()); + m_auxLine.assign(os.str()); Debug(3, "auxLine: %s", m_auxLine.c_str()); - delete [] sps_base64; - delete [] pps_base64; - } + delete [] sps_base64; + delete [] pps_base64; + } #endif - frameList.push_back(std::pair(buffer, size)); + frameList.push_back(std::pair(buffer, size)); if (!bufSize) break; - buffer = this->extractFrame(&buffer[size], bufSize, size); - } // end while buffer + buffer = this->extractFrame(&buffer[size], bufSize, size); + } // end while buffer frameSize = bufSize; - return frameList; + return frameList; } H265_ZoneMinderFifoSource::H265_ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ) - : H26X_ZoneMinderFifoSource(rtspServer, sessionId, channelId, fifo) -{ + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo +) + : H26X_ZoneMinderFifoSource(rtspServer, sessionId, channelId, fifo) { // extradata appears to simply be the SPS and PPS NAL's // this->splitFrames(m_stream->codecpar->extradata, m_stream->codecpar->extradata_size); m_hType = 265; @@ -108,73 +106,73 @@ H265_ZoneMinderFifoSource::H265_ZoneMinderFifoSource( // split packet in frames std::list< std::pair > H265_ZoneMinderFifoSource::splitFrames(unsigned char* frame, size_t &frameSize) { - std::list< std::pair > frameList; + std::list< std::pair > frameList; - size_t bufSize = frameSize; - size_t size = 0; - unsigned char* buffer = this->extractFrame(frame, bufSize, size); - while ( buffer != nullptr ) { + size_t bufSize = frameSize; + size_t size = 0; + unsigned char* buffer = this->extractFrame(frame, bufSize, size); + while ( buffer != nullptr ) { #if 0 - bool updateAux = false; - switch ((m_frameType&0x7E)>>1) { - case 32: - Debug(4, "VPS_Size: %d bufSize %d", size, bufSize); - m_vps.assign((char*)buffer,size); - updateAux = true; - break; - case 33: - Debug(4, "SPS_Size: %d bufSize %d", size, bufSize); - m_sps.assign((char*)buffer,size); - updateAux = true; - break; - case 34: - Debug(4, "PPS_Size: %d bufSize %d", size, bufSize); - m_pps.assign((char*)buffer,size); - updateAux = true; - break; - case 19: - case 20: - Debug(4, "IDR_Size: %d bufSize %d", size, bufSize); - if ( m_repeatConfig && !m_vps.empty() && !m_sps.empty() && !m_pps.empty() ) { - frameList.push_back(std::pair((unsigned char*)m_vps.c_str(), m_vps.size())); - frameList.push_back(std::pair((unsigned char*)m_sps.c_str(), m_sps.size())); - frameList.push_back(std::pair((unsigned char*)m_pps.c_str(), m_pps.size())); - } - break; - default: - //Debug(4, "Unknown frametype!? %d %d", m_frameType, ((m_frameType & 0x7E) >> 1)); - break; - } + bool updateAux = false; + switch ((m_frameType&0x7E)>>1) { + case 32: + Debug(4, "VPS_Size: %d bufSize %d", size, bufSize); + m_vps.assign((char*)buffer,size); + updateAux = true; + break; + case 33: + Debug(4, "SPS_Size: %d bufSize %d", size, bufSize); + m_sps.assign((char*)buffer,size); + updateAux = true; + break; + case 34: + Debug(4, "PPS_Size: %d bufSize %d", size, bufSize); + m_pps.assign((char*)buffer,size); + updateAux = true; + break; + case 19: + case 20: + Debug(4, "IDR_Size: %d bufSize %d", size, bufSize); + if ( m_repeatConfig && !m_vps.empty() && !m_sps.empty() && !m_pps.empty() ) { + frameList.push_back(std::pair((unsigned char*)m_vps.c_str(), m_vps.size())); + frameList.push_back(std::pair((unsigned char*)m_sps.c_str(), m_sps.size())); + frameList.push_back(std::pair((unsigned char*)m_pps.c_str(), m_pps.size())); + } + break; + default: + //Debug(4, "Unknown frametype!? %d %d", m_frameType, ((m_frameType & 0x7E) >> 1)); + break; + } - if ( updateAux and !m_vps.empty() and !m_sps.empty() and !m_pps.empty() ) { - char* vps_base64 = base64Encode(m_vps.c_str(), m_vps.size()); - char* sps_base64 = base64Encode(m_sps.c_str(), m_sps.size()); - char* pps_base64 = base64Encode(m_pps.c_str(), m_pps.size()); + if ( updateAux and !m_vps.empty() and !m_sps.empty() and !m_pps.empty() ) { + char* vps_base64 = base64Encode(m_vps.c_str(), m_vps.size()); + char* sps_base64 = base64Encode(m_sps.c_str(), m_sps.size()); + char* pps_base64 = base64Encode(m_pps.c_str(), m_pps.size()); - std::ostringstream os; - os << "sprop-vps=" << vps_base64; - os << ";sprop-sps=" << sps_base64; - os << ";sprop-pps=" << pps_base64; + std::ostringstream os; + os << "sprop-vps=" << vps_base64; + os << ";sprop-sps=" << sps_base64; + os << ";sprop-pps=" << pps_base64; os << "\r\n" << "a=x-dimensions:" << m_width << "," << m_height << "\r\n"; - m_auxLine.assign(os.str()); + m_auxLine.assign(os.str()); Debug(1, "Assigned h265 auxLine to %s", m_auxLine.c_str()); - delete [] vps_base64; - delete [] sps_base64; - delete [] pps_base64; - } + delete [] vps_base64; + delete [] sps_base64; + delete [] pps_base64; + } #endif - frameList.push_back(std::pair(buffer, size)); + frameList.push_back(std::pair(buffer, size)); - buffer = this->extractFrame(&buffer[size], bufSize, size); - } // end while buffer + buffer = this->extractFrame(&buffer[size], bufSize, size); + } // end while buffer frameSize = bufSize; - return frameList; + return frameList; } // end H265_ZoneMinderFifoSource::splitFrames(unsigned char* frame, unsigned frameSize) unsigned char * H26X_ZoneMinderFifoSource::findMarker( - unsigned char *frame, size_t size, size_t &length - ) { + unsigned char *frame, size_t size, size_t &length +) { //Debug(1, "findMarker %p %d", frame, size); unsigned char *start = nullptr; for ( size_t i = 0; i < size-2; i += 1 ) { @@ -195,45 +193,45 @@ unsigned char * H26X_ZoneMinderFifoSource::findMarker( // extract a frame unsigned char* H26X_ZoneMinderFifoSource::extractFrame(unsigned char* frame, size_t& size, size_t& outsize) { - unsigned char *outFrame = nullptr; - Debug(4, "ExtractFrame: %p %zu", frame, size); - outsize = 0; - size_t markerLength = 0; - m_frameType = 0; + unsigned char *outFrame = nullptr; + Debug(4, "ExtractFrame: %p %zu", frame, size); + outsize = 0; + size_t markerLength = 0; + m_frameType = 0; unsigned char *startFrame = nullptr; if (size >= 3) startFrame = this->findMarker(frame, size, markerLength); - if (startFrame != nullptr) { + if (startFrame != nullptr) { size_t endMarkerLength = 0; - Debug(4, "startFrame: %p marker Length %zu", startFrame, markerLength); - m_frameType = startFrame[markerLength]; + Debug(4, "startFrame: %p marker Length %zu", startFrame, markerLength); + m_frameType = startFrame[markerLength]; - int remainingSize = size-(startFrame-frame+markerLength); - unsigned char *endFrame = nullptr; + int remainingSize = size-(startFrame-frame+markerLength); + unsigned char *endFrame = nullptr; if ( remainingSize > 3 ) { endFrame = this->findMarker(startFrame+markerLength, remainingSize, endMarkerLength); } - Debug(4, "endFrame: %p marker Length %zu, remaining size %d", endFrame, endMarkerLength, remainingSize); + Debug(4, "endFrame: %p marker Length %zu, remaining size %d", endFrame, endMarkerLength, remainingSize); - if ( m_keepMarker ) { - size -= startFrame-frame; - outFrame = startFrame; - } else { - size -= startFrame-frame+markerLength; - outFrame = &startFrame[markerLength]; - } + if ( m_keepMarker ) { + size -= startFrame-frame; + outFrame = startFrame; + } else { + size -= startFrame-frame+markerLength; + outFrame = &startFrame[markerLength]; + } - if ( endFrame != nullptr ) { - outsize = endFrame - outFrame; - } else { - outsize = size; - } - size -= outsize; - Debug(4, "Have frame type: %d size %zu, keepmarker %d", m_frameType, outsize, m_keepMarker); - } else if ( size >= sizeof(H264shortmarker) ) { - Info("No marker found size %zu", size); - } + if ( endFrame != nullptr ) { + outsize = endFrame - outFrame; + } else { + outsize = size; + } + size -= outsize; + Debug(4, "Have frame type: %d size %zu, keepmarker %d", m_frameType, outsize, m_keepMarker); + } else if ( size >= sizeof(H264shortmarker) ) { + Info("No marker found size %zu", size); + } - return outFrame; + return outFrame; } #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_fifo_h264_source.h b/src/zm_rtsp_server_fifo_h264_source.h index 51ca5e6d5..cfdd21cb6 100644 --- a/src/zm_rtsp_server_fifo_h264_source.h +++ b/src/zm_rtsp_server_fifo_h264_source.h @@ -20,57 +20,57 @@ // --------------------------------- #if HAVE_RTSP_SERVER class H26X_ZoneMinderFifoSource : public ZoneMinderFifoVideoSource { - public: - H26X_ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ) - : - ZoneMinderFifoVideoSource(rtspServer, sessionId, channelId, fifo), - m_keepMarker(false), - m_frameType(0) { } + public: + H26X_ZoneMinderFifoSource( + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo + ) + : + ZoneMinderFifoVideoSource(rtspServer, sessionId, channelId, fifo), + m_keepMarker(false), + m_frameType(0) { } - virtual ~H26X_ZoneMinderFifoSource() {} + virtual ~H26X_ZoneMinderFifoSource() {} - virtual unsigned char* extractFrame(unsigned char* frame, size_t& size, size_t& outsize) override; - virtual unsigned char* findMarker(unsigned char *frame, size_t size, size_t &length); + virtual unsigned char* extractFrame(unsigned char* frame, size_t& size, size_t& outsize) override; + virtual unsigned char* findMarker(unsigned char *frame, size_t size, size_t &length); - protected: - std::string m_sps; - std::string m_pps; - bool m_keepMarker; - int m_frameType; + protected: + std::string m_sps; + std::string m_pps; + bool m_keepMarker; + int m_frameType; }; class H264_ZoneMinderFifoSource : public H26X_ZoneMinderFifoSource { - public: - H264_ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ); + public: + H264_ZoneMinderFifoSource( + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo + ); - // override ZoneMinderFifoSource - virtual std::list< std::pair > splitFrames(unsigned char* frame, size_t &frameSize) override; + // override ZoneMinderFifoSource + virtual std::list< std::pair > splitFrames(unsigned char* frame, size_t &frameSize) override; }; class H265_ZoneMinderFifoSource : public H26X_ZoneMinderFifoSource { - public: - H265_ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ); + public: + H265_ZoneMinderFifoSource( + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo + ); - // override ZoneMinderFifoSource - virtual std::list< std::pair > splitFrames(unsigned char* frame, size_t &frameSize) override; + // override ZoneMinderFifoSource + virtual std::list< std::pair > splitFrames(unsigned char* frame, size_t &frameSize) override; - protected: - std::string m_vps; + protected: + std::string m_vps; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_fifo_source.cpp b/src/zm_rtsp_server_fifo_source.cpp index 6ef543214..61ef9670b 100644 --- a/src/zm_rtsp_server_fifo_source.cpp +++ b/src/zm_rtsp_server_fifo_source.cpp @@ -21,19 +21,18 @@ #if HAVE_RTSP_SERVER ZoneMinderFifoSource::ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ) : + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo +) : stop_(false), m_rtspServer(rtspServer), m_sessionId(sessionId), m_channelId(channelId), - m_fifo(fifo), + m_fifo(fifo), m_fd(-1), - m_hType(0) -{ + m_hType(0) { read_thread_ = std::thread(&ZoneMinderFifoSource::ReadRun, this); write_thread_ = std::thread(&ZoneMinderFifoSource::WriteRun, this); } @@ -55,20 +54,20 @@ ZoneMinderFifoSource::~ZoneMinderFifoSource() { // thread mainloop void ZoneMinderFifoSource::ReadRun() { if (stop_) Warning("bad value for stop_ in ReadRun"); - while (!stop_ and !zm_terminate) { - if (getNextFrame() < 0) { + while (!stop_ and !zm_terminate) { + if (getNextFrame() < 0) { if (!stop_ and !zm_terminate) return; Debug(1, "Sleeping because couldn't getNextFrame"); sleep(1); } - } + } } void ZoneMinderFifoSource::WriteRun() { size_t maxNalSize = 1400; if (stop_) Warning("bad value for stop_ in WriteRun"); - while (!stop_) { + while (!stop_) { NAL_Frame *nal = nullptr; while (!stop_ and !zm_terminate and !nal) { std::unique_lock lck(mutex_); @@ -90,7 +89,7 @@ void ZoneMinderFifoSource::WriteRun() { u_int8_t *nalSrc = nal->buffer(); int fuNalSize = maxNalSize; - // ? nalRemaining : maxNalSize; + // ? nalRemaining : maxNalSize; NAL_Frame fuNal(nullptr, fuNalSize, nal->pts()); memcpy(fuNal.buffer()+1, nalSrc, fuNalSize-1); @@ -139,7 +138,7 @@ void ZoneMinderFifoSource::WriteRun() { nal = nullptr; Debug(3, "Done Pushing nal"); } // end if nal - } // end while !_stop + } // end while !_stop } // read from monitor diff --git a/src/zm_rtsp_server_fifo_source.h b/src/zm_rtsp_server_fifo_source.h index eea7c8230..c7de0aa30 100644 --- a/src/zm_rtsp_server_fifo_source.h +++ b/src/zm_rtsp_server_fifo_source.h @@ -1,8 +1,8 @@ /* --------------------------------------------------------------------------- ** ** FifoSource.h -** -** live555 source +** +** live555 source ** ** -------------------------------------------------------------------------*/ @@ -23,50 +23,50 @@ #include "xop/RtspServer.h" class ZoneMinderFifoSource { - - public: - void Stop() { - stop_ = true; - condition_.notify_all(); - }; + public: - ZoneMinderFifoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ); - virtual ~ZoneMinderFifoSource(); + void Stop() { + stop_ = true; + condition_.notify_all(); + }; - protected: - void ReadRun(); - void WriteRun(); + ZoneMinderFifoSource( + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo + ); + virtual ~ZoneMinderFifoSource(); - int getNextFrame(); - virtual void PushFrame(const uint8_t *data, size_t size, int64_t pts) = 0; - // split packet in frames - virtual std::list< std::pair > splitFrames(unsigned char* frame, size_t &frameSize); - virtual unsigned char *extractFrame(unsigned char *data, size_t& size, size_t& outsize); + protected: + void ReadRun(); + void WriteRun(); - protected: + int getNextFrame(); + virtual void PushFrame(const uint8_t *data, size_t size, int64_t pts) = 0; + // split packet in frames + virtual std::list< std::pair > splitFrames(unsigned char* frame, size_t &frameSize); + virtual unsigned char *extractFrame(unsigned char *data, size_t& size, size_t& outsize); - std::mutex mutex_; - std::condition_variable condition_; + protected: - std::thread read_thread_; - std::thread write_thread_; - std::atomic stop_; + std::mutex mutex_; + std::condition_variable condition_; - std::shared_ptr& m_rtspServer; - xop::MediaSessionId m_sessionId; - xop::MediaChannelId m_channelId; - std::string m_fifo; - int m_fd; - Buffer m_buffer; - AVRational m_timeBase; - std::queue m_nalQueue; - int m_hType; + std::thread read_thread_; + std::thread write_thread_; + std::atomic stop_; + + std::shared_ptr& m_rtspServer; + xop::MediaSessionId m_sessionId; + xop::MediaChannelId m_channelId; + std::string m_fifo; + int m_fd; + Buffer m_buffer; + AVRational m_timeBase; + std::queue m_nalQueue; + int m_hType; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_fifo_video_source.cpp b/src/zm_rtsp_server_fifo_video_source.cpp index 4c5b382bd..e40d3df3f 100644 --- a/src/zm_rtsp_server_fifo_video_source.cpp +++ b/src/zm_rtsp_server_fifo_video_source.cpp @@ -12,15 +12,14 @@ #if HAVE_RTSP_SERVER ZoneMinderFifoVideoSource::ZoneMinderFifoVideoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ) : + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo +) : ZoneMinderFifoSource(rtspServer, sessionId, channelId, fifo), m_width(0), - m_height(0) -{ + m_height(0) { m_timeBase = {1, 90000}; } diff --git a/src/zm_rtsp_server_fifo_video_source.h b/src/zm_rtsp_server_fifo_video_source.h index 8bbef12f5..95527d543 100644 --- a/src/zm_rtsp_server_fifo_video_source.h +++ b/src/zm_rtsp_server_fifo_video_source.h @@ -1,8 +1,8 @@ /* --------------------------------------------------------------------------- ** ** FifoSource.h -** -** live555 source +** +** live555 source ** ** -------------------------------------------------------------------------*/ @@ -14,25 +14,25 @@ #if HAVE_RTSP_SERVER class ZoneMinderFifoVideoSource: public ZoneMinderFifoSource { - - public: - int getWidth() { return m_width; }; - int getHeight() { return m_height; }; - int setWidth(int width) { return m_width=width; }; - int setHeight(int height) { return m_height=height; }; - ZoneMinderFifoVideoSource( - std::shared_ptr& rtspServer, - xop::MediaSessionId sessionId, - xop::MediaChannelId channelId, - const std::string &fifo - ); - protected: - void PushFrame(const uint8_t *data, size_t size, int64_t pts) override; + public: + int getWidth() { return m_width; }; + int getHeight() { return m_height; }; + int setWidth(int width) { return m_width=width; }; + int setHeight(int height) { return m_height=height; }; - protected: - int m_width; - int m_height; + ZoneMinderFifoVideoSource( + std::shared_ptr& rtspServer, + xop::MediaSessionId sessionId, + xop::MediaChannelId channelId, + const std::string &fifo + ); + protected: + void PushFrame(const uint8_t *data, size_t size, int64_t pts) override; + + protected: + int m_width; + int m_height; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_frame.h b/src/zm_rtsp_server_frame.h index 363ac7995..f8e7169f8 100644 --- a/src/zm_rtsp_server_frame.h +++ b/src/zm_rtsp_server_frame.h @@ -14,65 +14,65 @@ const char H264marker[] = {0,0,0,1}; const char H264shortmarker[] = {0,0,1}; class NAL_Frame { - public: - NAL_Frame(unsigned char * buffer, size_t size, int64 pts) : - m_buffer(nullptr), - m_size(size), - m_pts(pts), - m_ref_count(1) { - m_buffer = new unsigned char[m_size]; - if (buffer) { - memcpy(m_buffer, buffer, m_size); - } - }; - NAL_Frame& operator=(const NAL_Frame&); - ~NAL_Frame() { - delete[] m_buffer; - m_buffer = nullptr; - }; - unsigned char *buffer() const { return m_buffer; }; - // The buffer has a 32bit nal size value at the front, so if we want the nal, it's - // the address of the buffer plus 4 bytes. - unsigned char *nal() const { return m_buffer+4; }; - size_t size() const { return m_size; }; - size_t size(size_t new_size) { m_size=new_size; return m_size; }; - size_t nal_size() const { return m_size-4; }; - int64_t pts() const { return m_pts; }; - bool check() const { - // Look for marker at beginning - unsigned char *marker = (unsigned char*)memmem(m_buffer, sizeof(H264marker), H264marker, sizeof(H264marker)); + public: + NAL_Frame(unsigned char * buffer, size_t size, int64 pts) : + m_buffer(nullptr), + m_size(size), + m_pts(pts), + m_ref_count(1) { + m_buffer = new unsigned char[m_size]; + if (buffer) { + memcpy(m_buffer, buffer, m_size); + } + }; + NAL_Frame& operator=(const NAL_Frame&); + ~NAL_Frame() { + delete[] m_buffer; + m_buffer = nullptr; + }; + unsigned char *buffer() const { return m_buffer; }; + // The buffer has a 32bit nal size value at the front, so if we want the nal, it's + // the address of the buffer plus 4 bytes. + unsigned char *nal() const { return m_buffer+4; }; + size_t size() const { return m_size; }; + size_t size(size_t new_size) { m_size=new_size; return m_size; }; + size_t nal_size() const { return m_size-4; }; + int64_t pts() const { return m_pts; }; + bool check() const { + // Look for marker at beginning + unsigned char *marker = (unsigned char*)memmem(m_buffer, sizeof(H264marker), H264marker, sizeof(H264marker)); + if ( marker ) { + Debug(1, "marker found at beginning"); + return true; + } else { + marker = (unsigned char*)memmem(m_buffer, m_size, H264marker, sizeof(H264marker)); if ( marker ) { - Debug(1, "marker found at beginning"); - return true; - } else { - marker = (unsigned char*)memmem(m_buffer, m_size, H264marker, sizeof(H264marker)); - if ( marker ) { - Debug(1, "marker not found at beginning"); - return false; - } - } - return false; - } - - void debug() { - if (m_size <= 4) { - Debug(1, "NAL: %zu: %.2x %.2x %.2x %.2x", m_size, - m_buffer[0], m_buffer[1], m_buffer[2], m_buffer[3]); - } else { - Debug(1, "NAL: %zu: %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x ", m_size, - m_buffer[0], m_buffer[1], m_buffer[2], m_buffer[3], - m_buffer[4], m_buffer[5], m_buffer[6], m_buffer[7] - ); + Debug(1, "marker not found at beginning"); + return false; } } + return false; + } - private: - unsigned char* m_buffer; - size_t m_size; - public: - int64 m_pts; - private: - int m_ref_count; + void debug() { + if (m_size <= 4) { + Debug(1, "NAL: %zu: %.2x %.2x %.2x %.2x", m_size, + m_buffer[0], m_buffer[1], m_buffer[2], m_buffer[3]); + } else { + Debug(1, "NAL: %zu: %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x ", m_size, + m_buffer[0], m_buffer[1], m_buffer[2], m_buffer[3], + m_buffer[4], m_buffer[5], m_buffer[6], m_buffer[7] + ); + } + } + + private: + unsigned char* m_buffer; + size_t m_size; + public: + int64 m_pts; + private: + int m_ref_count; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_server_media_subsession.cpp b/src/zm_rtsp_server_server_media_subsession.cpp index c847b471e..68f532811 100644 --- a/src/zm_rtsp_server_server_media_subsession.cpp +++ b/src/zm_rtsp_server_server_media_subsession.cpp @@ -1,7 +1,7 @@ /* --------------------------------------------------------------------------- ** ** ServerMediaSubsession.cpp -** +** ** -------------------------------------------------------------------------*/ #include "zm_rtsp_server_server_media_subsession.h" @@ -16,94 +16,93 @@ // BaseServerMediaSubsession // --------------------------------- FramedSource* BaseServerMediaSubsession::createSource( - UsageEnvironment& env, - FramedSource* inputSource, - const std::string& format) -{ - FramedSource* source = nullptr; - if (format == "video/MP2T") { - source = MPEG2TransportStreamFramer::createNew(env, inputSource); - } else if (format == "video/H264") { - source = H264VideoStreamDiscreteFramer::createNew(env, inputSource - /*Boolean includeStartCodeInOutput, Boolean insertAccessUnitDelimiters*/ - ); - } + UsageEnvironment& env, + FramedSource* inputSource, + const std::string& format) { + FramedSource* source = nullptr; + if (format == "video/MP2T") { + source = MPEG2TransportStreamFramer::createNew(env, inputSource); + } else if (format == "video/H264") { + source = H264VideoStreamDiscreteFramer::createNew(env, inputSource + /*Boolean includeStartCodeInOutput, Boolean insertAccessUnitDelimiters*/ + ); + } #if LIVEMEDIA_LIBRARY_VERSION_INT > 1414454400 - else if (format == "video/H265") { - source = H265VideoStreamDiscreteFramer::createNew(env, inputSource); - } + else if (format == "video/H265") { + source = H265VideoStreamDiscreteFramer::createNew(env, inputSource); + } #endif #if 0 - else if (format == "video/JPEG") { - source = MJPEGVideoSource::createNew(env, inputSource); - } + else if (format == "video/JPEG") { + source = MJPEGVideoSource::createNew(env, inputSource); + } #endif - else { - source = inputSource; - } - return source; + else { + source = inputSource; + } + return source; } /* source is generally a replica */ RTPSink* BaseServerMediaSubsession::createSink( - UsageEnvironment& env, - Groupsock* rtpGroupsock, - unsigned char rtpPayloadTypeIfDynamic, - const std::string& format, - FramedSource *source - ) { + UsageEnvironment& env, + Groupsock* rtpGroupsock, + unsigned char rtpPayloadTypeIfDynamic, + const std::string& format, + FramedSource *source +) { - RTPSink* sink = nullptr; - if (format == "video/MP2T") { - sink = SimpleRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic, 90000, "video", "MP2T", 1, true, false); - } else if (format == "video/H264") { - sink = H264VideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic); - } else if (format == "video/VP8") { - sink = VP8VideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic); - } -#if LIVEMEDIA_LIBRARY_VERSION_INT > 1414454400 - else if (format == "video/VP9") { - sink = VP9VideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic); - } else if (format == "video/H265") { - sink = H265VideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic); + RTPSink* sink = nullptr; + if (format == "video/MP2T") { + sink = SimpleRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic, 90000, "video", "MP2T", 1, true, false); + } else if (format == "video/H264") { + sink = H264VideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic); + } else if (format == "video/VP8") { + sink = VP8VideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic); } -#endif +#if LIVEMEDIA_LIBRARY_VERSION_INT > 1414454400 + else if (format == "video/VP9") { + sink = VP9VideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic); + } else if (format == "video/H265") { + sink = H265VideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic); + } +#endif else if (format == "audio/AAC") { ADTS_ZoneMinderFifoSource *adts_source = (ADTS_ZoneMinderFifoSource *)(m_replicator->inputSource()); sink = MPEG4GenericRTPSink::createNew(env, rtpGroupsock, - rtpPayloadTypeIfDynamic, - adts_source->getFrequency(), - "audio", "AAC-hbr", - adts_source->configStr(), - adts_source->getChannels() - ); + rtpPayloadTypeIfDynamic, + adts_source->getFrequency(), + "audio", "AAC-hbr", + adts_source->configStr(), + adts_source->getChannels() + ); } else { Error("unknown format"); - } + } #if 0 - else if (format == "video/JPEG") { - sink = JPEGVideoRTPSink::createNew (env, rtpGroupsock); - } + else if (format == "video/JPEG") { + sink = JPEGVideoRTPSink::createNew (env, rtpGroupsock); + } #endif - return sink; + return sink; } char const* BaseServerMediaSubsession::getAuxLine( - ZoneMinderFifoSource* source, - unsigned char rtpPayloadType - ) { - const char* auxLine = nullptr; - if (source) { - std::ostringstream os; - os << "a=fmtp:" << int(rtpPayloadType) << " "; - os << source->getAuxLine(); - //os << "\r\n"; - auxLine = strdup(os.str().c_str()); + ZoneMinderFifoSource* source, + unsigned char rtpPayloadType +) { + const char* auxLine = nullptr; + if (source) { + std::ostringstream os; + os << "a=fmtp:" << int(rtpPayloadType) << " "; + os << source->getAuxLine(); + //os << "\r\n"; + auxLine = strdup(os.str().c_str()); Debug(1, "BaseServerMediaSubsession::auxLine: %s", auxLine); } else { Error("No source auxLine:"); return ""; - } - return auxLine; + } + return auxLine; } #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_server_media_subsession.h b/src/zm_rtsp_server_server_media_subsession.h index 04632c44b..49e1d3eef 100644 --- a/src/zm_rtsp_server_server_media_subsession.h +++ b/src/zm_rtsp_server_server_media_subsession.h @@ -4,7 +4,7 @@ ** any purpose. ** ** ServerMediaSubsession.h -** +** ** -------------------------------------------------------------------------*/ #ifndef ZM_RTSP_SERVER_SERVER_MEDIA_SUBSESSION_H @@ -20,28 +20,28 @@ class ZoneMinderDeviceSource; class BaseServerMediaSubsession { - public: - explicit BaseServerMediaSubsession(StreamReplicator* replicator): - m_replicator(replicator) {}; + public: + explicit BaseServerMediaSubsession(StreamReplicator* replicator): + m_replicator(replicator) {}; - FramedSource* createSource( - UsageEnvironment& env, - FramedSource * videoES, - const std::string& format); + FramedSource* createSource( + UsageEnvironment& env, + FramedSource * videoES, + const std::string& format); - RTPSink * createSink( - UsageEnvironment& env, - Groupsock * rtpGroupsock, - unsigned char rtpPayloadTypeIfDynamic, - const std::string& format, - FramedSource *source); + RTPSink * createSink( + UsageEnvironment& env, + Groupsock * rtpGroupsock, + unsigned char rtpPayloadTypeIfDynamic, + const std::string& format, + FramedSource *source); - char const* getAuxLine( - ZoneMinderFifoSource* source, - unsigned char rtpPayloadType); - - protected: - StreamReplicator* m_replicator; + char const* getAuxLine( + ZoneMinderFifoSource* source, + unsigned char rtpPayloadType); + + protected: + StreamReplicator* m_replicator; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_unicast_server_media_subsession.cpp b/src/zm_rtsp_server_unicast_server_media_subsession.cpp index 2376748d5..95ab7b454 100644 --- a/src/zm_rtsp_server_unicast_server_media_subsession.cpp +++ b/src/zm_rtsp_server_unicast_server_media_subsession.cpp @@ -17,36 +17,36 @@ // ServerMediaSubsession for Unicast // ----------------------------------------- UnicastServerMediaSubsession* UnicastServerMediaSubsession::createNew( - UsageEnvironment& env, - StreamReplicator* replicator, - //FramedSource *source, - const std::string& format - ) { - return new UnicastServerMediaSubsession(env, replicator, format); - //return new UnicastServerMediaSubsession(env, replicator, source, format); + UsageEnvironment& env, + StreamReplicator* replicator, + //FramedSource *source, + const std::string& format +) { + return new UnicastServerMediaSubsession(env, replicator, format); + //return new UnicastServerMediaSubsession(env, replicator, source, format); } FramedSource* UnicastServerMediaSubsession::createNewStreamSource( - unsigned clientSessionId, - unsigned& estBitrate - ) { - FramedSource* replica = m_replicator->createStreamReplica(); - return createSource(envir(), replica, m_format); + unsigned clientSessionId, + unsigned& estBitrate +) { + FramedSource* replica = m_replicator->createStreamReplica(); + return createSource(envir(), replica, m_format); } RTPSink* UnicastServerMediaSubsession::createNewRTPSink( - Groupsock* rtpGroupsock, - unsigned char rtpPayloadTypeIfDynamic, - FramedSource* inputSource - ) { - return createSink(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic, m_format, inputSource); + Groupsock* rtpGroupsock, + unsigned char rtpPayloadTypeIfDynamic, + FramedSource* inputSource +) { + return createSink(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic, m_format, inputSource); } char const* UnicastServerMediaSubsession::getAuxSDPLine( - RTPSink* rtpSink, FramedSource* inputSource - ) { - return this->getAuxLine( - dynamic_cast(m_replicator->inputSource()), - rtpSink->rtpPayloadType()); + RTPSink* rtpSink, FramedSource* inputSource +) { + return this->getAuxLine( + dynamic_cast(m_replicator->inputSource()), + rtpSink->rtpPayloadType()); } #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_unicast_server_media_subsession.h b/src/zm_rtsp_server_unicast_server_media_subsession.h index d10e3abf1..34857155e 100644 --- a/src/zm_rtsp_server_unicast_server_media_subsession.h +++ b/src/zm_rtsp_server_unicast_server_media_subsession.h @@ -19,32 +19,31 @@ #if HAVE_RTSP_SERVER class UnicastServerMediaSubsession : public OnDemandServerMediaSubsession, - public BaseServerMediaSubsession -{ - public: - static UnicastServerMediaSubsession* createNew( - UsageEnvironment& env, - StreamReplicator* replicator, - const std::string& format); + public BaseServerMediaSubsession { + public: + static UnicastServerMediaSubsession* createNew( + UsageEnvironment& env, + StreamReplicator* replicator, + const std::string& format); - protected: - UnicastServerMediaSubsession( - UsageEnvironment& env, - StreamReplicator* replicator, - const std::string& format) - : - OnDemandServerMediaSubsession(env, true - /* Boolean reuseFirstSource, portNumBits initialPortNum=6970, Boolean multiplexRTCPWithRTP=False */ - ), - BaseServerMediaSubsession(replicator), - m_format(format) {}; + protected: + UnicastServerMediaSubsession( + UsageEnvironment& env, + StreamReplicator* replicator, + const std::string& format) + : + OnDemandServerMediaSubsession(env, true + /* Boolean reuseFirstSource, portNumBits initialPortNum=6970, Boolean multiplexRTCPWithRTP=False */ + ), + BaseServerMediaSubsession(replicator), + m_format(format) {}; - virtual FramedSource* createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate); - virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, unsigned char rtpPayloadTypeIfDynamic, FramedSource* inputSource); - virtual char const* getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource); + virtual FramedSource* createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate); + virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, unsigned char rtpPayloadTypeIfDynamic, FramedSource* inputSource); + virtual char const* getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource); - protected: - const std::string m_format; + protected: + const std::string m_format; }; #endif // HAVE_RTSP_SERVER diff --git a/src/zm_sdp.cpp b/src/zm_sdp.cpp index 1593b1640..4a2292b7d 100644 --- a/src/zm_sdp.cpp +++ b/src/zm_sdp.cpp @@ -1,21 +1,21 @@ // // ZoneMinder SDP Class Implementation, $Date: 2009-04-14 21:20:02 +0100 (Tue, 14 Apr 2009) $, $Revision: 2850 $ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_sdp.h" @@ -63,8 +63,7 @@ SessionDescriptor::DynamicPayloadDesc SessionDescriptor::smDynamicPayloads[] = { SessionDescriptor::ConnInfo::ConnInfo( const std::string &connInfo ) : mTtl( 16 ), - mNoAddresses( 0 ) -{ + mNoAddresses( 0 ) { StringVector tokens = Split(connInfo, " "); if ( tokens.size() < 3 ) throw Exception( "Unable to parse SDP connection info from '"+connInfo+"'" ); @@ -75,7 +74,7 @@ SessionDescriptor::ConnInfo::ConnInfo( const std::string &connInfo ) : if ( mAddressType != "IP4" && mAddressType != "IP6" ) throw Exception( "Invalid SDP address type '"+mAddressType+"' in connection info '"+connInfo+"'" ); StringVector addressTokens = Split(tokens[2], "/"); - if ( addressTokens.size() < 1 ) + if ( addressTokens.size() < 1 ) throw Exception( "Invalid SDP address '"+tokens[2]+"' in connection info '"+connInfo+"'" ); mAddress = addressTokens[0]; if ( addressTokens.size() >= 2 ) @@ -85,23 +84,22 @@ SessionDescriptor::ConnInfo::ConnInfo( const std::string &connInfo ) : } SessionDescriptor::BandInfo::BandInfo( const std::string &bandInfo ) : - mValue( 0 ) -{ + mValue( 0 ) { StringVector tokens = Split(bandInfo, ":"); if ( tokens.size() < 2 ) throw Exception( "Unable to parse SDP bandwidth info from '"+bandInfo+"'" ); mType = tokens[0]; //if ( mNetworkType != "IN" ) - //throw Exception( "Invalid SDP network type '"+mNetworkType+"' in connection info '"+connInfo+"'" ); + //throw Exception( "Invalid SDP network type '"+mNetworkType+"' in connection info '"+connInfo+"'" ); mValue = atoi(tokens[1].c_str()); } SessionDescriptor::MediaDescriptor::MediaDescriptor( - const std::string &type, - int port, - int numPorts, - const std::string &transport, - int payloadType ) : + const std::string &type, + int port, + int numPorts, + const std::string &transport, + int payloadType ) : mType( type ), mPort( port ), mNumPorts( numPorts ), @@ -112,15 +110,13 @@ SessionDescriptor::MediaDescriptor::MediaDescriptor( mWidth( 0 ), mHeight( 0 ), mSprops( "" ), - mConnInfo( nullptr ) -{ + mConnInfo( nullptr ) { } -SessionDescriptor::SessionDescriptor( const std::string &url, const std::string &sdp ) : +SessionDescriptor::SessionDescriptor( const std::string &url, const std::string &sdp ) : mUrl( url ), mConnInfo( nullptr ), - mBandInfo( nullptr ) -{ + mBandInfo( nullptr ) { MediaDescriptor *currMedia = nullptr; StringVector lines = Split(sdp, "\r\n"); @@ -136,141 +132,139 @@ SessionDescriptor::SessionDescriptor( const std::string &url, const std::string line.erase(0, 2); switch( sdpType ) { - case 'v' : - mVersion = line; - break; - case 'o' : - mOwner = line; - break; - case 's' : - mName = line; - break; - case 'i' : - mInfo = line; - break; - case 'c' : - // This prevent a memory leak if the field appears more than one time - if ( mConnInfo ) - delete mConnInfo; - mConnInfo = new ConnInfo( line ); - break; - case 'b' : - // This prevent a memory leak if the field appears more than one time - if ( mBandInfo ) - delete mBandInfo; - mBandInfo = new BandInfo( line ); - break; - case 't' : - mTimeInfo = line; - break; - case 'a' : - { - mAttributes.push_back( line ); - StringVector tokens = Split(line, ":", 2); - std::string attrName = tokens[0]; - if ( currMedia ) { - if ( attrName == "control" ) { - if ( tokens.size() < 2 ) - throw Exception( "Unable to parse SDP control attribute '"+line+"' for media '"+currMedia->getType()+"'" ); - currMedia->setControlUrl( tokens[1] ); - } else if ( attrName == "range" ) { - } else if ( attrName == "rtpmap" ) { - // a=rtpmap:96 MP4V-ES/90000 - if ( tokens.size() < 2 ) - throw Exception( "Unable to parse SDP rtpmap attribute '"+line+"' for media '"+currMedia->getType()+"'" ); - StringVector attrTokens = Split(tokens[1], " "); - int payloadType = atoi(attrTokens[0].c_str()); - if ( payloadType != currMedia->getPayloadType() ) - throw Exception( stringtf( "Payload type mismatch, expected %d, got %d in '%s'", currMedia->getPayloadType(), payloadType, line.c_str() ) ); - if ( attrTokens.size() > 1 ) { - StringVector payloadTokens = Split(attrTokens[1], "/"); - std::string payloadDesc = payloadTokens[0]; - int payloadClock = atoi(payloadTokens[1].c_str()); - currMedia->setPayloadDesc( payloadDesc ); - currMedia->setClock( payloadClock ); - } - } else if ( attrName == "framesize" ) { - // a=framesize:96 320-240 - if ( tokens.size() < 2 ) - throw Exception("Unable to parse SDP framesize attribute '"+line+"' for media '"+currMedia->getType()+"'"); - StringVector attrTokens = Split(tokens[1], " "); - int payloadType = atoi(attrTokens[0].c_str()); - if ( payloadType != currMedia->getPayloadType() ) - throw Exception( stringtf("Payload type mismatch, expected %d, got %d in '%s'", - currMedia->getPayloadType(), payloadType, line.c_str())); - //currMedia->setPayloadType( payloadType ); - StringVector sizeTokens = Split(attrTokens[1], "-"); - int width = atoi(sizeTokens[0].c_str()); - int height = atoi(sizeTokens[1].c_str()); - currMedia->setFrameSize(width, height); - } else if ( attrName == "framerate" ) { - // a=framerate:5.0 - if ( tokens.size() < 2 ) - throw Exception("Unable to parse SDP framerate attribute '"+line+"' for media '"+currMedia->getType()+"'"); - double frameRate = atof(tokens[1].c_str()); - currMedia->setFrameRate(frameRate); - } else if ( attrName == "fmtp" ) { - // a=fmtp:96 profile-level-id=247; config=000001B0F7000001B509000001000000012008D48D8803250F042D14440F - if ( tokens.size() < 2 ) - throw Exception("Unable to parse SDP fmtp attribute '"+line+"' for media '"+currMedia->getType()+"'"); - StringVector attrTokens = Split(tokens[1], " ", 2); - int payloadType = atoi(attrTokens[0].c_str()); - if ( payloadType != currMedia->getPayloadType() ) - throw Exception(stringtf("Payload type mismatch, expected %d, got %d in '%s'", - currMedia->getPayloadType(), payloadType, line.c_str())); - //currMedia->setPayloadType( payloadType ); - if ( attrTokens.size() > 1 ) { - StringVector attr2Tokens = Split(attrTokens[1], "; "); - for ( unsigned int i = 0; i < attr2Tokens.size(); i++ ) { - StringVector attr3Tokens = Split(attr2Tokens[i], "="); - //Info( "Name = %s, Value = %s", attr3Tokens[0].c_str(), attr3Tokens[1].c_str() ); - if ( attr3Tokens[0] == "profile-level-id" ) { - } else if ( attr3Tokens[0] == "config" ) { - } else if ( attr3Tokens[0] == "sprop-parameter-sets" ) { - size_t t = attr2Tokens[i].find("="); - char *c = (char *)attr2Tokens[i].c_str() + t + 1; - Debug(4, "sprop-parameter-sets value %s", c); - currMedia->setSprops(std::string(c)); - } else { - Debug(3, "Ignoring SDP fmtp attribute '%s' for media '%s'", - attr3Tokens[0].c_str(), - currMedia->getType().c_str()); - } + case 'v' : + mVersion = line; + break; + case 'o' : + mOwner = line; + break; + case 's' : + mName = line; + break; + case 'i' : + mInfo = line; + break; + case 'c' : + // This prevent a memory leak if the field appears more than one time + if ( mConnInfo ) + delete mConnInfo; + mConnInfo = new ConnInfo( line ); + break; + case 'b' : + // This prevent a memory leak if the field appears more than one time + if ( mBandInfo ) + delete mBandInfo; + mBandInfo = new BandInfo( line ); + break; + case 't' : + mTimeInfo = line; + break; + case 'a' : { + mAttributes.push_back( line ); + StringVector tokens = Split(line, ":", 2); + std::string attrName = tokens[0]; + if ( currMedia ) { + if ( attrName == "control" ) { + if ( tokens.size() < 2 ) + throw Exception( "Unable to parse SDP control attribute '"+line+"' for media '"+currMedia->getType()+"'" ); + currMedia->setControlUrl( tokens[1] ); + } else if ( attrName == "range" ) { + } else if ( attrName == "rtpmap" ) { + // a=rtpmap:96 MP4V-ES/90000 + if ( tokens.size() < 2 ) + throw Exception( "Unable to parse SDP rtpmap attribute '"+line+"' for media '"+currMedia->getType()+"'" ); + StringVector attrTokens = Split(tokens[1], " "); + int payloadType = atoi(attrTokens[0].c_str()); + if ( payloadType != currMedia->getPayloadType() ) + throw Exception( stringtf( "Payload type mismatch, expected %d, got %d in '%s'", currMedia->getPayloadType(), payloadType, line.c_str() ) ); + if ( attrTokens.size() > 1 ) { + StringVector payloadTokens = Split(attrTokens[1], "/"); + std::string payloadDesc = payloadTokens[0]; + int payloadClock = atoi(payloadTokens[1].c_str()); + currMedia->setPayloadDesc( payloadDesc ); + currMedia->setClock( payloadClock ); + } + } else if ( attrName == "framesize" ) { + // a=framesize:96 320-240 + if ( tokens.size() < 2 ) + throw Exception("Unable to parse SDP framesize attribute '"+line+"' for media '"+currMedia->getType()+"'"); + StringVector attrTokens = Split(tokens[1], " "); + int payloadType = atoi(attrTokens[0].c_str()); + if ( payloadType != currMedia->getPayloadType() ) + throw Exception( stringtf("Payload type mismatch, expected %d, got %d in '%s'", + currMedia->getPayloadType(), payloadType, line.c_str())); + //currMedia->setPayloadType( payloadType ); + StringVector sizeTokens = Split(attrTokens[1], "-"); + int width = atoi(sizeTokens[0].c_str()); + int height = atoi(sizeTokens[1].c_str()); + currMedia->setFrameSize(width, height); + } else if ( attrName == "framerate" ) { + // a=framerate:5.0 + if ( tokens.size() < 2 ) + throw Exception("Unable to parse SDP framerate attribute '"+line+"' for media '"+currMedia->getType()+"'"); + double frameRate = atof(tokens[1].c_str()); + currMedia->setFrameRate(frameRate); + } else if ( attrName == "fmtp" ) { + // a=fmtp:96 profile-level-id=247; config=000001B0F7000001B509000001000000012008D48D8803250F042D14440F + if ( tokens.size() < 2 ) + throw Exception("Unable to parse SDP fmtp attribute '"+line+"' for media '"+currMedia->getType()+"'"); + StringVector attrTokens = Split(tokens[1], " ", 2); + int payloadType = atoi(attrTokens[0].c_str()); + if ( payloadType != currMedia->getPayloadType() ) + throw Exception(stringtf("Payload type mismatch, expected %d, got %d in '%s'", + currMedia->getPayloadType(), payloadType, line.c_str())); + //currMedia->setPayloadType( payloadType ); + if ( attrTokens.size() > 1 ) { + StringVector attr2Tokens = Split(attrTokens[1], "; "); + for ( unsigned int i = 0; i < attr2Tokens.size(); i++ ) { + StringVector attr3Tokens = Split(attr2Tokens[i], "="); + //Info( "Name = %s, Value = %s", attr3Tokens[0].c_str(), attr3Tokens[1].c_str() ); + if ( attr3Tokens[0] == "profile-level-id" ) { + } else if ( attr3Tokens[0] == "config" ) { + } else if ( attr3Tokens[0] == "sprop-parameter-sets" ) { + size_t t = attr2Tokens[i].find("="); + char *c = (char *)attr2Tokens[i].c_str() + t + 1; + Debug(4, "sprop-parameter-sets value %s", c); + currMedia->setSprops(std::string(c)); + } else { + Debug(3, "Ignoring SDP fmtp attribute '%s' for media '%s'", + attr3Tokens[0].c_str(), + currMedia->getType().c_str()); } } - } else if ( attrName == "mpeg4-iod" ) { - // a=mpeg4-iod: "data:application/mpeg4-iod;base64,AoEAAE8BAf73AQOAkwABQHRkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2Jhc2U2NCxBVGdCR3dVZkF4Y0F5U1FBWlFRTklCRUVrK0FBQWEyd0FBR3RzQVlCQkFFWkFwOERGUUJsQlFRTlFCVUFDN2dBQVBvQUFBRDZBQVlCQXc9PQQNAQUABAAAAAAAAAAAAAYJAQAAAAAAAAAAA0IAAkA+ZGF0YTphcHBsaWNhdGlvbi9tcGVnNC1iaWZzLWF1O2Jhc2U2NCx3QkFTZ1RBcUJYSmhCSWhRUlFVL0FBPT0EEgINAAACAAAAAAAAAAAFAwAAQAYJAQAAAAAAAAAA" - } else if ( attrName == "mpeg4-esid" ) { - // a=mpeg4-esid:201 - } else { - Debug(3, "Ignoring SDP attribute '%s' for media '%s'", line.c_str(), currMedia->getType().c_str()); } + } else if ( attrName == "mpeg4-iod" ) { + // a=mpeg4-iod: "data:application/mpeg4-iod;base64,AoEAAE8BAf73AQOAkwABQHRkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2Jhc2U2NCxBVGdCR3dVZkF4Y0F5U1FBWlFRTklCRUVrK0FBQWEyd0FBR3RzQVlCQkFFWkFwOERGUUJsQlFRTlFCVUFDN2dBQVBvQUFBRDZBQVlCQXc9PQQNAQUABAAAAAAAAAAAAAYJAQAAAAAAAAAAA0IAAkA+ZGF0YTphcHBsaWNhdGlvbi9tcGVnNC1iaWZzLWF1O2Jhc2U2NCx3QkFTZ1RBcUJYSmhCSWhRUlFVL0FBPT0EEgINAAACAAAAAAAAAAAFAwAAQAYJAQAAAAAAAAAA" + } else if ( attrName == "mpeg4-esid" ) { + // a=mpeg4-esid:201 } else { - Debug(3, "Ignoring general SDP attribute '%s'", line.c_str()); + Debug(3, "Ignoring SDP attribute '%s' for media '%s'", line.c_str(), currMedia->getType().c_str()); } - break; - } - case 'm' : - { - StringVector tokens = Split(line, " "); - if ( tokens.size() < 4 ) - throw Exception("Can't parse SDP media description '"+line+"'"); - std::string mediaType = tokens[0]; - if ( mediaType != "audio" && mediaType != "video" && mediaType != "application" ) - throw Exception("Unsupported media type '"+mediaType+"' in SDP media attribute '"+line+"'"); - StringVector portTokens = Split(tokens[1], "/"); - int mediaPort = atoi(portTokens[0].c_str()); - int mediaNumPorts = 1; - if ( portTokens.size() > 1 ) - mediaNumPorts = atoi(portTokens[1].c_str()); - std::string mediaTransport = tokens[2]; - if ( mediaTransport != "RTP/AVP" ) - throw Exception("Unsupported media transport '"+mediaTransport+"' in SDP media attribute '"+line+"'"); - int payloadType = atoi(tokens[3].c_str()); - currMedia = new MediaDescriptor(mediaType, mediaPort, mediaNumPorts, mediaTransport, payloadType); - mMediaList.push_back(currMedia); - break; + } else { + Debug(3, "Ignoring general SDP attribute '%s'", line.c_str()); } + break; + } + case 'm' : { + StringVector tokens = Split(line, " "); + if ( tokens.size() < 4 ) + throw Exception("Can't parse SDP media description '"+line+"'"); + std::string mediaType = tokens[0]; + if ( mediaType != "audio" && mediaType != "video" && mediaType != "application" ) + throw Exception("Unsupported media type '"+mediaType+"' in SDP media attribute '"+line+"'"); + StringVector portTokens = Split(tokens[1], "/"); + int mediaPort = atoi(portTokens[0].c_str()); + int mediaNumPorts = 1; + if ( portTokens.size() > 1 ) + mediaNumPorts = atoi(portTokens[1].c_str()); + std::string mediaTransport = tokens[2]; + if ( mediaTransport != "RTP/AVP" ) + throw Exception("Unsupported media transport '"+mediaTransport+"' in SDP media attribute '"+line+"'"); + int payloadType = atoi(tokens[3].c_str()); + currMedia = new MediaDescriptor(mediaType, mediaPort, mediaNumPorts, mediaTransport, payloadType); + mMediaList.push_back(currMedia); + break; + } } // end switch } // end foreach line } @@ -293,12 +287,12 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const { strncpy(formatContext->filename, mUrl.c_str(), sizeof(formatContext->filename) - 1); formatContext->filename[sizeof(formatContext->filename) - 1] = '\0'; #endif -/* - if ( mName.length() ) - strncpy( formatContext->title, mName.c_str(), sizeof(formatContext->title) ); - if ( mInfo.length() ) - strncpy( formatContext->comment, mInfo.c_str(), sizeof(formatContext->comment) ); -*/ + /* + if ( mName.length() ) + strncpy( formatContext->title, mName.c_str(), sizeof(formatContext->title) ); + if ( mInfo.length() ) + strncpy( formatContext->comment, mInfo.c_str(), sizeof(formatContext->comment) ); + */ //formatContext->nb_streams = mMediaList.size(); for ( unsigned int i = 0; i < mMediaList.size(); i++ ) { const MediaDescriptor *mediaDesc = mMediaList[i]; @@ -309,7 +303,7 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const { std::string type = mediaDesc->getType(); Debug(1, "Looking for codec for %s payload type %d / %s", - type.c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str()); + type.c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str()); if ( type == "video" ) codec_context->codec_type = AVMEDIA_TYPE_VIDEO; else if ( type == "audio" ) @@ -349,7 +343,7 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const { if (codec_name.empty()) { Warning( "Can't find payload details for %s payload type %d, name %s", - mediaDesc->getType().c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str() ); + mediaDesc->getType().c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str() ); } if ( mediaDesc->getWidth() ) codec_context->width = mediaDesc->getWidth(); @@ -360,9 +354,9 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const { codec_context->extradata_size= 0; codec_context->extradata= nullptr; char pvalue[1024], *value = pvalue; - + strcpy(pvalue, mediaDesc->getSprops().c_str()); - + while ( *value ) { char base64packet[1024]; uint8_t decoded_packet[1024]; @@ -370,7 +364,7 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const { char *dst = base64packet; while (*value && *value != ',' - && (dst - base64packet) < (long)(sizeof(base64packet)) - 1) { + && (dst - base64packet) < (long)(sizeof(base64packet)) - 1) { *dst++ = *value++; } *dst++ = '\0'; @@ -382,8 +376,8 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const { Hexdump(4, (char *)decoded_packet, packet_size); if ( packet_size ) { uint8_t *dest = - (uint8_t *) av_malloc( - packet_size + sizeof(start_sequence) + codec_context->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); + (uint8_t *) av_malloc( + packet_size + sizeof(start_sequence) + codec_context->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if ( dest ) { if ( codec_context->extradata_size ) { // av_realloc? @@ -394,12 +388,12 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const { memcpy(dest+codec_context->extradata_size, start_sequence, sizeof(start_sequence)); memcpy(dest+codec_context->extradata_size+sizeof(start_sequence), decoded_packet, packet_size); memset(dest+codec_context->extradata_size+sizeof(start_sequence)+ - packet_size, 0, - AV_INPUT_BUFFER_PADDING_SIZE - ); + packet_size, 0, + AV_INPUT_BUFFER_PADDING_SIZE + ); - codec_context->extradata= dest; - codec_context->extradata_size+= sizeof(start_sequence)+packet_size; + codec_context->extradata= dest; + codec_context->extradata_size+= sizeof(start_sequence)+packet_size; // } else { // av_log(codec, AV_LOG_ERROR, "Unable to allocate memory for extradata!"); // return AVERROR(ENOMEM); diff --git a/src/zm_sdp.h b/src/zm_sdp.h index 68f7e30a0..82a199f8d 100644 --- a/src/zm_sdp.h +++ b/src/zm_sdp.h @@ -1,21 +1,21 @@ // // ZoneMinder SDP Class Interface, $Date: 2009-02-16 18:21:50 +0000 (Mon, 16 Feb 2009) $, $Revision: 2765 $ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_SDP_H #define ZM_SDP_H @@ -26,7 +26,7 @@ #include class SessionDescriptor { -protected: + protected: enum { PAYLOAD_TYPE_DYNAMIC=96 }; struct StaticPayloadDesc { @@ -47,30 +47,30 @@ protected: //int autoChannels; }; -public: + public: class ConnInfo { - protected: + protected: std::string mNetworkType; std::string mAddressType; std::string mAddress; int mTtl; int mNoAddresses; - public: + public: explicit ConnInfo( const std::string &connInfo ); }; class BandInfo { - protected: + protected: std::string mType; int mValue; - public: + public: explicit BandInfo( const std::string &bandInfo ); }; class MediaDescriptor { - protected: + protected: std::string mType; int mPort; int mNumPorts; @@ -87,41 +87,33 @@ public: ConnInfo *mConnInfo; - public: + public: MediaDescriptor( const std::string &type, int port, int numPorts, const std::string &transport, int payloadType ); - const std::string &getType() const - { + const std::string &getType() const { return( mType ); } - int getPort() const - { + int getPort() const { return( mPort ); } - int getNumPorts() const - { + int getNumPorts() const { return( mNumPorts ); } - const std::string &getTransport() const - { + const std::string &getTransport() const { return( mTransport ); } - int getPayloadType() const - { + int getPayloadType() const { return( mPayloadType ); } - const std::string &getPayloadDesc() const - { + const std::string &getPayloadDesc() const { return( mPayloadDesc ); } - void setPayloadDesc( const std::string &payloadDesc ) - { + void setPayloadDesc( const std::string &payloadDesc ) { mPayloadDesc = payloadDesc; } - const std::string &getControlUrl() const - { + const std::string &getControlUrl() const { return( mControlUrl ); } void setControlUrl( const std::string &controlUrl ) { @@ -162,11 +154,11 @@ public: typedef std::vector MediaList; -protected: + protected: static StaticPayloadDesc smStaticPayloads[]; static DynamicPayloadDesc smDynamicPayloads[]; -protected: + protected: std::string mUrl; std::string mVersion; @@ -181,21 +173,18 @@ protected: MediaList mMediaList; -public: + public: SessionDescriptor( const std::string &url, const std::string &sdp ); ~SessionDescriptor(); - const std::string &getUrl() const - { + const std::string &getUrl() const { return( mUrl ); } - int getNumStreams() const - { + int getNumStreams() const { return( mMediaList.size() ); } - MediaDescriptor *getStream( int index ) - { + MediaDescriptor *getStream( int index ) { if ( index < 0 || (unsigned int)index >= mMediaList.size() ) return nullptr; return( mMediaList[index] ); @@ -205,26 +194,31 @@ public: }; #if 0 v=0 -o=- 1239719297054659 1239719297054674 IN IP4 192.168.1.11 -s=Media Presentation -e=NONE -c=IN IP4 0.0.0.0 -b=AS:174 -t=0 0 -a=control:* -a=range:npt=now- -a=mpeg4-iod: "data:application/mpeg4-iod;base64,AoEAAE8BAf73AQOAkwABQHRkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2Jhc2U2NCxBVGdCR3dVZkF4Y0F5U1FBWlFRTklCRUVrK0FBQWEyd0FBR3RzQVlCQkFFWkFwOERGUUJsQlFRTlFCVUFDN2dBQVBvQUFBRDZBQVlCQXc9PQQNAQUABAAAAAAAAAAAAAYJAQAAAAAAAAAAA0IAAkA+ZGF0YTphcHBsaWNhdGlvbi9tcGVnNC1iaWZzLWF1O2Jhc2U2NCx3QkFTZ1RBcUJYSmhCSWhRUlFVL0FBPT0EEgINAAACAAAAAAAAAAAFAwAAQAYJAQAAAAAAAAAA" -m=video 0 RTP/AVP 96 -b=AS:110 -a=framerate:5.0 -a=control:trackID=1 -a=rtpmap:96 MP4V-ES/90000 -a=fmtp:96 profile-level-id=247; config=000001B0F7000001B509000001000000012008D48D8803250F042D14440F -a=mpeg4-esid:201 -m=audio 0 RTP/AVP 0 -b=AS:64 -a=control:trackID=2 - + o=- 1239719297054659 1239719297054674 IN IP4 192.168.1.11 + s=Media Presentation + e=NONE + c=IN IP4 0.0.0.0 + b=AS:174 + t=0 0 + a=control: + * + a=range: + npt=now- + a=mpeg4-iod: "data:application/mpeg4-iod;base64,AoEAAE8BAf73AQOAkwABQHRkYXRhOmFwcGxpY2F0aW9uL21wZWc0LW9kLWF1O2Jhc2U2NCxBVGdCR3dVZkF4Y0F5U1FBWlFRTklCRUVrK0FBQWEyd0FBR3RzQVlCQkFFWkFwOERGUUJsQlFRTlFCVUFDN2dBQVBvQUFBRDZBQVlCQXc9PQQNAQUABAAAAAAAAAAAAAYJAQAAAAAAAAAAA0IAAkA+ZGF0YTphcHBsaWNhdGlvbi9tcGVnNC1iaWZzLWF1O2Jhc2U2NCx3QkFTZ1RBcUJYSmhCSWhRUlFVL0FBPT0EEgINAAACAAAAAAAAAAAFAwAAQAYJAQAAAAAAAAAA" + m=video 0 RTP/AVP 96 + b=AS:110 + a=framerate:5.0 + a=control: + trackID=1 + a=rtpmap:96 MP4V-ES/90000 + a=fmtp:96 profile-level-id=247; +config=000001B0F7000001B509000001000000012008D48D8803250F042D14440F + a=mpeg4-esid:201 + m=audio 0 RTP/AVP 0 + b=AS:64 + a=control: + trackID=2 + #endif #endif // ZM_SDP_H diff --git a/src/zm_server.cpp b/src/zm_server.cpp index adb353291..0c5df5132 100644 --- a/src/zm_server.cpp +++ b/src/zm_server.cpp @@ -1,17 +1,17 @@ /* * ZoneMinder Server class * Copyright (C) 2022 ZoneMinder Inc - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/src/zm_server.h b/src/zm_server.h index d5815da8d..32f4492bb 100644 --- a/src/zm_server.h +++ b/src/zm_server.h @@ -1,17 +1,17 @@ /* * ZoneMinder Server Class Interface * Copyright (C) 2022 ZoneMinder Inc - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -24,8 +24,8 @@ #include class Server { -protected: - unsigned int id; + protected: + unsigned int id; std::string name; std::string protocol; std::string hostname; @@ -33,19 +33,19 @@ protected: std::string path_to_zms; std::string path_to_api; -public: - Server(); - explicit Server( MYSQL_ROW &dbrow ); - explicit Server( unsigned int p_id ); - ~Server(); + public: + Server(); + explicit Server( MYSQL_ROW &dbrow ); + explicit Server( unsigned int p_id ); + ~Server(); - unsigned int Id() const { return id; } - const std::string &Name() const { return name; } - const std::string &Protocol() const { return protocol; } - const std::string &Hostname() const { return hostname; } - const std::string &PathToZMS() const { return path_to_zms; } - const std::string &PathToAPI() const { return path_to_api; } - const std::string &PathToIndex() const { return path_to_index; } + unsigned int Id() const { return id; } + const std::string &Name() const { return name; } + const std::string &Protocol() const { return protocol; } + const std::string &Hostname() const { return hostname; } + const std::string &PathToZMS() const { return path_to_zms; } + const std::string &PathToAPI() const { return path_to_api; } + const std::string &PathToIndex() const { return path_to_index; } }; #endif // ZM_SERVER_H diff --git a/src/zm_signal.cpp b/src/zm_signal.cpp index ba2fedc82..3342ee0d8 100644 --- a/src/zm_signal.cpp +++ b/src/zm_signal.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Signal Handling Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_signal.h" @@ -30,14 +30,14 @@ bool zm_terminate = false; RETSIGTYPE zm_hup_handler(int signal) { // Shouldn't do complex things in signal handlers, logging is complex and can block due to mutexes. - //Info("Got signal %d (%s), reloading", signal, strsignal(signal)); - zm_reload = true; + //Info("Got signal %d (%s), reloading", signal, strsignal(signal)); + zm_reload = true; } RETSIGTYPE zm_term_handler(int signal) { // Shouldn't do complex things in signal handlers, logging is complex and can block due to mutexes. - //Info("Got signal %d (%s), exiting", signal, strsignal(signal)); - zm_terminate = true; + //Info("Got signal %d (%s), exiting", signal, strsignal(signal)); + zm_terminate = true; } #if ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) @@ -47,151 +47,151 @@ RETSIGTYPE zm_die_handler(int signal) #endif { zm_terminate = true; - Error("Got signal %d (%s), crashing", signal, strsignal(signal)); + Error("Got signal %d (%s), crashing", signal, strsignal(signal)); #if (defined(__i386__) || defined(__x86_64__)) - // Get more information if available - #if ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) - void *ip = nullptr; - void *cr2 = nullptr; - if ( info && context ) { - Debug(1, - "Signal information: number %d code %d errno %d pid %d uid %d status %d", - signal, info->si_code, info->si_errno, info->si_pid, - info->si_uid, info->si_status); + // Get more information if available +#if ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) + void *ip = nullptr; + void *cr2 = nullptr; + if ( info && context ) { + Debug(1, + "Signal information: number %d code %d errno %d pid %d uid %d status %d", + signal, info->si_code, info->si_errno, info->si_pid, + info->si_uid, info->si_status); - ucontext_t *uc = (ucontext_t *) context; - cr2 = info->si_addr; - #if defined(__x86_64__) - #if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) - ip = (void *)(uc->uc_mcontext.mc_rip); - #elif defined(__OpenBSD__) - ip = (void *)(uc->sc_rip); - #else - ip = (void *)(uc->uc_mcontext.gregs[REG_RIP]); - #endif - #else - #if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) - ip = (void *)(uc->uc_mcontext.mc_eip); - #else - ip = (void *)(uc->uc_mcontext.gregs[REG_EIP]); - #endif - #endif // defined(__x86_64__) + ucontext_t *uc = (ucontext_t *) context; + cr2 = info->si_addr; +#if defined(__x86_64__) +#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) + ip = (void *)(uc->uc_mcontext.mc_rip); +#elif defined(__OpenBSD__) + ip = (void *)(uc->sc_rip); +#else + ip = (void *)(uc->uc_mcontext.gregs[REG_RIP]); +#endif +#else +#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) + ip = (void *)(uc->uc_mcontext.mc_eip); +#else + ip = (void *)(uc->uc_mcontext.gregs[REG_EIP]); +#endif +#endif // defined(__x86_64__) - // Print the signal address and instruction pointer if available - if ( ip ) { - Error("Signal address is %p, from %p", cr2, ip); - } else { - Error("Signal address is %p, no instruction pointer", cr2); - } - } - #endif // ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) + // Print the signal address and instruction pointer if available + if ( ip ) { + Error("Signal address is %p, from %p", cr2, ip); + } else { + Error("Signal address is %p, no instruction pointer", cr2); + } + } +#endif // ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) - // Print backtrace if enabled and available - #if ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS ) - void *trace[TRACE_SIZE]; - int trace_size = 0; - trace_size = backtrace(trace, TRACE_SIZE); + // Print backtrace if enabled and available +#if ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS ) + void *trace[TRACE_SIZE]; + int trace_size = 0; + trace_size = backtrace(trace, TRACE_SIZE); - char cmd[1024] = "addr2line -Cfip -e "; - char *cmd_ptr = cmd + strlen(cmd); - cmd_ptr += snprintf(cmd_ptr, sizeof(cmd) - (cmd_ptr - cmd), "%s", self); + char cmd[1024] = "addr2line -Cfip -e "; + char *cmd_ptr = cmd + strlen(cmd); + cmd_ptr += snprintf(cmd_ptr, sizeof(cmd) - (cmd_ptr - cmd), "%s", self); - char **messages = backtrace_symbols(trace, trace_size); - char *ofs_ptr; - char *end_ptr; - bool found_offset = false; + char **messages = backtrace_symbols(trace, trace_size); + char *ofs_ptr; + char *end_ptr; + bool found_offset = false; - // Print the full backtrace - for (int i = 0; i < trace_size; i++) { - Error("Backtrace %u: %s", i, messages[i]); - if (strstr(messages[i], self) == nullptr) - continue; - ofs_ptr = strstr(messages[i], "(+0x"); - if (ofs_ptr == nullptr) - continue; - ofs_ptr += 2; - end_ptr = strchr(ofs_ptr, ')'); - if (end_ptr == nullptr) - continue; - found_offset = true; - int rc = snprintf(cmd_ptr, sizeof(cmd) - (cmd_ptr - cmd), " %.*s", static_cast(end_ptr - ofs_ptr), ofs_ptr); - if (rc < 0 || static_cast(rc) > sizeof(cmd) - (cmd_ptr - cmd)) - break; - cmd_ptr += rc; - } - free(messages); + // Print the full backtrace + for (int i = 0; i < trace_size; i++) { + Error("Backtrace %u: %s", i, messages[i]); + if (strstr(messages[i], self) == nullptr) + continue; + ofs_ptr = strstr(messages[i], "(+0x"); + if (ofs_ptr == nullptr) + continue; + ofs_ptr += 2; + end_ptr = strchr(ofs_ptr, ')'); + if (end_ptr == nullptr) + continue; + found_offset = true; + int rc = snprintf(cmd_ptr, sizeof(cmd) - (cmd_ptr - cmd), " %.*s", static_cast(end_ptr - ofs_ptr), ofs_ptr); + if (rc < 0 || static_cast(rc) > sizeof(cmd) - (cmd_ptr - cmd)) + break; + cmd_ptr += rc; + } + free(messages); - if (found_offset) { - Error("Backtrace complete, please install debug symbols (typically zoneminder-dbg)"); - Error("and execute the following command for more information:"); - Error("%s", cmd); - } - #endif // ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS ) + if (found_offset) { + Error("Backtrace complete, please install debug symbols (typically zoneminder-dbg)"); + Error("and execute the following command for more information:"); + Error("%s", cmd); + } +#endif // ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS ) #endif // (defined(__i386__) || defined(__x86_64__) // Icon: Don't exit, setting zm_terminate should cause the exit to happen in a timely manner. // The main reason not to here is to make valgrind traces quieter because logger gets free while other threads - // are still running and trying to log. - //exit(signal); + // are still running and trying to log. + //exit(signal); } void zmSetHupHandler(SigHandler * handler) { - sigset_t block_set; - sigemptyset(&block_set); - struct sigaction action, old_action; + sigset_t block_set; + sigemptyset(&block_set); + struct sigaction action, old_action; - action.sa_handler = (SigHandler *) handler; - action.sa_mask = block_set; - action.sa_flags = SA_RESTART; - sigaction(SIGHUP, &action, &old_action); + action.sa_handler = (SigHandler *) handler; + action.sa_mask = block_set; + action.sa_flags = SA_RESTART; + sigaction(SIGHUP, &action, &old_action); } void zmSetTermHandler(SigHandler * handler) { - sigset_t block_set; - sigemptyset(&block_set); - struct sigaction action, old_action; + sigset_t block_set; + sigemptyset(&block_set); + struct sigaction action, old_action; - action.sa_handler = (SigHandler *) handler; - action.sa_mask = block_set; - action.sa_flags = SA_RESTART; - sigaction(SIGTERM, &action, &old_action); - sigaction(SIGINT, &action, &old_action); - sigaction(SIGQUIT, &action, &old_action); + action.sa_handler = (SigHandler *) handler; + action.sa_mask = block_set; + action.sa_flags = SA_RESTART; + sigaction(SIGTERM, &action, &old_action); + sigaction(SIGINT, &action, &old_action); + sigaction(SIGQUIT, &action, &old_action); } void zmSetDieHandler(SigHandler * handler) { - sigset_t block_set; - sigemptyset(&block_set); - struct sigaction action, old_action; + sigset_t block_set; + sigemptyset(&block_set); + struct sigaction action, old_action; - action.sa_mask = block_set; + action.sa_mask = block_set; #if ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) - action.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler; - action.sa_flags = SA_SIGINFO; + action.sa_sigaction = (void (*)(int, siginfo_t *, void *))handler; + action.sa_flags = SA_SIGINFO; #else - action.sa_handler = (SigHandler *) handler; - action.sa_flags = 0; + action.sa_handler = (SigHandler *) handler; + action.sa_flags = 0; #endif - sigaction(SIGBUS, &action, &old_action); - sigaction(SIGSEGV, &action, &old_action); - sigaction(SIGABRT, &action, &old_action); - sigaction(SIGILL, &action, &old_action); - sigaction(SIGFPE, &action, &old_action); + sigaction(SIGBUS, &action, &old_action); + sigaction(SIGSEGV, &action, &old_action); + sigaction(SIGABRT, &action, &old_action); + sigaction(SIGILL, &action, &old_action); + sigaction(SIGFPE, &action, &old_action); } void zmSetDefaultHupHandler() { - zmSetHupHandler((SigHandler *) zm_hup_handler); + zmSetHupHandler((SigHandler *) zm_hup_handler); } void zmSetDefaultTermHandler() { - zmSetTermHandler((SigHandler *) zm_term_handler); + zmSetTermHandler((SigHandler *) zm_term_handler); } void zmSetDefaultDieHandler() { - if ( config.dump_cores ) { - // Do nothing - } else { - zmSetDieHandler((SigHandler *) zm_die_handler); - } + if ( config.dump_cores ) { + // Do nothing + } else { + zmSetDieHandler((SigHandler *) zm_die_handler); + } } diff --git a/src/zm_signal.h b/src/zm_signal.h index 27fa2e766..3bd754725 100644 --- a/src/zm_signal.h +++ b/src/zm_signal.h @@ -1,21 +1,21 @@ /* * ZoneMinder Signal Handling Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ #ifndef ZM_SIGNAL_H #define ZM_SIGNAL_H diff --git a/src/zm_storage.cpp b/src/zm_storage.cpp index e53e79335..f247bc14e 100644 --- a/src/zm_storage.cpp +++ b/src/zm_storage.cpp @@ -1,17 +1,17 @@ /* * ZoneMinder regular expression class implementation, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/src/zm_storage.h b/src/zm_storage.h index 6ea0bae5a..7a6e67225 100644 --- a/src/zm_storage.h +++ b/src/zm_storage.h @@ -1,17 +1,17 @@ /* * ZoneMinder Storage Class Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -24,30 +24,30 @@ #include class Storage { - public: - typedef enum { - SHALLOW=0, - MEDIUM, - DEEP - } Schemes; + public: + typedef enum { + SHALLOW=0, + MEDIUM, + DEEP + } Schemes; -protected: - unsigned int id; - char name[64+1]; - char path[64+1]; + protected: + unsigned int id; + char name[64+1]; + char path[64+1]; std::string type_str; std::string scheme_str; Schemes scheme; -public: - Storage(); - explicit Storage( MYSQL_ROW &dbrow ); - explicit Storage( unsigned int p_id ); - ~Storage(); + public: + Storage(); + explicit Storage( MYSQL_ROW &dbrow ); + explicit Storage( unsigned int p_id ); + ~Storage(); - unsigned int Id() const { return id; } - const char *Name() const { return name; } - const char *Path() const { return path; } + unsigned int Id() const { return id; } + const char *Name() const { return name; } + const char *Path() const { return path; } Schemes Scheme() const { return scheme; } std::string SchemeString() const { return scheme_str; } }; diff --git a/src/zm_stream.cpp b/src/zm_stream.cpp index 083cb994d..1f55ad350 100644 --- a/src/zm_stream.cpp +++ b/src/zm_stream.cpp @@ -99,15 +99,15 @@ void StreamBase::updateFrameRate(double fps) { effective_fps = (base_fps*abs(replay_rate))/ZM_RATE_BASE; frame_mod = 1; Debug(3, "FPS:%.2f, MaxFPS:%.2f, BaseFPS:%.2f, EffectiveFPS:%.2f, FrameMod:%d, replay_rate(%d)", - fps, maxfps, base_fps, effective_fps, frame_mod, replay_rate); + fps, maxfps, base_fps, effective_fps, frame_mod, replay_rate); if (maxfps > 0.0) { // Min frame repeat? - // We want to keep the frame skip easy... problem is ... if effective = 31 and max = 30 then we end up with 15.5 fps. + // We want to keep the frame skip easy... problem is ... if effective = 31 and max = 30 then we end up with 15.5 fps. while ( (int)effective_fps > (int)maxfps ) { effective_fps /= 2.0; frame_mod *= 2; Debug(3, "Changing fps to be < max %.2f EffectiveFPS:%.2f, FrameMod:%d", - maxfps, effective_fps, frame_mod); + maxfps, effective_fps, frame_mod); } } } // void StreamBase::updateFrameRate(double fps) @@ -153,7 +153,7 @@ Image *StreamBase::prepareImage(Image *image) { base_image_height = image->Height(), disp_image_width = image->Width() * scale/ZM_SCALE_BASE, disp_image_height = image->Height() * scale / ZM_SCALE_BASE; - /* x and y are scaled by web UI to base dimensions units. + /* x and y are scaled by web UI to base dimensions units. * When zooming, we blow up the image by the amount 150 for first zoom, right? 150%, then cut out a base sized chunk * However if we have zoomed before, then we are zooming into the previous cutout * The box stored in last_crop should be in base_image units, So we need to turn x,y into percentages, then apply to last_crop @@ -263,7 +263,7 @@ bool StreamBase::sendTextFrame(const char *frame_text) { labelsize = monitor->LabelSize(); } Debug(2, "Sending %dx%dx%dx%d * %d scale text frame '%s'", - width, height, colours, subpixelorder, scale, frame_text); + width, height, colours, subpixelorder, scale, frame_text); Image image(width, height, colours, subpixelorder); image.Clear(); @@ -320,12 +320,12 @@ void StreamBase::openComms() { } unsigned int length = snprintf( - sock_path_lock, - sizeof(sock_path_lock), - "%s/zms-%06d.lock", - staticConfig.PATH_SOCKS.c_str(), - connkey - ); + sock_path_lock, + sizeof(sock_path_lock), + "%s/zms-%06d.lock", + staticConfig.PATH_SOCKS.c_str(), + connkey + ); if ( length >= sizeof(sock_path_lock) ) { Warning("Socket lock path was truncated."); } @@ -363,12 +363,12 @@ void StreamBase::openComms() { } length = snprintf( - loc_sock_path, - sizeof(loc_sock_path), - "%s/zms-%06ds.sock", - staticConfig.PATH_SOCKS.c_str(), - connkey - ); + loc_sock_path, + sizeof(loc_sock_path), + "%s/zms-%06ds.sock", + staticConfig.PATH_SOCKS.c_str(), + connkey + ); if ( length >= sizeof(loc_sock_path) ) { Warning("Socket path was truncated."); length = sizeof(loc_sock_path)-1; @@ -390,7 +390,7 @@ void StreamBase::openComms() { strncpy(rem_addr.sun_path, rem_sock_path, sizeof(rem_addr.sun_path)); rem_addr.sun_family = AF_UNIX; - struct timeval tv{1,0}; /* 1 Secs Timeout */ + struct timeval tv {1,0}; /* 1 Secs Timeout */ setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO,(struct timeval *)&tv, sizeof(struct timeval)); last_comm_update = std::chrono::steady_clock::now(); @@ -411,8 +411,7 @@ void StreamBase::closeComms() { } } // end void StreamBase::closeComms -void StreamBase::reserveTempImgBuffer(size_t size) -{ +void StreamBase::reserveTempImgBuffer(size_t size) { if (temp_img_buffer_size < size) { Debug(1, "Resizing image buffer from %zu to %zu", temp_img_buffer_size, size); delete[] temp_img_buffer; diff --git a/src/zm_stream.h b/src/zm_stream.h index 9ac66a063..c668c0bcb 100644 --- a/src/zm_stream.h +++ b/src/zm_stream.h @@ -1,21 +1,21 @@ // // ZoneMinder Stream Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_STREAM_H #define ZM_STREAM_H @@ -33,7 +33,7 @@ class Monitor; #define BOUNDARY "ZoneMinderFrame" class StreamBase { -public: + public: typedef enum { STREAM_JPEG, STREAM_RAW, @@ -43,7 +43,7 @@ public: } StreamType; typedef enum { FRAME_NORMAL, FRAME_ANALYSIS } FrameType; -protected: + protected: static constexpr Seconds MAX_STREAM_DELAY = Seconds(5); static constexpr Milliseconds MAX_SLEEP = Milliseconds(500); @@ -54,7 +54,7 @@ protected: enum { DEFAULT_MAXFPS=10 }; enum { DEFAULT_BITRATE=100000 }; -protected: + protected: typedef struct { int msg_type; char msg_data[16]; @@ -97,7 +97,7 @@ protected: CMD_QUERY=99 } MsgCommand; -protected: + protected: int monitor_id; std::shared_ptr monitor; @@ -153,7 +153,7 @@ protected: uint8_t *temp_img_buffer; // Used when encoding or sending file data size_t temp_img_buffer_size; -protected: + protected: bool loadMonitor(int monitor_id); bool checkInitialised(); void updateFrameRate(double fps); @@ -162,8 +162,8 @@ protected: virtual void processCommand(const CmdMsg *msg)=0; void reserveTempImgBuffer(size_t size); -public: - StreamBase(): + public: + StreamBase(): monitor_id(0), monitor(nullptr), type(DEFAULT_TYPE), @@ -196,8 +196,7 @@ public: frames_to_send(-1), got_command(false), temp_img_buffer(nullptr), - temp_img_buffer_size(0) - { + temp_img_buffer_size(0) { memset(&loc_sock_path, 0, sizeof(loc_sock_path)); memset(&loc_addr, 0, sizeof(loc_addr)); memset(&rem_sock_path, 0, sizeof(rem_sock_path)); diff --git a/src/zm_swscale.cpp b/src/zm_swscale.cpp index a5cf67fda..f61b7e3bc 100644 --- a/src/zm_swscale.cpp +++ b/src/zm_swscale.cpp @@ -1,17 +1,17 @@ /* * ZoneMinder FFMPEG implementation, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -26,8 +26,7 @@ SWScale::SWScale() : gotdefaults(false), swscale_ctx(nullptr), default_width(0), - default_height(0) -{ + default_height(0) { Debug(4, "SWScale object created"); } @@ -58,10 +57,10 @@ SWScale::~SWScale() { } int SWScale::SetDefaults( - enum _AVPIXELFORMAT in_pf, - enum _AVPIXELFORMAT out_pf, - unsigned int width, - unsigned int height) { + enum _AVPIXELFORMAT in_pf, + enum _AVPIXELFORMAT out_pf, + unsigned int width, + unsigned int height) { /* Assign the defaults */ default_input_pf = in_pf; @@ -74,7 +73,7 @@ int SWScale::SetDefaults( return 0; } -int SWScale::Convert( +int SWScale::Convert( AVFrame *in_frame, AVFrame *out_frame ) { @@ -82,17 +81,17 @@ int SWScale::Convert( AVPixelFormat format = fix_deprecated_pix_fmt((AVPixelFormat)in_frame->format); /* Get the context */ swscale_ctx = sws_getCachedContext(swscale_ctx, - in_frame->width, in_frame->height, format, - out_frame->width, out_frame->height, (AVPixelFormat)out_frame->format, - SWS_FAST_BILINEAR, NULL, NULL, NULL); + in_frame->width, in_frame->height, format, + out_frame->width, out_frame->height, (AVPixelFormat)out_frame->format, + SWS_FAST_BILINEAR, NULL, NULL, NULL); if ( swscale_ctx == NULL ) { Error("Failed getting swscale context"); return -6; } /* Do the conversion */ if (!sws_scale(swscale_ctx, - in_frame->data, in_frame->linesize, 0, in_frame->height, - out_frame->data, out_frame->linesize)) { + in_frame->data, in_frame->linesize, 0, in_frame->height, + out_frame->data, out_frame->linesize)) { Error("swscale conversion failed"); return -10; } @@ -101,20 +100,20 @@ int SWScale::Convert( } int SWScale::Convert( - const uint8_t* in_buffer, - const size_t in_buffer_size, - uint8_t* out_buffer, - const size_t out_buffer_size, - enum _AVPIXELFORMAT in_pf, - enum _AVPIXELFORMAT out_pf, - unsigned int width, - unsigned int height, - unsigned int new_width, - unsigned int new_height - ) { + const uint8_t* in_buffer, + const size_t in_buffer_size, + uint8_t* out_buffer, + const size_t out_buffer_size, + enum _AVPIXELFORMAT in_pf, + enum _AVPIXELFORMAT out_pf, + unsigned int width, + unsigned int height, + unsigned int new_width, + unsigned int new_height +) { Debug(1, "Convert: in_buffer %p in_buffer_size %zu out_buffer %p size %zu width %d height %d width %d height %d %d %d", - in_buffer, in_buffer_size, out_buffer, out_buffer_size, width, height, new_width, new_height, - in_pf, out_pf); + in_buffer, in_buffer_size, out_buffer, out_buffer_size, width, height, new_width, new_height, + in_pf, out_pf); /* Parameter checking */ if (in_buffer == nullptr) { Error("NULL Input buffer"); @@ -138,11 +137,11 @@ int SWScale::Convert( /* Warn if the input or output pixelformat is not supported */ if (!sws_isSupportedInput(in_pf)) { Warning("swscale does not support the input format: %c%c%c%c", - (in_pf)&0xff,((in_pf)&0xff),((in_pf>>16)&0xff),((in_pf>>24)&0xff)); + (in_pf)&0xff,((in_pf)&0xff),((in_pf>>16)&0xff),((in_pf>>24)&0xff)); } if (!sws_isSupportedOutput(out_pf)) { Warning("swscale does not support the output format: %c%c%c%c", - (out_pf)&0xff,((out_pf>>8)&0xff),((out_pf>>16)&0xff),((out_pf>>24)&0xff)); + (out_pf)&0xff,((out_pf>>8)&0xff),((out_pf>>16)&0xff),((out_pf>>24)&0xff)); } int alignment = width % 32 ? 1 : 32; @@ -150,12 +149,12 @@ int SWScale::Convert( size_t needed_insize = GetBufferSize(in_pf, width, height); if (needed_insize > in_buffer_size) { Warning( - "The input buffer size does not match the expected size for the input format. Required: %zu for %dx%d %d Available: %zu", - needed_insize, - width, - height, - in_pf, - in_buffer_size); + "The input buffer size does not match the expected size for the input format. Required: %zu for %dx%d %d Available: %zu", + needed_insize, + width, + height, + in_pf, + in_buffer_size); } size_t needed_outsize = GetBufferSize(out_pf, new_width, new_height); if (needed_outsize > out_buffer_size) { @@ -167,9 +166,9 @@ int SWScale::Convert( /* Get the context */ swscale_ctx = sws_getCachedContext(swscale_ctx, - width, height, in_pf, - new_width, new_height, out_pf, - SWS_FAST_BILINEAR, nullptr, nullptr, nullptr); + width, height, in_pf, + new_width, new_height, out_pf, + SWS_FAST_BILINEAR, nullptr, nullptr, nullptr); if (swscale_ctx == nullptr) { Error("Failed getting swscale context"); return -6; @@ -197,9 +196,9 @@ int SWScale::Convert( /* Do the conversion */ if ( !sws_scale(swscale_ctx, - input_avframe->data, input_avframe->linesize, - 0, height, - output_avframe->data, output_avframe->linesize) ) { + input_avframe->data, input_avframe->linesize, + 0, height, + output_avframe->data, output_avframe->linesize) ) { Error("swscale conversion failed"); return -10; } @@ -208,25 +207,25 @@ int SWScale::Convert( } int SWScale::Convert( - const uint8_t* in_buffer, - const size_t in_buffer_size, - uint8_t* out_buffer, - const size_t out_buffer_size, - enum _AVPIXELFORMAT in_pf, - enum _AVPIXELFORMAT out_pf, - unsigned int width, - unsigned int height) { + const uint8_t* in_buffer, + const size_t in_buffer_size, + uint8_t* out_buffer, + const size_t out_buffer_size, + enum _AVPIXELFORMAT in_pf, + enum _AVPIXELFORMAT out_pf, + unsigned int width, + unsigned int height) { return Convert(in_buffer, in_buffer_size, out_buffer, out_buffer_size, in_pf, out_pf, width, height, width, height); } int SWScale::Convert( - const Image* img, - uint8_t* out_buffer, - const size_t out_buffer_size, - enum _AVPIXELFORMAT in_pf, - enum _AVPIXELFORMAT out_pf, - unsigned int width, - unsigned int height) { + const Image* img, + uint8_t* out_buffer, + const size_t out_buffer_size, + enum _AVPIXELFORMAT in_pf, + enum _AVPIXELFORMAT out_pf, + unsigned int width, + unsigned int height) { if ( img->Width() != width ) { Error("Source image width differs. Source: %d Output: %d", img->Width(), width); return -12; diff --git a/src/zm_swscale.h b/src/zm_swscale.h index 32ce70217..74ab8951d 100644 --- a/src/zm_swscale.h +++ b/src/zm_swscale.h @@ -8,28 +8,28 @@ class Image; /* SWScale wrapper class to make our life easier and reduce code reuse */ class SWScale { - public: - SWScale(); - ~SWScale(); - bool init(); - int SetDefaults(enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height); - int ConvertDefaults(const Image* img, uint8_t* out_buffer, const size_t out_buffer_size); - int ConvertDefaults(const uint8_t* in_buffer, const size_t in_buffer_size, uint8_t* out_buffer, const size_t out_buffer_size); - int Convert( AVFrame *in_frame, AVFrame *out_frame ); - int Convert(const Image* img, uint8_t* out_buffer, const size_t out_buffer_size, enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height); - int Convert(const uint8_t* in_buffer, const size_t in_buffer_size, uint8_t* out_buffer, const size_t out_buffer_size, enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height); - int Convert(const uint8_t* in_buffer, const size_t in_buffer_size, uint8_t* out_buffer, const size_t out_buffer_size, enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height, unsigned int new_width, unsigned int new_height); - static size_t GetBufferSize(enum _AVPIXELFORMAT in_pf, unsigned int width, unsigned int height); - - protected: - bool gotdefaults; - struct SwsContext* swscale_ctx; - av_frame_ptr input_avframe; - av_frame_ptr output_avframe; - enum _AVPIXELFORMAT default_input_pf; - enum _AVPIXELFORMAT default_output_pf; - unsigned int default_width; - unsigned int default_height; + public: + SWScale(); + ~SWScale(); + bool init(); + int SetDefaults(enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height); + int ConvertDefaults(const Image* img, uint8_t* out_buffer, const size_t out_buffer_size); + int ConvertDefaults(const uint8_t* in_buffer, const size_t in_buffer_size, uint8_t* out_buffer, const size_t out_buffer_size); + int Convert( AVFrame *in_frame, AVFrame *out_frame ); + int Convert(const Image* img, uint8_t* out_buffer, const size_t out_buffer_size, enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height); + int Convert(const uint8_t* in_buffer, const size_t in_buffer_size, uint8_t* out_buffer, const size_t out_buffer_size, enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height); + int Convert(const uint8_t* in_buffer, const size_t in_buffer_size, uint8_t* out_buffer, const size_t out_buffer_size, enum _AVPIXELFORMAT in_pf, enum _AVPIXELFORMAT out_pf, unsigned int width, unsigned int height, unsigned int new_width, unsigned int new_height); + static size_t GetBufferSize(enum _AVPIXELFORMAT in_pf, unsigned int width, unsigned int height); + + protected: + bool gotdefaults; + struct SwsContext* swscale_ctx; + av_frame_ptr input_avframe; + av_frame_ptr output_avframe; + enum _AVPIXELFORMAT default_input_pf; + enum _AVPIXELFORMAT default_output_pf; + unsigned int default_width; + unsigned int default_height; }; #endif // ZM_SWSCALE_H diff --git a/src/zm_time.cpp b/src/zm_time.cpp index 828e7b0f3..fd8c69d67 100644 --- a/src/zm_time.cpp +++ b/src/zm_time.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Time Functions & Definitions, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_time.h" @@ -24,7 +24,7 @@ std::string SystemTimePointToString(SystemTimePoint tp) { time_t tp_sec = std::chrono::system_clock::to_time_t(tp); Microseconds now_frac = std::chrono::duration_cast( - tp.time_since_epoch() - std::chrono::duration_cast(tp.time_since_epoch())); + tp.time_since_epoch() - std::chrono::duration_cast(tp.time_since_epoch())); std::string timeString; timeString.reserve(64); @@ -38,10 +38,10 @@ std::string SystemTimePointToString(SystemTimePoint tp) { std::string TimePointToString(TimePoint tp) { const auto tp_dur = std::chrono::duration_cast(tp - std::chrono::steady_clock::now()); time_t tp_sec = std::chrono::system_clock::to_time_t( - std::chrono::system_clock::now() + tp_dur); + std::chrono::system_clock::now() + tp_dur); Microseconds now_frac = std::chrono::duration_cast( - tp.time_since_epoch() - std::chrono::duration_cast(tp.time_since_epoch())); + tp.time_since_epoch() - std::chrono::duration_cast(tp.time_since_epoch())); std::string timeString; timeString.reserve(64); diff --git a/src/zm_time.h b/src/zm_time.h index d9d131944..0ee10ab1c 100644 --- a/src/zm_time.h +++ b/src/zm_time.h @@ -1,21 +1,21 @@ // // ZoneMinder Time Functions & Definitions, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_TIME_H #define ZM_TIME_H @@ -63,8 +63,8 @@ template struct posix_duration_cast> { static std::chrono::duration cast(timeval const &tv) { return std::chrono::duration_cast>( - Seconds(tv.tv_sec) + Microseconds(tv.tv_usec) - ); + Seconds(tv.tv_sec) + Microseconds(tv.tv_usec) + ); } }; } @@ -92,9 +92,9 @@ Duration duration_cast(timeval const &tv) { class TimeSegmentAdder { public: explicit TimeSegmentAdder(Microseconds &in_target) : - target_(in_target), - start_time_(std::chrono::steady_clock::now()), - finished_(false) { + target_(in_target), + start_time_(std::chrono::steady_clock::now()), + finished_(false) { } ~TimeSegmentAdder() { diff --git a/src/zm_uri.cpp b/src/zm_uri.cpp index 930d1f75e..ec4ed042b 100644 --- a/src/zm_uri.cpp +++ b/src/zm_uri.cpp @@ -3,49 +3,49 @@ #include "zm_uri.h" Uri::Uri(const std::string &uri) { - if (uri.empty()) return; + if (uri.empty()) return; - typedef std::string::const_iterator iterator_t; + typedef std::string::const_iterator iterator_t; - iterator_t uriEnd = uri.end(); + iterator_t uriEnd = uri.end(); - // get query start - iterator_t queryStart = std::find(uri.begin(), uriEnd, '?'); + // get query start + iterator_t queryStart = std::find(uri.begin(), uriEnd, '?'); - // protocol - iterator_t protocolStart = uri.begin(); - iterator_t protocolEnd = std::find(protocolStart, uriEnd, ':'); //"://"); + // protocol + iterator_t protocolStart = uri.begin(); + iterator_t protocolEnd = std::find(protocolStart, uriEnd, ':'); //"://"); - if (protocolEnd != uriEnd) { - std::string prot = &*(protocolEnd); - if ((prot.length() > 3) && (prot.substr(0, 3) == "://")) { - Protocol = std::string(protocolStart, protocolEnd); - protocolEnd += 3; // :// - } else { - protocolEnd = uri.begin(); // no protocol - } + if (protocolEnd != uriEnd) { + std::string prot = &*(protocolEnd); + if ((prot.length() > 3) && (prot.substr(0, 3) == "://")) { + Protocol = std::string(protocolStart, protocolEnd); + protocolEnd += 3; // :// } else { - protocolEnd = uri.begin(); // no protocol + protocolEnd = uri.begin(); // no protocol } + } else { + protocolEnd = uri.begin(); // no protocol + } - // host - iterator_t hostStart = protocolEnd; - iterator_t pathStart = std::find(hostStart, uriEnd, '/'); // get pathStart + // host + iterator_t hostStart = protocolEnd; + iterator_t pathStart = std::find(hostStart, uriEnd, '/'); // get pathStart - iterator_t hostEnd = std::find(protocolEnd, - (pathStart != uriEnd) ? pathStart : queryStart, - ':'); // check for port + iterator_t hostEnd = std::find(protocolEnd, + (pathStart != uriEnd) ? pathStart : queryStart, + ':'); // check for port - Host = std::string(hostStart, hostEnd); + Host = std::string(hostStart, hostEnd); - // port - if ((hostEnd != uriEnd) && ((&*(hostEnd))[0] == ':')) { - // we have a port - hostEnd++; - iterator_t portEnd = (pathStart != uriEnd) ? pathStart : queryStart; - Port = std::string(hostEnd, portEnd); - } + // port + if ((hostEnd != uriEnd) && ((&*(hostEnd))[0] == ':')) { + // we have a port + hostEnd++; + iterator_t portEnd = (pathStart != uriEnd) ? pathStart : queryStart; + Port = std::string(hostEnd, portEnd); + } - if (pathStart != uriEnd) Path = std::string(pathStart, queryStart); - if (queryStart != uriEnd) QueryString = std::string(queryStart, uri.end()); + if (pathStart != uriEnd) Path = std::string(pathStart, queryStart); + if (queryStart != uriEnd) QueryString = std::string(queryStart, uri.end()); } diff --git a/src/zm_uri.h b/src/zm_uri.h index 41c427dad..fc953406f 100644 --- a/src/zm_uri.h +++ b/src/zm_uri.h @@ -23,7 +23,7 @@ #include class Uri { - public: + public: std::string QueryString, Path, Protocol, Host, Port; Uri(const std::string &uri); diff --git a/src/zm_user.cpp b/src/zm_user.cpp index 117614b9d..dc1e4373e 100644 --- a/src/zm_user.cpp +++ b/src/zm_user.cpp @@ -83,21 +83,21 @@ bool User::canAccess(int monitor_id) { if (it != monitor_permissions.end()) { auto permission = it->second.getPermission(); switch (permission) { - case Monitor_Permission::PERM_NONE : - Debug(1, "Returning None from monitor_permission"); - return false; - case Monitor_Permission::PERM_VIEW : - Debug(1, "Returning true because VIEW from monitor_permission"); - return true; - case Monitor_Permission::PERM_EDIT : - Debug(1, "Returning true because EDIT from monitor_permission"); - return true; - case Monitor_Permission::PERM_INHERIT : - Debug(1, "INHERIT from monitor_permission"); - break; - default: - Warning("UNKNOWN permission %d from monitor_permission", permission); - break; + case Monitor_Permission::PERM_NONE : + Debug(1, "Returning None from monitor_permission"); + return false; + case Monitor_Permission::PERM_VIEW : + Debug(1, "Returning true because VIEW from monitor_permission"); + return true; + case Monitor_Permission::PERM_EDIT : + Debug(1, "Returning true because EDIT from monitor_permission"); + return true; + case Monitor_Permission::PERM_INHERIT : + Debug(1, "INHERIT from monitor_permission"); + break; + default: + Warning("UNKNOWN permission %d from monitor_permission", permission); + break; } } @@ -106,21 +106,21 @@ bool User::canAccess(int monitor_id) { for (Group_Permission &gp : group_permissions) { auto permission = gp.getPermission(monitor_id); switch (permission) { - case Group_Permission::PERM_NONE : - Debug(1, "Returning None from group_permission"); - return false; - case Group_Permission::PERM_VIEW : - Debug(1, "Returning true because VIEW from group_permission"); - return true; - case Group_Permission::PERM_EDIT : - Debug(1, "Returning true because EDIT from group_permission"); - return true; - case Group_Permission::PERM_INHERIT : - Debug(1, "INHERIT from group_permission %d", gp.GroupId()); - break; - default : - Warning("UNKNOWN permission %d from group_permission %d", permission, gp.GroupId()); - break; + case Group_Permission::PERM_NONE : + Debug(1, "Returning None from group_permission"); + return false; + case Group_Permission::PERM_VIEW : + Debug(1, "Returning true because VIEW from group_permission"); + return true; + case Group_Permission::PERM_EDIT : + Debug(1, "Returning true because EDIT from group_permission"); + return true; + case Group_Permission::PERM_INHERIT : + Debug(1, "INHERIT from group_permission %d", gp.GroupId()); + break; + default : + Warning("UNKNOWN permission %d from group_permission %d", permission, gp.GroupId()); + break; } } // end foreach Group_Permission @@ -145,14 +145,14 @@ User *zmLoadUser(const std::string &username, const std::string &password) { MYSQL_ROW dbrow = mysql_fetch_row(result); User *user = new User(dbrow); - if ( - (password.empty() and (!strcmp(config.auth_relay, "none"))) // relay type must be none - || - verifyPassword(username.c_str(), password.c_str(), user->getPassword()) ) { + if ( + (password.empty() and (!strcmp(config.auth_relay, "none"))) // relay type must be none + || + verifyPassword(username.c_str(), password.c_str(), user->getPassword()) ) { mysql_free_result(result); Debug(1, "Authenticated user '%s'", user->getUsername()); return user; - } + } delete user; } // end if 1 result from db mysql_free_result(result); @@ -212,11 +212,11 @@ User *zmLoadTokenUser(const std::string &jwt_token_str, bool use_remote_addr) { } Debug(1, "Authenticated user '%s' via token with last revoke time: %u", - username.c_str(), stored_iat); + username.c_str(), stored_iat); mysql_free_result(result); return user; } // User *zmLoadTokenUser(std::string jwt_token_str, bool use_remote_addr) - + // Function to validate an authentication string User *zmLoadAuthUser(const std::string &auth, const std::string &username, bool use_remote_addr) { const char *remote_addr = ""; @@ -229,7 +229,7 @@ User *zmLoadAuthUser(const std::string &auth, const std::string &username, bool } Debug(1, "Attempting to authenticate user %s from auth string '%s', remote addr(%s)", - username.c_str(), auth.c_str(), remote_addr); + username.c_str(), auth.c_str(), remote_addr); std::string sql = "SELECT `Id`, `Username`, `Password`, `Enabled`," " `Stream`+0, `Events`+0, `Control`+0, `Monitors`+0, `System`+0" " FROM `Users` WHERE `Enabled` = 1"; diff --git a/src/zm_user.h b/src/zm_user.h index 2b8b74fb3..52950200c 100644 --- a/src/zm_user.h +++ b/src/zm_user.h @@ -1,21 +1,21 @@ /* * ZoneMinder User Class Interface, $Date$, $Revision$ * Copyright (C) 2001-2008 Philip Coombes - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ +*/ @@ -58,7 +58,8 @@ class User { User(const User &u) { Copy(u); } void Copy(const User &u); User& operator=(const User &u) { - Copy(u); return *this; + Copy(u); + return *this; } int Id() const { return id; } diff --git a/src/zm_utils.cpp b/src/zm_utils.cpp index 4d2075232..4b6cfb7eb 100644 --- a/src/zm_utils.cpp +++ b/src/zm_utils.cpp @@ -1,21 +1,21 @@ // // ZoneMinder General Utility Functions, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_utils.h" @@ -254,17 +254,17 @@ void HwCapsDetect() { #elif defined(__arm__) // ARM processor in 32bit mode // To see if it supports NEON, we need to get that information from the kernel - #ifdef __linux__ +#ifdef __linux__ unsigned long auxval = getauxval(AT_HWCAP); if (auxval & HWCAP_ARM_NEON) { - #elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) unsigned long auxval = 0; elf_aux_info(AT_HWCAP, &auxval, sizeof(auxval)); if (auxval & HWCAP_NEON) { - #else +#else { - #error Unsupported OS. - #endif +#error Unsupported OS. +#endif Debug(1,"Detected ARM (AArch32) processor with Neon"); neonversion = 1; } else { @@ -293,35 +293,35 @@ void *sse2_aligned_memcpy(void *dest, const void *src, size_t bytes) { const uint8_t *lastsrc = (uint8_t *) src + (bytes - remainder); __asm__ __volatile__( - "sse2_copy_iter:\n\t" - "movdqa (%0),%%xmm0\n\t" - "movdqa 0x10(%0),%%xmm1\n\t" - "movdqa 0x20(%0),%%xmm2\n\t" - "movdqa 0x30(%0),%%xmm3\n\t" - "movdqa 0x40(%0),%%xmm4\n\t" - "movdqa 0x50(%0),%%xmm5\n\t" - "movdqa 0x60(%0),%%xmm6\n\t" - "movdqa 0x70(%0),%%xmm7\n\t" - "movntdq %%xmm0,(%1)\n\t" - "movntdq %%xmm1,0x10(%1)\n\t" - "movntdq %%xmm2,0x20(%1)\n\t" - "movntdq %%xmm3,0x30(%1)\n\t" - "movntdq %%xmm4,0x40(%1)\n\t" - "movntdq %%xmm5,0x50(%1)\n\t" - "movntdq %%xmm6,0x60(%1)\n\t" - "movntdq %%xmm7,0x70(%1)\n\t" - "add $0x80, %0\n\t" - "add $0x80, %1\n\t" - "cmp %2, %0\n\t" - "jb sse2_copy_iter\n\t" - "test %3, %3\n\t" - "jz sse2_copy_finish\n\t" - "cld\n\t" - "rep movsb\n\t" - "sse2_copy_finish:\n\t" - : - : "S" (src), "D" (dest), "r" (lastsrc), "c" (remainder) - : "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "cc", "memory" + "sse2_copy_iter:\n\t" + "movdqa (%0),%%xmm0\n\t" + "movdqa 0x10(%0),%%xmm1\n\t" + "movdqa 0x20(%0),%%xmm2\n\t" + "movdqa 0x30(%0),%%xmm3\n\t" + "movdqa 0x40(%0),%%xmm4\n\t" + "movdqa 0x50(%0),%%xmm5\n\t" + "movdqa 0x60(%0),%%xmm6\n\t" + "movdqa 0x70(%0),%%xmm7\n\t" + "movntdq %%xmm0,(%1)\n\t" + "movntdq %%xmm1,0x10(%1)\n\t" + "movntdq %%xmm2,0x20(%1)\n\t" + "movntdq %%xmm3,0x30(%1)\n\t" + "movntdq %%xmm4,0x40(%1)\n\t" + "movntdq %%xmm5,0x50(%1)\n\t" + "movntdq %%xmm6,0x60(%1)\n\t" + "movntdq %%xmm7,0x70(%1)\n\t" + "add $0x80, %0\n\t" + "add $0x80, %1\n\t" + "cmp %2, %0\n\t" + "jb sse2_copy_iter\n\t" + "test %3, %3\n\t" + "jz sse2_copy_finish\n\t" + "cld\n\t" + "rep movsb\n\t" + "sse2_copy_finish:\n\t" + : + : "S" (src), "D" (dest), "r" (lastsrc), "c" (remainder) + : "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "cc", "memory" ); } else { diff --git a/src/zm_utils.h b/src/zm_utils.h index bc964092f..d90f0e87a 100644 --- a/src/zm_utils.h +++ b/src/zm_utils.h @@ -1,21 +1,21 @@ // // ZoneMinder General Utility Functions, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_UTILS_H #define ZM_UTILS_H @@ -104,7 +104,7 @@ constexpr const T &clamp(const T &v, const T &lo, const T &hi, Compare comp) { } template constexpr const T &clamp(const T &v, const T &lo, const T &hi) { - return zm::clamp(v, lo, hi, std::less{}); + return zm::clamp(v, lo, hi, std::less {}); } // C++17 std::data (TODO: remove this once C++17 is supported) @@ -186,13 +186,11 @@ namespace utils { * last if no such element is found. */ template< typename InputIt, typename UnaryPredicate > -[[ nodiscard ]] constexpr InputIt find_if( InputIt first, InputIt last, UnaryPredicate p ) noexcept -{ - for ( ; first != last; ++first ) - { - if ( p( *first ) ) { return first; } - } - return last; +[[ nodiscard ]] constexpr InputIt find_if( InputIt first, InputIt last, UnaryPredicate p ) noexcept { + for ( ; first != last; ++first ) { + if ( p( *first ) ) { return first; } + } + return last; } }; #endif // ZM_UTILS_H diff --git a/src/zm_vector2.h b/src/zm_vector2.h index c7630ad36..c2a3cb7cd 100644 --- a/src/zm_vector2.h +++ b/src/zm_vector2.h @@ -1,21 +1,21 @@ // // ZoneMinder Coordinate Class Interface, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_VECTOR2_H #define ZM_VECTOR2_H diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index c68207f41..915b51e93 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -67,14 +67,14 @@ VideoStore::CodecData VideoStore::codec_data[] = { }; VideoStore::VideoStore( - const char *filename_in, - const char *format_in, - AVStream *p_video_in_stream, - AVCodecContext *p_video_in_ctx, - AVStream *p_audio_in_stream, - AVCodecContext *p_audio_in_ctx, - Monitor *p_monitor - ) : + const char *filename_in, + const char *format_in, + AVStream *p_video_in_stream, + AVCodecContext *p_video_in_ctx, + AVStream *p_audio_in_stream, + AVCodecContext *p_audio_in_ctx, + Monitor *p_monitor +) : chosen_codec_data(nullptr), monitor(p_monitor), out_format(nullptr), @@ -106,8 +106,7 @@ VideoStore::VideoStore( next_dts(nullptr), audio_next_pts(0), max_stream_index(-1), - reorder_queue_size(0) -{ + reorder_queue_size(0) { FFMPEGInit(); swscale.init(); opkt = av_packet_ptr{av_packet_alloc()}; @@ -119,9 +118,9 @@ bool VideoStore::open() { int ret = avformat_alloc_output_context2(&oc, nullptr, nullptr, filename); if (ret < 0) { Warning( - "Could not create video storage stream %s as no out ctx" - " could be assigned based on filename: %s", - filename, av_make_error_string(ret).c_str()); + "Could not create video storage stream %s as no out ctx" + " could be assigned based on filename: %s", + filename, av_make_error_string(ret).c_str()); } // Couldn't deduce format from filename, trying from format name @@ -129,9 +128,9 @@ bool VideoStore::open() { avformat_alloc_output_context2(&oc, nullptr, format, filename); if (!oc) { Error( - "Could not create video storage stream %s as no out ctx" - " could not be assigned based on filename or format %s", - filename, format); + "Could not create video storage stream %s as no out ctx" + " could not be assigned based on filename or format %s", + filename, format); return false; } } // end if ! oc @@ -234,9 +233,9 @@ bool VideoStore::open() { if ((ret = avcodec_open2(video_out_ctx, video_out_codec, &opts)) < 0) { Warning("Can't open video codec (%s) %s", - video_out_codec->name, - av_make_error_string(ret).c_str() - ); + video_out_codec->name, + av_make_error_string(ret).c_str() + ); video_out_codec = nullptr; } } // end if video_out_codec @@ -264,10 +263,10 @@ bool VideoStore::open() { //wanted_codec = AV_CODEC_ID_H264; // FIXME what is the optimal codec? Probably low latency h264 which is effectively mjpeg } else { - if (AV_CODEC_ID_H264 != 27 and wanted_codec > 3) { - // Older ffmpeg had AV_CODEC_ID_MPEG2VIDEO_XVMC at position 3 has been deprecated - wanted_codec += 1; - } + if (AV_CODEC_ID_H264 != 27 and wanted_codec > 3) { + // Older ffmpeg had AV_CODEC_ID_MPEG2VIDEO_XVMC at position 3 has been deprecated + wanted_codec += 1; + } Debug(2, "Codec wanted %d %s", wanted_codec, avcodec_get_name((AVCodecID)wanted_codec)); } std::string wanted_encoder = monitor->Encoder(); @@ -282,11 +281,11 @@ bool VideoStore::open() { } if (wanted_codec and (codec_data[i].codec_id != wanted_codec)) { Debug(1, "Not the right codec %d %s != %d %s", - codec_data[i].codec_id, - avcodec_get_name(codec_data[i].codec_id), - wanted_codec, - avcodec_get_name((AVCodecID)wanted_codec) - ); + codec_data[i].codec_id, + avcodec_get_name(codec_data[i].codec_id), + wanted_codec, + avcodec_get_name((AVCodecID)wanted_codec) + ); continue; } @@ -329,8 +328,8 @@ bool VideoStore::open() { #if HAVE_LIBAVUTIL_HWCONTEXT_H && LIBAVCODEC_VERSION_CHECK(57, 107, 0, 107, 0) if (codec_data[i].hwdevice_type != AV_HWDEVICE_TYPE_NONE) { ret = av_hwdevice_ctx_create(&hw_device_ctx, - codec_data[i].hwdevice_type, - nullptr, nullptr, 0); + codec_data[i].hwdevice_type, + nullptr, nullptr, 0); if (0>ret) { Error("Failed to create hwdevice_ctx %s", av_make_error_string(ret).c_str()); continue; @@ -351,7 +350,7 @@ bool VideoStore::open() { frames_ctx->initial_pool_size = 20; if ((ret = av_hwframe_ctx_init(hw_frames_ref)) < 0) { Error("Failed to initialize hwaccel frame context." - "Error code: %s", av_err2str(ret)); + "Error code: %s", av_err2str(ret)); av_buffer_unref(&hw_frames_ref); } else { video_out_ctx->hw_frames_ctx = av_buffer_ref(hw_frames_ref); @@ -381,14 +380,14 @@ bool VideoStore::open() { if ((ret = avcodec_open2(video_out_ctx, video_out_codec, &opts)) < 0) { if (wanted_encoder != "" and wanted_encoder != "auto") { Warning("Can't open video codec (%s) %s", - video_out_codec->name, - av_make_error_string(ret).c_str() - ); + video_out_codec->name, + av_make_error_string(ret).c_str() + ); } else { Debug(1, "Can't open video codec (%s) %s", - video_out_codec->name, - av_make_error_string(ret).c_str() - ); + video_out_codec->name, + av_make_error_string(ret).c_str() + ); } video_out_codec = nullptr; } @@ -559,7 +558,7 @@ bool VideoStore::open() { // we crash if we try again if (ENOSPC != ret) { Warning("Unable to set movflags trying with defaults.%d %s", - ret, av_make_error_string(ret).c_str()); + ret, av_make_error_string(ret).c_str()); ret = avformat_write_header(oc, nullptr); Debug(1, "Done %d", ret); @@ -579,7 +578,7 @@ bool VideoStore::open() { av_dict_free(&opts); if (ret < 0) { Error("Error occurred when writing out file header to %s: %s", - filename, av_make_error_string(ret).c_str()); + filename, av_make_error_string(ret).c_str()); avio_closep(&oc->pb); return false; } @@ -605,8 +604,8 @@ void VideoStore::flush_codecs() { while ((zm_send_frame_receive_packet(video_out_ctx, nullptr, *pkt)) > 0) { av_packet_guard pkt_guard{pkt}; av_packet_rescale_ts(pkt.get(), - video_out_ctx->time_base, - video_out_stream->time_base); + video_out_ctx->time_base, + video_out_stream->time_base); write_packet(pkt.get(), video_out_stream); } // while have buffered frames Debug(1, "Done writing buffered video."); @@ -629,8 +628,8 @@ void VideoStore::flush_codecs() { if (zm_send_frame_receive_packet(audio_out_ctx, out_frame.get(), *pkt) > 0) { av_packet_guard pkt_guard{pkt}; av_packet_rescale_ts(pkt.get(), - audio_out_ctx->time_base, - audio_out_stream->time_base); + audio_out_ctx->time_base, + audio_out_stream->time_base); write_packet(pkt.get(), audio_out_stream); } } // end if data returned from fifo @@ -643,7 +642,7 @@ void VideoStore::flush_codecs() { * encode it and write it to the output file. */ Debug(1, "Remaining samples in fifo for AAC codec frame_size %d > fifo size %d", - frame_size, av_audio_fifo_size(fifo)); + frame_size, av_audio_fifo_size(fifo)); // SHould probably set the frame size to what is reported FIXME if (av_audio_fifo_read(fifo, (void **)out_frame->data, frame_size)) { @@ -652,15 +651,15 @@ void VideoStore::flush_codecs() { pkt->stream_index = audio_out_stream->index; av_packet_rescale_ts(pkt.get(), - audio_out_ctx->time_base, - audio_out_stream->time_base); + audio_out_ctx->time_base, + audio_out_stream->time_base); write_packet(pkt.get(), audio_out_stream); } } // end if data returned from fifo } // end while still data in the fifo - // Put encoder into flushing mode - avcodec_send_frame(audio_out_ctx, nullptr); + // Put encoder into flushing mode + avcodec_send_frame(audio_out_ctx, nullptr); while (true) { if (0 >= zm_receive_packet(audio_out_ctx, *pkt)) { @@ -801,10 +800,10 @@ bool VideoStore::setup_resampler() { audio_out_ctx->channel_layout = audio_in_ctx->channel_layout; if (!audio_out_ctx->channel_layout) { Debug(3, "Correcting channel layout from (%" PRIi64 ") to (%" PRIi64 ")", - audio_out_ctx->channel_layout, - av_get_default_channel_layout(audio_out_ctx->channels) - ); - audio_out_ctx->channel_layout = av_get_default_channel_layout(audio_out_ctx->channels); + audio_out_ctx->channel_layout, + av_get_default_channel_layout(audio_out_ctx->channels) + ); + audio_out_ctx->channel_layout = av_get_default_channel_layout(audio_out_ctx->channels); } #endif @@ -829,7 +828,7 @@ bool VideoStore::setup_resampler() { /* check that the encoder supports s16 pcm in */ if (!check_sample_fmt(audio_out_codec, audio_out_ctx->sample_fmt)) { Debug(3, "Encoder does not support sample format %s, setting to FLTP", - av_get_sample_fmt_name(audio_out_ctx->sample_fmt)); + av_get_sample_fmt_name(audio_out_ctx->sample_fmt)); audio_out_ctx->sample_fmt = AV_SAMPLE_FMT_FLTP; } @@ -845,7 +844,7 @@ bool VideoStore::setup_resampler() { av_dict_free(&opts); if (ret < 0) { Error("could not open codec (%d) (%s)", - ret, av_make_error_string(ret).c_str()); + ret, av_make_error_string(ret).c_str()); audio_out_codec = nullptr; audio_out_ctx = nullptr; audio_out_stream = nullptr; @@ -853,7 +852,7 @@ bool VideoStore::setup_resampler() { } zm_dump_codec(audio_out_ctx); - audio_out_stream->time_base = (AVRational){1, audio_out_ctx->sample_rate}; + audio_out_stream->time_base = (AVRational) {1, audio_out_ctx->sample_rate}; if ((ret = avcodec_parameters_from_context(audio_out_stream->codecpar, audio_out_ctx)) < 0) { Error("Could not initialize stream parameters"); return false; @@ -921,37 +920,37 @@ bool VideoStore::setup_resampler() { out_frame->sample_rate = audio_out_ctx->sample_rate; if (!(fifo = av_audio_fifo_alloc( - audio_out_ctx->sample_fmt, + audio_out_ctx->sample_fmt, #if LIBAVUTIL_VERSION_CHECK(57, 28, 100, 28, 0) - audio_out_ctx->ch_layout.nb_channels + audio_out_ctx->ch_layout.nb_channels #else - audio_out_ctx->channels + audio_out_ctx->channels #endif - , 1))) { + , 1))) { Error("Could not allocate FIFO"); return false; } #if LIBAVUTIL_VERSION_CHECK(57, 28, 100, 28, 0) if ((ret = swr_alloc_set_opts2(&resample_ctx, - &audio_out_ctx->ch_layout, - audio_out_ctx->sample_fmt, - audio_out_ctx->sample_rate, - &audio_in_ctx->ch_layout, - audio_in_ctx->sample_fmt, - audio_in_ctx->sample_rate, - 0, nullptr)) < 0) { + &audio_out_ctx->ch_layout, + audio_out_ctx->sample_fmt, + audio_out_ctx->sample_rate, + &audio_in_ctx->ch_layout, + audio_in_ctx->sample_fmt, + audio_in_ctx->sample_rate, + 0, nullptr)) < 0) { Error("Could not allocate resample context"); return false; } #else resample_ctx = swr_alloc_set_opts(nullptr, - audio_out_ctx->channel_layout, - audio_out_ctx->sample_fmt, - audio_out_ctx->sample_rate, - audio_in_ctx->channel_layout, - audio_in_ctx->sample_fmt, - audio_in_ctx->sample_rate, - 0, nullptr); + audio_out_ctx->channel_layout, + audio_out_ctx->sample_fmt, + audio_out_ctx->sample_rate, + audio_in_ctx->channel_layout, + audio_in_ctx->sample_fmt, + audio_in_ctx->sample_rate, + 0, nullptr); if (!resample_ctx) { Error("Could not allocate resample context"); return false; @@ -972,19 +971,19 @@ bool VideoStore::setup_resampler() { out_frame->channels = audio_out_ctx->channels; out_frame->channel_layout = audio_out_ctx->channel_layout; #endif - out_frame->sample_rate = audio_out_ctx->sample_rate; + out_frame->sample_rate = audio_out_ctx->sample_rate; // The codec gives us the frame size, in samples, we calculate the size of the // samples buffer in bytes unsigned int audioSampleBuffer_size = av_samples_get_buffer_size( - nullptr, + nullptr, #if LIBAVUTIL_VERSION_CHECK(57, 28, 100, 28, 0) - audio_out_ctx->ch_layout.nb_channels, + audio_out_ctx->ch_layout.nb_channels, #else - audio_out_ctx->channels, + audio_out_ctx->channels, #endif - audio_out_ctx->frame_size, - audio_out_ctx->sample_fmt, 0); + audio_out_ctx->frame_size, + audio_out_ctx->sample_fmt, 0); converted_in_samples = reinterpret_cast(av_malloc(audioSampleBuffer_size)); if (!converted_in_samples) { @@ -1086,11 +1085,11 @@ int VideoStore::writeVideoFramePacket(const std::shared_ptr &zm_packet if (!zm_packet->out_frame) { Debug(3, "Have no out frame. codec is %s sw_pf %d %s hw_pf %d %s %dx%d", - chosen_codec_data->codec_name, - chosen_codec_data->sw_pix_fmt, av_get_pix_fmt_name(chosen_codec_data->sw_pix_fmt), - chosen_codec_data->hw_pix_fmt, av_get_pix_fmt_name(chosen_codec_data->hw_pix_fmt), - video_out_ctx->width, video_out_ctx->height - ); + chosen_codec_data->codec_name, + chosen_codec_data->sw_pix_fmt, av_get_pix_fmt_name(chosen_codec_data->sw_pix_fmt), + chosen_codec_data->hw_pix_fmt, av_get_pix_fmt_name(chosen_codec_data->hw_pix_fmt), + video_out_ctx->width, video_out_ctx->height + ); AVFrame *out_frame = zm_packet->get_out_frame(video_out_ctx->width, video_out_ctx->height, chosen_codec_data->sw_pix_fmt); if (!out_frame) { Error("Unable to allocate a frame"); @@ -1101,14 +1100,14 @@ int VideoStore::writeVideoFramePacket(const std::shared_ptr &zm_packet Debug(2, "Have an image, convert it"); //Go straight to out frame swscale.Convert( - zm_packet->image, - zm_packet->out_frame->buf[0]->data, - zm_packet->codec_imgsize, - zm_packet->image->AVPixFormat(), - chosen_codec_data->sw_pix_fmt, - video_out_ctx->width, - video_out_ctx->height - ); + zm_packet->image, + zm_packet->out_frame->buf[0]->data, + zm_packet->codec_imgsize, + zm_packet->image->AVPixFormat(), + chosen_codec_data->sw_pix_fmt, + video_out_ctx->width, + video_out_ctx->height + ); } else if (!zm_packet->in_frame) { Debug(4, "Have no in_frame"); if (zm_packet->packet->size and !zm_packet->decoded) { @@ -1121,7 +1120,7 @@ int VideoStore::writeVideoFramePacket(const std::shared_ptr &zm_packet swscale.Convert(zm_packet->in_frame.get(), out_frame); } else { Error("Have neither in_frame or image in packet %d!", - zm_packet->image_index); + zm_packet->image_index); return 0; } // end if has packet or image } else { @@ -1174,7 +1173,7 @@ int VideoStore::writeVideoFramePacket(const std::shared_ptr &zm_packet } else { Microseconds useconds = std::chrono::duration_cast( - zm_packet->timestamp - SystemTimePoint(Microseconds(video_first_pts))); + zm_packet->timestamp - SystemTimePoint(Microseconds(video_first_pts))); frame->pts = av_rescale_q(useconds.count(), AV_TIME_BASE_Q, video_out_ctx->time_base); Debug(2, "Setting pts for frame(%d) to (%" PRId64 ") from (zm_packet->timestamp(%" PRIi64 " - first %" PRId64 " us %" PRId64 " ) @ %d/%d", @@ -1203,61 +1202,61 @@ int VideoStore::writeVideoFramePacket(const std::shared_ptr &zm_packet if (opkt->dts != AV_NOPTS_VALUE) opkt->dts = av_rescale_q(opkt->dts, video_out_ctx->time_base, video_out_stream->time_base); Debug(1, "Timebase conversions using %d/%d -> %d/%d", - video_out_ctx->time_base.num, - video_out_ctx->time_base.den, - video_out_stream->time_base.num, - video_out_stream->time_base.den); + video_out_ctx->time_base.num, + video_out_ctx->time_base.den, + video_out_stream->time_base.num, + video_out_stream->time_base.den); int64_t duration = 0; if (zm_packet->in_frame) { if ( #if LIBAVCODEC_VERSION_CHECK(60, 3, 0, 3, 0) - zm_packet->in_frame->duration + zm_packet->in_frame->duration #else - zm_packet->in_frame->pkt_duration + zm_packet->in_frame->pkt_duration #endif - ) { + ) { duration = av_rescale_q( #if LIBAVCODEC_VERSION_CHECK(60, 3, 0, 3, 0) - zm_packet->in_frame->duration, + zm_packet->in_frame->duration, #else - zm_packet->in_frame->pkt_duration, + zm_packet->in_frame->pkt_duration, #endif - video_in_stream->time_base, - video_out_stream->time_base); + video_in_stream->time_base, + video_out_stream->time_base); Debug(1, "duration from ipkt: = duration(%" PRId64 ") => (%" PRId64 ") (%d/%d) (%d/%d)", #if LIBAVCODEC_VERSION_CHECK(60, 3, 0, 3, 0) - zm_packet->in_frame->duration, + zm_packet->in_frame->duration, #else - zm_packet->in_frame->pkt_duration, + zm_packet->in_frame->pkt_duration, #endif - duration, - video_in_stream->time_base.num, - video_in_stream->time_base.den, - video_out_stream->time_base.num, - video_out_stream->time_base.den - ); + duration, + video_in_stream->time_base.num, + video_in_stream->time_base.den, + video_out_stream->time_base.num, + video_out_stream->time_base.den + ); } else if (video_last_pts != AV_NOPTS_VALUE) { duration = av_rescale_q( - zm_packet->in_frame->pts - video_last_pts, - video_in_stream->time_base, - video_out_stream->time_base); + zm_packet->in_frame->pts - video_last_pts, + video_in_stream->time_base, + video_out_stream->time_base); Debug(1, "duration calc: pts(%" PRId64 ") - last_pts(%" PRId64 ") = (%" PRId64 ") => (%" PRId64 ")", - zm_packet->in_frame->pts, - video_last_pts, - zm_packet->in_frame->pts - video_last_pts, - duration - ); + zm_packet->in_frame->pts, + video_last_pts, + zm_packet->in_frame->pts - video_last_pts, + duration + ); if (duration <= 0) { #if LIBAVCODEC_VERSION_CHECK(60, 3, 0, 3, 0) duration = zm_packet->in_frame->duration ? - zm_packet->in_frame->duration : - av_rescale_q(1, video_in_stream->time_base, video_out_stream->time_base); + zm_packet->in_frame->duration : + av_rescale_q(1, video_in_stream->time_base, video_out_stream->time_base); #else duration = zm_packet->in_frame->pkt_duration ? - zm_packet->in_frame->pkt_duration : - av_rescale_q(1, video_in_stream->time_base, video_out_stream->time_base); + zm_packet->in_frame->pkt_duration : + av_rescale_q(1, video_in_stream->time_base, video_out_stream->time_base); #endif } } // end if in_frmae->pkt_duration @@ -1279,7 +1278,7 @@ int VideoStore::writeVideoFramePacket(const std::shared_ptr &zm_packet video_first_dts = ipkt->dts; } opkt->dts = ipkt->dts - video_first_dts; - //} else { + //} else { //opkt.dts = next_dts[video_out_stream->index] ? av_rescale_q(next_dts[video_out_stream->index], video_out_stream->time_base, video_in_stream->time_base) : 0; //Debug(3, "Setting dts to video_next_dts %" PRId64 " from %" PRId64, opkt.dts, next_dts[video_out_stream->index]); } @@ -1325,7 +1324,7 @@ int VideoStore::writeAudioFramePacket(const std::shared_ptr &zm_packet // We put the samples into the fifo so we are basically resetting the frame out_frame->nb_samples = audio_out_ctx->frame_size; - + if (zm_get_samples_from_fifo(fifo, out_frame.get()) <= 0) break; @@ -1339,8 +1338,8 @@ int VideoStore::writeAudioFramePacket(const std::shared_ptr &zm_packet // Scale the PTS of the outgoing packet to be the correct time base av_packet_rescale_ts(opkt.get(), - audio_out_ctx->time_base, - audio_out_stream->time_base); + audio_out_ctx->time_base, + audio_out_stream->time_base); write_packet(opkt.get(), audio_out_stream); zm_av_packet_unref(opkt.get()); @@ -1382,12 +1381,12 @@ int VideoStore::write_packet(AVPacket *pkt, AVStream *stream) { Debug(1, "undef dts, fixing by setting to stream last_dts %" PRId64, last_dts[stream->index]); if (last_dts[stream->index] == AV_NOPTS_VALUE) { last_dts[stream->index] = 0; - } + } pkt->dts = last_dts[stream->index]; } else { if ((last_dts[stream->index] != AV_NOPTS_VALUE) and (pkt->dts < last_dts[stream->index])) { Warning("non increasing dts, fixing. our dts %" PRId64 " stream %d last_dts %" PRId64 ". reorder_queue_size=%zu", - pkt->dts, stream->index, last_dts[stream->index], reorder_queue_size); + pkt->dts, stream->index, last_dts[stream->index], reorder_queue_size); pkt->dts = last_dts[stream->index]; } next_dts[stream->index] = pkt->dts + pkt->duration; @@ -1400,16 +1399,16 @@ int VideoStore::write_packet(AVPacket *pkt, AVStream *stream) { Warning("pkt.dts(%" PRId64 ") must be <= pkt.pts(%" PRId64 ")." "Decompression must happen before presentation.", pkt->dts, pkt->pts); -/* Debug(1, - "pkt.dts(%" PRId64 ") must be <= pkt.pts(%" PRId64 ")." - "Decompression must happen before presentation.", - pkt->dts, pkt->pts);*/ + /* Debug(1, + "pkt.dts(%" PRId64 ") must be <= pkt.pts(%" PRId64 ")." + "Decompression must happen before presentation.", + pkt->dts, pkt->pts);*/ pkt->pts = pkt->dts; } ZM_DUMP_STREAM_PACKET(stream, pkt, "finished pkt"); Debug(3, "next_dts for stream %d has become %" PRId64 " last_dts %" PRId64, - stream->index, next_dts[stream->index], last_dts[stream->index]); + stream->index, next_dts[stream->index], last_dts[stream->index]); int ret = av_interleaved_write_frame(oc, pkt); if (ret != 0) { diff --git a/src/zm_videostore.h b/src/zm_videostore.h index b04550225..fc18c47ce 100644 --- a/src/zm_videostore.h +++ b/src/zm_videostore.h @@ -23,105 +23,105 @@ class ZMPacket; class PacketQueue; class VideoStore { - private: + private: - struct CodecData { - const AVCodecID codec_id; - const char *codec_codec; - const char *codec_name; - const enum AVPixelFormat sw_pix_fmt; - const enum AVPixelFormat hw_pix_fmt; + struct CodecData { + const AVCodecID codec_id; + const char *codec_codec; + const char *codec_name; + const enum AVPixelFormat sw_pix_fmt; + const enum AVPixelFormat hw_pix_fmt; #if HAVE_LIBAVUTIL_HWCONTEXT_H && LIBAVCODEC_VERSION_CHECK(57, 107, 0, 107, 0) - const AVHWDeviceType hwdevice_type; + const AVHWDeviceType hwdevice_type; #endif - }; + }; - static struct CodecData codec_data[]; - CodecData *chosen_codec_data; + static struct CodecData codec_data[]; + CodecData *chosen_codec_data; - Monitor *monitor; - AVOutputFormat *out_format; - AVFormatContext *oc; - AVStream *video_out_stream; - AVStream *audio_out_stream; + Monitor *monitor; + AVOutputFormat *out_format; + AVFormatContext *oc; + AVStream *video_out_stream; + AVStream *audio_out_stream; - AVCodecContext *video_in_ctx; - AVCodecContext *video_out_ctx; + AVCodecContext *video_in_ctx; + AVCodecContext *video_out_ctx; - AVStream *video_in_stream; - AVStream *audio_in_stream; + AVStream *video_in_stream; + AVStream *audio_in_stream; - const AVCodec *audio_in_codec; - AVCodecContext *audio_in_ctx; - // The following are used when encoding the audio stream to AAC - const AVCodec *audio_out_codec; - AVCodecContext *audio_out_ctx; - // Move this into the object so that we aren't constantly allocating/deallocating it on the stack - av_packet_ptr opkt; + const AVCodec *audio_in_codec; + AVCodecContext *audio_in_ctx; + // The following are used when encoding the audio stream to AAC + const AVCodec *audio_out_codec; + AVCodecContext *audio_out_ctx; + // Move this into the object so that we aren't constantly allocating/deallocating it on the stack + av_packet_ptr opkt; - av_frame_ptr in_frame; - av_frame_ptr out_frame; + av_frame_ptr in_frame; + av_frame_ptr out_frame; - SWScale swscale; - unsigned int packets_written; - unsigned int frame_count; + SWScale swscale; + unsigned int packets_written; + unsigned int frame_count; - AVBufferRef *hw_device_ctx; + AVBufferRef *hw_device_ctx; - SwrContext *resample_ctx; - AVAudioFifo *fifo; - uint8_t *converted_in_samples; + SwrContext *resample_ctx; + AVAudioFifo *fifo; + uint8_t *converted_in_samples; - const char *filename; - const char *format; + const char *filename; + const char *format; - // These are for in - int64_t video_first_pts; /* starting pts of first in frame/packet */ - int64_t video_first_dts; - int64_t audio_first_pts; - int64_t audio_first_dts; - int64_t video_last_pts; - int64_t audio_last_pts; + // These are for in + int64_t video_first_pts; /* starting pts of first in frame/packet */ + int64_t video_first_dts; + int64_t audio_first_pts; + int64_t audio_first_dts; + int64_t video_last_pts; + int64_t audio_last_pts; - // These are for out, should start at zero. We assume they do not wrap because we just aren't going to save files that big. - int64_t *next_dts; - std::map last_dts; - int64_t audio_next_pts; + // These are for out, should start at zero. We assume they do not wrap because we just aren't going to save files that big. + int64_t *next_dts; + std::map last_dts; + int64_t audio_next_pts; - int max_stream_index; + int max_stream_index; - size_t reorder_queue_size; - std::map>> reorder_queues; + size_t reorder_queue_size; + std::map>> reorder_queues; - bool setup_resampler(); - int write_packet(AVPacket *pkt, AVStream *stream); + bool setup_resampler(); + int write_packet(AVPacket *pkt, AVStream *stream); - public: - VideoStore( - const char *filename_in, - const char *format_in, - AVStream *video_in_stream, - AVCodecContext *video_in_ctx, - AVStream *audio_in_stream, - AVCodecContext *audio_in_ctx, - Monitor * p_monitor); - ~VideoStore(); - bool open(); + public: + VideoStore( + const char *filename_in, + const char *format_in, + AVStream *video_in_stream, + AVCodecContext *video_in_ctx, + AVStream *audio_in_stream, + AVCodecContext *audio_in_ctx, + Monitor * p_monitor); + ~VideoStore(); + bool open(); - void write_video_packet(AVPacket &pkt); - void write_audio_packet(AVPacket &pkt); - int writeVideoFramePacket(const std::shared_ptr &pkt); - int writeAudioFramePacket(const std::shared_ptr &pkt); - int writePacket(const std::shared_ptr &pkt); - int write_packets(PacketQueue &queue); - void flush_codecs(); - const char *get_codec() { - if (chosen_codec_data) - return chosen_codec_data->codec_codec; - if (video_out_stream) - return avcodec_get_name(video_out_stream->codecpar->codec_id); - return ""; - } + void write_video_packet(AVPacket &pkt); + void write_audio_packet(AVPacket &pkt); + int writeVideoFramePacket(const std::shared_ptr &pkt); + int writeAudioFramePacket(const std::shared_ptr &pkt); + int writePacket(const std::shared_ptr &pkt); + int write_packets(PacketQueue &queue); + void flush_codecs(); + const char *get_codec() { + if (chosen_codec_data) + return chosen_codec_data->codec_codec; + if (video_out_stream) + return avcodec_get_name(video_out_stream->codecpar->codec_id); + return ""; + } }; #endif // ZM_VIDEOSTORE_H diff --git a/src/zm_zone.cpp b/src/zm_zone.cpp index 1fb322aac..1a7772096 100644 --- a/src/zm_zone.cpp +++ b/src/zm_zone.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Zone Class Implementation, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include "zm_zone.h" @@ -62,7 +62,7 @@ void Zone::Setup( #if 0 Debug( 1, "Initialised zone %d/%s - %d - %dx%d - Rgb:%06x, CM:%d, MnAT:%d, MxAT:%d, MnAP:%d, MxAP:%d, FB:%dx%d, MnFP:%d, MxFP:%d, MnBS:%d, MxBS:%d, MnB:%d, MxB:%d, OF: %d, AF: %d", - id, label.c_str(), type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames, extend_alarm_frames ); + id, label.c_str(), type, polygon.Width(), polygon.Height(), alarm_rgb, check_method, min_pixel_threshold, max_pixel_threshold, min_alarm_pixels, max_alarm_pixels, filter_box.X(), filter_box.Y(), min_filter_pixels, max_filter_pixels, min_blob_pixels, max_blob_pixels, min_blobs, max_blobs, overload_frames, extend_alarm_frames ); #endif ResetStats(); @@ -97,12 +97,12 @@ void Zone::Setup( if (config.record_diag_images) { if (config.record_diag_images_fifo) { diag_path = stringtf("%s/diagpipe-%d-poly.jpg", - staticConfig.PATH_SOCKS.c_str(), id); + staticConfig.PATH_SOCKS.c_str(), id); Fifo::fifo_create_if_missing(diag_path); } else { diag_path = stringtf("%s/diag-%d-poly.jpg", - monitor->getStorage()->Path(), id); + monitor->getStorage()->Path(), id); } pg_image->WriteJpeg(diag_path, config.record_diag_images_fifo); @@ -118,24 +118,24 @@ Zone::~Zone() { void Zone::RecordStats(const Event *event) { std::string sql = stringtf( - "INSERT INTO Stats SET MonitorId=%d, ZoneId=%d, EventId=%" PRIu64 ", FrameId=%d, " - "PixelDiff=%d, AlarmPixels=%d, FilterPixels=%d, BlobPixels=%d, " - "Blobs=%d, MinBlobSize=%d, MaxBlobSize=%d, " - "MinX=%d, MinY=%d, MaxX=%d, MaxY=%d, Score=%d", - monitor->Id(), id, event->Id(), event->Frames(), - stats.pixel_diff_, - stats.alarm_pixels_, - stats.alarm_filter_pixels_, - stats.alarm_blob_pixels_, - stats.alarm_blobs_, - stats.min_blob_size_, - stats.max_blob_size_, - stats.alarm_box_.Lo().x_, - stats.alarm_box_.Lo().y_, - stats.alarm_box_.Hi().x_, - stats.alarm_box_.Hi().y_, - stats.score_ - ); + "INSERT INTO Stats SET MonitorId=%d, ZoneId=%d, EventId=%" PRIu64 ", FrameId=%d, " + "PixelDiff=%d, AlarmPixels=%d, FilterPixels=%d, BlobPixels=%d, " + "Blobs=%d, MinBlobSize=%d, MaxBlobSize=%d, " + "MinX=%d, MinY=%d, MaxX=%d, MaxY=%d, Score=%d", + monitor->Id(), id, event->Id(), event->Frames(), + stats.pixel_diff_, + stats.alarm_pixels_, + stats.alarm_filter_pixels_, + stats.alarm_blob_pixels_, + stats.alarm_blobs_, + stats.min_blob_size_, + stats.max_blob_size_, + stats.alarm_box_.Lo().x_, + stats.alarm_box_.Lo().y_, + stats.alarm_box_.Hi().x_, + stats.alarm_box_.Hi().y_, + stats.score_ + ); zmDbDo(sql); } // end void Zone::RecordStats( const Event *event ) @@ -346,9 +346,9 @@ bool Zone::CheckAlarms(const Image *delta_image) { } if (max_filter_pixels != 0) - stats.score_ = (100*stats.alarm_filter_pixels_)/max_filter_pixels; + stats.score_ = (100*stats.alarm_filter_pixels_)/max_filter_pixels; else - stats.score_ = (100*stats.alarm_filter_pixels_)/polygon.Area(); + stats.score_ = (100*stats.alarm_filter_pixels_)/polygon.Area(); if (stats.score_ < 1) stats.score_ = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */ @@ -399,13 +399,13 @@ bool Zone::CheckAlarms(const Image *delta_image) { bss = bsm==bsx?bsy:bsx; Debug(9, - "Different neighbours, setting pixels of %d to %d\n" - "Master blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d\n" - "Slave blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d\n", - bss->tag, bsm->tag, - bsm->tag, bsm->count, bsm->lo_x, bsm->hi_x, bsm->lo_y, bsm->hi_y, - bss->tag, bss->count, bss->lo_x, bss->hi_x, bss->lo_y, bss->hi_y - ); + "Different neighbours, setting pixels of %d to %d\n" + "Master blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d\n" + "Slave blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d\n", + bss->tag, bsm->tag, + bsm->tag, bsm->count, bsm->lo_x, bsm->hi_x, bsm->lo_y, bsm->hi_y, + bss->tag, bss->count, bss->lo_x, bss->hi_x, bss->lo_y, bss->hi_y + ); // Now change all those pixels to the other setting int changed = 0; for (int sy = bss->lo_y; sy <= bss->hi_y; sy++) { @@ -413,9 +413,9 @@ bool Zone::CheckAlarms(const Image *delta_image) { int hi_sx = bss->hi_x<=ranges[sy].hi_x?bss->hi_x:ranges[sy].hi_x; Debug(9, - "Changing %d, %d->%d Range %d->%d", - sy, lo_sx, hi_sx, ranges[sy].lo_x, ranges[sy].hi_x - ); + "Changing %d, %d->%d Range %d->%d", + sy, lo_sx, hi_sx, ranges[sy].lo_x, ranges[sy].hi_x + ); spdiff = diff_buff + ((diff_width * sy) + lo_sx); for (int sx = lo_sx; sx <= hi_sx; sx++, spdiff++) { Debug(9, "Pixel at %d,%d (%p) is %d", sx, sy, spdiff, *spdiff); @@ -430,11 +430,11 @@ bool Zone::CheckAlarms(const Image *delta_image) { stats.alarm_blob_pixels_++; if (!changed) { Info( - "Master blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d\n" - "Slave blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", - bsm->tag, bsm->count, bsm->lo_x, bsm->hi_x, bsm->lo_y, bsm->hi_y, - bss->tag, bss->count, bss->lo_x, bss->hi_x, bss->lo_y, bss->hi_y - ); + "Master blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d\n" + "Slave blob t:%d, c:%d, lx:%d, hx:%d, ly:%d, hy:%d", + bsm->tag, bsm->count, bsm->lo_x, bsm->hi_x, bsm->lo_y, bsm->hi_y, + bss->tag, bss->count, bss->lo_x, bss->hi_x, bss->lo_y, bss->hi_y + ); Error("No pixels changed, exiting"); exit(-1); } @@ -451,7 +451,7 @@ bool Zone::CheckAlarms(const Image *delta_image) { stats.alarm_blobs_--; Debug(6, "Merging blob %d with %d at %d,%d, %d current blobs", - bss->tag, bsm->tag, x, y, stats.alarm_blobs_); + bss->tag, bsm->tag, x, y, stats.alarm_blobs_); // Clear out the old blob bss->tag = 0; @@ -463,7 +463,7 @@ bool Zone::CheckAlarms(const Image *delta_image) { } } else { Debug(9, "Setting to left neighbour %d", last_x); - // Add to the blob from the x side + // Add to the blob from the x side *pdiff = last_x; stats.alarm_blob_pixels_++; bsx->count++; @@ -490,10 +490,10 @@ bool Zone::CheckAlarms(const Image *delta_image) { // See if we can recycle one first, only if it's at least two rows up if (bs->count && bs->hi_y < (int)(y-1)) { if ( - (min_blob_pixels && bs->count < min_blob_pixels) - || - (max_blob_pixels && bs->count > max_blob_pixels) - ) { + (min_blob_pixels && bs->count < min_blob_pixels) + || + (max_blob_pixels && bs->count > max_blob_pixels) + ) { if (( monitor->GetOptSaveJPEGs() > 1 ) || config.record_diag_images) { for (int sy = bs->lo_y; sy <= bs->hi_y; sy++) { spdiff = diff_buff + ((diff_width * sy) + bs->lo_x); @@ -508,7 +508,7 @@ bool Zone::CheckAlarms(const Image *delta_image) { stats.alarm_blob_pixels_ -= bs->count; Debug(6, "Eliminated blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", - i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, stats.alarm_blobs_); + i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, stats.alarm_blobs_); bs->tag = 0; bs->count = 0; @@ -579,7 +579,7 @@ bool Zone::CheckAlarms(const Image *delta_image) { stats.alarm_blob_pixels_ -= bs->count; Debug(6, "Eliminated blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", - i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, stats.alarm_blobs_); + i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, stats.alarm_blobs_); bs->tag = 0; bs->count = 0; @@ -589,7 +589,7 @@ bool Zone::CheckAlarms(const Image *delta_image) { bs->hi_y = 0; } else { Debug(6, "Preserved blob %d, %d pixels (%d,%d - %d,%d), %d current blobs", - i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, stats.alarm_blobs_); + i, bs->count, bs->lo_x, bs->lo_y, bs->hi_x, bs->hi_y, stats.alarm_blobs_); if (!stats.min_blob_size_ || bs->count < stats.min_blob_size_) stats.min_blob_size_ = bs->count; if (!stats.max_blob_size_ || bs->count > stats.max_blob_size_) stats.max_blob_size_ = bs->count; } @@ -852,22 +852,37 @@ std::vector Zone::Load(const std::shared_ptr &monitor) { ZoneType Type = static_cast(atoi(dbrow[col++])); const char *Units = dbrow[col++]; const char *Coords = dbrow[col++]; - int AlarmRGB = dbrow[col]?atoi(dbrow[col]):0; col++; + int AlarmRGB = dbrow[col]?atoi(dbrow[col]):0; + col++; Zone::CheckMethod CheckMethod = static_cast(atoi(dbrow[col++])); - int MinPixelThreshold = dbrow[col]?atoi(dbrow[col]):0; col++; - int MaxPixelThreshold = dbrow[col]?atoi(dbrow[col]):0; col++; - int MinAlarmPixels = dbrow[col]?atoi(dbrow[col]):0; col++; - int MaxAlarmPixels = dbrow[col]?atoi(dbrow[col]):0; col++; - int FilterX = dbrow[col]?atoi(dbrow[col]):0; col++; - int FilterY = dbrow[col]?atoi(dbrow[col]):0; col++; - int MinFilterPixels = dbrow[col]?atoi(dbrow[col]):0; col++; - int MaxFilterPixels = dbrow[col]?atoi(dbrow[col]):0; col++; - int MinBlobPixels = dbrow[col]?atoi(dbrow[col]):0; col++; - int MaxBlobPixels = dbrow[col]?atoi(dbrow[col]):0; col++; - int MinBlobs = dbrow[col]?atoi(dbrow[col]):0; col++; - int MaxBlobs = dbrow[col]?atoi(dbrow[col]):0; col++; - int OverloadFrames = dbrow[col]?atoi(dbrow[col]):0; col++; - int ExtendAlarmFrames = dbrow[col]?atoi(dbrow[col]):0; col++; + int MinPixelThreshold = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MaxPixelThreshold = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MinAlarmPixels = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MaxAlarmPixels = dbrow[col]?atoi(dbrow[col]):0; + col++; + int FilterX = dbrow[col]?atoi(dbrow[col]):0; + col++; + int FilterY = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MinFilterPixels = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MaxFilterPixels = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MinBlobPixels = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MaxBlobPixels = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MinBlobs = dbrow[col]?atoi(dbrow[col]):0; + col++; + int MaxBlobs = dbrow[col]?atoi(dbrow[col]):0; + col++; + int OverloadFrames = dbrow[col]?atoi(dbrow[col]):0; + col++; + int ExtendAlarmFrames = dbrow[col]?atoi(dbrow[col]):0; + col++; /* HTML colour code is actually BGR in memory, we want RGB */ AlarmRGB = rgb_convert(AlarmRGB, ZM_SUBPIX_ORDER_BGR); @@ -899,9 +914,9 @@ std::vector Zone::Load(const std::shared_ptr &monitor) { auto n_coords = polygon.GetVertices().size(); polygon.Clip(Box( - {0, 0}, - {static_cast(monitor->Width()), static_cast(monitor->Height())} - )); + {0, 0}, + {static_cast(monitor->Width()), static_cast(monitor->Height())} + )); if (polygon.GetVertices().size() != n_coords) { Error("Cropping altered the number of vertices! From %zu to %zu", n_coords, polygon.GetVertices().size()); } @@ -922,12 +937,12 @@ std::vector Zone::Load(const std::shared_ptr &monitor) { zones.emplace_back(monitor, Id, Name, Type, polygon); } else { zones.emplace_back( - monitor, Id, Name, Type, polygon, AlarmRGB, - CheckMethod, MinPixelThreshold, MaxPixelThreshold, - MinAlarmPixels, MaxAlarmPixels, Vector2(FilterX, FilterY), - MinFilterPixels, MaxFilterPixels, - MinBlobPixels, MaxBlobPixels, MinBlobs, MaxBlobs, - OverloadFrames, ExtendAlarmFrames); + monitor, Id, Name, Type, polygon, AlarmRGB, + CheckMethod, MinPixelThreshold, MaxPixelThreshold, + MinAlarmPixels, MaxAlarmPixels, Vector2(FilterX, FilterY), + MinFilterPixels, MaxFilterPixels, + MinBlobPixels, MaxBlobPixels, MinBlobs, MaxBlobs, + OverloadFrames, ExtendAlarmFrames); } } // end foreach row mysql_free_result(result); @@ -940,23 +955,23 @@ bool Zone::DumpSettings(char *output, bool /*verbose*/) const { sprintf(output+strlen(output), " Id : %u\n", id ); sprintf(output+strlen(output), " Label : %s\n", label.c_str() ); sprintf(output+strlen(output), " Type: %d - %s\n", type, - type==ACTIVE?"Active":( - type==INCLUSIVE?"Inclusive":( - type==EXCLUSIVE?"Exclusive":( - type==PRECLUSIVE?"Preclusive":( - type==INACTIVE?"Inactive":( - type==PRIVACY?"Privacy":"Unknown" - )))))); + type==ACTIVE?"Active":( + type==INCLUSIVE?"Inclusive":( + type==EXCLUSIVE?"Exclusive":( + type==PRECLUSIVE?"Preclusive":( + type==INACTIVE?"Inactive":( + type==PRIVACY?"Privacy":"Unknown" + )))))); sprintf( output+strlen(output), " Shape : %zu points\n", polygon.GetVertices().size() ); for (size_t i = 0; i < polygon.GetVertices().size(); i++) { sprintf(output + strlen(output), " %zu: %d,%d\n", i, polygon.GetVertices()[i].x_, polygon.GetVertices()[i].y_); } sprintf( output+strlen(output), " Alarm RGB : %06x\n", alarm_rgb ); sprintf( output+strlen(output), " Check Method: %d - %s\n", check_method, - check_method==ALARMED_PIXELS?"Alarmed Pixels":( - check_method==FILTERED_PIXELS?"FilteredPixels":( - check_method==BLOBS?"Blobs":"Unknown" - ))); + check_method==ALARMED_PIXELS?"Alarmed Pixels":( + check_method==FILTERED_PIXELS?"FilteredPixels":( + check_method==BLOBS?"Blobs":"Unknown" + ))); sprintf( output+strlen(output), " Min Pixel Threshold : %d\n", min_pixel_threshold ); sprintf( output+strlen(output), " Max Pixel Threshold : %d\n", max_pixel_threshold ); sprintf( output+strlen(output), " Min Alarm Pixels : %d\n", min_alarm_pixels ); @@ -972,10 +987,10 @@ bool Zone::DumpSettings(char *output, bool /*verbose*/) const { } void Zone::std_alarmedpixels( - Image* pdiff_image, - const Image* ppoly_image, - unsigned int* pixel_count, - unsigned int* pixel_sum) { + Image* pdiff_image, + const Image* ppoly_image, + unsigned int* pixel_count, + unsigned int* pixel_sum) { uint32_t pixelsalarmed = 0; uint32_t pixelsdifference = 0; uint8_t calc_max_pixel_threshold = 255; @@ -1013,33 +1028,32 @@ void Zone::std_alarmedpixels( } // end void Zone::std_alarmedpixels(Image* pdiff_image, const Image* ppoly_image, unsigned int* pixel_count, unsigned int* pixel_sum) Zone::Zone(const Zone &z) : - monitor(z.monitor), - id(z.id), - label(z.label), - type(z.type), - polygon(z.polygon), - alarm_rgb(z.alarm_rgb), - check_method(z.check_method), - min_pixel_threshold(z.min_pixel_threshold), - max_pixel_threshold(z.max_pixel_threshold), - min_alarm_pixels(z.min_alarm_pixels), - max_alarm_pixels(z.max_alarm_pixels), - filter_box(z.filter_box), - min_filter_pixels(z.min_filter_pixels), - max_filter_pixels(z.max_filter_pixels), - min_blob_pixels(z.min_blob_pixels), - max_blob_pixels(z.max_blob_pixels), - min_blobs(z.min_blobs), - max_blobs(z.max_blobs), - overload_frames(z.overload_frames), - extend_alarm_frames(z.extend_alarm_frames), - alarmed(z.alarmed), - was_alarmed(z.was_alarmed), - stats(z.stats), - overload_count(z.overload_count), - extend_alarm_count(z.extend_alarm_count), - diag_path(z.diag_path) -{ + monitor(z.monitor), + id(z.id), + label(z.label), + type(z.type), + polygon(z.polygon), + alarm_rgb(z.alarm_rgb), + check_method(z.check_method), + min_pixel_threshold(z.min_pixel_threshold), + max_pixel_threshold(z.max_pixel_threshold), + min_alarm_pixels(z.min_alarm_pixels), + max_alarm_pixels(z.max_alarm_pixels), + filter_box(z.filter_box), + min_filter_pixels(z.min_filter_pixels), + max_filter_pixels(z.max_filter_pixels), + min_blob_pixels(z.min_blob_pixels), + max_blob_pixels(z.max_blob_pixels), + min_blobs(z.min_blobs), + max_blobs(z.max_blobs), + overload_frames(z.overload_frames), + extend_alarm_frames(z.extend_alarm_frames), + alarmed(z.alarmed), + was_alarmed(z.was_alarmed), + stats(z.stats), + overload_count(z.overload_count), + extend_alarm_count(z.extend_alarm_count), + diag_path(z.diag_path) { std::copy(z.blob_stats, z.blob_stats+256, blob_stats); pg_image = z.pg_image ? new Image(*z.pg_image) : nullptr; ranges = new Range[monitor->Height()]; diff --git a/src/zm_zone.h b/src/zm_zone.h index d2004ee74..205c3ab3f 100644 --- a/src/zm_zone.h +++ b/src/zm_zone.h @@ -1,21 +1,21 @@ // // ZoneMinder Zone Class Interfaces, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_ZONE_H #define ZM_ZONE_H @@ -42,195 +42,192 @@ class Monitor; // class Zone { - protected: - struct Range { - int lo_x; - int hi_x; - int off_x; - }; - typedef struct { - unsigned char tag; - int count; - int lo_x; - int hi_x; - int lo_y; - int hi_y; - } BlobStats; - public: - typedef enum { ACTIVE=1, INCLUSIVE, EXCLUSIVE, PRECLUSIVE, INACTIVE, PRIVACY } ZoneType; - typedef enum { ALARMED_PIXELS=1, FILTERED_PIXELS, BLOBS } CheckMethod; + protected: + struct Range { + int lo_x; + int hi_x; + int off_x; + }; + typedef struct { + unsigned char tag; + int count; + int lo_x; + int hi_x; + int lo_y; + int hi_y; + } BlobStats; + public: + typedef enum { ACTIVE=1, INCLUSIVE, EXCLUSIVE, PRECLUSIVE, INACTIVE, PRIVACY } ZoneType; + typedef enum { ALARMED_PIXELS=1, FILTERED_PIXELS, BLOBS } CheckMethod; - protected: - // Inputs - const std::shared_ptr monitor; + protected: + // Inputs + const std::shared_ptr monitor; - unsigned int id; - std::string label; - ZoneType type; - Polygon polygon; - Rgb alarm_rgb; - CheckMethod check_method; + unsigned int id; + std::string label; + ZoneType type; + Polygon polygon; + Rgb alarm_rgb; + CheckMethod check_method; - int min_pixel_threshold; - int max_pixel_threshold; + int min_pixel_threshold; + int max_pixel_threshold; - int min_alarm_pixels; - int max_alarm_pixels; + int min_alarm_pixels; + int max_alarm_pixels; - Vector2 filter_box; - int min_filter_pixels; - int max_filter_pixels; + Vector2 filter_box; + int min_filter_pixels; + int max_filter_pixels; - BlobStats blob_stats[256]; - int min_blob_pixels; - int max_blob_pixels; - int min_blobs; - int max_blobs; + BlobStats blob_stats[256]; + int min_blob_pixels; + int max_blob_pixels; + int min_blobs; + int max_blobs; - int overload_frames; - int extend_alarm_frames; + int overload_frames; + int extend_alarm_frames; - // Outputs/Statistics - bool alarmed; - bool was_alarmed; - ZoneStats stats; - Image *pg_image; - Range *ranges; - Image *image; + // Outputs/Statistics + bool alarmed; + bool was_alarmed; + ZoneStats stats; + Image *pg_image; + Range *ranges; + Image *image; - int overload_count; - int extend_alarm_count; - std::string diag_path; + int overload_count; + int extend_alarm_count; + std::string diag_path; - protected: - void Setup( - ZoneType p_type, - const Polygon &p_polygon, - const Rgb p_alarm_rgb, - CheckMethod p_check_method, - int p_min_pixel_threshold, - int p_max_pixel_threshold, - int p_min_alarm_pixels, - int p_max_alarm_pixels, - const Vector2 &p_filter_box, - int p_min_filter_pixels, - int p_max_filter_pixels, - int p_min_blob_pixels, - int p_max_blob_pixels, - int p_min_blobs, - int p_max_blobs, - int p_overload_frames, - int p_extend_alarm_frames); + protected: + void Setup( + ZoneType p_type, + const Polygon &p_polygon, + const Rgb p_alarm_rgb, + CheckMethod p_check_method, + int p_min_pixel_threshold, + int p_max_pixel_threshold, + int p_min_alarm_pixels, + int p_max_alarm_pixels, + const Vector2 &p_filter_box, + int p_min_filter_pixels, + int p_max_filter_pixels, + int p_min_blob_pixels, + int p_max_blob_pixels, + int p_min_blobs, + int p_max_blobs, + int p_overload_frames, + int p_extend_alarm_frames); - void std_alarmedpixels(Image* pdiff_image, const Image* ppoly_image, unsigned int* pixel_count, unsigned int* pixel_sum); + void std_alarmedpixels(Image* pdiff_image, const Image* ppoly_image, unsigned int* pixel_count, unsigned int* pixel_sum); - public: - Zone( - const std::shared_ptr &p_monitor, - unsigned int p_id, - const char *p_label, - ZoneType p_type, - const Polygon &p_polygon, - const Rgb p_alarm_rgb, - CheckMethod p_check_method, - int p_min_pixel_threshold=15, - int p_max_pixel_threshold=0, - int p_min_alarm_pixels=50, - int p_max_alarm_pixels=75000, - const Vector2 &p_filter_box = Vector2(3, 3), - int p_min_filter_pixels=50, - int p_max_filter_pixels=50000, - int p_min_blob_pixels=10, - int p_max_blob_pixels=0, - int p_min_blobs=0, - int p_max_blobs=0, - int p_overload_frames=0, - int p_extend_alarm_frames=0) - : - monitor(p_monitor), - id(p_id), - label(p_label), - blob_stats{}, - stats(p_id) - { - Setup(p_type, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames, p_extend_alarm_frames ); - } + public: + Zone( + const std::shared_ptr &p_monitor, + unsigned int p_id, + const char *p_label, + ZoneType p_type, + const Polygon &p_polygon, + const Rgb p_alarm_rgb, + CheckMethod p_check_method, + int p_min_pixel_threshold=15, + int p_max_pixel_threshold=0, + int p_min_alarm_pixels=50, + int p_max_alarm_pixels=75000, + const Vector2 &p_filter_box = Vector2(3, 3), + int p_min_filter_pixels=50, + int p_max_filter_pixels=50000, + int p_min_blob_pixels=10, + int p_max_blob_pixels=0, + int p_min_blobs=0, + int p_max_blobs=0, + int p_overload_frames=0, + int p_extend_alarm_frames=0) + : + monitor(p_monitor), + id(p_id), + label(p_label), + blob_stats{}, + stats(p_id) { + Setup(p_type, p_polygon, p_alarm_rgb, p_check_method, p_min_pixel_threshold, p_max_pixel_threshold, p_min_alarm_pixels, p_max_alarm_pixels, p_filter_box, p_min_filter_pixels, p_max_filter_pixels, p_min_blob_pixels, p_max_blob_pixels, p_min_blobs, p_max_blobs, p_overload_frames, p_extend_alarm_frames ); + } - Zone(const std::shared_ptr&p_monitor, unsigned int p_id, const char *p_label, const Polygon &p_polygon) - : - monitor(p_monitor), - id(p_id), - label(p_label), - blob_stats{}, - stats(p_id) - { - Setup(Zone::INACTIVE, p_polygon, kRGBBlack, (Zone::CheckMethod)0, 0, 0, 0, 0, Vector2(0, 0), 0, 0, 0, 0, 0, 0, 0, 0); - } - Zone(const std::shared_ptr&p_monitor, unsigned int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon) - : - monitor(p_monitor), - id(p_id), - label(p_label), - blob_stats{}, - stats(p_id) - { - Setup(p_type, p_polygon, kRGBBlack, (Zone::CheckMethod)0, 0, 0, 0, 0, Vector2(0, 0), 0, 0, 0, 0, 0, 0, 0, 0 ); - } + Zone(const std::shared_ptr&p_monitor, unsigned int p_id, const char *p_label, const Polygon &p_polygon) + : + monitor(p_monitor), + id(p_id), + label(p_label), + blob_stats{}, + stats(p_id) { + Setup(Zone::INACTIVE, p_polygon, kRGBBlack, (Zone::CheckMethod)0, 0, 0, 0, 0, Vector2(0, 0), 0, 0, 0, 0, 0, 0, 0, 0); + } + Zone(const std::shared_ptr&p_monitor, unsigned int p_id, const char *p_label, ZoneType p_type, const Polygon &p_polygon) + : + monitor(p_monitor), + id(p_id), + label(p_label), + blob_stats{}, + stats(p_id) { + Setup(p_type, p_polygon, kRGBBlack, (Zone::CheckMethod)0, 0, 0, 0, 0, Vector2(0, 0), 0, 0, 0, 0, 0, 0, 0, 0 ); + } - Zone(const Zone &z); - ~Zone(); + Zone(const Zone &z); + ~Zone(); - inline unsigned int Id() const { return id; } - inline const char *Label() const { return label.c_str(); } - const std::string &Name() const { return label; } - inline ZoneType Type() const { return type; } - inline bool IsActive() const { return( type == ACTIVE ); } - inline bool IsInclusive() const { return( type == INCLUSIVE ); } - inline bool IsExclusive() const { return( type == EXCLUSIVE ); } - inline bool IsPreclusive() const { return( type == PRECLUSIVE ); } - inline bool IsInactive() const { return( type == INACTIVE ); } - inline bool IsPrivacy() const { return( type == PRIVACY ); } - inline const Image *AlarmImage() const { return image; } - inline const Polygon &GetPolygon() const { return polygon; } - inline bool Alarmed() const { return alarmed; } - inline bool WasAlarmed() const { return was_alarmed; } - inline void SetAlarm() { was_alarmed = alarmed; alarmed = true; } - inline void ClearAlarm() { was_alarmed = alarmed; alarmed = false; } - inline Vector2 GetAlarmCentre() const { return stats.alarm_centre_; } - inline unsigned int Score() const { return stats.score_; } + inline unsigned int Id() const { return id; } + inline const char *Label() const { return label.c_str(); } + const std::string &Name() const { return label; } + inline ZoneType Type() const { return type; } + inline bool IsActive() const { return( type == ACTIVE ); } + inline bool IsInclusive() const { return( type == INCLUSIVE ); } + inline bool IsExclusive() const { return( type == EXCLUSIVE ); } + inline bool IsPreclusive() const { return( type == PRECLUSIVE ); } + inline bool IsInactive() const { return( type == INACTIVE ); } + inline bool IsPrivacy() const { return( type == PRIVACY ); } + inline const Image *AlarmImage() const { return image; } + inline const Polygon &GetPolygon() const { return polygon; } + inline bool Alarmed() const { return alarmed; } + inline bool WasAlarmed() const { return was_alarmed; } + inline void SetAlarm() { was_alarmed = alarmed; alarmed = true; } + inline void ClearAlarm() { was_alarmed = alarmed; alarmed = false; } + inline Vector2 GetAlarmCentre() const { return stats.alarm_centre_; } + inline unsigned int Score() const { return stats.score_; } - inline void ResetStats() { - alarmed = false; - was_alarmed = false; - stats.Reset(); - } - void RecordStats( const Event *event ); - ZoneStats const &GetStats() const { - stats.DumpToLog("GetStats"); - return stats; - }; + inline void ResetStats() { + alarmed = false; + was_alarmed = false; + stats.Reset(); + } + void RecordStats( const Event *event ); + ZoneStats const &GetStats() const { + stats.DumpToLog("GetStats"); + return stats; + }; - bool CheckAlarms(const Image *delta_image); - bool DumpSettings(char *output, bool verbose) const; + bool CheckAlarms(const Image *delta_image); + bool DumpSettings(char *output, bool verbose) const; - static bool ParsePolygonString( const char *polygon_string, Polygon &polygon ); - static bool ParseZoneString( const char *zone_string, unsigned int &zone_id, int &colour, Polygon &polygon ); - static std::vector Load(const std::shared_ptr &monitor); - //================================================= - bool CheckOverloadCount(); - int GetOverloadCount(); - void SetOverloadCount(int nOverCount); - int GetOverloadFrames(); - //================================================= - bool CheckExtendAlarmCount(); - int GetExtendAlarmCount(); - void SetExtendAlarmCount(int nOverCount); - int GetExtendAlarmFrames(); - void SetScore(unsigned int nScore); - void SetAlarmImage(const Image* srcImage); + static bool ParsePolygonString( const char *polygon_string, Polygon &polygon ); + static bool ParseZoneString( const char *zone_string, unsigned int &zone_id, int &colour, Polygon &polygon ); + static std::vector Load(const std::shared_ptr &monitor); + //================================================= + bool CheckOverloadCount(); + int GetOverloadCount(); + void SetOverloadCount(int nOverCount); + int GetOverloadFrames(); + //================================================= + bool CheckExtendAlarmCount(); + int GetExtendAlarmCount(); + void SetExtendAlarmCount(int nOverCount); + int GetExtendAlarmFrames(); + void SetScore(unsigned int nScore); + void SetAlarmImage(const Image* srcImage); - inline const Image *getPgImage() const { return pg_image; } - inline const Range *getRanges() const { return ranges; } + inline const Image *getPgImage() const { return pg_image; } + inline const Range *getRanges() const { return ranges; } }; #endif // ZM_ZONE_H diff --git a/src/zm_zone_stats.h b/src/zm_zone_stats.h index 6243f53b6..5815bb3bf 100644 --- a/src/zm_zone_stats.h +++ b/src/zm_zone_stats.h @@ -1,21 +1,21 @@ // // ZoneMinder Zone Stats Class Interfaces, $Date$, $Revision$ // Copyright (C) 2021 Isaac Connor -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #ifndef ZM_ZONE_STATS_H #define ZM_ZONE_STATS_H @@ -27,15 +27,15 @@ class ZoneStats { public: explicit ZoneStats(int zone_id) : - zone_id_(zone_id), - pixel_diff_(0), - alarm_pixels_(0), - alarm_filter_pixels_(0), - alarm_blob_pixels_(0), - alarm_blobs_(0), - min_blob_size_(0), - max_blob_size_(0), - score_(0) {}; + zone_id_(zone_id), + pixel_diff_(0), + alarm_pixels_(0), + alarm_filter_pixels_(0), + alarm_blob_pixels_(0), + alarm_blobs_(0), + min_blob_size_(0), + max_blob_size_(0), + score_(0) {}; void Reset() { pixel_diff_ = 0; @@ -69,7 +69,7 @@ class ZoneStats { alarm_centre_.x_, alarm_centre_.y_, score_ - ); + ); } public: diff --git a/src/zmbenchmark.cpp b/src/zmbenchmark.cpp index 04c504217..90e7e8ff8 100644 --- a/src/zmbenchmark.cpp +++ b/src/zmbenchmark.cpp @@ -1,21 +1,21 @@ // // ZoneMinder Benchmark, $Date$, $Revision$ // Copyright (C) 2001-2008 Philip Coombes -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// +// #include #include @@ -43,7 +43,7 @@ class TimingsTable { // // Add a row to the end of the table. - // + // // Args: // label: The name of the row (printed in the first column). // timings: The values for all the other columns in this row. @@ -55,12 +55,12 @@ class TimingsTable { rows_.push_back(row); } - // + // // Print out the table. - // + // // Args: // columnPad: # characters between table columns - // + // void Print(const int column_pad = 5) { // Figure out column widths. std::vector widths(columns_.size() + 1); @@ -68,9 +68,9 @@ class TimingsTable { // The first width is the max of the row labels. auto result = std::max_element(rows_.begin(), rows_.end(), - [](const Row &a, const Row &b) -> bool { - return a.label.length() < b.label.length(); - }); + [](const Row &a, const Row &b) -> bool { + return a.label.length() < b.label.length(); + }); widths[0] = result->label.length() + column_pad; // Calculate the rest of the column widths. @@ -122,20 +122,20 @@ class TimingsTable { // Zone::CheckAlarms. This first creates a black image, and then it fills // a box of a certain size inside the image with random data. This is to simulate // a typical scene where most of the scene doesn't change except a specific region. -// +// // Args: // changeBoxPercent: 0-100 value telling how large the box with random data should be. // Set to 0 to leave the whole thing black. // width: The width of the new image. // height: The height of the new image. -// +// // Return: // An image with all pixels initialized to values in the [minVal,maxVal] range. // std::shared_ptr GenerateRandomImage( - const int change_box_percent, - const int width = 3840, - const int height = 2160) { + const int change_box_percent, + const int width = 3840, + const int height = 2160) { // Create the image. Image *image = new Image(width, height, ZM_COLOUR_GRAY8, ZM_SUBPIX_ORDER_NONE); @@ -176,10 +176,10 @@ class TestMonitor : public Monitor { // // Add a new zone to this monitor. - // + // // Args: // checkMethod: This controls how this zone will actually do motion detection. - // + // // p_filter_box: The size of the filter to use. // void AddZone(Zone::CheckMethod checkMethod, const Vector2 &p_filter_box = Vector2(5, 5)) { @@ -222,14 +222,14 @@ class TestMonitor : public Monitor { // // Run zone benchmarks on the given image. -// +// // Args: // label: A label to be printed before the output. -// +// // image: The image to run the tests on. -// +// // p_filter_box: The size of the filter to use for alarm detection. -// +// // Return: // The average time taken for each DetectMotion call. // @@ -243,7 +243,7 @@ Microseconds RunDetectMotionBenchmark(const std::string &label, // Generate a black image to use as the reference image. std::shared_ptr blackImage = GenerateRandomImage( - 0, image->Width(), image->Height()); + 0, image->Width(), image->Height()); testMonitor.SetRefImage(blackImage.get()); Microseconds totalTimeTaken(0); @@ -266,35 +266,35 @@ Microseconds RunDetectMotionBenchmark(const std::string &label, // // This runs a set of Monitor::DetectMotion benchmarks, one for each of the -// "delta box percents" that are passed in. This adds one row to the +// "delta box percents" that are passed in. This adds one row to the // TimingsTable specified. -// +// // Args: // table: The table to add timings into. -// +// // deltaBoxPercents: Each of these defines a box size in the delta images // passed to DetectMotion (larger boxes make it slower, sometimes significantly so). -// +// // p_filter_box: Defines the filter size used in DetectMotion. // void RunDetectMotionBenchmarks( - TimingsTable &table, - const std::vector &delta_box_percents, - const Vector2 &p_filter_box) { + TimingsTable &table, + const std::vector &delta_box_percents, + const Vector2 &p_filter_box) { std::vector timings; for (int percent : delta_box_percents) { Microseconds timing = RunDetectMotionBenchmark( - std::string("DetectMotion: ") + std::to_string(p_filter_box.x_) + "x" + std::to_string(p_filter_box.y_) - + " box, " + std::to_string(percent) + "% delta", - GenerateRandomImage(percent), - p_filter_box); + std::string("DetectMotion: ") + std::to_string(p_filter_box.x_) + "x" + std::to_string(p_filter_box.y_) + + " box, " + std::to_string(percent) + "% delta", + GenerateRandomImage(percent), + p_filter_box); timings.push_back(timing); } table.AddRow( - std::to_string(p_filter_box.x_) + "x" + std::to_string(p_filter_box.y_) + " filter", - timings); + std::to_string(p_filter_box.x_) + "x" + std::to_string(p_filter_box.y_) + " filter", + timings); } int main(int argc, char *argv[]) { @@ -312,7 +312,7 @@ int main(int argc, char *argv[]) { const std::vector percents = {0, 10, 50, 100}; std::vector columns(percents.size()); std::transform(percents.begin(), percents.end(), columns.begin(), - [](const int percent) { return std::to_string(percent) + "% delta (ms)"; }); + [](const int percent) { return std::to_string(percent) + "% delta (ms)"; }); TimingsTable table(columns); std::vector filterSizes = {Vector2(3, 3), Vector2(5, 5), Vector2(13, 13)}; diff --git a/src/zmc.cpp b/src/zmc.cpp index b0712b633..a12810265 100644 --- a/src/zmc.cpp +++ b/src/zmc.cpp @@ -118,34 +118,34 @@ int main(int argc, char *argv[]) { } switch (c) { - case 'd': - device = optarg; - break; - case 'H': - host = optarg; - break; - case 'P': - port = optarg; - break; - case 'p': - path = optarg; - break; - case 'f': - file = optarg; - break; - case 'm': - monitor_id = atoi(optarg); - break; - case 'h': - case '?': - Usage(); - break; - case 'v': - std::cout << ZM_VERSION << "\n"; - exit(0); - default: - // fprintf(stderr, "?? getopt returned character code 0%o ??\n", c); - break; + case 'd': + device = optarg; + break; + case 'H': + host = optarg; + break; + case 'P': + port = optarg; + break; + case 'p': + path = optarg; + break; + case 'f': + file = optarg; + break; + case 'm': + monitor_id = atoi(optarg); + break; + case 'h': + case '?': + Usage(); + break; + case 'v': + std::cout << ZM_VERSION << "\n"; + exit(0); + default: + // fprintf(stderr, "?? getopt returned character code 0%o ??\n", c); + break; } } @@ -198,18 +198,18 @@ int main(int argc, char *argv[]) { monitors = Monitor::LoadLocalMonitors(device, Monitor::CAPTURE); } else #endif // ZM_HAS_V4L2 - if ( host[0] ) { - if ( !port ) - port = "80"; - monitors = Monitor::LoadRemoteMonitors(protocol, host, port, path, Monitor::CAPTURE); - } else if ( file[0] ) { - monitors = Monitor::LoadFileMonitors(file, Monitor::CAPTURE); - } else { - std::shared_ptr monitor = Monitor::Load(monitor_id, true, Monitor::CAPTURE); - if ( monitor ) { - monitors.push_back(monitor); + if ( host[0] ) { + if ( !port ) + port = "80"; + monitors = Monitor::LoadRemoteMonitors(protocol, host, port, path, Monitor::CAPTURE); + } else if ( file[0] ) { + monitors = Monitor::LoadFileMonitors(file, Monitor::CAPTURE); + } else { + std::shared_ptr monitor = Monitor::Load(monitor_id, true, Monitor::CAPTURE); + if ( monitor ) { + monitors.push_back(monitor); + } } - } if (monitors.empty()) { Error("No monitors found"); @@ -247,9 +247,9 @@ int main(int argc, char *argv[]) { monitor->SetStartupTime(now); std::string sql = stringtf( - "INSERT INTO Monitor_Status (MonitorId,Status,CaptureFPS,AnalysisFPS,CaptureBandwidth)" - " VALUES (%u, 'Running',0,0,0) ON DUPLICATE KEY UPDATE Status='Running',CaptureFPS=0,AnalysisFPS=0,CaptureBandwidth=0", - monitor->Id()); + "INSERT INTO Monitor_Status (MonitorId,Status,CaptureFPS,AnalysisFPS,CaptureBandwidth)" + " VALUES (%u, 'Running',0,0,0) ON DUPLICATE KEY UPDATE Status='Running',CaptureFPS=0,AnalysisFPS=0,CaptureBandwidth=0", + monitor->Id()); zmDbDo(sql); if (monitor->StartupDelay() > 0) { @@ -276,8 +276,8 @@ int main(int argc, char *argv[]) { if (zm_terminate) break; sql = stringtf( - "INSERT INTO Monitor_Status (MonitorId,Status) VALUES (%u, 'Connected') ON DUPLICATE KEY UPDATE Status='Connected'", - monitor->Id()); + "INSERT INTO Monitor_Status (MonitorId,Status) VALUES (%u, 'Connected') ON DUPLICATE KEY UPDATE Status='Connected'", + monitor->Id()); zmDbDo(sql); } // end foreach monitor @@ -310,19 +310,19 @@ int main(int argc, char *argv[]) { if (monitors[i]->PreCapture() < 0) { Error("Failed to pre-capture monitor %d %s (%zu/%zu)", - monitors[i]->Id(), monitors[i]->Name(), i + 1, monitors.size()); + monitors[i]->Id(), monitors[i]->Name(), i + 1, monitors.size()); result = -1; break; } if (monitors[i]->Capture() < 0) { Error("Failed to capture image from monitor %d %s (%zu/%zu)", - monitors[i]->Id(), monitors[i]->Name(), i + 1, monitors.size()); + monitors[i]->Id(), monitors[i]->Name(), i + 1, monitors.size()); result = -1; break; } if (monitors[i]->PostCapture() < 0) { Error("Failed to post-capture monitor %d %s (%zu/%zu)", - monitors[i]->Id(), monitors[i]->Name(), i + 1, monitors.size()); + monitors[i]->Id(), monitors[i]->Name(), i + 1, monitors.size()); result = -1; break; } @@ -334,7 +334,7 @@ int main(int argc, char *argv[]) { // capture_delay is the amount of time we should sleep in useconds to achieve the desired framerate. Microseconds delay = (monitors[i]->GetState() == Monitor::ALARM) ? monitors[i]->GetAlarmCaptureDelay() - : monitors[i]->GetCaptureDelay(); + : monitors[i]->GetCaptureDelay(); if (delay != Seconds(0)) { if (last_capture_times[i].time_since_epoch() != Seconds(0)) { Microseconds delta_time = std::chrono::duration_cast(now - last_capture_times[i]); @@ -384,8 +384,8 @@ int main(int argc, char *argv[]) { for (std::shared_ptr &monitor : monitors) { std::string sql = stringtf( - "INSERT INTO Monitor_Status (MonitorId,Status) VALUES (%u, 'NotRunning') ON DUPLICATE KEY UPDATE Status='NotRunning'", - monitor->Id()); + "INSERT INTO Monitor_Status (MonitorId,Status) VALUES (%u, 'NotRunning') ON DUPLICATE KEY UPDATE Status='NotRunning'", + monitor->Id()); zmDbDo(sql); } monitors.clear(); diff --git a/src/zms.cpp b/src/zms.cpp index 089010f78..09d4cd08c 100644 --- a/src/zms.cpp +++ b/src/zms.cpp @@ -34,16 +34,16 @@ bool ValidateAccess(User *user, int mon_id) { if (user->getStream() < User::PERM_VIEW) { allowed = false; Warning("Insufficient privileges for request user %d %s for monitor %d, user does not have permission to stream live view.", - user->Id(), user->getUsername(), mon_id); + user->Id(), user->getUsername(), mon_id); } else if (!user->canAccess(mon_id)) { allowed = false; Warning("Insufficient privileges for request user %d %s for monitor %d, user does not have permission view this monitor.", - user->Id(), user->getUsername(), mon_id); + user->Id(), user->getUsername(), mon_id); } } else if (user->getEvents() < User::PERM_VIEW) { allowed = false; Warning("Insufficient privileges for request user %d %s, user does not have permission view events.", - user->Id(), user->getUsername()); + user->Id(), user->getUsername()); } return allowed; } @@ -268,16 +268,16 @@ int main(int argc, const char *argv[], char **envp) { char date_string[64]; tm now_tm = {}; strftime(date_string, sizeof(date_string)-1, - "%a, %d %b %Y %H:%M:%S GMT", gmtime_r(&now, &now_tm)); + "%a, %d %b %Y %H:%M:%S GMT", gmtime_r(&now, &now_tm)); fputs("Last-Modified: ", stdout); fputs(date_string, stdout); fputs( - "\r\nExpires: Mon, 26 Jul 1997 05:00:00 GMT\r\n" - "Cache-Control: no-store, no-cache, must-revalidate\r\n" - "Cache-Control: post-check=0, pre-check=0\r\n" - "Pragma: no-cache\r\n", - stdout); + "\r\nExpires: Mon, 26 Jul 1997 05:00:00 GMT\r\n" + "Cache-Control: no-store, no-cache, must-revalidate\r\n" + "Cache-Control: post-check=0, pre-check=0\r\n" + "Pragma: no-cache\r\n", + stdout); if ( source == ZMS_MONITOR ) { MonitorStream stream; diff --git a/src/zmu.cpp b/src/zmu.cpp index 6509b3458..b112247b1 100644 --- a/src/zmu.cpp +++ b/src/zmu.cpp @@ -81,7 +81,7 @@ Options for use with monitors: -U, --username - When running in authenticated mode the username and -P, --password - password combination of the given user -A, --auth - Pass authentication hash string instead of user details - -x, --xtrigger - Output the current monitor trigger state, 0 = not triggered, 1 = triggered + -x, --xtrigger - Output the current monitor trigger state, 0 = not triggered, 1 = triggered =cut */ @@ -97,81 +97,81 @@ Options for use with monitors: void Usage(int status=-1) { fputs( - "zmu <-d device_path> [-v] [function] [-U -P]\n" - "zmu <-m monitor_id> [-v] [function] [-U -P]\n" - "General options:\n" - " -h, --help : This screen\n" - " -v, --verbose : Produce more verbose output\n" - " -l, --list : List the current status of active (or all with -v) monitors\n" - "Options for use with devices:\n" - " -d, --device [device_path] : Get the current video device settings for [device_path] or all devices\n" - " -V, --version : Set the Video 4 Linux API version to use for the query, use 1 or 2\n" - " -q, --query : Query the current settings for the device\n" - "Options for use with monitors:\n" - " -m, --monitor : Specify which monitor to address, default 1 if absent\n" - " -q, --query : Query the current settings for the monitor\n" - " -s, --state : Output the current monitor state, 0 = idle, 1 = prealarm, 2 = alarm,\n" - " 3 = alert, 4 = tape\n" - " -j, --janus-pin : Output the pin, if set, used to secure Janus for this monitor \n" - " -B, --brightness [value] : Output the current brightness, set to value if given \n" - " -C, --contrast [value] : Output the current contrast, set to value if given \n" - " -H, --hue [value] : Output the current hue, set to value if given \n" - " -O, --colour [value] : Output the current colour, set to value if given \n" - " -i, --image [image_index] : Write captured image to disk as .jpg, last image captured\n" - " or specified ring buffer index if given.\n" - " -S, --scale : With --image specify any scaling (in %%) to be applied to the image\n" - " -t, --timestamp [image_index] : Output captured image timestamp, last image captured or specified\n" - " ring buffer index if given\n" - " -R, --read_index : Output ring buffer read index\n" - " -W, --write_index : Output ring buffer write index\n" - " -e, --event : Output last event index\n" - " -f, --fps : Output last Frames Per Second captured reading\n" - " -z, --zones : Write last captured image overlaid with zones to -Zones.jpg\n" - " -a, --alarm : Force alarm in monitor, this will trigger recording until cancelled with -c\n" - " -n, --noalarm : Force no alarms in monitor, this will prevent alarms until cancelled with -c\n" - " -c, --cancel : Cancel a forced alarm/noalarm in monitor, required after being enabled with -a or -n\n" - " -L, --reload : Signal monitor to reload settings\n" - " -E, --enable : Enable capture, wake monitor up\n" - " -D, --disable : Disable capture, put monitor to sleep\n" - " -u, --suspend : Suspend motion detection, useful to prevent bogus alarms when panning etc\n" - " -r, --resume : Resume motion detection after a suspend\n" - " -U, --username : When running in authenticated mode the username and\n" - " -P, --password : password combination of the given user\n" - " -A, --auth : Pass authentication hash string instead of user details\n" - " -T, --token : Pass JWT token string instead of user details\n" - " -x, --xtrigger : Output the current monitor trigger state, 0 = not triggered, 1 = triggered\n" + "zmu <-d device_path> [-v] [function] [-U -P]\n" + "zmu <-m monitor_id> [-v] [function] [-U -P]\n" + "General options:\n" + " -h, --help : This screen\n" + " -v, --verbose : Produce more verbose output\n" + " -l, --list : List the current status of active (or all with -v) monitors\n" + "Options for use with devices:\n" + " -d, --device [device_path] : Get the current video device settings for [device_path] or all devices\n" + " -V, --version : Set the Video 4 Linux API version to use for the query, use 1 or 2\n" + " -q, --query : Query the current settings for the device\n" + "Options for use with monitors:\n" + " -m, --monitor : Specify which monitor to address, default 1 if absent\n" + " -q, --query : Query the current settings for the monitor\n" + " -s, --state : Output the current monitor state, 0 = idle, 1 = prealarm, 2 = alarm,\n" + " 3 = alert, 4 = tape\n" + " -j, --janus-pin : Output the pin, if set, used to secure Janus for this monitor \n" + " -B, --brightness [value] : Output the current brightness, set to value if given \n" + " -C, --contrast [value] : Output the current contrast, set to value if given \n" + " -H, --hue [value] : Output the current hue, set to value if given \n" + " -O, --colour [value] : Output the current colour, set to value if given \n" + " -i, --image [image_index] : Write captured image to disk as .jpg, last image captured\n" + " or specified ring buffer index if given.\n" + " -S, --scale : With --image specify any scaling (in %%) to be applied to the image\n" + " -t, --timestamp [image_index] : Output captured image timestamp, last image captured or specified\n" + " ring buffer index if given\n" + " -R, --read_index : Output ring buffer read index\n" + " -W, --write_index : Output ring buffer write index\n" + " -e, --event : Output last event index\n" + " -f, --fps : Output last Frames Per Second captured reading\n" + " -z, --zones : Write last captured image overlaid with zones to -Zones.jpg\n" + " -a, --alarm : Force alarm in monitor, this will trigger recording until cancelled with -c\n" + " -n, --noalarm : Force no alarms in monitor, this will prevent alarms until cancelled with -c\n" + " -c, --cancel : Cancel a forced alarm/noalarm in monitor, required after being enabled with -a or -n\n" + " -L, --reload : Signal monitor to reload settings\n" + " -E, --enable : Enable capture, wake monitor up\n" + " -D, --disable : Disable capture, put monitor to sleep\n" + " -u, --suspend : Suspend motion detection, useful to prevent bogus alarms when panning etc\n" + " -r, --resume : Resume motion detection after a suspend\n" + " -U, --username : When running in authenticated mode the username and\n" + " -P, --password : password combination of the given user\n" + " -A, --auth : Pass authentication hash string instead of user details\n" + " -T, --token : Pass JWT token string instead of user details\n" + " -x, --xtrigger : Output the current monitor trigger state, 0 = not triggered, 1 = triggered\n" - "", stderr ); + "", stderr ); exit(status); } typedef enum { - ZMU_BOGUS = 0x00000000, - ZMU_STATE = 0x00000001, - ZMU_IMAGE = 0x00000002, - ZMU_TIME = 0x00000004, - ZMU_READ_IDX = 0x00000008, - ZMU_WRITE_IDX = 0x00000010, - ZMU_EVENT = 0x00000020, - ZMU_FPS = 0x00000040, - ZMU_ZONES = 0x00000080, - ZMU_ALARM = 0x00000100, - ZMU_NOALARM = 0x00000200, - ZMU_CANCEL = 0x00000400, - ZMU_QUERY = 0x00000800, - ZMU_BRIGHTNESS = 0x00001000, - ZMU_CONTRAST = 0x00002000, - ZMU_HUE = 0x00004000, - ZMU_COLOUR = 0x00008000, - ZMU_RELOAD = 0x00010000, - ZMU_ENABLE = 0x00100000, - ZMU_DISABLE = 0x00200000, - ZMU_SUSPEND = 0x00400000, - ZMU_RESUME = 0x00800000, - ZMU_LIST = 0x10000000, - ZMU_TRIGGER = 0x20000000, - ZMU_JANUS = 0x40000000, + ZMU_BOGUS = 0x00000000, + ZMU_STATE = 0x00000001, + ZMU_IMAGE = 0x00000002, + ZMU_TIME = 0x00000004, + ZMU_READ_IDX = 0x00000008, + ZMU_WRITE_IDX = 0x00000010, + ZMU_EVENT = 0x00000020, + ZMU_FPS = 0x00000040, + ZMU_ZONES = 0x00000080, + ZMU_ALARM = 0x00000100, + ZMU_NOALARM = 0x00000200, + ZMU_CANCEL = 0x00000400, + ZMU_QUERY = 0x00000800, + ZMU_BRIGHTNESS = 0x00001000, + ZMU_CONTRAST = 0x00002000, + ZMU_HUE = 0x00004000, + ZMU_COLOUR = 0x00008000, + ZMU_RELOAD = 0x00010000, + ZMU_ENABLE = 0x00100000, + ZMU_DISABLE = 0x00200000, + ZMU_SUSPEND = 0x00400000, + ZMU_RESUME = 0x00800000, + ZMU_LIST = 0x10000000, + ZMU_TRIGGER = 0x20000000, + ZMU_JANUS = 0x40000000, } Function; bool ValidateAccess(User *user, int mon_id, int function) { @@ -280,7 +280,7 @@ int main(int argc, char *argv[]) { char *auth = nullptr; std::string jwt_token_str = ""; #if ZM_HAS_V4L2 - int v4lVersion = 2; + int v4lVersion = 2; #endif // ZM_HAS_V4L2 while (1) { int option_index = 0; @@ -291,137 +291,137 @@ int main(int argc, char *argv[]) { } switch (c) { - case 'd': - if (optarg) - device = optarg; - break; - case 'm': - mon_id = atoi(optarg); - break; - case 'v': - verbose = true; - break; - case 's': - function |= ZMU_STATE; - break; - case 'j': - function |= ZMU_JANUS; - break; - case 'x': - function |= ZMU_TRIGGER; - break; - case 'i': - function |= ZMU_IMAGE; - if (optarg) - image_idx = atoi(optarg); - break; - case 'S': - scale = atoi(optarg); - break; - case 't': - function |= ZMU_TIME; - if (optarg) - image_idx = atoi(optarg); - break; - case 'R': - function |= ZMU_READ_IDX; - break; - case 'W': - function |= ZMU_WRITE_IDX; - break; - case 'e': - function |= ZMU_EVENT; - break; - case 'f': - function |= ZMU_FPS; - break; - case 'z': - function |= ZMU_ZONES; - if (optarg) - zoneString = optarg; - break; - case 'a': - function |= ZMU_ALARM; - break; - case 'n': - function |= ZMU_NOALARM; - break; - case 'c': - function |= ZMU_CANCEL; - break; - case 'L': - function |= ZMU_RELOAD; - break; - case 'E': - function |= ZMU_ENABLE; - break; - case 'D': - function |= ZMU_DISABLE; - break; - case 'u': - function |= ZMU_SUSPEND; - break; - case 'r': - function |= ZMU_RESUME; - break; - case 'q': - function |= ZMU_QUERY; - break; - case 'B': - function |= ZMU_BRIGHTNESS; - if (optarg) { - have_brightness = true; - brightness = atoi(optarg); - } - break; - case 'C': - function |= ZMU_CONTRAST; - if (optarg) { - have_contrast = true; - contrast = atoi(optarg); - } - break; - case 'H': - function |= ZMU_HUE; - if (optarg) { - have_hue = true; - hue = atoi(optarg); - } - break; - case 'O': - function |= ZMU_COLOUR; - if (optarg) { - have_colour = true; - colour = atoi(optarg); - } - break; - case 'U': - username = optarg; - break; - case 'P': - password = optarg; - break; - case 'A': - auth = optarg; - break; - case 'T': - jwt_token_str = std::string(optarg); - break; + case 'd': + if (optarg) + device = optarg; + break; + case 'm': + mon_id = atoi(optarg); + break; + case 'v': + verbose = true; + break; + case 's': + function |= ZMU_STATE; + break; + case 'j': + function |= ZMU_JANUS; + break; + case 'x': + function |= ZMU_TRIGGER; + break; + case 'i': + function |= ZMU_IMAGE; + if (optarg) + image_idx = atoi(optarg); + break; + case 'S': + scale = atoi(optarg); + break; + case 't': + function |= ZMU_TIME; + if (optarg) + image_idx = atoi(optarg); + break; + case 'R': + function |= ZMU_READ_IDX; + break; + case 'W': + function |= ZMU_WRITE_IDX; + break; + case 'e': + function |= ZMU_EVENT; + break; + case 'f': + function |= ZMU_FPS; + break; + case 'z': + function |= ZMU_ZONES; + if (optarg) + zoneString = optarg; + break; + case 'a': + function |= ZMU_ALARM; + break; + case 'n': + function |= ZMU_NOALARM; + break; + case 'c': + function |= ZMU_CANCEL; + break; + case 'L': + function |= ZMU_RELOAD; + break; + case 'E': + function |= ZMU_ENABLE; + break; + case 'D': + function |= ZMU_DISABLE; + break; + case 'u': + function |= ZMU_SUSPEND; + break; + case 'r': + function |= ZMU_RESUME; + break; + case 'q': + function |= ZMU_QUERY; + break; + case 'B': + function |= ZMU_BRIGHTNESS; + if (optarg) { + have_brightness = true; + brightness = atoi(optarg); + } + break; + case 'C': + function |= ZMU_CONTRAST; + if (optarg) { + have_contrast = true; + contrast = atoi(optarg); + } + break; + case 'H': + function |= ZMU_HUE; + if (optarg) { + have_hue = true; + hue = atoi(optarg); + } + break; + case 'O': + function |= ZMU_COLOUR; + if (optarg) { + have_colour = true; + colour = atoi(optarg); + } + break; + case 'U': + username = optarg; + break; + case 'P': + password = optarg; + break; + case 'A': + auth = optarg; + break; + case 'T': + jwt_token_str = std::string(optarg); + break; #if ZM_HAS_V4L2 - case 'V': - v4lVersion = (atoi(optarg)==1)?1:2; - break; + case 'V': + v4lVersion = (atoi(optarg)==1)?1:2; + break; #endif // ZM_HAS_V4L2 - case 'h': - case '?': - Usage(0); - break; - case 'l': - function |= ZMU_LIST; - break; - default: - //fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); - break; + case 'h': + case '?': + Usage(0); + break; + case 'l': + function |= ZMU_LIST; + break; + default: + //fprintf( stderr, "?? getopt returned character code 0%o ??\n", c ); + break; } } // end getopt loop @@ -494,10 +494,10 @@ int main(int argc, char *argv[]) { Error("Unable to authenticate user"); exit_zmu(-1); } - if ( !ValidateAccess(user, mon_id, function) ) { - Error("Insufficient privileges for user %s for requested function %x", username.c_str(), function); - exit_zmu(-1); - } + if ( !ValidateAccess(user, mon_id, function) ) { + Error("Insufficient privileges for user %s for requested function %x", username.c_str(), function); + exit_zmu(-1); + } } // end if auth if ( mon_id > 0 ) { @@ -528,8 +528,8 @@ int main(int argc, char *argv[]) { char separator = ' '; bool have_output = false; if ( function & ZMU_JANUS ) { - printf("%s", monitor->get_stream_key()); - have_output = true; + printf("%s", monitor->get_stream_key()); + have_output = true; } if ( function & ZMU_STATE ) { Monitor::State state = monitor->GetState(); @@ -562,8 +562,7 @@ int main(int argc, char *argv[]) { Microseconds ts_usec = std::chrono::duration_cast(timestamp.time_since_epoch() - ts_sec); if (image_idx == -1) { printf("Time of last image capture: %s.%02d\n", timestamp_str, static_cast(ts_usec.count())); - } - else { + } else { printf("Time of image %d capture: %s.%02d\n", image_idx, timestamp_str, static_cast(ts_usec.count())); } } else { @@ -604,7 +603,7 @@ int main(int argc, char *argv[]) { if ( function & ZMU_FPS ) { if ( verbose ) { printf("Current capture rate: %.2f frames per second, analysis rate: %.2f frames per second\n", - monitor->get_capture_fps(), monitor->get_analysis_fps()); + monitor->get_capture_fps(), monitor->get_analysis_fps()); } else { if ( have_output ) fputc(separator, stdout); printf("capture: %.2f, analysis: %.2f", monitor->get_capture_fps(), monitor->get_analysis_fps()); @@ -633,9 +632,9 @@ int main(int argc, char *argv[]) { if (verbose) { printf("Forcing alarm on current state: %s, event %" PRIu64 "\n", - state==Monitor::ALARM?"Alarm":(state==Monitor::ALERT?"Alert":"Idle"), - monitor->GetLastEventId() - ); + state==Monitor::ALARM?"Alarm":(state==Monitor::ALERT?"Alert":"Idle"), + monitor->GetLastEventId() + ); } // Ensure that we are not recording. So the forced alarm is distinct from what was recording before @@ -767,12 +766,12 @@ int main(int argc, char *argv[]) { } else { // non monitor functions if ( function & ZMU_QUERY ) { #if ZM_HAS_V4L2 - char vidString[0x10000] = ""; - bool ok = LocalCamera::GetCurrentSettings(device, vidString, v4lVersion, verbose); - printf("%s", vidString); - exit_zmu(ok ? 0 : -1); + char vidString[0x10000] = ""; + bool ok = LocalCamera::GetCurrentSettings(device, vidString, v4lVersion, verbose); + printf("%s", vidString); + exit_zmu(ok ? 0 : -1); #else // ZM_HAS_V4L2 - Error("Video4linux is required for device querying"); + Error("Video4linux is required for device querying"); exit_zmu(-1); #endif // ZM_HAS_V4L2 } @@ -792,8 +791,8 @@ int main(int argc, char *argv[]) { Debug(1, "Got %" PRIu64 " monitors", static_cast(mysql_num_rows(result))); printf("%4s %9s %9s %9s %5s %8s %13s %5s %5s %9s %9s\n", - "Id", "Capturing", "Analysing", "Recording", "State", "TrgState", - "LastImageTime", "RdIdx", "WrIdx", "LastEvent", "FrameRate"); + "Id", "Capturing", "Analysing", "Recording", "State", "TrgState", + "LastImageTime", "RdIdx", "WrIdx", "LastEvent", "FrameRate"); for (int i=0; MYSQL_ROW dbrow = mysql_fetch_row(result); i++) { int monitor_id = atoi(dbrow[0]); if (mon_id and (monitor_id != mon_id)) continue; @@ -805,31 +804,31 @@ int main(int argc, char *argv[]) { SystemTimePoint timestamp = monitor->GetTimestamp(); printf("%4d %9d %9d %9d %5d %8d %13.2f %5d %5d %9" PRIu64 "%10.2f\n", - monitor->Id(), - monitor->Capturing(), - monitor->Analysing(), - monitor->Recording(), - monitor->GetState(), - monitor->GetTriggerState(), - FPSeconds(timestamp.time_since_epoch()).count(), - monitor->GetLastReadIndex(), - monitor->GetLastWriteIndex(), - monitor->GetLastEventId(), - monitor->GetFPS() - ); + monitor->Id(), + monitor->Capturing(), + monitor->Analysing(), + monitor->Recording(), + monitor->GetState(), + monitor->GetTriggerState(), + FPSeconds(timestamp.time_since_epoch()).count(), + monitor->GetLastReadIndex(), + monitor->GetLastWriteIndex(), + monitor->GetLastEventId(), + monitor->GetFPS() + ); } } else { printf("%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n", - monitor_id, - function, - 0, - 0, - 0l, 0l, - 0, - 0, - 0, - 0.0 - ); + monitor_id, + function, + 0, + 0, + 0l, 0l, + 0, + 0, + 0, + 0.0 + ); } // end if function filter } // endif !user || canAccess(mon_id) } // end foreach row